CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
mergeLHE.ExternalCppLHEMerger Class Reference
Inheritance diagram for mergeLHE.ExternalCppLHEMerger:
mergeLHE.BaseLHEMerger

Public Member Functions

def __init__ (self, input_files, output_file, kwargs)
 
def merge (self)
 
- Public Member Functions inherited from mergeLHE.BaseLHEMerger
def __init__ (self, input_files, output_file)
 
def merge (self)
 

Private Attributes

 _merger_script_url
 

Additional Inherited Members

- Public Attributes inherited from mergeLHE.BaseLHEMerger
 input_files
 
 output_file
 

Detailed Description

Use the external mergeLheFiles.cpp file to merge LHE files, as introduced in
https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideSubgroupMC#1_2_Using_pLHE_campaigns

Definition at line 302 of file mergeLHE.py.

Constructor & Destructor Documentation

◆ __init__()

def mergeLHE.ExternalCppLHEMerger.__init__ (   self,
  input_files,
  output_file,
  kwargs 
)

Definition at line 307 of file mergeLHE.py.

307  def __init__(self, input_files, output_file, **kwargs):
308  super(ExternalCppLHEMerger, self).__init__(input_files, output_file)
309  self._merger_script_url = \
310  'https://twiki.cern.ch/twiki/bin/viewfile/CMSPublic/SWGuideSubgroupMC?filename=mergeLheFiles.cpp;rev=2'
311 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ merge()

def mergeLHE.ExternalCppLHEMerger.merge (   self)

Definition at line 312 of file mergeLHE.py.

References mergeLHE.MG5LOLHEMerger._merger_script_url, mergeLHE.ExternalCppLHEMerger._merger_script_url, mergeLHE.BaseLHEMerger.input_files, DTWorkflow.DTWorkflow.input_files, join(), DTT0WireWorkflow.DTT0WireWorkflow.output_file, mergeLHE.BaseLHEMerger.output_file, DTVdriftWorkflow.DTvdriftWorkflow.output_file, and DTTtrigWorkflow.DTttrigWorkflow.output_file.

312  def merge(self):
313  logging.info(
314  ('Use the external mergeLheFiles.cpp file to merge LHE files.'))
315  os.system('curl -s -o mergeLheFiles.cpp %s' % self._merger_script_url)
316  with open('mergeLheFiles.cpp') as f:
317  script_str = f.read()
318  with open('mergeLheFiles.cpp', 'w') as fw:
319  fw.write(script_str.replace('/tmp/covarell/out.lhe', self.output_file))
320  with open('input_files.txt', 'w') as fw:
321  fw.write('\n'.join(self.input_files) + '\n')
322 
323  os.system('g++ -Wall -o mergeLheFiles mergeLheFiles.cpp')
324  os.system('./mergeLheFiles input_files.txt')
325  os.system('rm mergeLheFiles* input_files.txt')
326 
327 
int merge(int argc, char *argv[])
Definition: DiMuonVmerge.cc:27
static std::string join(char **cmd)
Definition: RemoteFile.cc:19

Member Data Documentation

◆ _merger_script_url

mergeLHE.ExternalCppLHEMerger._merger_script_url
private

Definition at line 309 of file mergeLHE.py.

Referenced by mergeLHE.ExternalCppLHEMerger.merge().