4 Instantiate the electron, photon and muon isolation
7 from AthenaCommon.Logging
import logging
8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
13 mlog = logging.getLogger(name)
14 mlog.info(
'Starting input building for isolation density configuration')
18 from JetRecConfig.StandardJetConstits
import stdConstitDic
as cst
19 from JetRecConfig.JetRecConfig
import JetInputCfg, getConstitPJGAlg
31 mlog = logging.getLogger(name)
32 mlog.info(
'Starting input building for neutral eflow isolation density configuration')
36 from JetRecConfig.StandardJetConstits
import stdConstitDic
as cst
37 from JetRecConfig.JetRecConfig
import JetInputCfg
40 if 'InputType' not in kwargs:
41 kwargs[
'InputType'] =
'EMPFlow'
42 cstI = cst[kwargs[
'InputType']]
45 cstO = cstI.containername[0:cstI.containername.find(
'ParticleFlowObjects')]
46 mlog.info(
'Configuring density for type '+cstO)
47 cstOs = cstO
if cstO !=
'CHS' else ''
50 constitpjalg = CompFactory.PseudoJetAlgorithm(
51 name =
"PseudoJetAlgForIso"+cstOs+
"NFlow",
52 InputContainer = cstO+
"NeutralParticleFlowObjects",
53 OutputContainer =
"PseudoJet"+cstOs+
"NFlow",
54 Label =
"EM"+cstOs+
"NPFlow",
55 SkipNegativeEnergy=
True)
58 acc.addEventAlgo(constitpjalg)
65 mlog = logging.getLogger(name)
66 mlog.info(
'Starting density alg for isolation configuration')
71 if name.find(
'Topo') >= 0:
72 inputO =
'PseudoJetEMTopoClusters'
73 outputS =
'TopoCluster'
74 elif name.find(
'NFlow') >= 0:
75 suff =
'CSSK' if name.find(
'CSSK') >= 0
else ''
76 inputO =
'PseudoJet'+suff+
'NFlow'
77 outputS =
'NeutralParticle'+suff+
'Flow'
78 kwargs[
'InputContainer'] = inputO
79 kwargs[
'JetRadius'] = 0.5
80 kwargs[
'UseFourMomArea'] =
True
81 kwargs[
'VoronoiRfact'] = 0.9
82 kwargs[
'JetAlgorithm'] =
'Kt'
83 if name.find(
'Central') >= 0:
84 kwargs[
'OutputContainer'] = outputS+
'IsoCentralEventShape'
85 kwargs[
'AbsRapidityMin'] = 0.0
86 kwargs[
'AbsRapidityMax'] = 1.5
87 elif name.find(
'Forward') >= 0:
88 kwargs[
'OutputContainer'] = outputS+
'IsoForwardEventShape'
89 kwargs[
'AbsRapidityMin'] = 1.5
90 kwargs[
'AbsRapidityMax'] = 3.0
91 densityTool = CompFactory.EventDensityTool(
92 name = name+
'Tool',**kwargs)
94 densityAlg = CompFactory.EventDensityAthAlg(
96 EventDensityTool = densityTool)
97 acc.addEventAlgo(densityAlg)
102 if __name__ ==
"__main__":
103 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
104 from AthenaConfiguration.ComponentAccumulator
import printProperties
105 from AthenaConfiguration.TestDefaults
import defaultTestFiles
106 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
108 flags.Input.Files = defaultTestFiles.RDO_RUN2
109 flags.Output.doWriteESD =
True
110 flags.Output.doWriteAOD =
True
113 mlog = logging.getLogger(
"densityForIsolationConfigTest")
114 mlog.info(
"Configuring density for isolation: ")
123 acc.getEventAlgo(
'CentralDensityForTopoIsoAlg'),
127 acc.getEventAlgo(
'JetModAlgForIsoNFlow'),
131 with open(
"isolationdensityconfig.pkl",
"wb")
as f: