Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions
PFRun3Config Namespace Reference

Functions

def PFFullCfg (inputFlags, runTauReco=False, **kwargs)
 
def PFCfg (inputFlags, **kwargs)
 
def PFTauFELinkCfg (inputFlags, **kwargs)
 
def PFRun3ConfigTest (flags=None)
 

Function Documentation

◆ PFCfg()

def PFRun3Config.PFCfg (   inputFlags,
**  kwargs 
)

Definition at line 66 of file PFRun3Config.py.

66 def PFCfg(inputFlags,**kwargs):
67 
68  result=ComponentAccumulator()
69 
70  #Configure the pflow algorithms
71  PFLeptonSelectorFactory=CompFactory.PFLeptonSelector
72  PFLeptonSelector = PFLeptonSelectorFactory("PFLeptonSelector")
73  PFLeptonSelector.selectElectrons=False
74  PFLeptonSelector.selectMuons=False
75  result.addEventAlgo(PFLeptonSelector)
76 
77  from eflowRec.PFCfg import PFTrackSelectorAlgCfg
78  useCaching = True
79  #If reading ESD/AOD do not make use of caching of track extrapolations.
80  if inputFlags.Input.Format is Format.POOL and "StreamRDO" not in inputFlags.Input.ProcessingTags:
81  useCaching = False
82  result.merge(PFTrackSelectorAlgCfg(inputFlags,"PFTrackSelector",useCaching))
83 
84  from eflowRec.PFCfg import getOfflinePFAlgorithm
85  result.merge(getOfflinePFAlgorithm(inputFlags))
86 
87  from eflowRec.PFCfg import getChargedFlowElementCreatorAlgorithm,getNeutralFlowElementCreatorAlgorithm,getLCNeutralFlowElementCreatorAlgorithm
88  result.addEventAlgo(getChargedFlowElementCreatorAlgorithm(inputFlags,""))
89  result.addEventAlgo(getNeutralFlowElementCreatorAlgorithm(inputFlags,""))
90  result.addEventAlgo(getLCNeutralFlowElementCreatorAlgorithm(inputFlags,""))
91 
92  #Only do linking if not in eoverp mode
93  if not inputFlags.PF.EOverPMode:
94  if inputFlags.PF.useElPhotLinks:
95  from eflowRec.PFCfg import getEGamFlowElementAssocAlgorithm
96  result.addEventAlgo(getEGamFlowElementAssocAlgorithm(inputFlags))
97 
98  if inputFlags.PF.useMuLinks and inputFlags.Detector.GeometryMuon:
99  from eflowRec.PFCfg import getMuonFlowElementAssocAlgorithm
100  result.addEventAlgo(getMuonFlowElementAssocAlgorithm(inputFlags))
101 
102  from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD
103  toESDAndAOD = ""
104  if(inputFlags.PF.EOverPMode):
105  toESDAndAOD = ["xAOD::FlowElementContainer#EOverPChargedParticleFlowObjects","xAOD::FlowElementAuxContainer#EOverPChargedParticleFlowObjectsAux."]
106  toESDAndAOD += ["xAOD::FlowElementContainer#EOverPNeutralParticleFlowObjects","xAOD::FlowElementAuxContainer#EOverPNeutralParticleFlowObjectsAux."]
107  else:
108  toESDAndAOD = ["xAOD::FlowElementContainer#JetETMissChargedParticleFlowObjects", "xAOD::FlowElementAuxContainer#JetETMissChargedParticleFlowObjectsAux."]
109  toESDAndAOD += ["xAOD::FlowElementContainer#JetETMissNeutralParticleFlowObjects","xAOD::FlowElementAuxContainer#JetETMissNeutralParticleFlowObjectsAux.-FEShowerSubtractedClusterLink"]
110  toESDAndAOD += ["xAOD::FlowElementContainer#JetETMissLCNeutralParticleFlowObjects","xAOD::ShallowAuxContainer#JetETMissLCNeutralParticleFlowObjectsAux."]
111 
112  if inputFlags.PF.addCPData:
113  #if CPData mode, then add PFCaloCluster to ESD and AOD
114  #PFCaloCluster are the clusters modified by the PFlow algorithm
115  toESDAndAOD += ["xAOD::CaloClusterContainer#PFCaloCluster","xAOD::CaloClusterAuxContainer#PFCaloClusterAux."]
116  #also schedule an algoroithm to decorate each calo cluster with the cluster width in eta and phi
117  #this allows clients of the AOD to calculate deltaRPrime for track-calocluster pairs.
118  PFClusterWidthDecorator = CompFactory.PFClusterWidthDecorator()
119  result.addEventAlgo(PFClusterWidthDecorator)
120  #For the CP data we need to keep all the CaloCells and write to AOD
121  from TrigGepPerf.KeepCellsConfig import KeepCellsCfg
122  result.merge(KeepCellsCfg(inputFlags))
123  toESDAndAOD += ["CaloCellContainer#AllCalo"]
124 
125  result.merge(addToESD(inputFlags, toESDAndAOD))
126  result.merge(addToAOD(inputFlags, toESDAndAOD))
127 
128  #In some workflows we may need to disable this
129  #e.g if running in e/p mode where the standard containers are not produced
130  if inputFlags.PF.doThinning:
131  from ThinningUtils.ThinNegativeEnergyNeutralPFOCfg import ThinNegativeEnergyNeutralPFOCfg
132  result.merge(ThinNegativeEnergyNeutralPFOCfg(inputFlags))
133 
134  return result
135 
136 #Configure tau-FE link algorithm - this cannot be in PFCfg because
137 #pflow runs before taus in standard serial reco. Thus the links
138 #between taus and FE must happen after tau reco.

