Class to hold/interpret experiment-specific metadata
Definition at line 124 of file extractor_prod.py.
def extractor_prod.expMetaData.__init__ |
( |
|
self, |
|
|
|
expname, |
|
|
|
inputfile |
|
) |
| |
Definition at line 126 of file extractor_prod.py.
127 MetaData.__init__(self, inputfile)
138 self.metadataList, self.
translateKeyf = metaDataModule.metadataList(), metaDataModule.translateKey
def extractor_prod.expMetaData.getmetadata |
( |
|
self, |
|
|
|
md0 = {} |
|
) |
| |
Get metadata from input file and return as python dictionary.
Calls other methods in class and returns metadata dictionary
Definition at line 340 of file extractor_prod.py.
341 """ Get metadata from input file and return as python dictionary. 342 Calls other methods in class and returns metadata dictionary""" 346 return self.
md_gen(mdart, md0)
def extractor_prod.expMetaData.md_gen |
( |
|
self, |
|
|
|
mdart, |
|
|
|
md0 = {} |
|
) |
| |
Loop through art metdata, generate metadata dictionary
Definition at line 144 of file extractor_prod.py.
145 """Loop through art metdata, generate metadata dictionary""" 152 for mdkey
in list(mdart.keys()):
156 if mdkey ==
'file_format_version':
158 elif mdkey ==
'file_format_era':
164 elif mdkey ==
'run_type':
166 elif mdkey ==
'application.version':
168 elif mdkey ==
'application.family':
170 elif mdkey ==
'application.name':
175 elif mdkey ==
'data_stream':
176 if 'dunemeta.data_stream' not in list(mdart.keys()):
177 md[
'data_stream'] = mdval
180 elif mdkey ==
'process_name':
185 elif mdkey ==
'applicationFamily':
186 if not md.has_key(
'application'):
187 md[
'application'] = {}
188 md[
'application'][
'family'] = mdval
189 elif mdkey ==
'StageName' or mdkey ==
'applicationName':
190 if not md.has_key(
'application'):
191 md[
'application'] = {}
192 md[
'application'][
'name'] = mdval
193 elif mdkey ==
'applicationVersion':
194 if not md.has_key(
'application'):
195 md[
'application'] = {}
196 md[
'application'][
'version'] = mdval
200 elif mdkey ==
'parents':
202 if not args.strip_parents:
204 parent_dict = {
'file_name': parent}
205 mdparents.append(parent_dict)
206 md[
'parents'] = mdparents
210 elif mdkey ==
'art.first_event':
212 elif mdkey ==
'art.last_event':
214 elif mdkey ==
'first_event':
216 elif mdkey ==
'last_event':
218 elif mdkey ==
'lbneMCGenerators':
219 md[
'lbne_MC.generators'] = mdval
220 elif mdkey ==
'lbneMCOscillationP':
221 md[
'lbne_MC.oscillationP'] = mdval
222 elif mdkey ==
'lbneMCTriggerListVersion':
223 md[
'lbne_MC.trigger-list-version'] = mdval
224 elif mdkey ==
'lbneMCBeamEnergy':
225 md[
'lbne_MC.beam_energy'] = mdval
226 elif mdkey ==
'lbneMCBeamFluxID':
227 md[
'lbne_MC.beam_flux_ID'] = mdval
228 elif mdkey ==
'lbneMCName':
229 md[
'lbne_MC.name'] = mdval
230 elif mdkey ==
'lbneMCDetectorType':
231 md[
'lbne_MC.detector_type'] = mdval
232 elif mdkey ==
'lbneMCNeutrinoFlavors':
233 md[
'lbne_MC.neutrino_flavors'] = mdval
234 elif mdkey ==
'lbneMCMassHierarchy':
235 md[
'lbne_MC.mass_hierarchy'] = mdval
236 elif mdkey ==
'lbneMCMiscellaneous':
237 md[
'lbne_MC.miscellaneous'] = mdval
238 elif mdkey ==
'lbneMCGeometryVersion':
239 md[
'lbne_MC.geometry_version'] = mdval
240 elif mdkey ==
'lbneMCOverlay':
241 md[
'lbne_MC.overlay'] = mdval
242 elif mdkey ==
'lbneDataRunMode':
243 md[
'lbne_data.run_mode'] = mdval
244 elif mdkey ==
'lbneDataDetectorType':
245 md[
'lbne_data.detector_type'] = mdval
246 elif mdkey ==
'lbneDataName':
247 md[
'lbne_data.name'] = mdval
248 elif mdkey ==
'detector.hv_status':
250 elif mdkey ==
'detector.hv_value':
252 elif mdkey ==
'detector.tpc_status':
254 elif mdkey ==
'detector.tpc_apa_status':
256 elif mdkey ==
'detector.tpc_apas':
258 elif mdkey ==
'detector.tpc_apa_1':
260 elif mdkey ==
'detector.tpc_apa_2':
262 elif mdkey ==
'detector.tpc_apa_3':
264 elif mdkey ==
'detector.tpc_apa_4':
266 elif mdkey ==
'detector.tpc_apa_5':
268 elif mdkey ==
'detector.tpc_apa_6':
270 elif mdkey ==
'detector.pd_status':
272 elif mdkey ==
'detector.crt_status':
274 elif mdkey ==
'daq.readout':
276 elif mdkey ==
'daq.felix_status':
278 elif mdkey ==
'beam.polarity':
280 elif mdkey ==
'beam.momentum':
282 elif mdkey ==
'dunemeta.data_stream':
283 md[
'data_stream'] = mdval
284 elif mdkey ==
'??.data_type':
286 elif mdkey ==
'data_quality.level':
288 elif mdkey ==
'data_quality.is_junk':
290 elif mdkey ==
'data_quality.do_not_process':
292 elif mdkey ==
'data_quality.online_good_run_list':
294 elif mdkey ==
'dunemeta.dune_data.accouple':
295 md[
'DUNE_data.accouple'] =
int(mdval)
296 elif mdkey ==
'dunemeta.dune_data.calibpulsemode':
297 md[
'DUNE_data.calibpulsemode'] =
int(mdval)
298 elif mdkey ==
'dunemeta.dune_data.daqconfigname':
299 md[
'DUNE_data.DAQConfigName'] = mdval
300 elif mdkey ==
'dunemeta.dune_data.detector_config':
301 md[
'DUNE_data.detector_config'] = mdval
302 elif mdkey ==
'dunemeta.dune_data.febaselinehigh':
303 md[
'DUNE_data.febaselinehigh'] =
int(mdval)
304 elif mdkey ==
'dunemeta.dune_data.fegain':
305 md[
'DUNE_data.fegain'] =
int(mdval)
306 elif mdkey ==
'dunemeta.dune_data.feleak10x':
307 md[
'DUNE_data.feleak10x'] =
int(mdval)
308 elif mdkey ==
'dunemeta.dune_data.feleakhigh':
309 md[
'DUNE_data.feleakhigh'] =
int(mdval)
310 elif mdkey ==
'dunemeta.dune_data.feshapingtime':
311 md[
'DUNE_data.feshapingtime'] =
int(mdval)
312 elif mdkey ==
'dunemeta.dune_data.inconsistent_hw_config':
313 md[
'DUNE_data.inconsistent_hw_config'] =
int(mdval)
314 elif mdkey ==
'dunemeta.dune_data.is_fake_data':
315 md[
'DUNE_data.is_fake_data'] =
int(mdval)
316 elif mdkey ==
'dunemeta.dune_data.readout_window':
317 md[
'DUNE_data.readout_window'] =
float(mdval)
322 md[mdkey] = mdart[mdkey]
326 md[
'file_name'] = self.inputfile.split(
"/")[-1]
327 if 'file_size' in md0:
328 md[
'file_size'] = md0[
'file_size']
330 md[
'file_size'] = os.path.getsize(self.
inputfile)
331 if 'crc' in md0
and not args.no_crc:
332 md[
'crc'] = md0[
'crc']
333 elif not args.no_crc:
334 md[
'crc'] = root_metadata.fileEnstoreChecksum(self.
inputfile)
def extractor_prod.expMetaData.translateKey |
( |
|
self, |
|
|
|
key |
|
) |
| |
Returns the output of the imported translateKey function (as translateKeyf) called on key
Definition at line 140 of file extractor_prod.py.
141 """Returns the output of the imported translateKey function (as translateKeyf) called on key"""
extractor_prod.expMetaData.expname |
extractor_prod.expMetaData.md |
extractor_prod.expMetaData.translateKeyf |
The documentation for this class was generated from the following file: