Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 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
Esempio n. 4
0
 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
Esempio n. 5
0
 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
Esempio n. 6
0
 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
Esempio n. 7
0
 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
Esempio n. 8
0
 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
Esempio n. 9
0
 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
Esempio n. 10
0
 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
Esempio n. 11
0
    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
Esempio n. 12
0
        # jetrec.JetModifiers += [centerofmassshapes]
        #jetrec.JetModifiers += [energycorrelator]
        #jetrec.JetModifiers += [energycorrelatorratios]
        # jetrec.JetModifiers += [pull]
        # jetrec.JetModifiers += [charge]
        # jetrec.JetModifiers += [subjetmaker]
        # jetrec.JetModifiers += [subjetfinder]
        ToolSvc += jetrec

        jetPseudojetRetriever = JetPseudojetRetriever(
            "JetPseudojetRetriever_" + name)
        ToolSvc += jetPseudojetRetriever

        # JetRec tool for finding.
        jetrec_trimm = JetRecTool("JetRecTool_" + name + "Trimm")
        jetrec_trimm.JetGroomer = groomer
        jetrec_trimm.InputContainer = "AntiKt10" + name + "Jets"
        jetrec_trimm.OutputContainer = "AntiKt10" + name + "TrimmedJets"
        jetrec_trimm.JetPseudojetRetriever = jetPseudojetRetriever
        #jetrec_trimm.JetModifiers += [nsubjettiness]
        #jetrec_trimm.JetModifiers += [nsubjettinessratios]
        # jetrec_trimm.JetModifiers += [ktsplittingscale]
        # jetrec_trimm.JetModifiers += [dipolarity]
        # jetrec_trimm.JetModifiers += [angularity]
        # jetrec_trimm.JetModifiers += [ktdr]
        # jetrec_trimm.JetModifiers += [ktmassdrop]
        # jetrec_trimm.JetModifiers += [planarflow]
        # jetrec_trimm.JetModifiers += [centerofmassshapes]
        #jetrec_trimm.JetModifiers += [energycorrelator]
        #jetrec_trimm.JetModifiers += [energycorrelatorratios]
        # jetrec_trimm.JetModifiers += [pull]