File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -106,15 +106,15 @@ def read_AO2D_eventcount(file):
106106 # the O2mccollision_ tree contains the simulated collisions
107107 # but the version number might change so better to loop over keys and do matching
108108 tabname = tab .GetName ()
109- if tabname . startswith ( "O2mccollision_" ):
109+ if re . match ( "^O2mccollision(_[0-9]*)?$" , tabname ):
110110 coltreekey = obj .GetKey (tabname )
111111 coltree = coltreekey .ReadObj ()
112112 if coltree and isinstance (coltree , ROOT .TTree ):
113113 eventcount = eventcount + coltree .GetEntries ()
114114 colfound = colfound + 1
115115
116- if colfound != 1 :
117- print ("ERROR in extracting the expected amount of MC collision tables " )
116+ if colfound == 0 :
117+ print ("ERROR: No MC collision table found " )
118118
119119 # Close the files
120120 tfile .Close ()
@@ -125,4 +125,5 @@ def read_AO2D_eventcount(file):
125125if AO2D_eventcount != GEANT_eventcount :
126126 print ("WARN: AO2D MC event count and GEANT event count differ" )
127127
128- write_stat_file (AO2D_eventcount )
128+ print ("Found " + str (AO2D_eventcount ) + " events in AO2D file" )
129+ write_stat_file (AO2D_eventcount )
You can’t perform that action at this time.
0 commit comments