ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
PanTau
PanTauAlgs
python
Class_InformationHandler.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
import
string
4
5
class
InformationHandler
:
6
7
def
__init__
(self, flags):
8
9
#setup the member variables
10
# they are filled in the helper functions setupInfo_*
11
self.
m_Infos_Int
= {}
12
self.
m_Infos_Double
= {}
13
self.
m_Infos_String
= {}
14
self.
m_Infos_VecDouble
= {}
15
self.
m_Infos_VecString
= {}
16
17
#fill member variables
18
self.
setupInfo_Int
(flags)
19
self.
setupInfo_Double
(flags)
20
self.
setupInfo_String
(flags)
21
self.
setupInfo_VecDouble
(flags)
22
self.
setupInfo_VecString
(flags)
23
24
#fill the feature types and default values
25
# -> a bit more involved, have extra function for this
26
self.
setupInfo_Features
(flags)
27
28
29
def
dump
(self):
30
print
(
"PanTau::InformationHandler: Printing stored information"
)
31
32
print
(
"PanTau::InformationHandler: \tIntegers:"
)
33
for
iInfo
in
sorted(self.
m_Infos_Int
.iterkeys()):
34
print
(
"\t\t"
+ string.ljust(iInfo, 50) +
": "
+ string.rjust(str(self.
m_Infos_Int
[iInfo]), 10) )
35
36
print
(
"PanTau::InformationHandler: \tDoubles:"
)
37
for
iInfo
in
sorted(self.
m_Infos_Double
.iterkeys()):
38
print
(
"\t\t"
+ string.ljust(iInfo, 50) +
": "
+ string.rjust(str(self.
m_Infos_Double
[iInfo]), 10) )
39
40
print
(
"PanTau::InformationHandler: \tStrings:"
)
41
for
iInfo
in
sorted(self.
m_Infos_String
.iterkeys()):
42
print
(
"\t\t"
+ string.ljust(iInfo, 50) +
": "
+ string.ljust(self.
m_Infos_String
[iInfo], 80) )
43
44
print
(
"PanTau::InformationHandler: \tVecDoubles:"
)
45
for
iInfo
in
sorted(self.
m_Infos_VecDouble
.iterkeys()):
46
print
(
"InformationHandler: \t\t"
+ string.ljust(iInfo, 50) +
":"
)
47
for
iVal
in
self.
m_Infos_VecDouble
[iInfo]:
48
print
(
"InformationHandler: \t\t\t"
+ string.rjust(str(iVal), 10) )
49
50
print
(
"PanTau::InformationHandler: \tVecStrings:"
)
51
for
iInfo
in
sorted(self.
m_Infos_VecString
.iterkeys()):
52
print
(
"InformationHandler: \t\t"
+ string.ljust(iInfo, 50) +
":"
)
53
for
iVal
in
self.
m_Infos_VecString
[iInfo]:
54
print
(
"InformationHandler: \t\t\t"
+ string.ljust(str(iVal), 80) )
55
56
print
(
"PanTau::InformationHandler: Done printing stored information"
)
57
58
59
60
def
setupInfo_Int
(self, flags):
61
self.
m_Infos_Int
[
"TauConstituents_UsePionMass"
] = int(flags.Tau.PanTau.TauConstituents_UsePionMass)
62
self.
m_Infos_Int
[
"FeatureExtractor_UseEmptySeeds"
] = int(flags.Tau.PanTau.FeatureExtractor_UseEmptySeeds)
63
#nothing to do here yet (no integer infos...)
64
65
66
def
setupInfo_Double
(self, flags):
67
self.
m_Infos_Double
[
"TauConstituents_Types_DeltaRCore"
] = flags.Tau.PanTau.TauConstituents_Types_DeltaRCore
68
self.
m_Infos_Double
[
"TauConstituents_MaxEta"
] = flags.Tau.PanTau.TauConstituents_MaxEta
69
self.
m_Infos_Double
[
"TauConstituents_PreselectionMinEnergy"
] = flags.Tau.PanTau.TauConstituents_PreselectionMinEnergy
70
71
self.
m_Infos_Double
[
"DecayModeDeterminator_BDTCutValue_R10X_CellBased"
] = flags.Tau.PanTau.DecayModeDeterminator_BDTCutValue_R10X_CellBased
72
self.
m_Infos_Double
[
"DecayModeDeterminator_BDTCutValue_R11X_CellBased"
] = flags.Tau.PanTau.DecayModeDeterminator_BDTCutValue_R11X_CellBased
73
self.
m_Infos_Double
[
"DecayModeDeterminator_BDTCutValue_R110_CellBased"
] = flags.Tau.PanTau.DecayModeDeterminator_BDTCutValue_R110_CellBased
74
self.
m_Infos_Double
[
"DecayModeDeterminator_BDTCutValue_R1XX_CellBased"
] = flags.Tau.PanTau.DecayModeDeterminator_BDTCutValue_R1XX_CellBased
75
self.
m_Infos_Double
[
"DecayModeDeterminator_BDTCutValue_R30X_CellBased"
] = flags.Tau.PanTau.DecayModeDeterminator_BDTCutValue_R30X_CellBased
76
self.
m_Infos_Double
[
"DecayModeDeterminator_BDTCutValue_R3XX_CellBased"
] = flags.Tau.PanTau.DecayModeDeterminator_BDTCutValue_R3XX_CellBased
77
78
def
setupInfo_String
(self, flags):
79
self.
m_Infos_String
[
"ModeDiscriminator_TMVAMethod"
] = flags.Tau.PanTau.ModeDiscriminator_TMVAMethod
80
81
82
def
setupInfo_VecDouble
(self, flags):
83
self.
m_Infos_VecDouble
[
"Common_BinEdges_Eta"
] = flags.Tau.PanTau.Common_BinEdges_Eta
84
self.
m_Infos_VecDouble
[
"TauConstituents_Selection_Neutral_EtaBinned_EtCut"
] = flags.Tau.PanTau.TauConstituents_Selection_Neutral_EtaBinned_EtCut
85
self.
m_Infos_VecDouble
[
"CellBased_EtaBinned_Pi0MVACut_1prong"
] = flags.Tau.PanTau.CellBased_EtaBinned_Pi0MVACut_1prong
86
self.
m_Infos_VecDouble
[
"CellBased_EtaBinned_Pi0MVACut_3prong"
] = flags.Tau.PanTau.CellBased_EtaBinned_Pi0MVACut_3prong
87
self.
m_Infos_VecDouble
[
"ModeDiscriminator_BinEdges_Pt"
] = flags.Tau.PanTau.ModeDiscriminator_BinEdges_Pt
88
89
90
def
setupInfo_VecString
(self, flags):
91
self.
m_Infos_VecString
[
"ModeDiscriminator_BDTVariableNames_CellBased_1p0n_vs_1p1n"
] = flags.Tau.PanTau.ModeDiscriminator_BDTVariableNames_CellBased_1p0n_vs_1p1n
92
self.
m_Infos_VecString
[
"ModeDiscriminator_BDTVariableNames_CellBased_1p1n_vs_1pXn"
] = flags.Tau.PanTau.ModeDiscriminator_BDTVariableNames_CellBased_1p1n_vs_1pXn
93
self.
m_Infos_VecString
[
"ModeDiscriminator_BDTVariableNames_CellBased_3p0n_vs_3pXn"
] = flags.Tau.PanTau.ModeDiscriminator_BDTVariableNames_CellBased_3p0n_vs_3pXn
94
95
96
def
setupInfo_Features
(self, flags):
97
98
#get list of signal modes from config
99
List_ModeCases = flags.Tau.PanTau.Names_ModeCases
100
101
#get the feature handler
102
from
PanTauAlgs.Class_FeatureHandler
import
FeatureHandler
103
theFeatureHandler = FeatureHandler()
104
105
#for each algorithm and mode, loop over variables to be used in BDT
106
# and fetch the type of the variable and the name
107
# these are needed for the PanTauFillerTool in TauD3PDMaker
108
for
iModeCase
in
List_ModeCases:
109
110
infoKey_Names =
"ModeDiscriminator_BDTVariableNames_CellBased_"
+ iModeCase
111
curVarList = self.
m_Infos_VecString
[infoKey_Names]
112
113
BDTVariable_TypeList = []
114
BDTVariable_DefaultValList = []
115
116
for
iVar
in
curVarList:
117
theType = theFeatureHandler.m_Feature_Types[iVar]
118
theDefVal = theFeatureHandler.m_Feature_Defaults[iVar]
119
BDTVariable_TypeList += [theType]
120
BDTVariable_DefaultValList += [theDefVal]
121
#end loop over variables
122
123
infoKey_Types =
"ModeDiscriminator_BDTVariableTypes_CellBased_"
+ iModeCase
124
self.
m_Infos_VecString
[infoKey_Types] = BDTVariable_TypeList
125
126
infoKey_Defaults =
"ModeDiscriminator_BDTVariableDefaults_CellBased_"
+ iModeCase
127
self.
m_Infos_VecDouble
[infoKey_Defaults] = BDTVariable_DefaultValList
128
#end loop over signal modes
129
130
#add the prefixes for the variables
131
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_Ratio"
] = theFeatureHandler.m_VarTypeName_Ratio
132
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_Mean"
] = theFeatureHandler.m_VarTypeName_Mean
133
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_StdDev"
] = theFeatureHandler.m_VarTypeName_StdDev
134
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_HLV"
] = theFeatureHandler.m_VarTypeName_HLV
135
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_DeltaR"
] = theFeatureHandler.m_VarTypeName_DeltaR
136
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_JetMoment"
] = theFeatureHandler.m_VarTypeName_JetMoment
137
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_Combined"
] = theFeatureHandler.m_VarTypeName_Combined
138
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_Basic"
] = theFeatureHandler.m_VarTypeName_Basic
139
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_PID"
] = theFeatureHandler.m_VarTypeName_PID
140
self.
m_Infos_String
[
"FeatureExtractor_VarTypeName_varTypeName_Shots"
] = theFeatureHandler.m_VarTypeName_Shots
141
#end def setupInfo_Features
142
143
#end class config_FeatureCalculator
print
void print(char *figname, TCanvas *c1)
Definition
TRTCalib_StrawStatusPlots.cxx:26
python.Class_InformationHandler.InformationHandler
Definition
Class_InformationHandler.py:5
python.Class_InformationHandler.InformationHandler.m_Infos_Int
dict m_Infos_Int
Definition
Class_InformationHandler.py:11
python.Class_InformationHandler.InformationHandler.setupInfo_String
setupInfo_String(self, flags)
Definition
Class_InformationHandler.py:78
python.Class_InformationHandler.InformationHandler.setupInfo_VecDouble
setupInfo_VecDouble(self, flags)
Definition
Class_InformationHandler.py:82
python.Class_InformationHandler.InformationHandler.setupInfo_VecString
setupInfo_VecString(self, flags)
Definition
Class_InformationHandler.py:90
python.Class_InformationHandler.InformationHandler.m_Infos_VecString
dict m_Infos_VecString
Definition
Class_InformationHandler.py:15
python.Class_InformationHandler.InformationHandler.setupInfo_Int
setupInfo_Int(self, flags)
Definition
Class_InformationHandler.py:60
python.Class_InformationHandler.InformationHandler.setupInfo_Features
setupInfo_Features(self, flags)
Definition
Class_InformationHandler.py:96
python.Class_InformationHandler.InformationHandler.m_Infos_String
dict m_Infos_String
Definition
Class_InformationHandler.py:13
python.Class_InformationHandler.InformationHandler.m_Infos_VecDouble
dict m_Infos_VecDouble
Definition
Class_InformationHandler.py:14
python.Class_InformationHandler.InformationHandler.m_Infos_Double
dict m_Infos_Double
Definition
Class_InformationHandler.py:12
python.Class_InformationHandler.InformationHandler.setupInfo_Double
setupInfo_Double(self, flags)
Definition
Class_InformationHandler.py:66
python.Class_InformationHandler.InformationHandler.__init__
__init__(self, flags)
Definition
Class_InformationHandler.py:7
dump
-event-from-file
Generated on
for ATLAS Offline Software by
1.17.0