def addJetFinder(self, output, alg, radius, gettersin, modifiersin =None, consumers =None, ivtxin =None, ghostArea =0.0, ptmin =0.0, ptminFilter =0.0, rndseed =1, isTrigger =False, useTriggerStore =False, variableRMinRadius =-1.0, variableRMassScale =-1.0, calibOpt ="", jetPseudojetCopier ="", warnIfDuplicate=True, overwrite=False): self.msg(2, "Adding finder") from JetRec.JetRecConf import JetRecTool if type(gettersin) == str: getters = self.gettersMap[gettersin] else: getters = gettersin # If jet finding by vertex is not specified, check for special input type names ivtx = ivtxin if ivtx == None: if gettersin == "ztrack": ivtx = -1 # Find tracs separatesly for each vertex elif gettersin == "pv0track": ivtx = 0 # Find tracks only for 1st vertex # Retrieve/build the jet finder. lofinder,hifinder = self.addJetFinderTool(output+"Finder", alg, radius, ivtx, ghostArea, ptmin, rndseed, variableRMinRadius, variableRMassScale) jetrec = JetRecTool(output) jetrec.PseudoJetGetters = getters jetrec.JetFinder = hifinder jetrec.OutputContainer = output ptminSave = self.ptminFilter if ptminFilter > 0.0: self.ptminFilter = ptminFilter jetrec.JetModifiers = self.buildModifiers(modifiersin, lofinder, getters, gettersin, output, calibOpt) if consumers != None: jetrec.JetConsumers = consumers self.ptminFilter = ptminSave jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() jetrec.WarnIfDuplicate = warnIfDuplicate jetrec.Overwrite = overwrite self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetFinder(self, output, alg, radius, gettersin, modifiersin =None, consumers =None, ivtxin =None, ghostArea =0.0, ptmin =0.0, ptminFilter =0.0, rndseed =1, isTrigger =False, useTriggerStore =False, variableRMinRadius =-1.0, variableRMassScale =-1.0, calibOpt ="", jetPseudojetCopier ="", warnIfDuplicate=True, overwrite=False): self.msg(2, "Adding finder") from JetRec.JetRecConf import JetRecTool if type(gettersin) == str: getters = self.gettersMap[gettersin] else: getters = gettersin # If jet finding by vertex is not specified, check for special input type names ivtx = ivtxin if ivtx == None: if gettersin == "ztrack": ivtx = -1 # Find tracs separatesly for each vertex elif gettersin == "pv0track": ivtx = 0 # Find tracks only for 1st vertex # Retrieve/build the jet finder. lofinder,hifinder = self.addJetFinderTool(output+"Finder", alg, radius, ivtx, ghostArea, ptmin, rndseed, variableRMinRadius, variableRMassScale) jetrec = JetRecTool(output) jetrec.PseudoJetGetters = getters jetrec.JetFinder = hifinder jetrec.OutputContainer = output ptminSave = self.ptminFilter if ptminFilter > 0.0: self.ptminFilter = ptminFilter jetrec.JetModifiers = self.buildModifiers(modifiersin, lofinder, getters, gettersin, output, calibOpt) if consumers != None: jetrec.JetConsumers = consumers self.ptminFilter = ptminSave jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() jetrec.WarnIfDuplicate = warnIfDuplicate jetrec.Overwrite = overwrite self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
# Find jets. from JetRec.JetRecConf import JetFinder jfind = JetFinder("JetFinder_" + name) jfind.JetAlgorithm = "AntiKt" jfind.JetRadius = 1.0 jfind.GhostArea = 0.01 jfind.PtMin = 200000.0 # jfind.OutputLevel = VERBOSE ToolSvc += jfind # JetRec tool for finding. jetrec = JetRecTool("JetRecTool_" + name) jetrec.OutputContainer = "AntiKt10" + name + "Jets" # jetrec.OutputLevel = INFO jetrec.PseudoJetGetters += [psjget] jetrec.JetFinder = jfind #jetrec.JetModifiers += [nsubjettiness] #jetrec.JetModifiers += [nsubjettinessratios] # jetrec.JetModifiers += [ktsplittingscale] # jetrec.JetModifiers += [dipolarity] # jetrec.JetModifiers += [angularity] # jetrec.JetModifiers += [ktdr] # jetrec.JetModifiers += [ktmassdrop] # jetrec.JetModifiers += [planarflow] # jetrec.JetModifiers += [centerofmassshapes] #jetrec.JetModifiers += [energycorrelator] #jetrec.JetModifiers += [energycorrelatorratios] # jetrec.JetModifiers += [pull] # jetrec.JetModifiers += [charge] # jetrec.JetModifiers += [subjetmaker] # jetrec.JetModifiers += [subjetfinder]
def addJetFinder(self, output, alg, radius, gettersin, modifiersin=None, consumers=None, ivtxin=None, ghostArea=0.0, ptmin=0.0, ptminFilter=0.0, rndseed=1, isTrigger=False, useTriggerStore=False, variableRMinRadius=-1.0, variableRMassScale=-1.0, calibOpt="", jetPseudojetCopier="", constmods=[]): self.msg(2, "Adding finder") from JetRec.JetRecConf import JetRecTool if type(gettersin) == str: getters = self.gettersMap[gettersin] else: getters = gettersin # Accumulate all PseudoJetGetters such that we can schedule all # needed PseudoJetAlgorithms before jet building self.allGetters += [ getter for getter in getters if not getter in self.allGetters ] # If jet finding by vertex is not specified, check for special input type names ivtx = ivtxin if ivtx == None: if gettersin == "ztrack": ivtx = -1 # Find tracs separatesly for each vertex elif gettersin == "pv0track": ivtx = 0 # Find tracks only for 1st vertex # Retrieve/build the jet finder. lofinder, hifinder = self.addJetFinderTool(output + "Finder", alg, radius, ivtx, ghostArea, ptmin, rndseed, variableRMinRadius, variableRMassScale, constmods=constmods) jetrec = JetRecTool(output) jetrec.InputPseudoJets = [getter.OutputContainer for getter in getters] jetrec.JetFinder = hifinder jetrec.OutputContainer = output ptminSave = self.ptminFilter if ptminFilter > 0.0: self.ptminFilter = ptminFilter jetrec.JetModifiers = self.buildModifiers(modifiersin, lofinder, getters, gettersin, output, calibOpt, constmods=constmods) self.autoconfigureModifiers(jetrec.JetModifiers, output) if consumers != None: jetrec.JetConsumers = consumers self.ptminFilter = ptminSave jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() #jetrec.WarnIfDuplicate = warnIfDuplicate #jetrec.Overwrite = overwrite # JetRecTool.OutputLevel = VERBOSE self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
OutputContainer="PseudoJetEMTopo4", SkipNegativeEnergy=True, GhostScale=0.0) f4 = JetFinder("fastjet-4") f4.JetAlgorithm = "AntiKt" f4.JetRadius = 0.4 f4.GhostArea = 0.0 f4.PtMin = 10.0 o4 = JetFromPseudojet("out4") ToolSvc += JetRecTool("jetrectool4") ToolSvc += PseudoJetGetter("emget4") ToolSvc += JetFinder("fastjet-4") ToolSvc += JetFromPseudojet("out4") j4.PseudoJetGetters += [g4] j4.JetFinder = f4 f4.JetBuilder = o4 jalg4.Tools += [j4] topSequence += jalg4 jetFlags.jetAODList += ["xAOD::JetContainer#AntiKt4EMTopoJets"] jetFlags.jetAODList += ["xAOD::JetAuxContainer#AntiKt4EMTopoJetsAux."] OutLevel = INFO for x in range(0, nJets): app = str((0.5 + x) / 10) app = app.replace('.', 'p') out = "AntiKt" + app + "EMTopoJets" jalg = JetAlgorithm("jetalg" + app, OutputLevel=OutLevel) j = JetRecTool("jetrectool" + app,
def addJetFinder(self, output, alg, radius, gettersin, modifiersin =None, ivtxin =None, ghostArea =0.0, ptmin =0.0, ptminFilter =0.0, rndseed =1, isTrigger =False, useTriggerStore =False, variableRMinRadius =-1.0, variableRMassScale =-1.0, calibOpt =""): from JetRec.JetRecConf import JetByVertexFinder self.msg(2, "Adding finder") if ghostArea == 0.0: self.m_jetBuilder = self.jetBuilderWithoutArea else: self.m_jetBuilder = self.jetBuilderWithArea if self.m_jetBuilder == None: self.msg(0, "Jet builder must be specified") raise Error from JetRec.JetRecConf import JetFinder from JetRec.JetRecConf import JetSplitter from JetRec.JetRecConf import JetRecTool if type(gettersin) == str: getters = self.gettersMap[gettersin] else: getters = gettersin areaSuffix= "Area" if ghostArea>0.0 else "" finder = JetFinder(output + areaSuffix+ "Finder") finder.JetAlgorithm = alg finder.JetRadius = radius finder.VariableRMinRadius = variableRMinRadius finder.VariableRMassScale = variableRMassScale finder.RandomOption = rndseed finder.GhostArea = ghostArea if ptmin > 0.0: finder.PtMin = ptmin else: finder.PtMin = self.ptminFinder finder.JetBuilder = self.m_jetBuilder self += finder jrfinder = finder; # If jet finding by vertex is not specified, check for special input type names ivtx = ivtxin if ivtx == None: if gettersin == "ztrack": ivtx = -1 # Find tracs separatesly for each vertex elif gettersin == "pv0track": ivtx = 0 # Find tracks only for 1st vertex # If jet finding by vertex is requested, change the finder if type(ivtx) is int: vfinder = JetByVertexFinder( output + "VertexFinder", JetFinder = finder, Vertex = ivtx ) self += vfinder jrfinder = vfinder; jetrec = JetRecTool(output) jetrec.PseudoJetGetters = getters jetrec.JetFinder = jrfinder jetrec.OutputContainer = output ptminSave = self.ptminFilter if ptminFilter > 0.0: self.ptminFilter = ptminFilter jetrec.JetModifiers = self.buildModifiers(modifiersin, finder, getters, gettersin, output, calibOpt) self.ptminFilter = ptminSave jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = self.timer self += jetrec self.finders += [finder] if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec