Commit 07efa9a5 authored by Federico Di Pierro's avatar Federico Di Pierro
Browse files

Added a check on M1 and M2 MC headers identicalness

parent d7604c47
Pipeline #89379 failed with stage
in 18 minutes and 21 seconds
......@@ -333,6 +333,14 @@ class MAGICEventSource(EventSource):
data.mon.tels_with_data = {1, 2}
data.mon.tel[tel_i + 1] = monitoring_camera
else:
if self.current_run['data'].mcheader_data['M1']['sim_nevents'] != self.current_run['data'].mcheader_data['M2']['sim_nevents'] or \
self.current_run['data'].mcheader_data['M1']['sim_emin'] != self.current_run['data'].mcheader_data['M2']['sim_emin'] or \
self.current_run['data'].mcheader_data['M1']['sim_emax'] != self.current_run['data'].mcheader_data['M2']['sim_emax'] or \
self.current_run['data'].mcheader_data['M1']['sim_eslope'] != self.current_run['data'].mcheader_data['M2']['sim_eslope'] or \
self.current_run['data'].mcheader_data['M1']['sim_max_impact'] != self.current_run['data'].mcheader_data['M2']['sim_max_impact'] or \
self.current_run['data'].mcheader_data['M1']['sim_conesemiangle'] != self.current_run['data'].mcheader_data['M2']['sim_conesemiangle']:
print("WARNING!!! Simulation configurations are different for M1 and M2 !!!")
else:
data.mcheader.num_showers = self.current_run['data'].mcheader_data['M1']['sim_nevents']
data.mcheader.energy_range_min = (self.current_run['data'].mcheader_data['M1']['sim_emin']).to(u.TeV) # GeV->TeV
......@@ -1012,9 +1020,7 @@ class MarsRun:
'MRawRunHeader.fSourceDEC',
'MRawRunHeader.fTelescopeNumber']
for file_name in file_list:
#print("file_name: ",file_name, is_mc, len(file_list))
input_file = uproot.open(file_name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment