94 if not os.path.exists(inputFile)
and not arg.noRun:
95 print (
'ERROR input file ', inputFile ,
' missing')
99 transform=
"Reco_tf.py"
101 inputFileBase = os.path.basename(inputFile)
103 if 'HITS' in inputFileBase:
109 elif "RDO" in inputFileBase:
111 inputDataType=inputType
113 preExec=
'''flags.Reco.EnableTrigger=False; flags.Reco.EnableBTagging=False'''
115 elif "RAW" in inputFileBase:
119 preExec=
'''flags.Reco.EnableTrigger=False'''
121 elif 'ESD' in inputFileBase:
123 inputDataType=inputType
125 preExec=
'''flags.Reco.EnableTrigger=False'''
128 print (
"ERROR RunStep: Input file does not appear to be a supported type (RAW, HITS, RDO, ESD)")
129 print (
' -> got', inputFileBase)
132 print (
"Starting ",inputType,
' to ', outputType)
135 runDir = arg.outputDir +
'/' + inputType+
'to'+outputType +
'/'
136 if not os.path.exists(runDir):
138 outputFile = runDir + inputFileBase.replace(inputType, outputType)
139 if arg.overWrite
and os.path.exists(outputFile):
140 os.remove(outputFile)
142 outputLog = runDir+
'log'
144 if specifyCondAndGeo:
146 fullComand=
"${transform} preExec=${preExec} input${inputDataType}File=${inputDir}/${inputFile} output${outputType}File=${outputFile} maxEvents=${maxEvents} skipEvents=${skipEvents} geometryVersion=$geometryVersion conditionsTag=$conditionsTag autoConfiguration=everything"
148 comandArgs = [
'--preExec='+preExec,
149 '--input%sFile=%s'%(inputDataType, inputFile),
150 '--output%sFile=%s'%(outputType, outputFile),
151 '--maxEvents='+
str(maxEvents),
152 '--skipEvents='+
str(skipEvents),
153 '--autoConfiguration=everything',
158 print (transform,
' '.
join(comandArgs))
164 logfile =
open(outputLog,
'w')
165 res = subprocess.call( [transform] + comandArgs, stdout=logfile, stderr=logfile)
169 print (
'ERROR RunStep: Transform appears to have failed - exiting. Check ', outputLog)
174 print (
'Done %s to %s step'%(inputType, outputType))