Example #1
0
def addTruthEnergyDensity(kernel=None):
    #Ensure that we are adding it to something
    if kernel is None:
        from DerivationFrameworkCore.DerivationFrameworkMaster import DerivationFrameworkJob
        kernel = DerivationFrameworkJob
    if hasattr(kernel, 'DFCommonTruthEDKernel'):
        # Already there!  Carry on...
        dfcommontruthlog.warning(
            "Attempt to add a duplicate DFCommonTruthEDKernel. Failing.")
        return
    # Truth energy density tools
    from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAthAlg
    from AthenaCommon.AppMgr import ToolSvc
    from JetRec.JetRecStandard import jtm
    # Algorithms for the energy density - needed only if e/gamma hasn't set things up already
    if not hasattr(ToolSvc, 'EDTruthCentralTool'):
        DFCommonTruthCentralEDTool = configEventDensityTool(
            "DFCommonTruthCentralEDTool",
            jtm.truthget,
            0.5,
            AbsRapidityMax=1.5,
            OutputContainer="TruthIsoCentralEventShape",
        )
        ToolSvc += DFCommonTruthCentralEDTool
        kernel += EventDensityAthAlg(
            "DFCommonTruthCentralEDAlg",
            EventDensityTool=DFCommonTruthCentralEDTool)
    if not hasattr(ToolSvc, 'EDTruthForwardTool'):
        DFCommonTruthForwardEDTool = configEventDensityTool(
            "DFCommonTruthForwardEDTool",
            jtm.truthget,
            0.5,
            AbsRapidityMin=1.5,
            AbsRapidityMax=3.0,
            OutputContainer="TruthIsoForwardEventShape",
        )
        ToolSvc += DFCommonTruthForwardEDTool
        kernel += EventDensityAthAlg(
            "DFCommonTruthForwardEDAlg",
            EventDensityTool=DFCommonTruthForwardEDTool)

    # Now add the tool to do the decoration
    from DerivationFrameworkMCTruth.DerivationFrameworkMCTruthConf import DerivationFramework__TruthEDDecorator
    DFCommonTruthEDDecorator = DerivationFramework__TruthEDDecorator(
        "DFCommonTruthEDDecorator",
        EventInfoName="EventInfo",
        EnergyDensityKeys=[
            "TruthIsoCentralEventShape", "TruthIsoForwardEventShape"
        ],
        DecorationSuffix="_rho")
    ToolSvc += DFCommonTruthEDDecorator
    kernel += CfgMgr.DerivationFramework__DerivationKernel(
        "DFCommonTruthEDKernel", AugmentationTools=[DFCommonTruthEDDecorator])
Example #2
0
def defineEDAlg(R=0.4, inputtype="LCTopo"):
    from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg
    from AthenaCommon.AppMgr import ToolSvc

    # map a getter to the input argument
    inputgetter = {"LCTopo": jtm.lcget, "EMTopo": jtm.emget}[inputtype]

    t = configEventDensityTool("EDTool" + str(int(R * 10)) + inputtype, inputgetter, R)
    t.OutputLevel = 3
    ToolSvc += t
    return EventDensityAlg("EventDensityAlg" + t.name(), EventDensityTool=t, OutputLevel=3)
Example #3
0
def configureEDCorrection(tool):
  """Configure tools and algorithm for energy density correction 
     (only if doEnergyDensityCorrection = True)"""
  # Return if doEnergyDensityCorrection is false
  if not getPropertyValue(tool, 'doEnergyDensityCorrection'):
    return
  # Set OutputLevel to INFO or higher if tool has it too
  OutputLevel = min(getPropertyValue(tool, 'OutputLevel'), INFO)
  try:
    from AthenaCommon.AppMgr import ToolSvc
    from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg
    from JetRec.JetRecStandard import jtm
    tc=configEventDensityTool("EDtpIsoCentralTool", jtm.emget,
                              radius          = 0.5,
                              AbsRapidityMin  = 0.0,
                              AbsRapidityMax  = 1.5,
                              OutputContainer = "DensitytpIsoCentral",
                              OutputLevel     = OutputLevel
                              )
    ToolSvc += tc
    tf=configEventDensityTool("EDtpIsoForwardTool", jtm.emget,
                              radius          = 0.5,
                              AbsRapidityMin  = 1.5,
                              AbsRapidityMax  = 3.0,
                              OutputContainer = "DensitytpIsoForward",
                              OutputLevel     = OutputLevel
                              )
    ToolSvc += tf
  except Exception:
    print '\nERROR: could not get handle to EDEgammaXTool'
    raise
 
  # add to topsequence 
  from AthenaCommon.AlgSequence import AlgSequence
  topSequence = AlgSequence()
  if not hasattr(topSequence,'EDtpIsoCentralAlg'):
    topSequence += EventDensityAlg("EDtpIsoCentralAlg", EventDensityTool = tc)
  if not hasattr(topSequence,'EDtpIsoForwardAlg'):
    topSequence += EventDensityAlg("EDtpIsoForwardAlg", EventDensityTool = tf)
Example #4
0
def defineEDAlg(R=0.4, inputtype="LCTopo"):
    from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg
    from AthenaCommon.AppMgr import ToolSvc

    from JetRec.JetRecStandard import jtm

    t = configEventDensityTool("EDTool" + str(int(R * 10)) + inputtype,
                               inputlabel=inputtype,
                               radius=R)
    t.OutputLevel = 3
    ToolSvc += t
    return EventDensityAlg("EventDensityAlg" + t.name(),
                           EventDensityTool=t,
                           OutputLevel=3)
Example #5
0
def defineEDAlg(R=0.4, inputtype="LCTopo"):
    from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg
    from AthenaCommon.AppMgr import ToolSvc

    # map a getter to the input argument
    inputgetter = {
        "LCTopo": jtm.lcget,
        "EMTopo": jtm.emget,
    }[inputtype]

    t = configEventDensityTool("EDTool" + str(int(R * 10)) + inputtype,
                               inputgetter, R)
    t.OutputLevel = 3
    ToolSvc += t
    return EventDensityAlg("EventDensityAlg" + t.name(),
                           EventDensityTool=t,
                           OutputLevel=3)
