ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigTrackingHypo
python
IDCalibHypoConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
import
re
4
5
from
AthenaCommon.Logging
import
logging
6
from
AthenaConfiguration.ComponentFactory
import
CompFactory
7
from
AthenaMonitoringKernel.GenericMonitoringTool
import
GenericMonitoringTool
8
9
def
createIDCalibHypoAlg
(flags, name):
10
# Monitoring
11
monTool =
GenericMonitoringTool
(flags,
"IM_MonTool"
+name,
12
HistPath =
'IDCalibHypoAlg'
)
13
monTool.defineHistogram(
'pt'
, type=
'TH1F'
, path=
'EXPERT'
, title=
"p_{T};p_{T} [GeV];Nevents"
, xbins=50, xmin=0, xmax=100)
14
15
# Setup the hypothesis algorithm
16
theHypo = CompFactory.IDCalibHypoAlg(name,
17
MonTool = monTool)
18
return
theHypo
19
20
21
def
IDCalibHypoToolFromDict
(flags, chainDict):
22
23
log = logging.getLogger(
'IDCalibHypoTool'
)
24
25
""" Use menu decoded chain dictionary to configure the tool """
26
cparts = [i
for
i
in
chainDict[
'chainParts'
]
if
i[
'signature'
]==
'Calib'
]
27
28
name =
"default_chain_name"
29
if
'chainName'
in
chainDict:
30
name = chainDict[
'chainName'
]
31
else
:
32
log.error(
"chainName not in chain dictionary"
)
33
34
# set thresholds
35
m = re.search(
r'trk(\d+)'
,[ cpart[
'hypo'
]
for
cpart
in
cparts ][0])
36
threshold = m.group(1)
37
38
mult = [ cpart[
'multiplicity'
]
for
cpart
in
cparts ][0]
39
thresholds = [ float(threshold)
for
x
in
range(0,int(mult)) ]
40
log.debug(
"Threshold values are: %s"
,
", "
.join(str(THR)
for
THR
in
thresholds))
41
42
tool = CompFactory.IDCalibHypoTool(name,
43
cutTrackPtGeV = thresholds)
44
return
tool
GenericMonitoringTool
Definition
GenericMonitoringTool.h:51
python.IDCalibHypoConfig.IDCalibHypoToolFromDict
IDCalibHypoToolFromDict(flags, chainDict)
Definition
IDCalibHypoConfig.py:21
python.IDCalibHypoConfig.createIDCalibHypoAlg
createIDCalibHypoAlg(flags, name)
Definition
IDCalibHypoConfig.py:9
Generated on
for ATLAS Offline Software by
1.14.0