◆ PFFullCfg()

def PFRun3Config.PFFullCfg (   inputFlags,
  runTauReco = False,
**  kwargs 
)

Definition at line 8 of file PFRun3Config.py.

8 def PFFullCfg(inputFlags,runTauReco=False,**kwargs):
9 
10  result=ComponentAccumulator()
11 
12  StoreGateSvc=CompFactory.StoreGateSvc
13  result.addService(StoreGateSvc("DetectorStore"))
14 
15  #Alias calibrated topoclusters, if they exist already, such that overwrite won't fail
16  from SGComps.AddressRemappingConfig import InputRenameCfg
17  result.merge(InputRenameCfg("xAOD::CaloClusterContainer","CaloCalTopoClusters",""))
18 
19  #This is needed to ensure the convertor is correctly configured for each LHC period
20  #Otherwise a default convertor is provided that is not correctly configured for e.g Run4
21  from TrkEventCnvTools.TrkEventCnvToolsConfig import TrkEventCnvSuperToolCfg
22  result.merge(TrkEventCnvSuperToolCfg(inputFlags))
23 
24  #setup magnetic field service
25  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
26  result.merge(AtlasFieldCacheCondAlgCfg(inputFlags))
27 
28  #Configure topocluster algorithmsm, and associated conditions
29  from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
30  result.merge(CaloTopoClusterCfg(inputFlags))
31 
32  from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
33  result.merge(CaloNoiseCondAlgCfg(inputFlags,"totalNoise"))
34  result.merge(CaloNoiseCondAlgCfg(inputFlags,"electronicNoise"))
35 
36  #Cache the track extrapolations
37  from TrackToCalo.CaloExtensionBuilderAlgCfg import CaloExtensionBuilderAlgCfg
38  # FIXME: This inversion to merge in CAs is a workaround, which can be removed once SiDetElementCondAlgs
39  # don't depend on Muons/TRT/alignment/otherSiSubdetectorAlignment anymore.
40  tempCA = CaloExtensionBuilderAlgCfg(inputFlags)
41  tempCA.merge(result)
42  result = tempCA
43 
44  from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD
45  #PFlow requires tracks, electrons, photons, muons and taus in order to have valid links to them. So lets add these objects to the AOD and ESD
46  #PFlow also requires calo clusters for links to work, but these are added to output streams elsewhere already
47  toESDAndAOD = ["xAOD::TrackParticleContainer#InDetTrackParticles","xAOD::TrackParticleAuxContainer#InDetTrackParticlesAux."]
48  if inputFlags.PF.useElPhotLinks:
49  toESDAndAOD += ["xAOD::ElectronContainer#Electrons","xAOD::ElectronAuxContainer#ElectronsAux."]
50  toESDAndAOD += ["xAOD::PhotonContainer#Photons","xAOD::PhotonAuxContainer#PhotonsAux."]
51  if inputFlags.PF.useMuLinks:
52  toESDAndAOD += ["xAOD::MuonContainer#Muons","xAOD::MuonAuxContainer#MuonsAux."]
53  #If we rerun tau reco then it adds taus to the output itself, which results in an error message
54  #because you cannot mix +ve and -ve aux attributes (the below is considered +ve as a default).
55  if not runTauReco:
56  toESDAndAOD += ["xAOD::TauJetContainer#TauJets","xAOD::TauJetAuxContainer#TauJetsAux."]
57 
58  result.merge(addToESD(inputFlags, toESDAndAOD))
59  result.merge(addToAOD(inputFlags, toESDAndAOD))
60 
61  result.merge(PFCfg(inputFlags))
62  return result
63 
64 #Configures only the pflow algorithms and tools - to be used from RecExCommon to avoid
65 #conflicts or if you only want to configure just the pflow algorithms and tools

◆ PFRun3ConfigTest()

def PFRun3Config.PFRun3ConfigTest (   flags = None)

Definition at line 146 of file PFRun3Config.py.

