ATLAS Offline Software
Loading...
Searching...
No Matches
CosmicChainConfiguration.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaCommon.Logging import logging
4logging.getLogger().info("Importing %s",__name__)
5log = logging.getLogger(__name__)
6
7from AthenaConfiguration.ComponentFactory import CompFactory
8from TriggerMenuMT.HLT.Config.MenuComponents import MenuSequence, SelectionCA, InViewRecoCA, createEmptyMenuSequenceCfg
9from TrigEDMConfig.TriggerEDM import recordable
10import AthenaCommon.SystemOfUnits as Units
11
12from TriggerMenuMT.HLT.Config.ChainConfigurationBase import ChainConfigurationBase
13
14def TrackCountHypoToolGen(flags, chainDict):
15 hypo = CompFactory.TrackCountHypoTool(chainDict["chainName"])
16 hypo.minNtrks = 1
17 return hypo
18
20
21 trkRecoSeq = InViewRecoCA("CosmicTrkRecoSeq", InViewRoIs = "CosmicRoIs")
22
23 from TrigInDetConfig.utils import getFlagsForActiveConfig
24 flagsWithTrk = getFlagsForActiveConfig(flags, "cosmics", log)
25
26 from TrigInDetConfig.InnerTrackingTrigSequence import InnerTrackingTrigSequence
27 seq = InnerTrackingTrigSequence.create(flagsWithTrk,
28 flagsWithTrk.Tracking.ActiveConfig.input_name,
29 rois ="CosmicRoIs",
30 inView = "VDVCosmicsIDTracking")
31 idTrackingAlgs = seq.sequence("Offline")
32 trkRecoSeq.mergeReco(idTrackingAlgs)
33
34 trackCountHypo = CompFactory.TrackCountHypoAlg("CosmicsTrackCountHypoAlg",
35 minPt = [100*Units.MeV],
36 maxZ0 = [401*Units.mm],
37 vertexZ = [803*Units.mm])
38 trackCountHypo.tracksKey = recordable("HLT_IDTrack_Cosmic_IDTrig")
39 trackCountHypo.trackCountKey = "HLT_CosmicsTrackCount" # irrelevant, not recorded
40
41 #TODO move a complete configuration of the algs to TrigMinBias package
42 from TrigMinBias.TrigMinBiasMonitoring import TrackCountMonitoring
43 trackCountHypo.MonTool = TrackCountMonitoring(flags, trackCountHypo) # monitoring tool configures itself using config of the hypo alg
44
45
46 trkSequence = SelectionCA("CosmicTrkSequence")
47 trkSequence.mergeReco(trkRecoSeq)
48 trkSequence.addHypoAlgo(trackCountHypo)
49 log.debug("Prepared ID tracking sequence")
50 log.debug(trkSequence)
51 return MenuSequence(flags,
52 trkSequence,
53 HypoToolGen = TrackCountHypoToolGen)
54
55
56#----------------------------------------------------------------
57class CosmicChainConfiguration(ChainConfigurationBase):
58
59 def __init__(self, chainDict):
60 ChainConfigurationBase.__init__(self,chainDict)
61
62 # ----------------------
63 # Assemble the chain depending on information from chainName
64 # ----------------------
65 def assembleChainImpl(self, flags):
66
67 steps = []
68 log.debug("Assembling chain for %s", self.chainName)
69 # --------------------
70 # define here the names of the steps and obtain the chainStep configuration
71 # --------------------
72 if 'cosmic_id' in self.chainName:
73 seqName="EmptyBeforeCosmicID"
74 emptySeqGen = createEmptyMenuSequenceCfg(flags, name=seqName)
75 steps += [ self.getStep(flags, 'Empty', [emptySeqGen], name=seqName),
76 self.getStep(flags, 'CosmicTracking', [CosmicsTrkSequenceGenCfg]) ]
77
78 return self.buildChain(steps)
79
80