Class to hold/interpret experiment-specific metadata
Definition at line 98 of file extractor_dict.py.
def extractor_dict.expMetaData.__init__ |
( |
|
self, |
|
|
|
expname, |
|
|
|
inputfile |
|
) |
| |
Definition at line 100 of file extractor_dict.py.
101 MetaData.__init__(self, inputfile)
106 from experiment_utilities
import MetaDataKey
108 print(
"You have not defined an experiment-specific metadata and key-translating module in experiment_utilities. Exiting")
111 metaDataModule = MetaDataKey()
112 self.metadataList, self.
translateKeyf = metaDataModule.metadataList(), metaDataModule.translateKey
def extractor_dict.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 235 of file extractor_dict.py.
236 """ Get metadata from input file and return as python dictionary. 237 Calls other methods in class and returns metadata dictionary""" 241 return self.
md_gen(mdart, md0)
def extractor_dict.expMetaData.md_gen |
( |
|
self, |
|
|
|
mdart, |
|
|
|
md0 = {} |
|
) |
| |
Loop through art metdata, generate metadata dictionary
Definition at line 118 of file extractor_dict.py.
119 """Loop through art metdata, generate metadata dictionary""" 126 for mdkey
in mdart.keys():
131 if mdkey ==
'file_format_version':
133 elif mdkey ==
'file_format_era':
139 elif mdkey ==
'run_type':
144 elif mdkey ==
'data_stream':
149 elif mdkey ==
'process_name':
154 elif mdkey ==
'applicationFamily':
155 if not md.has_key(
'application'):
156 md[
'application'] = {}
157 md[
'application'][
'family'] = mdval
158 elif mdkey ==
'StageName':
159 if not md.has_key(
'application'):
160 md[
'application'] = {}
161 md[
'application'][
'name'] = mdval
162 elif mdkey ==
'applicationVersion':
163 if not md.has_key(
'application'):
164 md[
'application'] = {}
165 md[
'application'][
'version'] = mdval
169 elif mdkey ==
'parents':
172 parent_dict = {
'file_name': parent}
173 mdparents.append(parent_dict)
174 md[
'parents'] = mdparents
178 elif mdkey ==
'first_event':
180 elif mdkey ==
'last_event':
182 elif mdkey ==
'lbneMCGenerators':
183 md[
'lbne_MC.generators'] = mdval
184 elif mdkey ==
'lbneMCOscillationP':
185 md[
'lbne_MC.oscillationP'] = mdval
186 elif mdkey ==
'lbneMCTriggerListVersion':
187 md[
'lbne_MC.trigger-list-version'] = mdval
188 elif mdkey ==
'lbneMCBeamEnergy':
189 md[
'lbne_MC.beam_energy'] = mdval
190 elif mdkey ==
'lbneMCBeamFluxID':
191 md[
'lbne_MC.beam_flux_ID'] = mdval
192 elif mdkey ==
'lbneMCName':
193 md[
'lbne_MC.name'] = mdval
194 elif mdkey ==
'lbneMCDetectorType':
195 md[
'lbne_MC.detector_type'] = mdval
196 elif mdkey ==
'lbneMCNeutrinoFlavors':
197 md[
'lbne_MC.neutrino_flavors'] = mdval
198 elif mdkey ==
'lbneMCMassHierarchy':
199 md[
'lbne_MC.mass_hierarchy'] = mdval
200 elif mdkey ==
'lbneMCMiscellaneous':
201 md[
'lbne_MC.miscellaneous'] = mdval
202 elif mdkey ==
'lbneMCGeometryVersion':
203 md[
'lbne_MC.geometry_version'] = mdval
204 elif mdkey ==
'lbneMCOverlay':
205 md[
'lbne_MC.overlay'] = mdval
206 elif mdkey ==
'lbneDataRunMode':
207 md[
'lbne_data.run_mode'] = mdval
208 elif mdkey ==
'lbneDataDetectorType':
209 md[
'lbne_data.detector_type'] = mdval
210 elif mdkey ==
'lbneDataName':
211 md[
'lbne_data.name'] = mdval
217 md[mdkey] = mdart[mdkey]
221 md[
'file_name'] = self.inputfile.split(
"/")[-1]
222 if 'file_size' in md0:
223 md[
'file_size'] = md0[
'file_size']
225 md[
'file_size'] = os.path.getsize(self.
inputfile)
227 md[
'crc'] = md0[
'crc']
229 md[
'crc'] = root_metadata.fileEnstoreChecksum(self.
inputfile)
def extractor_dict.expMetaData.translateKey |
( |
|
self, |
|
|
|
key |
|
) |
| |
Returns the output of the imported translateKey function (as translateKeyf) called on key
Definition at line 114 of file extractor_dict.py.
115 """Returns the output of the imported translateKey function (as translateKeyf) called on key"""
extractor_dict.expMetaData.expname |
extractor_dict.expMetaData.md |
extractor_dict.expMetaData.translateKeyf |
The documentation for this class was generated from the following file: