ATLAS Offline Software
Photon/PrecisionCaloMenuSequences.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 # menu components
6 from TriggerMenuMT.HLT.Config.MenuComponents import MenuSequence, SelectionCA, InViewRecoCA
7 from TriggerMenuMT.HLT.Egamma.TrigEgammaKeys import getTrigEgammaKeys
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 from AthenaConfiguration.AccumulatorCache import AccumulatorCache
10 
11 def tag(ion):
12  return 'precision' + ('HI' if ion is True else '') + 'CaloPhoton'
13 
14 @AccumulatorCache
15 def precisionCaloSequenceGenCfg(flags, ion=False, is_probe_leg=False):
16  """ Creates PrecisionCalo sequence """
17  TrigEgammaKeys = getTrigEgammaKeys(flags, ion=ion)
18 
19  hiInfo = 'HI' if ion else ''
20  # EV creator
21  InViewRoIs="PrecisionCaloRoIs"
22  roiTool = CompFactory.ViewCreatorPreviousROITool()
23  # Note: This step processes Decision Objects which have followed either Electron reco, Photon reco, or both.
24  # For Decision Object which have followed both, there is an ambiguity about which ROI should be used in this
25  # merged step. In such cases we break the ambiguity by specifying that the Electron ROI is to be used.
26  roiTool.RoISGKey = "HLT_Roi_FastElectron"
27 
28  recoAcc = InViewRecoCA(tag(ion),InViewRoIs=InViewRoIs, RoITool = roiTool, RequireParentView = True, isProbe=is_probe_leg)
29  # reco sequence
30  from TriggerMenuMT.HLT.Photon.PrecisionCaloRecoSequences import precisionCaloRecoSequence
31  recoAcc.mergeReco(precisionCaloRecoSequence(flags, InViewRoIs,'gPrecisionCaloRecoSequence'+hiInfo, ion))
32 
33  selAcc = SelectionCA('gPrecisionCaloMenuSequence'+hiInfo, isProbe=is_probe_leg)
34  #TODO mirrors config present is in Electrons - has to be to be unified
35  pedestalCA = None
36  if ion is True:
37  # add UE subtraction for heavy ion e/gamma triggers
38  # NOTE: UE subtraction requires an average pedestal to be calculated
39  # using the full event (FS info), and has to be done outside of the
40  # event views in this sequence. the egammaFSHIEventShapeMaker is thus placed
41  # in the upSequenceCA before the recoCA.
42  from TriggerMenuMT.HLT.HeavyIon.HeavyIonMenuSequences import egammaFSHIEventShapeMakerCfg
43  pedestalCA = egammaFSHIEventShapeMakerCfg(flags)
44 
45  selAcc.mergeReco(recoAcc, upSequenceCA=pedestalCA)
46 
47  hypoAlg = CompFactory.TrigEgammaPrecisionCaloHypoAlg('Photon' + tag(ion) + 'Hypo')
48 
49  hypoAlg.CaloClusters = TrigEgammaKeys.precisionPhotonCaloClusterContainer
50 
51  selAcc.addHypoAlgo(hypoAlg)
52 
53  from TrigEgammaHypo.TrigEgammaPrecisionCaloHypoTool import TrigEgammaPrecisionCaloHypoToolFromDict
54 
55  return MenuSequence(flags, selAcc, HypoToolGen=TrigEgammaPrecisionCaloHypoToolFromDict)
python.HLT.HeavyIon.HeavyIonMenuSequences.egammaFSHIEventShapeMakerCfg
def egammaFSHIEventShapeMakerCfg(flags)
Definition: HeavyIonMenuSequences.py:3
python.HLT.Electron.PrecisionCaloRecoSequences.precisionCaloRecoSequence
def precisionCaloRecoSequence(flags, RoIs, name=None, ion=False, variant='')
Definition: Electron/PrecisionCaloRecoSequences.py:31
PrecisionCaloMenuSequences.tag
def tag(ion)
Definition: Photon/PrecisionCaloMenuSequences.py:11
PrecisionCaloMenuSequences.precisionCaloSequenceGenCfg
def precisionCaloSequenceGenCfg(flags, ion=False, is_probe_leg=False)
Definition: Photon/PrecisionCaloMenuSequences.py:15
python.HLT.Egamma.TrigEgammaKeys.getTrigEgammaKeys
def getTrigEgammaKeys(AthConfigFlags flags, name='', ion=False)
Definition: TrigEgammaKeys.py:138