Example #6
0
def configureEDCorrection(tool):
    """Configure tools and algorithm for energy density correction 
     (only if doEnergyDensityCorrection = True)"""
    # Return if doEnergyDensityCorrection is false
    if not getPropertyValue(tool, 'doEnergyDensityCorrection'):
        return
    # Set OutputLevel to INFO or higher if tool has it too
    OutputLevel = min(getPropertyValue(tool, 'OutputLevel'), INFO)
    try:
        from AthenaCommon.AppMgr import ToolSvc
        from AthenaCommon.AlgSequence import AlgSequence
        from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAthAlg
        from JetRec.JetRecStandard import jtm
        topSequence = AlgSequence()
        if not hasattr(topSequence, 'EDtpIsoCentralAlg'):
            tccc = configEventDensityTool(
                "EDtpIsoCentralTool",
                jtm.emget,
                radius=0.5,
                AbsRapidityMin=0.0,
                AbsRapidityMax=1.5,
                OutputContainer="TopoClusterIsoCentralEventShape",
                OutputLevel=OutputLevel)
            ToolSvc += tccc
            topSequence += EventDensityAthAlg("EDtpIsoCentralAlg",
                                              EventDensityTool=tccc)

        if not hasattr(topSequence, 'EDtpIsoForwardAlg'):
            tfcc = configEventDensityTool(
                "EDtpIsoForwardTool",
                jtm.emget,
                radius=0.5,
                AbsRapidityMin=1.5,
                AbsRapidityMax=3.0,
                OutputContainer="TopoClusterIsoForwardEventShape",
                OutputLevel=OutputLevel)
            ToolSvc += tfcc
            topSequence += EventDensityAthAlg("EDtpIsoForwardAlg",
                                              EventDensityTool=tfcc)

        if not hasattr(topSequence, 'EDtpIsoVeryForwardAlg'):
            tvfcc = configEventDensityTool(
                "EDtpIsoVeryForwardTool",
                jtm.emget,
                radius=0.5,
                AbsRapidityMin=2.5,
                AbsRapidityMax=4.5,
                OutputContainer="TopoClusterIsoVeryForwardEventShape",
                OutputLevel=OutputLevel)
            ToolSvc += tvfcc
            topSequence += EventDensityAthAlg("EDtpIsoVeryForwardAlg",
                                              EventDensityTool=tvfcc)

        if doPFlow:
            if not hasattr(topSequence, 'EDpfIsoCentralAlg'):
                tcpf = configEventDensityTool(
                    "EDpfIsoCentralTool",
                    jtm.empflowget,
                    radius=0.5,
                    AbsRapidityMin=0.0,
                    AbsRapidityMax=1.5,
                    OutputContainer="ParticleFlowIsoCentralEventShape",
                    OutputLevel=OutputLevel)
                ToolSvc += tcpf
                topSequence += EventDensityAthAlg("EDpfIsoCentralAlg",
                                                  EventDensityTool=tcpf)

            if not hasattr(topSequence, 'EDpfIsoForwardAlg'):
                tfpf = configEventDensityTool(
                    "EDpfIsoForwardTool",
                    jtm.empflowget,
                    radius=0.5,
                    AbsRapidityMin=1.5,
                    AbsRapidityMax=3.0,
                    OutputContainer="ParticleFlowIsoForwardEventShape",
                    OutputLevel=OutputLevel)
                ToolSvc += tfpf
                topSequence += EventDensityAthAlg("EDpfIsoForwardAlg",
                                                  EventDensityTool=tfpf)

            ## Try a neutral density
            if not hasattr(topSequence, 'EDnpfIsoCentralAlg'):
                tcnpf = configEventDensityTool(
                    "EDnpfIsoCentralTool",
                    jtm.emnpflowget,
                    radius=0.5,
                    AbsRapidityMin=0.0,
                    AbsRapidityMax=1.5,
                    OutputContainer="NeutralParticleFlowIsoCentralEventShape",
                    OutputLevel=OutputLevel)
                ToolSvc += tcnpf
                topSequence += EventDensityAthAlg("EDnpfIsoCentralAlg",
                                                  EventDensityTool=tcnpf)

            if not hasattr(topSequence, 'EDnpfIsoForwardAlg'):
                tfnpf = configEventDensityTool(
                    "EDnpfIsoForwardTool",
                    jtm.emnpflowget,
                    radius=0.5,
                    AbsRapidityMin=1.5,
                    AbsRapidityMax=3.0,
                    OutputContainer="NeutralParticleFlowIsoForwardEventShape",
                    OutputLevel=OutputLevel)
                ToolSvc += tfnpf
                topSequence += EventDensityAthAlg("EDnpfIsoForwardAlg",
                                                  EventDensityTool=tfnpf)

    except Exception:
        print '\nERROR: could not get handle to ED'
        raise
Example #7
0
                                  allParticlesKey="TruthParticles",
                                  particleIDsToCalculate=[-11, 11, 22],
                                  IsolationConeSizes=[0.2, 0.3, 0.4],
                                  IsolationVarNamePrefix='ptcone',
                                  ChargedParticlesOnly=True)
    ToolSvc += TruthEgptIsolationTool
    print TruthEgptIsolationTool
    EGAugmentationTools.append(TruthEgptIsolationTool)

    # Compute the truth-particle-level energy density in the central eta region
    from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg
    from JetRec.JetRecStandard import jtm
    tc = configEventDensityTool(
        "EDTruthCentralTool",
        jtm.truthget,
        0.5,
        AbsRapidityMax=1.5,
        OutputContainer="TruthIsoCentralEventShape",
        OutputLevel=3,
    )
    ToolSvc += tc

    # Compute the truth-particle-level energy density in the forward eta region
    tf = configEventDensityTool(
        "EDTruthForwardTool",
        jtm.truthget,
        0.5,
        AbsRapidityMin=1.5,
        AbsRapidityMax=3.0,
        OutputContainer="TruthIsoForwardEventShape",
        OutputLevel=3,
    )
