4 from TrigEDMConfig.TriggerEDM
import recordable
6 from TrigMinBias.TrigMinBiasMonitoring
import MbtsHypoToolMonitoring
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
11 from ..Config.MenuComponents
import InViewRecoCA, InEventRecoCA, SelectionCA, MenuSequence
13 from AthenaCommon.Logging
import logging
14 log = logging.getLogger(__name__)
18 hypo = CompFactory.SPCountHypoTool(chainDict[
"chainName"])
19 if "hmt" in chainDict[
"chainName"]:
20 hypo.sctSP =
int(chainDict[
"chainParts"][0][
"hypoSPInfo"].strip(
"sp"))
21 if "mb_sptrk_" in chainDict[
"chainName"]
or "mb_sp_" in chainDict[
"chainName"]:
24 if "mb_excl" in chainDict[
"chainName"]:
27 if "sp_pix" in chainDict[
"chainName"]:
28 hypo.pixCL =
int(chainDict[
"chainParts"][0][
"hypoSPInfo"].removeprefix(
"pix"))
29 if "sp_vpix" in chainDict[
"chainName"]:
32 hypo.pixCLMax =
int(chainDict[
"chainParts"][0][
"hypoSPInfo"].removeprefix(
"vpix"))
33 if "nototpix" in chainDict[
"chainName"]:
36 hypo.pixCLnoToT =
int(chainDict[
"chainParts"][0][
"hypoSPInfo"].removeprefix(
"nototpix"))
37 if "q2" in chainDict[
"chainName"]:
39 if "mb_pixsptrk_" in chainDict[
"chainName"]:
50 return int(sv[0])+0.1*
int(sv[1])
54 hypo = CompFactory.TrackCountHypoTool(chainDict[
"chainName"])
55 if "hmt" in chainDict[
"chainName"]:
56 hypo.minNtrks =
int(chainDict[
"chainParts"][0][
"hypoTrkInfo"].strip(
"trk"))
57 hypo.minPt = 200*Units.MeV
58 if "pusup" in chainDict[
"chainName"]:
59 hypo.maxVertexZ = 10*Units.mm
60 if "mb_sptrk" in chainDict[
"chainName"]:
61 hypo.minPt = 100*Units.MeV
62 hypo.maxZ0 = 401*Units.millimeter
63 if "_pt" in chainDict[
"chainName"]:
64 hypo.minPt = ptToGeV(chainDict[
"chainParts"][0][
"hypoPtInfo"].strip(
"pt"))*Units.GeV
65 if "_trk" in chainDict[
"chainName"]:
66 hypo.minNtrks =
int(chainDict[
"chainParts"][0][
"hypoTrkInfo"].strip(
"trk"))
67 if "excl" in chainDict[
"chainName"]:
69 hypo.minPt = ptToGeV(chainDict[
"chainParts"][0][
"hypoPtInfo"].strip(
"pt"))*Units.GeV
70 trk = chainDict[
"chainParts"][0][
"hypoTrkInfo"]
72 limits = trk[0:trk.index(
"trk")], trk[trk.index(
"trk")+3:]
73 hypo.minNtrks =
int(limits[0])
74 hypo.maxNtrks =
int(limits[1])
75 if "mb_pixsptrk" in chainDict[
"chainName"]:
76 hypo.minPt = 100*Units.MeV
77 hypo.maxZ0 = 401*Units.millimeter
83 hypo = CompFactory.MbtsHypoTool(chainDict[
"chainName"])
84 if chainDict[
"chainParts"][0][
"extra"]
in [
"vetombts2in",
"vetospmbts2in"]:
88 if '_all_' in chainDict[
"chainName"]:
90 if "mbMon:online" in chainDict[
"monGroups"]:
99 hypo = CompFactory.TrigZVertexHypoTool(chainDict[
"chainName"])
100 if "pusup" in chainDict[
"chainName"]:
101 hypo.minWeight =
int(chainDict[
"chainParts"][0][
"pileupInfo"].removeprefix(
"pusup"))
110 reco = InViewRecoCA(
"SPCountingReco")
111 minBiasFlags = flags.cloneAndReplace(
"Tracking.ActiveConfig",
"Trigger.InDetTracking.minBias")
113 from TrigInDetConfig.InnerTrackingTrigSequence
import InnerTrackingTrigSequence
114 seq = InnerTrackingTrigSequence.create(minBiasFlags,
115 minBiasFlags.Tracking.ActiveConfig.input_name,
116 rois =
str(reco.inputMaker().InViewRoIs),
117 inView =
str(reco.inputMaker().Views))
118 spMakingCA = seq.sequence(
"spacePointFormation")
120 reco.mergeReco(spMakingCA)
123 vdv = CompFactory.AthViews.ViewDataVerifier(
"VDVSPCountingInputs",
124 DataObjects = {(
'PixelID' ,
'DetectorStore+PixelID' ),
125 (
'SCT_ID' ,
'DetectorStore+SCT_ID' )} )
126 reco.addRecoAlgo(vdv)
128 from TrigMinBias.MinBiasCountersConfig
import SPCounterRecoAlgCfg
131 selAcc = SelectionCA(
"MinBiasSPCounting")
132 selAcc.mergeReco(reco)
133 spCountHypo = CompFactory.SPCountHypoAlg(SpacePointsKey=
recordable(
"HLT_SpacePointCounts"))
134 selAcc.addHypoAlgo(spCountHypo)
139 return MenuSequence(flags, selAcc, HypoToolGen = SPCountHypoToolGen)
142 recoAcc = InViewRecoCA(name=
"ZVertFinderReco", InViewRoIs=
"InputRoI", RequireParentView=
True)
143 vdv = CompFactory.AthViews.ViewDataVerifier(
"VDVZFinderInputs",
144 DataObjects = {(
'SpacePointContainer' ,
'StoreGateSvc+PixelTrigSpacePoints'),
145 (
'PixelID' ,
'DetectorStore+PixelID' ) })
147 recoAcc.addRecoAlgo(vdv)
148 from IDScanZFinder.ZFinderAlgConfig
import MinBiasZFinderCfg
150 selAcc = SelectionCA(
"ZVertexFinderSel")
151 selAcc.mergeReco(recoAcc)
152 selAcc.addHypoAlgo( CompFactory.TrigZVertexHypoAlg(
"TrigZVertexHypoAlg", ZVertexKey=
recordable(
"HLT_vtx_z")))
153 return MenuSequence(flags, selAcc, HypoToolGen = TrigZVertexHypoToolGen)
157 recoAcc = InViewRecoCA(name=
"MBTrackReco", InViewRoIs=
"InputRoI", RequireParentView=
True)
159 from TrigInDetConfig.utils
import getFlagsForActiveConfig
162 from TrigInDetConfig.InnerTrackingTrigSequence
import InnerTrackingTrigSequence
163 trkSeq = InnerTrackingTrigSequence.create(flagsWithTrk,
164 flagsWithTrk.Tracking.ActiveConfig.input_name,
166 inView =
"VDVMinBiasIDTracking")
168 recoAcc.mergeReco(trkSeq.sequence(
"OfflineNoDataPrep"))
170 selAcc = SelectionCA(
"MBTrackCountSel")
171 selAcc.mergeReco(recoAcc)
172 from TrigMinBias.MinBiasCountersConfig
import TrackCounterHypoAlgCfg
174 selAcc.mergeHypo(trackCountHypoAlgo)
175 return MenuSequence(flagsWithTrk, selAcc, HypoToolGen = TrackCountHypoToolGen)
179 recoAcc = InViewRecoCA(name=
"MBPixelTrackReco", InViewRoIs=
"InputRoI", RequireParentView=
True)
181 from TrigInDetConfig.utils
import getFlagsForActiveConfig
184 from TrigInDetConfig.InnerTrackingTrigSequence
import InnerTrackingTrigSequence
185 trkSeq = InnerTrackingTrigSequence.create(flagsWithTrk,
186 flagsWithTrk.Tracking.ActiveConfig.input_name,
188 inView =
"VDVMinBiasIDTracking")
190 recoAcc.mergeReco(trkSeq.sequence(
"OfflineNoDataPrep"))
192 selAcc = SelectionCA(
"MBPixelTrackCountSel")
193 selAcc.mergeReco(recoAcc)
194 from TrigMinBias.MinBiasCountersConfig
import PixelTrackCounterHypoAlgCfg
196 selAcc.mergeHypo(trackCountHypoAlgo)
197 return MenuSequence(flagsWithTrk, selAcc, HypoToolGen = TrackCountHypoToolGen)
202 recoAcc = InEventRecoCA(name=
"Mbts")
204 from TrigMinBias.MbtsConfig
import MbtsFexCfg, MbtsSGInputCfg
208 recoAcc.mergeReco(fex)
210 selAcc = SelectionCA(
"MbtsSel")
211 selAcc.mergeReco(recoAcc)
213 hypo = CompFactory.MbtsHypoAlg(
"MbtsHypoAlg", MbtsBitsKey = fex.getPrimary().MbtsBitsKey)
214 selAcc.addHypoAlgo(hypo)
216 return MenuSequence(flags,
218 HypoToolGen = MbtsHypoToolGen)
221 if __name__ ==
"__main__":
222 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
226 zf.ca.printConfig(withDetails=
True)