146 def PFRun3ConfigTest(flags=None):
147 
148  if flags is None:
149  from AthenaConfiguration.AllConfigFlags import initConfigFlags
150  flags = initConfigFlags()
151 
152  from AthenaConfiguration.TestDefaults import defaultTestFiles, defaultConditionsTags
153  flags.Input.Files = defaultTestFiles.ESD_RUN3_MC
154  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_MC
155  flags.Output.doWriteAOD=True
156  flags.Output.AODFileName="output_AOD.root"
157 
158  flags.fillFromArgs()
159  flags.lock()
160 
161  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
162  cfg=MainServicesCfg(flags)
163 
164  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
165  cfg.merge(PoolReadCfg(flags))
166  cfg.merge(PFFullCfg(flags))
167 
168  from eflowRec.PFRun3Remaps import ListRemaps
169 
170  list_remaps=ListRemaps(cfg, 'AOD')
171  for mapping in list_remaps:
172  cfg.merge(mapping)
173 
174  cfg.run()
175 

◆ PFTauFELinkCfg()

def PFRun3Config.PFTauFELinkCfg (   inputFlags,
**  kwargs 
)

Definition at line 139 of file PFRun3Config.py.

139 def PFTauFELinkCfg(inputFlags,**kwargs):
140  result=ComponentAccumulator()
141  from eflowRec.PFCfg import getTauFlowElementAssocAlgorithm
142  result.addEventAlgo(getTauFlowElementAssocAlgorithm(inputFlags))
143  return result
144 
145 # Run with python -m eflowRec.PFRun3Config
PFCfg.getOfflinePFAlgorithm
def getOfflinePFAlgorithm(inputFlags)
Definition: PFCfg.py:448
PFRun3Config.PFFullCfg
def PFFullCfg(inputFlags, runTauReco=False, **kwargs)
Definition: PFRun3Config.py:8
KeepCellsConfig.KeepCellsCfg
def KeepCellsCfg(flags, streamName='StreamAOD')
Definition: KeepCellsConfig.py:6
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
PFRun3Config.PFCfg
def PFCfg(inputFlags, **kwargs)
Definition: PFRun3Config.py:66
PFRun3Remaps.ListRemaps
def ListRemaps(cfg, streams=[])
Definition: PFRun3Remaps.py:3
PFCfg.getNeutralFlowElementCreatorAlgorithm
def getNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
Definition: PFCfg.py:196
PFCfg.PFTrackSelectorAlgCfg
def PFTrackSelectorAlgCfg(inputFlags, algName, useCaching=True)
Definition: PFCfg.py:6
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:124
python.TrkEventCnvToolsConfig.TrkEventCnvSuperToolCfg
def TrkEventCnvSuperToolCfg(flags, name='EventCnvSuperTool', **kwargs)
Definition: TrkEventCnvToolsConfig.py:51
PFRun3Config.PFTauFELinkCfg
def PFTauFELinkCfg(inputFlags, **kwargs)
Definition: PFRun3Config.py:139
python.CaloNoiseCondAlgConfig.CaloNoiseCondAlgCfg
def CaloNoiseCondAlgCfg(flags, noisetype="totalNoise")
Definition: CaloNoiseCondAlgConfig.py:11
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
PFCfg.getChargedFlowElementCreatorAlgorithm
def getChargedFlowElementCreatorAlgorithm(inputFlags, chargedFlowElementOutputName, nameSuffix="", eflowCaloObjectContainerName="eflowCaloObjects")
Definition: PFCfg.py:182
PFCfg.getEGamFlowElementAssocAlgorithm
def getEGamFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:222
PFCfg.getMuonFlowElementAssocAlgorithm
def getMuonFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:303
PFCfg.getLCNeutralFlowElementCreatorAlgorithm
def getLCNeutralFlowElementCreatorAlgorithm(inputFlags, neutralFlowElementOutputName)
Definition: PFCfg.py:211
python.OutputStreamConfig.addToESD
def addToESD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:134
PFCfg.getTauFlowElementAssocAlgorithm
def getTauFlowElementAssocAlgorithm(inputFlags, algName="", **kwargs)
Definition: PFCfg.py:401
python.CaloTopoClusterConfig.CaloTopoClusterCfg
def CaloTopoClusterCfg(flags, cellsname="AllCalo", clustersname=None, clustersnapname="CaloTopoClusters")
Definition: CaloTopoClusterConfig.py:318
CaloExtensionBuilderAlgCfg
Definition: CaloExtensionBuilderAlgCfg.py:1
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.OutputStreamConfig.addToAOD
def addToAOD(flags, itemOrList, **kwargs)
Definition: OutputStreamConfig.py:149
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
PFRun3Config.PFRun3ConfigTest
def PFRun3ConfigTest(flags=None)
Definition: PFRun3Config.py:146
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.ThinNegativeEnergyNeutralPFOCfg.ThinNegativeEnergyNeutralPFOCfg
def ThinNegativeEnergyNeutralPFOCfg(flags, StreamName="StreamAOD")
Definition: ThinNegativeEnergyNeutralPFOCfg.py:7
PFCfg
Definition: PFCfg.py:1
AddressRemappingConfig.InputRenameCfg
def InputRenameCfg(type, from_name, to_name)
Definition: AddressRemappingConfig.py:28