95 if not os.path.exists(inputFile)
and not arg.noRun:
96 print (
'ERROR input file ', inputFile ,
' missing')
100 transform=
"Reco_tf.py"
102 inputFileBase = os.path.basename(inputFile)
104 if 'HITS' in inputFileBase:
110 elif "RDO" in inputFileBase:
112 inputDataType=inputType
114 preExec=
'''flags.Reco.EnableTrigger=False; flags.Reco.EnableBTagging=False'''
116 elif "RAW" in inputFileBase:
120 preExec=
'''flags.Reco.EnableTrigger=False'''
122 elif 'ESD' in inputFileBase:
124 inputDataType=inputType
126 preExec=
'''flags.Reco.EnableTrigger=False'''
129 print (
"ERROR RunStep: Input file does not appear to be a supported type (RAW, HITS, RDO, ESD)")
130 print (
' -> got', inputFileBase)
133 print (
"Starting ",inputType,
' to ', outputType)
136 runDir = arg.outputDir +
'/' + inputType+
'to'+outputType +
'/'
137 if not os.path.exists(runDir):
139 outputFile = runDir + inputFileBase.replace(inputType, outputType)
140 if arg.overWrite
and os.path.exists(outputFile):
141 os.remove(outputFile)
143 outputLog = runDir+
'log'
145 if specifyCondAndGeo:
147 fullComand=
"${transform} preExec=${preExec} input${inputDataType}File=${inputDir}/${inputFile} output${outputType}File=${outputFile} maxEvents=${maxEvents} skipEvents=${skipEvents} geometryVersion=$geometryVersion conditionsTag=$conditionsTag autoConfiguration=everything"
149 comandArgs = [
'--preExec='+preExec,
150 '--input%sFile=%s'%(inputDataType, inputFile),
151 '--output%sFile=%s'%(outputType, outputFile),
152 '--maxEvents='+
str(maxEvents),
153 '--skipEvents='+
str(skipEvents),
154 '--autoConfiguration=everything',
159 print (transform,
' '.
join(comandArgs))
165 logfile =
open(outputLog,
'w')
166 res = subprocess.call( [transform] + comandArgs, stdout=logfile, stderr=logfile)
170 print (
'ERROR RunStep: Transform appears to have failed - exiting. Check ', outputLog)
175 print (
'Done %s to %s step'%(inputType, outputType))