92def runStep(inputFile):
93 if not os.path.exists(inputFile) and not arg.noRun:
94 print ('ERROR input file ', inputFile , ' missing')
95 sys.exit(2)
96
97 preExec = ''
98 transform="Reco_tf.py"
99
100 inputFileBase = os.path.basename(inputFile)
101
102 if 'HITS' in inputFileBase:
103 inputType = 'HITS'
104 outputType = "RDO"
105
106 preExec=""
107
108 elif "RDO" in inputFileBase:
109 inputType="RDO"
110 inputDataType=inputType
111 outputType="ESD"
112 preExec='''flags.Reco.EnableTrigger=False; flags.Reco.EnableBTagging=False'''
113
114 elif "RAW" in inputFileBase:
115 inputType="RAW"
116 inputDataType="BS"
117 outputType="ESD"
118 preExec='''flags.Reco.EnableTrigger=False'''
119
120 elif 'ESD' in inputFileBase:
121 inputType="ESD"
122 inputDataType=inputType
123 outputType="AOD"
124 preExec='''flags.Reco.EnableTrigger=False'''
125
126 else:
127 print ("ERROR RunStep: Input file does not appear to be a supported type (RAW, HITS, RDO, ESD)")
128 print (' -> got', inputFileBase)
129 sys.exit(3)
130
131 print ("Starting ",inputType, ' to ', outputType)
132
133
134 runDir = arg.outputDir + '/' + inputType+'to'+outputType + '/'
135 if not os.path.exists(runDir):
136 os.mkdir(runDir)
137 outputFile = runDir + inputFileBase.replace(inputType, outputType)
138 if arg.overWrite and os.path.exists(outputFile):
139 os.remove(outputFile)
140
141 outputLog = runDir+'log'
142
143 comandArgs = [ '--preExec='+preExec,
144 '--input%sFile=%s'%(inputDataType, inputFile),
145 '--output%sFile=%s'%(outputType, outputFile),
146 '--maxEvents='+str(maxEvents),
147 '--skipEvents='+str(skipEvents),
148 '--autoConfiguration=everything',
149 ]
150
151 print ('Running : ')
152 print (transform, ' '.join(comandArgs))
154
155 if arg.noRun :
156 res = 0
157 else:
158 logfile = open(outputLog, 'w')
159 res = subprocess.call( [transform] + comandArgs, stdout=logfile, stderr=logfile)
160 logfile.close()
161
162 if res != 0:
163 print ('ERROR RunStep: Transform appears to have failed - exiting. Check ', outputLog)
164 sys.exit(4)
165
166
167
168 print ('Done %s to %s step'%(inputType, outputType))
169 return outputFile
170
171
void print(char *figname, TCanvas *c1)