Example #8
0
def addJetRecoToAlgSequence(job=None,
                            useTruth=None,
                            eventShapeTools=None,
                            separateJetAlgs=None,
                            debug=None):

    myname = "JetAlgorithm: "

    # We need this to modify the global variable.
    global jetalg

    # Import message level flags.
    from GaudiKernel.Constants import DEBUG

    # Import the jet reconstruction control flags.
    from JetRec.JetRecFlags import jetFlags

    # Import the standard jet tool manager.
    from JetRec.JetRecStandardToolManager import jtm

    # Set sequence and flags as needed.
    if job == None:
        from AthenaCommon.AlgSequence import AlgSequence
        job = AlgSequence()
    if useTruth == None:
        useTruth = jetFlags.useTruth()
    if eventShapeTools == None:
        eventShapeTools = jetFlags.eventShapeTools()
        if eventShapeTools == None:
            eventShapeTools = []
    if separateJetAlgs == None:
        separateJetAlgs = jetFlags.separateJetAlgs()

    # Event shape tools.
    evstools = []
    evsDict = {
        "emtopo": ("EMTopoEventShape", jtm.emget),
        "lctopo": ("LCTopoEventShape", jtm.lcget),
        "empflow": ("EMPFlowEventShape", jtm.empflowget),
        "emcpflow": ("EMCPFlowEventShape", jtm.emcpflowget),
        "lcpflow": ("LCPFlowEventShape", jtm.lcpflowget),
    }

    if jetFlags.useTracks():
        evsDict["emtopo"] = ("EMTopoOriginEventShape", jtm.emoriginget)
        evsDict["lctopo"] = ("LCTopoOriginEventShape", jtm.lcoriginget)
    jetlog.info(myname + "Event shape tools: " + str(eventShapeTools))

    from RecExConfig.AutoConfiguration import IsInInputFile
    for evskey in eventShapeTools:
        from EventShapeTools.EventDensityConfig import configEventDensityTool
        if evskey in evsDict:
            (toolname, getter) = evsDict[evskey]
            if toolname in jtm.tools:
                jetlog.info(myname + "Skipping duplicate event shape: " +
                            toolname)
            else:
                jetlog.info(myname + "Adding event shape " + evskey)
                if not IsInInputFile("xAOD::EventShape", "Kt4" + toolname):
                    jtm += configEventDensityTool(toolname, getter, 0.4)
                    evstools += [jtm.tools[toolname]]
        else:
            jetlog.info(myname + "Invalid event shape key: " + evskey)
            raise Exception

    # Add the tool runner. It runs the jetrec tools.
    rtools = []
    # Add the truth tools.
    if useTruth:
        from JetRec.JetFlavorAlgs import scheduleCopyTruthParticles
        rtools += scheduleCopyTruthParticles()

        # build truth jet input :
        rtools += [jtm.truthpartcopy, jtm.truthpartcopywz]

    ## if jetFlags.useCells():
    ##   rtools += [jtm.missingcells] commented out : incompatible with trigger : ATR-9696
    if jetFlags.useTracks:
        rtools += [
            jtm.tracksel,
            jtm.tvassoc,
            jtm.trackselloose_trackjets,
        ]

    # Add the algorithm. It runs the jetrec tools.
    from JetRec.JetRecConf import JetAlgorithm
    ctools = []
    if jetFlags.useTracks:
        if not IsInInputFile("xAOD::CaloClusterContainer",
                             "LCOriginTopoClusters"):
            ctools += [jtm.JetConstitSeq_LCOrigin]
        if not IsInInputFile("xAOD::CaloClusterContainer",
                             "EMOriginTopoClusters"):
            ctools += [jtm.JetConstitSeq_EMOrigin]
    from JetRec.JetRecConf import JetToolRunner
    runners = []
    if len(ctools) > 0:
        jtm += JetToolRunner("jetconstit",
                             EventShapeTools=[],
                             Tools=ctools,
                             Timer=jetFlags.timeJetToolRunner())
        jtm.jetconstit
        runners = [jtm.jetconstit]

    if jetFlags.separateJetAlgs():

        jtm += JetToolRunner("jetrun",
                             EventShapeTools=evstools,
                             Tools=rtools,
                             Timer=jetFlags.timeJetToolRunner())
        runners += [jetrun]

        job += JetAlgorithm("jetalg")
        jetalg = job.jetalg
        jetalg.Tools = runners

        for t in jtm.jetrecs:
            jalg = JetAlgorithm("jetalg" + t.name())
            jalg.Tools = [t]
            job += jalg

    else:
        from JetRec.JetRecConf import JetToolRunner
        jtm += JetToolRunner("jetrun",
                             EventShapeTools=evstools,
                             Tools=rtools + jtm.jetrecs,
                             Timer=jetFlags.timeJetToolRunner())
        runners += [jtm.jetrun]

        job += JetAlgorithm("jetalg")
        jetalg = job.jetalg
        jetalg.Tools = runners
        if jetFlags.debug > 0:
            jtm.setOutputLevel(jtm.jetrun, DEBUG)
            jetalg.OutputLevel = DEBUG
        if jetFlags.debug > 1:
            for tool in jtm.jetrecs:
                jtm.setOutputLevel(tool, DEBUG)
        if jetFlags.debug > 2:
            for tool in jtm.finders:
                jtm.setOutputLevel(tool, DEBUG)
        if jetFlags.debug > 3:
            jtm.setOutputLevel(jtm.jetBuilderWithArea, DEBUG)
            jtm.setOutputLevel(jtm.jetBuilderWithoutArea, DEBUG)
Example #9
0
# Full job is a list of algorithms
from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()

# Add the truth tools.
if jetFlags.useTruth:
  from JetRec.JetFlavorAlgs import scheduleCopyTruthParticles
  scheduleCopyTruthParticles(job)

# Event shape tools.
evstools = []
for name in jetFlags.eventShapeTools():
  from EventShapeTools.EventDensityConfig import configEventDensityTool
  if   name == "em":
    jtm += configEventDensityTool("EMTopoEventShape", jtm.emget, 0.4)
    evstools += [jtm.tools["EMTopoEventShape"]]
  elif name == "lc":
    jtm += configEventDensityTool("LCTopoEventShape", jtm.lcget, 0.4)
    evstools += [jtm.tools["LCTopoEventShape"]]
  else:
    print myname + "Invalid event shape key: " + name
    raise Exception

# Add the tool runner. It runs the jetrec tools.
rtools = []
if jetFlags.useCells():
  rtools += [jtm.missingcells]
if jetFlags.useTracks:
  rtools += [jtm.tracksel]
  rtools += [jtm.tvassoc]
