ATLAS Offline Software
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 61 of file PFRun3Config.py.

61 def PFCfg(inputFlags,**kwargs):
62 
63  result=ComponentAccumulator()
64 
65  #Configure the pflow algorithms
66  PFLeptonSelectorFactory=CompFactory.PFLeptonSelector
67  PFLeptonSelector = PFLeptonSelectorFactory("PFLeptonSelector")
68  PFLeptonSelector.selectElectrons=False
69  PFLeptonSelector.selectMuons=False
70  result.addEventAlgo(PFLeptonSelector)
71 
72  from eflowRec.PFCfg import PFTrackSelectorAlgCfg
73  useCaching = True
74  #If reading ESD/AOD do not make use of caching of track extrapolations.
75  if inputFlags.Input.Format is Format.POOL and "StreamRDO" not in inputFlags.Input.ProcessingTags:
76  useCaching = False
77  result.merge(PFTrackSelectorAlgCfg(inputFlags,"PFTrackSelector",useCaching))
78 
79  from eflowRec.PFCfg import getOfflinePFAlgorithm
80  result.merge(getOfflinePFAlgorithm(inputFlags))
81 
82  from eflowRec.PFCfg import getChargedFlowElementCreatorAlgorithm,getNeutralFlowElementCreatorAlgorithm,getLCNeutralFlowElementCreatorAlgorithm
83  result.addEventAlgo(getChargedFlowElementCreatorAlgorithm(inputFlags,""))
84  result.addEventAlgo(getNeutralFlowElementCreatorAlgorithm(inputFlags,""))
85  result.addEventAlgo(getLCNeutralFlowElementCreatorAlgorithm(inputFlags,""))
86 
87  #Only do linking if not in eoverp mode
88  if not inputFlags.PF.EOverPMode:
89  if inputFlags.PF.useElPhotLinks:
90  from eflowRec.PFCfg import getEGamFlowElementAssocAlgorithm
91  result.addEventAlgo(getEGamFlowElementAssocAlgorithm(inputFlags))
92 
93  if inputFlags.PF.useMuLinks and inputFlags.Detector.GeometryMuon:
94  from eflowRec.PFCfg import getMuonFlowElementAssocAlgorithm
95  result.addEventAlgo(getMuonFlowElementAssocAlgorithm(inputFlags))
96 
97  from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD
98  toESDAndAOD = ""
99  if(inputFlags.PF.EOverPMode):
100  toESDAndAOD = ["xAOD::FlowElementContainer#EOverPChargedParticleFlowObjects","xAOD::FlowElementAuxContainer#EOverPChargedParticleFlowObjectsAux."]
101  toESDAndAOD += ["xAOD::FlowElementContainer#EOverPNeutralParticleFlowObjects","xAOD::FlowElementAuxContainer#EOverPNeutralParticleFlowObjectsAux."]
102  else:
103  toESDAndAOD = ["xAOD::FlowElementContainer#JetETMissChargedParticleFlowObjects", "xAOD::FlowElementAuxContainer#JetETMissChargedParticleFlowObjectsAux."]
104  toESDAndAOD += ["xAOD::FlowElementContainer#JetETMissNeutralParticleFlowObjects","xAOD::FlowElementAuxContainer#JetETMissNeutralParticleFlowObjectsAux.-FEShowerSubtractedClusterLink"]
105  toESDAndAOD += ["xAOD::FlowElementContainer#JetETMissLCNeutralParticleFlowObjects","xAOD::ShallowAuxContainer#JetETMissLCNeutralParticleFlowObjectsAux."]
106 
107  if inputFlags.PF.addCPData:
108  #if CPData mode, then add PFCaloCluster to ESD and AOD
109  #PFCaloCluster are the clusters modified by the PFlow algorithm
110  toESDAndAOD += ["xAOD::CaloClusterContainer#PFCaloCluster","xAOD::CaloClusterAuxContainer#PFCaloClusterAux."]
111  #also schedule an algoroithm to decorate each calo cluster with the cluster width in eta and phi
112  #this allows clients of the AOD to calculate deltaRPrime for track-calocluster pairs.
113  PFClusterWidthDecorator = CompFactory.PFClusterWidthDecorator()
114  result.addEventAlgo(PFClusterWidthDecorator)
115  #For the CP data we need to keep all the CaloCells and write to AOD
116  from TrigGepPerf.KeepCellsConfig import KeepCellsCfg
117  result.merge(KeepCellsCfg(inputFlags))
118  toESDAndAOD += ["CaloCellContainer#AllCalo"]
119 
120  result.merge(addToESD(inputFlags, toESDAndAOD))
121  result.merge(addToAOD(inputFlags, toESDAndAOD))
122 
123  #In some workflows we may need to disable this
124  #e.g if running in e/p mode where the standard containers are not produced
125  if inputFlags.PF.doThinning:
126  from ThinningUtils.ThinNegativeEnergyNeutralPFOCfg import ThinNegativeEnergyNeutralPFOCfg
127  result.merge(ThinNegativeEnergyNeutralPFOCfg(inputFlags))
128 
129  return result
130 
131 #Configure tau-FE link algorithm - this cannot be in PFCfg because
132 #pflow runs before taus in standard serial reco. Thus the links
133 #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 fial
16  from SGComps.AddressRemappingConfig import InputRenameCfg
17  result.merge(InputRenameCfg("xAOD::CaloClusterContainer","CaloCalTopoClusters",""))
18 
19  #setup magnetic field service
20  from MagFieldServices.MagFieldServicesConfig import AtlasFieldCacheCondAlgCfg
21  result.merge(AtlasFieldCacheCondAlgCfg(inputFlags))
22 
23  #Configure topocluster algorithmsm, and associated conditions
24  from CaloRec.CaloTopoClusterConfig import CaloTopoClusterCfg
25  result.merge(CaloTopoClusterCfg(inputFlags))
26 
27  from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
28  result.merge(CaloNoiseCondAlgCfg(inputFlags,"totalNoise"))
29  result.merge(CaloNoiseCondAlgCfg(inputFlags,"electronicNoise"))
30 
31  #Cache the track extrapolations
32  from TrackToCalo.CaloExtensionBuilderAlgCfg import CaloExtensionBuilderAlgCfg
33  # FIXME: This inversion to merge in CAs is a workaround, which can be removed once SiDetElementCondAlgs
34  # don't depend on Muons/TRT/alignment/otherSiSubdetectorAlignment anymore.
35  tempCA = CaloExtensionBuilderAlgCfg(inputFlags)
36  tempCA.merge(result)
37  result = tempCA
38 
39  from OutputStreamAthenaPool.OutputStreamConfig import addToAOD, addToESD
40  #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
41  #PFlow also requires calo clusters for links to work, but these are added to output streams elsewhere already
42  toESDAndAOD = ["xAOD::TrackParticleContainer#InDetTrackParticles","xAOD::TrackParticleAuxContainer#InDetTrackParticlesAux."]
43  if inputFlags.PF.useElPhotLinks:
44  toESDAndAOD += ["xAOD::ElectronContainer#Electrons","xAOD::ElectronAuxContainer#ElectronsAux."]
45  toESDAndAOD += ["xAOD::PhotonContainer#Photons","xAOD::PhotonAuxContainer#PhotonsAux."]
46  if inputFlags.PF.useMuLinks:
47  toESDAndAOD += ["xAOD::MuonContainer#Muons","xAOD::MuonAuxContainer#MuonsAux."]
48  #If we rerun tau reco then it adds taus to the output itself, which results in an error message
49  #because you cannot mix +ve and -ve aux attributes (the below is considered +ve as a default).
50  if not runTauReco:
51  toESDAndAOD += ["xAOD::TauJetContainer#TauJets","xAOD::TauJetAuxContainer#TauJetsAux."]
52 
53  result.merge(addToESD(inputFlags, toESDAndAOD))
54  result.merge(addToAOD(inputFlags, toESDAndAOD))
55 
56  result.merge(PFCfg(inputFlags))
57  return result
58 
59 #Configures only the pflow algorithms and tools - to be used from RecExCommon to avoid
60 #conflicts or if you only want to configure just the pflow algorithms and tools

