def addJetSplitter(self, output, mumax, ymin, input, modifiersin ="groomed", isTrigger =False, useTriggerStore =False, doArea =True): from JetRec.JetRecConf import JetSplitter from JetRec.JetRecConf import JetRecTool groomer = JetSplitter(output + "Groomer") groomer.MuMax = mumax groomer.YMin = ymin groomer.BDRS = False groomer.NSubjetMax = 3 if doArea: groomer.JetBuilder = self.jetBuilderWithArea else: groomer.JetBuilder = self.jetBuilderWithoutArea self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetPruner(self, output, rcut, zcut, input, modifiersin="groomed", isTrigger=False, useTriggerStore=False, doArea=True): from JetRec.JetRecConf import JetPruner from JetRec.JetRecConf import JetRecTool groomer = JetPruner(output + "Groomer") groomer.RCut = rcut groomer.ZCut = zcut if doArea: groomer.JetBuilder = self.jetBuilderWithArea else: groomer.JetBuilder = self.jetBuilderWithoutArea self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetPruner(self, output, rcut, zcut, input, modifiersin ="groomed", isTrigger =False, useTriggerStore =False, doArea =True): from JetRec.JetRecConf import JetPruner from JetRec.JetRecConf import JetRecTool groomer = JetPruner(output + "Groomer") groomer.RCut = rcut groomer.ZCut = zcut if doArea: groomer.JetBuilder = self.jetBuilderWithArea else: groomer.JetBuilder = self.jetBuilderWithoutArea self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetSplitter(self, output, mumax, ymin, input, modifiersin="groomed", isTrigger=False, useTriggerStore=False, doArea=True): from JetRec.JetRecConf import JetSplitter from JetRec.JetRecConf import JetRecTool groomer = JetSplitter(output + "Groomer") groomer.MuMax = mumax groomer.YMin = ymin groomer.BDRS = False groomer.NSubjetMax = 3 if doArea: groomer.JetBuilder = self.jetBuilderWithArea else: groomer.JetBuilder = self.jetBuilderWithoutArea self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetSplitter(self, output, mumax, ymin, input, modifiersin ="groomed", isTrigger =False, useTriggerStore =False): if self.m_jetBuilder == None: self.msg(0, "Jet builder must be specified") from JetRec.JetRecConf import JetSplitter from JetRec.JetRecConf import JetRecTool groomer = JetSplitter(output + "Groomer") groomer.MuMax = mumax groomer.YMin = ymin groomer.BDRS = False groomer.NSubjetMax = 3 groomer.JetBuilder = self.m_jetBuilder self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = self.timer self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetTrimmer(self, output, rclus, ptfrac, input, modifiersin ="groomed", pseudojetRetriever ="jpjretriever", isTrigger =False, useTriggerStore =False, doArea =True): from JetRec.JetRecConf import JetTrimmer from JetRec.JetRecConf import JetRecTool groomer = JetTrimmer(output + "Groomer") groomer.RClus = rclus groomer.PtFrac = ptfrac if doArea: groomer.JetBuilder = self.jetBuilderWithArea else: groomer.JetBuilder = self.jetBuilderWithoutArea self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() if pseudojetRetriever in self.tools: jetrec.JetPseudojetRetriever = self.tools[pseudojetRetriever] else: jetlog.info( "Requested jet pseudojet retriever is not a registered tool: " \ + pseudojetRetriever ) raise KeyError self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetReclusterer(self, output, alg, radius, input, modifiersin =None, consumers =None, ivtx =None, ghostArea =0.0, ptmin =0.0, ptminFilter =0.0, rndseed =1, isTrigger =False, useTriggerStore =False, variableRMinRadius =-1.0, variableRMassScale =-1.0, calibOpt ="", jetPseudojetCopier =""): self.msg(2, "Adding reclusterer") from JetRec.JetRecConf import JetRecTool from JetRec.JetRecConf import JetReclusterer # Retrieve/build the jet finder. lofinder,hifinder = self.addJetFinderTool(output+"Finder", alg, radius, ivtx, ghostArea, ptmin, rndseed, variableRMinRadius, variableRMassScale) reclname = output + "Reclusterer" groomer = JetReclusterer( reclname, JetConstituentsRetriever = self.tools["jconretriever"], JetFinder = hifinder ) self += groomer jetrec = JetRecTool(output) jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetGroomer = groomer jetrec.JetModifiers = self.getModifiers(modifiersin) if consumers != None: jetrec.JetConsumers = consumers jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetPruner(self, output, rcut, zcut, input, modifiersin ="groomed", isTrigger =False, useTriggerStore =False): if self.m_jetBuilder == None: self.msg(0, "Jet builder must be specified") from JetRec.JetRecConf import JetPruner from JetRec.JetRecConf import JetRecTool groomer = JetPruner(output + "Groomer") groomer.RCut = rcut groomer.ZCut = zcut groomer.JetBuilder = self.m_jetBuilder self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = self.timer self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetTrimmer(self, output, rclus, ptfrac, input, modifiersin ="groomed", pseudojetRetriever ="jpjretriever", isTrigger =False, useTriggerStore =False, doArea =True): from JetRec.JetRecConf import JetTrimmer from JetRec.JetRecConf import JetRecTool groomer = JetTrimmer(output + "Groomer") groomer.RClus = rclus groomer.PtFrac = ptfrac if doArea: groomer.JetBuilder = self.jetBuilderWithArea else: groomer.JetBuilder = self.jetBuilderWithoutArea self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() if pseudojetRetriever in self.tools: jetrec.JetPseudojetRetriever = self.tools[pseudojetRetriever] else: print "Requested jet pseudojet retriever is not a registered tool: " \ + pseudojetRetriever raise KeyError self += jetrec if isTrigger: self.trigjetrecs += [jetrec] else: self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetReclusterer(self, output, alg, radius, input, modifiersin =None, consumers =None, ivtx =None, ghostArea =0.0, ptmin =0.0, ptminFilter =0.0, rndseed =1, isTrigger =False, useTriggerStore =False, variableRMinRadius =-1.0, variableRMassScale =-1.0, calibOpt ="", jetPseudojetCopier =""): self.msg(2, "Adding reclusterer") from JetRec.JetRecConf import JetRecTool from JetRec.JetRecConf import JetReclusterer # Retrieve/build the jet finder. lofinder,hifinder = self.addJetFinderTool(output+"Finder", alg, radius, ivtx, ghostArea, ptmin, rndseed, variableRMinRadius, variableRMassScale) reclname = output + "Reclusterer" groomer = JetReclusterer( reclname, JetConstituentsRetriever = self.tools["jconretriever"], JetFinder = hifinder ) self += groomer jetrec = JetRecTool(output) jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetGroomer = groomer jetrec.JetModifiers = self.getModifiers(modifiersin) if consumers != None: jetrec.JetConsumers = consumers jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() 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
def addJetCopier(self, output, input, modifiersin, ptminFilter=0.0, radius=0.0, alg="", inp="", isTrigger=False, useTriggerStore=False, calibOpt="", shallow=True, constmods=[]): from JetRec.JetRecConf import JetRecTool jetrec = JetRecTool(output) jetrec.InputContainer = input jetrec.OutputContainer = output ptminSave = self.ptminFilter if ptminFilter > 0.0: self.ptminFilter = ptminFilter class finder: JetRadius = radius JetAlgorithm = alg class get: Label = inp getters = [get] jetrec.JetModifiers = self.buildModifiers(modifiersin, finder, getters, None, output, calibOpt, constmods=constmods) self.autoconfigureModifiers(jetrec.JetModifiers, output) self.ptminFilter = ptminSave jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() ### jetrec.ShallowCopy = shallow self += jetrec 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
def addJetCopier(self, output, input, modifiersin, ptminFilter =0.0, radius =0.0, alg ="", inp ="", isTrigger=False, useTriggerStore=False, calibOpt =""): from JetRec.JetRecConf import JetRecTool jetrec = JetRecTool(output) jetrec.InputContainer = input jetrec.OutputContainer = output ptminSave = self.ptminFilter if ptminFilter > 0.0: self.ptminFilter = ptminFilter class finder: JetRadius = radius JetAlgorithm = alg class get: Label = inp getters = [get] jetrec.JetModifiers = self.buildModifiers(modifiersin, finder, getters, None, output, calibOpt) self.ptminFilter = ptminSave jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = self.timer self += jetrec self.jetrecs += [jetrec] self.jetcons += [output] return jetrec
def addJetRecursiveSoftDrop(self, output, beta, zcut, N, r0, input, modifiersin="groomed", isTrigger=False, useTriggerStore=False, doArea=True): from JetRec.JetRecConf import JetRecursiveSoftDrop from JetRec.JetRecConf import JetRecTool groomer = JetRecursiveSoftDrop(output + "Groomer") groomer.ZCut = zcut groomer.Beta = beta groomer.N = N groomer.R0 = r0 if doArea: groomer.JetBuilder = self.jetBuilderWithArea else: groomer.JetBuilder = self.jetBuilderWithoutArea self += groomer jetrec = JetRecTool(output) jetrec.JetGroomer = groomer jetrec.InputContainer = input jetrec.OutputContainer = output jetrec.JetModifiers = self.getModifiers(modifiersin) self.autoconfigureModifiers(jetrec.JetModifiers, output) jetrec.Trigger = isTrigger or useTriggerStore jetrec.Timer = jetFlags.timeJetRecTool() 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, 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
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