Example #10
0
def addJetRecoToAlgSequence(job =None, useTruth =None, eventShapeTools =None,
                            separateJetAlgs= None, debug =None):

  myname = "JetAlgorithm: "

  # We need this to modify the global variable.
  global jetalg

  # Import message level flags.
  from GaudiKernel.Constants import DEBUG

  # Import the jet reconstruction control flags.
  from JetRec.JetRecFlags import jetFlags

  # Import the standard jet tool manager.
  from JetRec.JetRecStandardToolManager import jtm

  # Set sequence and flags as needed.
  if job == None:
    from AthenaCommon.AlgSequence import AlgSequence
    job = AlgSequence()
  if useTruth == None:
    useTruth = jetFlags.useTruth()
  if eventShapeTools == None:
    eventShapeTools = jetFlags.eventShapeTools()
    if eventShapeTools == None:
      eventShapeTools = []
  if separateJetAlgs == None:
    separateJetAlgs = jetFlags.separateJetAlgs()


  # Event shape tools.
  evstools = []
  evsDict = {
    "emtopo"   : ("EMTopoEventShape",   jtm.emget),
    "lctopo"   : ("LCTopoEventShape",   jtm.lcget),
    "empflow"  : ("EMPFlowEventShape",  jtm.empflowget),
    "emcpflow" : ("EMCPFlowEventShape", jtm.emcpflowget),
    "lcpflow"  : ("LCPFlowEventShape",  jtm.lcpflowget),
  }
  print myname + "Event shape tools: " + str(eventShapeTools)
  for evskey in eventShapeTools:
    from EventShapeTools.EventDensityConfig import configEventDensityTool
    if evskey in evsDict:
      (toolname, getter) = evsDict[evskey]
      if toolname in jtm.tools:
        print myname + "Skipping duplicate event shape: " + toolname
      else:
        print myname + "Adding event shape " + evskey
        jtm += configEventDensityTool(toolname, getter, 0.4)
        evstools += [jtm.tools[toolname]]
    else:
      print myname + "Invalid event shape key: " + evskey
      raise Exception

  # Add the tool runner. It runs the jetrec tools.
  rtools = []
  # Add the truth tools.
  if useTruth:    
    from JetRec.JetFlavorAlgs import scheduleCopyTruthParticles
    rtools += scheduleCopyTruthParticles()
    
    # build truth jet input :
    rtools += [ jtm.truthpartcopy, jtm.truthpartcopywz ]

  ## if jetFlags.useCells():
  ##   rtools += [jtm.missingcells] commented out : incompatible with trigger : ATR-9696
  if jetFlags.useTracks:
    rtools += [jtm.tracksel,
               jtm.tvassoc,
               jtm.trackselloose_trackjets,
               jtm.JetConstitSeq_LCOrigin,
               jtm.JetConstitSeq_EMOrigin,
               ]
    
  # Add the algorithm. It runs the jetrec tools.
  from JetRec.JetRecConf import JetAlgorithm

  if jetFlags.separateJetAlgs():

    from JetRec.JetRecConf import JetToolRunner
    jtm += JetToolRunner("jetrun",
                         EventShapeTools=evstools,
                         Tools=rtools,
                         Timer=jetFlags.timeJetToolRunner()
                         )
    jetrun = jtm.jetrun

    job += JetAlgorithm("jetalg")
    jetalg = job.jetalg
    jetalg.Tools = [jtm.jetrun]

    for t in jtm.jetrecs:
      # from JetRec.JetRecConf import JetToolRunner
      # jetrun_rec = JetToolRunner("jetrun"+t.name(),
      #                            EventShapeTools=[],
      #                            Tools=[t],
      #                            Timer=jetFlags.timeJetToolRunner()
      #                            )
      # jtm += jetrun_rec
      jalg = JetAlgorithm("jetalg"+t.name())
      jalg.Tools = [t]
      job+= jalg

  else:
    from JetRec.JetRecConf import JetToolRunner
    jtm += JetToolRunner("jetrun",
                         EventShapeTools=evstools,
                         Tools=rtools+jtm.jetrecs,
                         Timer=jetFlags.timeJetToolRunner()
                         )
    jetrun = jtm.jetrun

    job += JetAlgorithm("jetalg")
    jetalg = job.jetalg
    jetalg.Tools = [jtm.jetrun]
    if jetFlags.debug > 0:
      jtm.setOutputLevel(jtm.jetrun, DEBUG)
      jetalg.OutputLevel = DEBUG
    if jetFlags.debug > 1:
      for tool in jtm.jetrecs:
        jtm.setOutputLevel(tool, DEBUG)
    if jetFlags.debug > 2:
      for tool in jtm.finders:
        jtm.setOutputLevel(tool, DEBUG)
    if jetFlags.debug > 3:
      jtm.setOutputLevel(jtm.jetBuilderWithArea, DEBUG)
      jtm.setOutputLevel(jtm.jetBuilderWithoutArea, DEBUG)