◆ PFRun3ConfigTest()

def PFRun3Config.PFRun3ConfigTest (   flags = None)

Definition at line 141 of file PFRun3Config.py.

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

◆ PFTauFELinkCfg()

def PFRun3Config.PFTauFELinkCfg (   inputFlags,
**  kwargs 
)

Definition at line 134 of file PFRun3Config.py.

134 def PFTauFELinkCfg(inputFlags,**kwargs):
135  result=ComponentAccumulator()
136  from eflowRec.PFCfg import getTauFlowElementAssocAlgorithm
137  result.addEventAlgo(getTauFlowElementAssocAlgorithm(inputFlags))
138  return result
139 
140 # 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:61
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:125
PFRun3Config.PFTauFELinkCfg
def PFTauFELinkCfg(inputFlags, **kwargs)
Definition: PFRun3Config.py:134
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:127
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:142
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
PFRun3Config.PFRun3ConfigTest
def PFRun3ConfigTest(flags=None)
Definition: PFRun3Config.py:141
python.MagFieldServicesConfig.AtlasFieldCacheCondAlgCfg
def AtlasFieldCacheCondAlgCfg(flags, **kwargs)
Definition: MagFieldServicesConfig.py:8
PFRun3Remaps.ListRemaps
def ListRemaps()
Definition: PFRun3Remaps.py:3
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