ATLAS Offline Software
Loading...
Searching...
No Matches
HLTSignatureConfig.py
Go to the documentation of this file.
2# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
4from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5from TriggerMenuMT.HLT.Config.MenuComponents import MenuSequence, SelectionCA, InEventRecoCA
6from AthenaConfiguration.ComponentAccumulator import CompFactory
7from TriggerMenuMT.CFtest.HLTSignatureHypoTools import MuTestHypoTool, ElTestHypoTool
8import sys
9
10HLTTest__TestHypoAlg=CompFactory.getComp("HLTTest::TestHypoAlg")
11HLTTest__TestRecoAlg=CompFactory.getComp("HLTTest::TestRecoAlg")
12HLTTest__TestInputMaker=CompFactory.getComp("HLTTest::TestInputMaker")
13
14UseThisLinkName="initialRoI"
15
16
18 return HLTTest__TestInputMaker(name, RoIsLink="initialRoI", LinkName="initialRoI")
19
21 return HLTTest__TestInputMaker(name, RoIsLink="initialRoI", LinkName=UseThisLinkName)
22
23
24#generalize
25
26
27def makeSequence(flags, name,step, signature):
28 """
29 generate reco sequence for emulation chains
30 """
31 IM= InputMakerForFeatureAlg("IM"+signature+name+"Step"+step)
32 IM.Output=name+signature+"IM"+step+"_out"
33 if "el" in signature:
34 Alg = CaloClustering("CaloClustering"+name+"Step"+step, FileName="emclusters.dat")
35 elif "mu" in signature:
36 Alg = muMSRecAlg("muMSRecAlg"+name+"Step"+step, FileName="msmu.dat")
37 else:
38 sys.exit("ERROR, in configuration of sequence "+name+step+signature)
39
40 Alg.Output = name+signature+"Alg"+step+"_out"
41 Alg.Input = IM.Output
42
43 accAlg = ComponentAccumulator()
44 accAlg.addEventAlgo(Alg)
45 InEventReco = InEventRecoCA(name+signature+"SeqStep"+step,inputMaker=IM)
46 InEventReco.mergeReco(accAlg)
47
48 return (InEventReco,IM, Alg.Output)
49
50
51
52
53# here define the sequences from the signatures
54# signatures do this:
55# - declare all the RecoAlg and the HypoAlg -> create the Sequence
56# - creates the InputMaker, without the inputs
57
58
59
60
62
63
64def muMSRecAlg(name, FileName="noreco.dat"):
65 return HLTTest__TestRecoAlg(name=name, FileName=FileName)
66
67def MuHypo(name):
68 return HLTTest__TestHypoAlg(name=name, LinkName=UseThisLinkName)
69
70def makeMuSequence(flags, name,step):
71 return makeSequence(flags, name,step, "mu")
72
73
74
76
77def CaloClustering(name, FileName="noreco.dat"):
78 return HLTTest__TestRecoAlg(name=name, FileName=FileName)
79
80def ElGamHypo(name):
81 return HLTTest__TestHypoAlg(name=name, LinkName=UseThisLinkName)
82
83def makeElSequence(flags, name,step):
84 return makeSequence(flags, name,step, "el")
85
86
87def elMenuSequence(flags, step, reconame, hyponame):
88 (Sequence, IM, seqOut) = makeElSequence (flags,name=reconame, step=step)
89 elHypo = ElGamHypo(hyponame+"Step"+step+"ElHypo")
90 elHypo.Input = seqOut
91
92 selAcc=SelectionCA(hyponame+"elStep"+step)
93 selAcc.mergeReco(Sequence)
94 selAcc.addHypoAlgo(elHypo)
95 return MenuSequence(flags, selAcc, HypoToolGen=ElTestHypoTool)
96
97
98def gamMenuSequence(flags, step, reconame, hyponame):
99 (Sequence, IM, seqOut) = makeElSequence(flags,name=reconame, step=step)
100 elHypo = ElGamHypo(hyponame+"Step"+step+"GamHypo")
101 elHypo.Input = seqOut
102
103 selAcc=SelectionCA(hyponame+"gamStep"+step+"Gam")
104 selAcc.mergeReco(Sequence)
105 selAcc.addHypoAlgo(elHypo)
106 return MenuSequence(flags,selAcc, HypoToolGen=ElTestHypoTool)
107
108
109
110def muMenuSequence(flags, step, reconame, hyponame):
111 (Sequence, IM, seqOut) = makeMuSequence(flags,name=reconame, step=step)
112 muHypo = MuHypo(hyponame+"Step"+step+"MuHypo")
113 muHypo.Input = seqOut
114
115 selAcc=SelectionCA(hyponame+"muStep"+step)
116 selAcc.mergeReco(Sequence)
117 selAcc.addHypoAlgo(muHypo)
118 return MenuSequence(flags, selAcc, HypoToolGen=MuTestHypoTool)
119
120
121def genMenuSequence(flags, step, reconame, hyponame):
122 (Sequence, IM, seqOut) = makeElSequence (flags,name=reconame, step=step)
123 elHypo = ElGamHypo(hyponame+"Hypo")
124 elHypo.Input = seqOut
125
126 selAcc=SelectionCA(hyponame+"elStep"+step)
127 selAcc.mergeReco(Sequence)
128 selAcc.addHypoAlgo(elHypo)
129 return MenuSequence(flags, selAcc, HypoToolGen=ElTestHypoTool)
130
genMenuSequence(flags, step, reconame, hyponame)
muMenuSequence(flags, step, reconame, hyponame)
gamMenuSequence(flags, step, reconame, hyponame)
makeElSequence(flags, name, step)
CaloClustering(name, FileName="noreco.dat")
makeMuSequence(flags, name, step)
elMenuSequence(flags, step, reconame, hyponame)
muMSRecAlg(name, FileName="noreco.dat")
muon signatures
makeSequence(flags, name, step, signature)