Example #11
0
def addJetRecoToAlgSequence(job=None,
                            useTruth=None,
                            eventShapeTools=None,
                            separateJetAlgs=None,
                            debug=None):

    myname = "JetAlgorithm: "

    # We need this to modify the global variable.
    global jetalg

    # Import message level flags.
    from GaudiKernel.Constants import DEBUG

    # Import the jet reconstruction control flags.
    from JetRec.JetRecFlags import jetFlags

    # Import the standard jet tool manager.
    from JetRec.JetRecStandard import jtm

    # Set sequence and flags as needed.
    if job == None:
        from AthenaCommon.AlgSequence import AlgSequence
        job = AlgSequence()
    if useTruth == None:
        useTruth = jetFlags.useTruth()
    if eventShapeTools == None:
        eventShapeTools = jetFlags.eventShapeTools()
        if eventShapeTools == None:
            eventShapeTools = []
    if separateJetAlgs == None:
        separateJetAlgs = jetFlags.separateJetAlgs()

    # Event shape tools.
    evsDict = {
        "emtopo": ("EMTopoEventShape", jtm.emget),
        "lctopo": ("LCTopoEventShape", jtm.lcget),
        "empflow": ("EMPFlowEventShape", jtm.empflowget),
    }

    if jetFlags.useTracks():
        if jetFlags.useVertices():
            evsDict["emtopo"] = ("EMTopoOriginEventShape", jtm.emoriginget)
            evsDict["lctopo"] = ("LCTopoOriginEventShape", jtm.lcoriginget)
        else:
            evsDict["emtopo"] = ("EMTopoOriginEventShape", jtm.emget)
            evsDict["lctopo"] = ("LCTopoOriginEventShape", jtm.lcget)
    jetlog.info(myname + "Event shape tools: " + str(eventShapeTools))

    from RecExConfig.AutoConfiguration import IsInInputFile
    for evskey in eventShapeTools:
        from EventShapeTools.EventDensityConfig import configEventDensityTool
        if evskey in evsDict:
            (toolname, getter) = evsDict[evskey]
            if toolname in jtm.tools:
                jetlog.info(myname + "Skipping duplicate event shape: " +
                            toolname)
            else:
                jetlog.info(myname + "Adding event shape " + evskey)
                if not IsInInputFile("xAOD::EventShape", toolname):
                    jtm += configEventDensityTool(toolname, getter.Label, 0.4)
                    jtm.allEDTools += [jtm.tools[toolname]]
        else:
            jetlog.info(myname + "Invalid event shape key: " + evskey)
            raise Exception

    # Add the tool runner. It runs the jetrec tools.
    ctools = []
    # Add the truth tools.
    if useTruth:
        from JetRec.JetFlavorAlgs import scheduleCopyTruthParticles
        ctools += scheduleCopyTruthParticles()

        # build truth jet input :
        ctools += [jtm.truthpartcopy, jtm.truthpartcopywz]

    ## if jetFlags.useCells():
    ##   ctools += [jtm.missingcells] commented out : incompatible with trigger : ATR-9696
    if jetFlags.useTracks:
        ctools += [jtm.tracksel, jtm.trackselloose_trackjets]
        if jetFlags.useVertices:
            ctools += [jtm.tvassoc]

    # LCOriginTopoClusters and EMOriginTopoClusters are shallow copies
    # of CaloCalTopoClusters.  This means that if CaloCalTopoClusters gets
    # thinned on output, the the two derived containers need to be thinned
    # in the same way, else they'll be corrupted in the output.
    # FIXME: this should be automatic somehow.
    postalgs = []
    thinneg = False
    from RecExConfig.RecFlags import rec
    if rec.doWriteAOD() and not rec.readAOD():
        from ParticleBuilderOptions.AODFlags import AODFlags
        if AODFlags.ThinNegativeEnergyCaloClusters:
            thinneg = True

    if jetFlags.useTracks and jetFlags.useVertices:
        if not IsInInputFile("xAOD::CaloClusterContainer",
                             "LCOriginTopoClusters"):
            ctools += [jtm.JetConstitSeq_LCOrigin]
            if thinneg:
                from ThinningUtils.ThinningUtilsConf import ThinNegativeEnergyCaloClustersAlg
                postalgs.append(
                    ThinNegativeEnergyCaloClustersAlg(
                        'ThinNegLCOriginTopoClusters',
                        ThinNegativeEnergyCaloClusters=True,
                        CaloClustersKey='LCOriginTopoClusters',
                        StreamName='StreamAOD'))
        if not IsInInputFile("xAOD::CaloClusterContainer",
                             "EMOriginTopoClusters"):
            ctools += [jtm.JetConstitSeq_EMOrigin]
            if thinneg:
                from ThinningUtils.ThinningUtilsConf import ThinNegativeEnergyCaloClustersAlg
                postalgs.append(
                    ThinNegativeEnergyCaloClustersAlg(
                        'ThinNegEMOriginTopoClusters',
                        ThinNegativeEnergyCaloClusters=True,
                        CaloClustersKey='EMOriginTopoClusters',
                        StreamName='StreamAOD'))
        if not IsInInputFile("xAOD::PFOContainer", "CHSParticleFlowObjects"):
            if not hasattr(job, "jetalgCHSPFlow"):
                ctools += [jtm.JetConstitSeq_PFlowCHS]
                if thinneg:
                    from ThinningUtils.ThinningUtilsConf import ThinNegativeEnergyNeutralPFOsAlg
                    CHSnPFOsThinAlg = ThinNegativeEnergyNeutralPFOsAlg(
                        "ThinNegativeEnergyCHSNeutralPFOsAlg",
                        NeutralPFOsKey="CHSNeutralParticleFlowObjects",
                        ThinNegativeEnergyNeutralPFOs=True,
                        StreamName='StreamAOD')
                    postalgs.append(CHSnPFOsThinAlg)

    from JetRec.JetRecConf import JetToolRunner
    from JetRec.JetRecConf import JetAlgorithm
    runners = []
    if len(ctools) > 0:
        jtm += JetToolRunner("jetconstit",
                             EventShapeTools=[],
                             Tools=ctools,
                             Timer=jetFlags.timeJetToolRunner())
        job += JetAlgorithm("jetalgConstituents", Tools=[jtm.jetconstit])

    # Add all the PseudoJetAlgorithms now
    # To avoid massive refactoring and to preserve familiarity,
    # kept calling things "getters", but these are already
    # PseudoJetAlgorithms as we eliminated the wrappers
    for getter in jtm.allGetters:
        job += getter

    # Then, add all event shape tools in separate algs
    for evstool in jtm.allEDTools:
        from EventShapeTools.EventShapeToolsConf import EventDensityAthAlg
        job += EventDensityAthAlg("edalg_" + evstool.OutputContainer,
                                  EventDensityTool=evstool)

    if separateJetAlgs:

        for t in jtm.jetrecs:
            jalg = JetAlgorithm("jetalg" + t.name(), Tools=[t])
            job += jalg

    else:
        from JetRec.JetRecConf import JetToolRunner
        jtm += JetToolRunner("jetrun",
                             EventShapeTools=[],
                             Tools=rtools + jtm.jetrecs,
                             Timer=jetFlags.timeJetToolRunner())
        runners += [jtm.jetrun]

    job += JetAlgorithm("jetalg")
    jetalg = job.jetalg
    jetalg.Tools = runners
    if jetFlags.debug > 0:
        # jtm.setOutputLevel(jtm.jetrun, DEBUG)
        jetalg.OutputLevel = DEBUG
    if jetFlags.debug > 1:
        for tool in jtm.jetrecs:
            jtm.setOutputLevel(tool, DEBUG)
    if jetFlags.debug > 2:
        for tool in jtm.finders:
            jtm.setOutputLevel(tool, DEBUG)
    if jetFlags.debug > 3:
        jtm.setOutputLevel(jtm.jetBuilderWithArea, DEBUG)
        jtm.setOutputLevel(jtm.jetBuilderWithoutArea, DEBUG)

    for postalg in postalgs:
        job += postalg
