def RefreshStat(self): InstanceName.Clear() # Reinitializing counters self.Nevent_histos = 0 self.Npart_histos = 0 self.Nhistos = 0 self.Nevent_cuts = 0 self.Npart_cuts = 0 self.Ncuts = 0 self.Npid = 0 # Loop over selection for item in self.table: # Histogram case if item.__class__.__name__=="Histogram": if item.observable.name in ["NPID","NAPID"]: self.Npid+=1 self.Nevent_histos+=1 elif item.observable.name in ["TET", "MET", "THT", "MHT", "SQRTS"]: self.Nevent_histos+=1 else: self.Npart_histos+=1 # Cut case elif item.__class__.__name__=="Cut": self.Ncuts+=1 if len(item.part)==0: self.Nevent_cuts+=1 else: self.Npart_cuts+=1 # Updating global counters self.Nhistos = self.Nevent_histos + self.Npart_histos self.Ncuts = self.Nevent_cuts + self.Npart_cuts
def Open(self): if not self.resubmit: InstanceName.Clear() return FolderWriter.CreateDirectory(self.path, question=True) else: return self.CheckJobStructure()
def WriteContainer(file, main, part_list): # Skipping empty case if len(part_list) == 0: return # Cleaning particle containers file.write(' // Clearing particle containers\n') file.write(' {\n') for item in part_list: WriteCleanContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling particle containers file.write(' // Filling particle containers\n') file.write(' {\n') InstanceName.Clear() # Filling particle containers in PARTON and HADRON mode if main.mode in [MA5RunningType.PARTON, MA5RunningType.HADRON]: file.write( ' for (UInt_t i=0;i<event.mc()->particles().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling particle containers in RECO mode else: # Filling with jets file.write(' for (UInt_t i=0;i<event.rec()->jets().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithJetContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with electrons file.write( ' for (UInt_t i=0;i<event.rec()->electrons().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithElectronContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with muons file.write(' for (UInt_t i=0;i<event.rec()->muons().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithMuonContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with taus file.write(' for (UInt_t i=0;i<event.rec()->taus().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithTauContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() file.write(' }\n\n') # Managing PT rank file.write(' // Sorting particles\n') for item in part_list: WriteJobRank(item[0], file, item[1], item[2]) InstanceName.Clear()
def WriteContainer(file, main, part_list): # Skipping empty case if len(part_list) == 0: return # Cleaning particle containers file.write(' // Clearing particle containers\n') file.write(' {\n') for item in part_list: WriteCleanContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling particle containers file.write(' // Filling particle containers\n') file.write(' {\n') InstanceName.Clear() # Filling particle containers in PARTON and HADRON mode if main.mode in [MA5RunningType.PARTON, MA5RunningType.HADRON]: # Special particles : MET or MHT for item in part_list: if item[0].particle.Find(99) or item[0].particle.Find(100): WriteFillWithMETContainerMC(item[0], file, item[1], item[2]) WriteFillWithMHTContainerMC(item[0], file, item[1], item[2]) # Ordinary particles file.write( ' for (MAuint32 i=0;i<event.mc()->particles().size();i++)\n') file.write(' {\n') for item in part_list: if item[0].particle.Find(99) or item[0].particle.Find(100): pass else: WriteFillContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling particle containers in RECO mode else: # Filling with jets file.write(' for (MAuint32 i=0;i<event.rec()->jets().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithJetContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with photons file.write( ' for (MAuint32 i=0;i<event.rec()->photons().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithPhotonContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with electrons file.write( ' for (MAuint32 i=0;i<event.rec()->electrons().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithElectronContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with muons file.write( ' for (MAuint32 i=0;i<event.rec()->muons().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithMuonContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with taus file.write(' for (MAuint32 i=0;i<event.rec()->taus().size();i++)\n') file.write(' {\n') for item in part_list: WriteFillWithTauContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with MET file.write(' {\n') for item in part_list: WriteFillWithMETContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() # Filling with MHT file.write(' {\n') for item in part_list: WriteFillWithMHTContainer(item[0], file, item[1], item[2]) file.write(' }\n') InstanceName.Clear() file.write(' }\n\n') # Managing PT rank file.write(' // Sorting particles\n') for item in part_list: WriteJobRank(item[0], file, item[1], item[2]) InstanceName.Clear()