Skip to content
Snippets Groups Projects

MetaReader for byte-stream: Convert numeric beam type to string

Merged Walter Lampl requested to merge wlampl/athena:metaReaderFixByteStreamBeamType into master
1 file
+ 12
1
Compare changes
  • Side-by-side
  • Inline
@@ -285,7 +285,18 @@ def read_metadata(filenames, file_type = None, mode = 'lite', promote = None, me
bs_metadata['lumiBlockNumbers'] = getattr(data_reader, 'lumiblockNumber')()
bs_metadata['projectTag'] = getattr(data_reader, 'projectTag')()
bs_metadata['stream'] = getattr(data_reader, 'stream')()
bs_metadata['beamType'] = getattr(data_reader, 'beamType')()
#bs_metadata['beamType'] = getattr(data_reader, 'beamType')()
beamTypeNbr= getattr(data_reader, 'beamType')()
#According to info from Rainer and Guiseppe the beam type is
#O: no beam
#1: protons
#2: ions
print beamTypeNbr
if (beamTypeNbr==0): bs_metadata['beamType'] = 'cosmics'
elif (beamTypeNbr==1 or beamTypeNbr==2): bs_metadata['beamType'] = 'collisions'
else: bs_metadata['beamType'] = 'unknown'
print bs_metadata['beamType']
bs_metadata['beamEnergy'] = getattr(data_reader, 'beamEnergy')()
meta_dict[filename]['eventTypes'] = bs_metadata.get('eventTypes', [])
Loading