Example #12
0
def ConstituentPileupIso(privateSeq):
  from AthenaCommon.AppMgr import ToolSvc
  from JetRecTools.JetRecToolsConfig import ctm
  from JetRecTools.JetRecToolsConf import ConstituentSubtractorTool, ConstitTimeCutTool, SoftKillerWeightTool
  ctm.add( ConstitTimeCutTool("JetConstit_Timing"),
           alias = 'timing' )
  ctm.add( ConstituentSubtractorTool("JetConstit_ConstSub"),
           alias = 'constsub' )
  ctm.add( ConstitTimeCutTool("JetPF_Timing", ApplyToChargedPFO=False),
           alias = 'timingPF' )
  ctm.add( SoftKillerWeightTool("JetPF_SoftKiller", SKGridSize=0.6, ApplyToChargedPFO=False) ,
           alias = 'softkillerPF' )
  ctm.add( ConstituentSubtractorTool("JetPF_ConstSub", ApplyToChargedPFO=False),
           alias = 'constsubPF' )
  clustOrigSeq = ctm.buildConstitModifSequence( 'ConstitOrigSeq',
                                                OutputContainer = 'OrigTopoClusters',
                                                InputContainer= 'CaloCalTopoClusters',
                                                modList = [  'clus_origin'] )
  
  xAOD_Type_CaloCluster = 1
  clustTimeSeq = ctm.buildConstitModifSequence( 'ConstitTimeSeq',
                                              OutputContainer = 'OrigTimeTopoClusters',
                                              InputContainer= 'OrigTopoClusters',
                                              modList = [  'timing'] , InputType=xAOD_Type_CaloCluster)
  clustTimeSKSeq = ctm.buildConstitModifSequence( 'ConstitOrigTimeSKSeq',
                                              OutputContainer = 'OrigTimeSKTopoClusters',
                                              InputContainer= 'OrigTimeTopoClusters',
                                              modList = [  'softkiller'] , InputType=xAOD_Type_CaloCluster)
  clustTimeCSSeq = ctm.buildConstitModifSequence( 'ConstitOrigTimeCSSeq',
                                              OutputContainer = 'OrigTimeCSTopoClusters',
                                              InputContainer= 'OrigTimeTopoClusters',
                                              modList = [  'constsub'] , InputType=xAOD_Type_CaloCluster)
  clustTimeCSSKSeq = ctm.buildConstitModifSequence( 'ConstitOrigTimeCSSKSeq',
                                              OutputContainer = 'OrigTimeCSSKTopoClusters',
                                              InputContainer= 'OrigTimeCSTopoClusters',
                                              modList = [  'softkiller'] , InputType=xAOD_Type_CaloCluster)
  
  pfTimeSeq = ctm.buildConstitModifSequence( 'pfTimeSeq',
                                              InputContainer= 'JetETMiss',
                                              OutputContainer = 'TimePF',
                                              modList = [  'timingPF'], InputType=3)
  pfTimeSKSeq = ctm.buildConstitModifSequence( "pfTimeSKSeq",
                                        InputContainer = "TimePF",
                                        OutputContainer = 'TimePFSK',
                                        modList = ['softkillerPF'] , InputType=3)
  pfTimeCSSeq = ctm.buildConstitModifSequence( "pfTimeCSSeq",
                                        InputContainer = "TimePF",
                                        OutputContainer = 'TimePFCS',
                                        modList = ['constsubPF'] , InputType=3)
  pfTimeCSSKSeq = ctm.buildConstitModifSequence( 'pfTimeCSSKSeq',
                                              InputContainer= 'TimePFCS',
                                              OutputContainer = 'TimePFCSSK',
                                              modList = [  'softkillerPF'], InputType=3)
  
  from JetRec.JetRecConf import JetAlgorithm
  clustSeqAlg = JetAlgorithm("ClusterModifiers", Tools = [clustOrigSeq, clustTimeSeq, clustTimeSKSeq, clustTimeCSSeq, clustTimeCSSKSeq])
  pfSeqAlg = JetAlgorithm("pfModifiers", Tools = [pfTimeSeq, pfTimeSKSeq, pfTimeCSSeq, pfTimeCSSKSeq])
  privateSeq += clustSeqAlg
  privateSeq += pfSeqAlg
  
  from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAthAlg
  from JetRec.JetRecStandard import jtm
  tccc = configEventDensityTool("EDtpIsoCentralTool", jtm.lcget,
                                radius          = 0.5,
                                AbsRapidityMin  = 0.0,
                                AbsRapidityMax  = 1.5,
                                OutputContainer = "LCTopoClusterIsoCentralEventShape",
                               )
  ToolSvc += tccc
  privateSeq += EventDensityAthAlg("LCEDtpIsoCentralAlg", EventDensityTool = tccc)
  
  tfcc = configEventDensityTool("EDtpIsoForwardTool", jtm.lcget,
                                radius          = 0.5,
                                AbsRapidityMin  = 1.5,
                                AbsRapidityMax  = 3.0,
                                OutputContainer = "LCTopoClusterIsoForwardEventShape",
                                )
  ToolSvc += tfcc
  privateSeq += EventDensityAthAlg("LCEDtpIsoForwardAlg", EventDensityTool = tfcc)
  
  from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__CaloClustersInConeTool
  LCCaloClustersInConeTool = xAOD__CaloClustersInConeTool(name = "LCCaloClustersInConeTool",
                                       CaloClusterLocation = "CaloCalTopoClusters")
  ToolSvc += LCCaloClustersInConeTool
  OrigTimeCSCaloClustersInConeTool = xAOD__CaloClustersInConeTool(name = "OrigTimeCSCaloClustersInConeTool",
                                       CaloClusterLocation = "OrigTimeCSTopoClusters")
  ToolSvc += OrigTimeCSCaloClustersInConeTool
  OrigTimeSKCaloClustersInConeTool = xAOD__CaloClustersInConeTool(name = "OrigTimeSKCaloClustersInConeTool",
                                       CaloClusterLocation = "OrigTimeSKTopoClusters")
  ToolSvc += OrigTimeSKCaloClustersInConeTool
  OrigTimeCSSKCaloClustersInConeTool = xAOD__CaloClustersInConeTool(name = "OrigTimeCSSKCaloClustersInConeTool",
                                       CaloClusterLocation = "OrigTimeCSSKTopoClusters")
  ToolSvc += OrigTimeCSSKCaloClustersInConeTool
  
  from PFlowUtils.PFlowUtilsConf import CP__RetrievePFOTool as RetrievePFOTool
  TimePFCSTool = RetrievePFOTool("TimePFCSTool",NeutralInputContainer="TimePFCSNeutralParticleFlowObjects")
  ToolSvc += TimePFCSTool
  TimePFSKTool = RetrievePFOTool("TimePFSKTool",NeutralInputContainer="TimePFSKNeutralParticleFlowObjects")
  ToolSvc += TimePFSKTool
  TimePFCSSKTool = RetrievePFOTool("TimePFCSSKTool",NeutralInputContainer="TimePFCSSKNeutralParticleFlowObjects")
  ToolSvc += TimePFCSSKTool
  
  from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__PFlowObjectsInConeTool
  TimePFCSObjectsInConeTool = xAOD__PFlowObjectsInConeTool(
                                       name = "TimePFCSObjectsInConeTool",
                                       RetrievePFOTool = TimePFCSTool)
  ToolSvc += TimePFCSObjectsInConeTool
  TimePFSKObjectsInConeTool = xAOD__PFlowObjectsInConeTool(
                                       name = "TimePFSKObjectsInConeTool",
                                       RetrievePFOTool = TimePFSKTool)
  ToolSvc += TimePFSKObjectsInConeTool
  TimePFCSSKObjectsInConeTool = xAOD__PFlowObjectsInConeTool(
                                       name = "TimePFCSSKObjectsInConeTool",
                                       RetrievePFOTool = TimePFCSSKTool)
  ToolSvc += TimePFCSSKObjectsInConeTool
  
  from IsolationTool.IsolationToolConf import xAOD__CaloIsolationTool
  LCCaloIsolationTool = xAOD__CaloIsolationTool(name = "LCCaloIsolationTool",
                                  CaloFillRectangularClusterTool  = None,
                                  ClustersInConeTool              = LCCaloClustersInConeTool,
                                  PFlowObjectsInConeTool          = None,
                                  IsoLeakCorrectionTool           = None,
                                  saveOnlyRequestedCorrections    = False,
                                  EMCaloNums                      = [],
                                  HadCaloNums                     = [],
                                  TopoClusterEDCentralContainer   = "LCTopoClusterIsoCentralEventShape",
                                  TopoClusterEDForwardContainer   = "LCTopoClusterIsoForwardEventShape",
                                  UseEMScale                      = False,
                                  addCaloExtensionDecoration      = False)
  ToolSvc += LCCaloIsolationTool
  
  OrigTimeCSCaloIsolationTool = xAOD__CaloIsolationTool(name = "OrigTimeCSCaloIsolationTool",
                                  CaloFillRectangularClusterTool  = None,
                                  ClustersInConeTool              = OrigTimeCSCaloClustersInConeTool,
                                  PFlowObjectsInConeTool          = None,
                                  IsoLeakCorrectionTool           = None,
                                  saveOnlyRequestedCorrections    = False,
                                  EMCaloNums                      = [],
                                  HadCaloNums                     = [],
                                  UseEMScale                      = False,
                                  addCaloExtensionDecoration      = False)
  ToolSvc += OrigTimeCSCaloIsolationTool
  OrigTimeSKCaloIsolationTool = xAOD__CaloIsolationTool(name = "OrigTimeSKCaloIsolationTool",
                                  CaloFillRectangularClusterTool  = None,
                                  ClustersInConeTool              = OrigTimeSKCaloClustersInConeTool,
                                  PFlowObjectsInConeTool          = None,
                                  IsoLeakCorrectionTool           = None,
                                  saveOnlyRequestedCorrections    = False,
                                  EMCaloNums                      = [],
                                  HadCaloNums                     = [],
                                  UseEMScale                      = False,
                                  addCaloExtensionDecoration      = False)
  ToolSvc += OrigTimeSKCaloIsolationTool
  OrigTimeCSSKCaloIsolationTool = xAOD__CaloIsolationTool(name = "OrigTimeCSSKCaloIsolationTool",
                                  CaloFillRectangularClusterTool  = None,
                                  ClustersInConeTool              = OrigTimeCSSKCaloClustersInConeTool,
                                  PFlowObjectsInConeTool          = None,
                                  IsoLeakCorrectionTool           = None,
                                  saveOnlyRequestedCorrections    = False,
                                  EMCaloNums                      = [],
                                  HadCaloNums                     = [],
                                  UseEMScale                      = False,
                                  addCaloExtensionDecoration      = False)
  ToolSvc += OrigTimeCSSKCaloIsolationTool

  TimePFCSCaloIsolationTool = xAOD__CaloIsolationTool(name = "TimePFCSCaloIsolationTool",
                                  CaloFillRectangularClusterTool  = None,
                                  ClustersInConeTool              = None,
                                  PFlowObjectsInConeTool          = TimePFCSObjectsInConeTool,
                                  IsoLeakCorrectionTool           = None,
                                  saveOnlyRequestedCorrections    = False,
                                  EMCaloNums                      = [],
                                  HadCaloNums                     = [],
                                  UseEMScale                      = True,
                                  addCaloExtensionDecoration      = False)
  ToolSvc += TimePFCSCaloIsolationTool
  TimePFSKCaloIsolationTool = xAOD__CaloIsolationTool(name = "TimePFSKCaloIsolationTool",
                                  CaloFillRectangularClusterTool  = None,
                                  ClustersInConeTool              = None,
                                  PFlowObjectsInConeTool          = TimePFSKObjectsInConeTool,
                                  IsoLeakCorrectionTool           = None,
                                  saveOnlyRequestedCorrections    = False,
                                  EMCaloNums                      = [],
                                  HadCaloNums                     = [],
                                  UseEMScale                      = True,
                                  addCaloExtensionDecoration      = False)
  ToolSvc += TimePFSKCaloIsolationTool
  TimePFCSSKCaloIsolationTool = xAOD__CaloIsolationTool(name = "TimePFCSSKCaloIsolationTool",
                                  CaloFillRectangularClusterTool  = None,
                                  ClustersInConeTool              = None,
                                  PFlowObjectsInConeTool          = TimePFCSSKObjectsInConeTool,
                                  IsoLeakCorrectionTool           = None,
                                  saveOnlyRequestedCorrections    = False,
                                  EMCaloNums                      = [],
                                  HadCaloNums                     = [],
                                  UseEMScale                      = True,
                                  addCaloExtensionDecoration      = False)
  ToolSvc += TimePFCSSKCaloIsolationTool

  # Import the xAOD isolation parameters.
  from xAODPrimitives.xAODIso import xAODIso as isoPar

  from IsolationAlgs.IsolationAlgsConf import IsolationBuilder
  isoBuilderLC = IsolationBuilder(
                                        name                  = "isoBuilderLC",
                                        ElectronCollectionContainerName    = "",
                                        PhotonCollectionContainerName      = "",
                                        MuonCollectionContainerName        = "Muons",
                                        FwdElectronCollectionContainerName = "",
                                        CaloCellIsolationTool = None,
                                        CaloTopoIsolationTool = LCCaloIsolationTool,
                                        PFlowIsolationTool    = None,
                                        TrackIsolationTool    = None, 
                                        FeIsoTypes            = [[]] ,
                                        FeCorTypes            = [[]],
                                        EgIsoTypes            = [[]],
                                        EgCorTypes            = [[]],
                                        MuIsoTypes            = [[isoPar.topoetcone20]],
                                        MuCorTypes            = [[isoPar.coreCone, isoPar.pileupCorrection ]],
                                        CustomConfigurationNameMu = "LC",
                                        CustomConfigurationNameEl = "",
                                        CustomConfigurationNamePh = "",
                                        CustomConfigurationName   = "LC",
                                        IsAODFix              = False,
                                        LeakageTool           = None,
                                        IsolateEl             = True)
  privateSeq += isoBuilderLC
  
  isoBuilderOrigTimeCS = IsolationBuilder(
                                        name                  = "isoBuilderOrigTimeCS",
                                        ElectronCollectionContainerName    = "",
                                        PhotonCollectionContainerName      = "",
                                        MuonCollectionContainerName        = "Muons",
                                        FwdElectronCollectionContainerName = "",
                                        CaloCellIsolationTool = None,
                                        CaloTopoIsolationTool = OrigTimeCSCaloIsolationTool,
                                        PFlowIsolationTool    = None,
                                        TrackIsolationTool    = None, 
                                        FeIsoTypes            = [[]] ,
                                        FeCorTypes            = [[]],
                                        EgIsoTypes            = [[]],
                                        EgCorTypes            = [[]],
                                        MuIsoTypes            = [[isoPar.topoetcone20]],
                                        MuCorTypes            = [[isoPar.coreCone]],
                                        CustomConfigurationNameMu = "OrigTimeCS",
                                        CustomConfigurationNameEl = "",
                                        CustomConfigurationNamePh = "",
                                        CustomConfigurationName   = "OrigTimeCS",
                                        IsAODFix              = False,
                                        LeakageTool           = None,
                                        IsolateEl             = True)
  privateSeq += isoBuilderOrigTimeCS
  
  isoBuilderOrigTimeSK = IsolationBuilder(
                                        name                  = "isoBuilderOrigTimeSK",
                                        ElectronCollectionContainerName    = "",
                                        PhotonCollectionContainerName      = "",
                                        MuonCollectionContainerName        = "Muons",
                                        FwdElectronCollectionContainerName = "",
                                        CaloCellIsolationTool = None,
                                        CaloTopoIsolationTool = OrigTimeSKCaloIsolationTool,
                                        PFlowIsolationTool    = None,
                                        TrackIsolationTool    = None, 
                                        FeIsoTypes            = [[]] ,
                                        FeCorTypes            = [[]],
                                        EgIsoTypes            = [[]],
                                        EgCorTypes            = [[]],
                                        MuIsoTypes            = [[isoPar.topoetcone20]],
                                        MuCorTypes            = [[isoPar.coreCone]],
                                        CustomConfigurationNameMu = "OrigTimeSK",
                                        CustomConfigurationNameEl = "",
                                        CustomConfigurationNamePh = "",
                                        CustomConfigurationName   = "OrigTimeSK",
                                        IsAODFix              = False,
                                        LeakageTool           = None,
                                        IsolateEl             = True)
  privateSeq += isoBuilderOrigTimeSK
  isoBuilderOrigTimeCSSK = IsolationBuilder(
                                        name                  = "isoBuilderOrigTimeCSSK",
                                        ElectronCollectionContainerName    = "",
                                        PhotonCollectionContainerName      = "",
                                        MuonCollectionContainerName        = "Muons",
                                        FwdElectronCollectionContainerName = "",
                                        CaloCellIsolationTool = None,
                                        CaloTopoIsolationTool = OrigTimeCSSKCaloIsolationTool,
                                        PFlowIsolationTool    = None,
                                        TrackIsolationTool    = None, 
                                        FeIsoTypes            = [[]] ,
                                        FeCorTypes            = [[]],
                                        EgIsoTypes            = [[]],
                                        EgCorTypes            = [[]],
                                        MuIsoTypes            = [[isoPar.topoetcone20]],
                                        MuCorTypes            = [[isoPar.coreCone]],
                                        CustomConfigurationNameMu = "OrigTimeCSSK",
                                        CustomConfigurationNameEl = "",
                                        CustomConfigurationNamePh = "",
                                        CustomConfigurationName   = "OrigTimeCSSK",
                                        IsAODFix              = False,
                                        LeakageTool           = None,
                                        IsolateEl             = True)
  privateSeq += isoBuilderOrigTimeCSSK
  
  isoBuilderTimePFCS = IsolationBuilder(
                                        name                  = "isoBuilderTimePFCS",
                                        ElectronCollectionContainerName    = "",
                                        PhotonCollectionContainerName      = "",
                                        MuonCollectionContainerName        = "Muons",
                                        FwdElectronCollectionContainerName = "",
                                        CaloCellIsolationTool = None,
                                        CaloTopoIsolationTool = None,
                                        PFlowIsolationTool    = TimePFCSCaloIsolationTool,
                                        TrackIsolationTool    = None, 
                                        FeIsoTypes            = [[]] ,
                                        FeCorTypes            = [[]],
                                        EgIsoTypes            = [[]],
                                        EgCorTypes            = [[]],
                                        MuIsoTypes            = [[isoPar.neflowisol20]],
                                        MuCorTypes            = [[isoPar.coreCone]],
                                        CustomConfigurationNameMu = "TimePFCS",
                                        CustomConfigurationNameEl = "",
                                        CustomConfigurationNamePh = "",
                                        CustomConfigurationName   = "TimePFCS",
                                        IsAODFix              = False,
                                        LeakageTool           = None,
                                        IsolateEl             = True)
  privateSeq += isoBuilderTimePFCS
  
  isoBuilderTimePFSK = IsolationBuilder(
                                        name                  = "isoBuilderTimePFSK",
                                        ElectronCollectionContainerName    = "",
                                        PhotonCollectionContainerName      = "",
                                        MuonCollectionContainerName        = "Muons",
                                        FwdElectronCollectionContainerName = "",
                                        CaloCellIsolationTool = None,
                                        CaloTopoIsolationTool = None,
                                        PFlowIsolationTool    = TimePFSKCaloIsolationTool,
                                        TrackIsolationTool    = None, 
                                        FeIsoTypes            = [[]] ,
                                        FeCorTypes            = [[]],
                                        EgIsoTypes            = [[]],
                                        EgCorTypes            = [[]],
                                        MuIsoTypes            = [[isoPar.neflowisol20]],
                                        MuCorTypes            = [[isoPar.coreCone]],
                                        CustomConfigurationNameMu = "TimePFSK",
                                        CustomConfigurationNameEl = "",
                                        CustomConfigurationNamePh = "",
                                        CustomConfigurationName   = "TimePFSK",
                                        IsAODFix              = False,
                                        LeakageTool           = None,
                                        IsolateEl             = True)
  privateSeq += isoBuilderTimePFSK

  isoBuilderTimePFCSSK = IsolationBuilder(
                                        name                  = "isoBuilderTimePFCSSK",
                                        ElectronCollectionContainerName    = "",
                                        PhotonCollectionContainerName      = "",
                                        MuonCollectionContainerName        = "Muons",
                                        FwdElectronCollectionContainerName = "",
                                        CaloCellIsolationTool = None,
                                        CaloTopoIsolationTool = None,
                                        PFlowIsolationTool    = TimePFCSSKCaloIsolationTool,
                                        TrackIsolationTool    = None, 
                                        FeIsoTypes            = [[]] ,
                                        FeCorTypes            = [[]],
                                        EgIsoTypes            = [[]],
                                        EgCorTypes            = [[]],
                                        MuIsoTypes            = [[isoPar.neflowisol20]],
                                        MuCorTypes            = [[isoPar.coreCone]],
                                        CustomConfigurationNameMu = "TimePFCSSK",
                                        CustomConfigurationNameEl = "",
                                        CustomConfigurationNamePh = "",
                                        CustomConfigurationName   = "TimePFCSSK",
                                        IsAODFix              = False,
                                        LeakageTool           = None,
                                        IsolateEl             = True)
  privateSeq += isoBuilderTimePFCSSK