ATLAS Offline Software
Tool_InformationStore.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #define GeV 1000
8 
10 #ifdef XAOD_ANALYSIS
11 
12  // Boolean values
13  MapInt m01 = {
14  {"UseDefaultCellBasedConfig",1},//is this one necessary
15  {"TauConstituents_UsePionMass",1},
16  {"FeatureExtractor_UseEmptySeeds",0},
17  {"TauConstituents_eflowRec_UseMomentumAsEnergy",0},
18  {"TauConstituents_UseShrinkingCone",0}
19  };
20  setMapInt(m01);
21 
22  // double values
23  MapDouble m02 = {
24  {"eflowRec_Assoc_DeltaR",0.4},
25  {"TauConstituents_Types_DeltaRCore",0.2},
26  {"TauConstituents_MaxEta",9.9},
27  {"TauConstituents_PreselectionMinEnergy",500.},
28  {"TauConstituents_eflowRec_BDTThreshold_Pi0Neut",-0.04},
29  // PanTau BDT Cut values --- CellBased
30  {"DecayModeDeterminator_BDTCutValue_R10X_CellBased",0.52},
31  {"DecayModeDeterminator_BDTCutValue_R11X_CellBased",-0.33},
32  {"DecayModeDeterminator_BDTCutValue_R110_CellBased",0.47},
33  {"DecayModeDeterminator_BDTCutValue_R1XX_CellBased",-0.21},
34  {"DecayModeDeterminator_BDTCutValue_R30X_CellBased",-0.13},
35  {"DecayModeDeterminator_BDTCutValue_R3XX_CellBased",-0.08},
36  // PanTau BDT Cut values --- eflowRec
37  {"DecayModeDeterminator_BDTCutValue_R10X_eflowRec",-0.15},
38  {"DecayModeDeterminator_BDTCutValue_R11X_eflowRec",-0.60},
39  {"DecayModeDeterminator_BDTCutValue_R110_eflowRec",-0.08},
40  {"DecayModeDeterminator_BDTCutValue_R1XX_eflowRec",0.03},
41  {"DecayModeDeterminator_BDTCutValue_R30X_eflowRec",-0.25},
42  {"DecayModeDeterminator_BDTCutValue_R3XX_eflowRec",-0.23}
43  };
44 
45  setMapDouble(m02);
46 
47  // String values
48  MapString m03 = {
49  {"Name_TauRecContainer","TauJets"},
50  {"Name_eflowRecContainer","eflowObjects_tauMode"},
51  {"Name_TrackParticleContainer","TrackParticleCandidate"},
52  {"Name_PanTauSeedsContainer","PanTau_OutputSeeds"},
53  {"ModeDiscriminator_ReaderOption","!Color:Silent"},
54  {"ModeDiscriminator_TMVAMethod","BDTG"},
55  {"FeatureExtractor_VarTypeName_varTypeName_Sum", "Sum"},
56  {"FeatureExtractor_VarTypeName_varTypeName_Ratio", "Ratio"},
57  {"FeatureExtractor_VarTypeName_varTypeName_EtInRing", "EtInRing"},
58  {"FeatureExtractor_VarTypeName_varTypeName_Isolation", "Isolation"},
59  {"FeatureExtractor_VarTypeName_varTypeName_Num", "Num"},
60  {"FeatureExtractor_VarTypeName_varTypeName_Mean", "Mean"},
61  {"FeatureExtractor_VarTypeName_varTypeName_StdDev", "StdDev"},
62  {"FeatureExtractor_VarTypeName_varTypeName_HLV", "HLV"},
63  {"FeatureExtractor_VarTypeName_varTypeName_Angle", "Angle"},
64  {"FeatureExtractor_VarTypeName_varTypeName_DeltaR", "DeltaR"},
65  {"FeatureExtractor_VarTypeName_varTypeName_JetMoment", "JetMoment"},
66  {"FeatureExtractor_VarTypeName_varTypeName_Combined", "Combined"},
67  {"FeatureExtractor_VarTypeName_varTypeName_JetShape", "JetShape"},
68  {"FeatureExtractor_VarTypeName_varTypeName_ImpactParams", "ImpactParams"},
69  {"FeatureExtractor_VarTypeName_varTypeName_Basic", "Basic"},
70  {"FeatureExtractor_VarTypeName_varTypeName_PID", "PID"},
71  {"FeatureExtractor_VarTypeName_varTypeName_Shots", "Shots"},
72  };
73  setMapString(m03);
74 
75  // vector<double> values
76  // In Config_PanTau.py, this was called "vector<float> values". This was changed to "double".
77  // The "Units.GeV" (import AthenaCommon.SystemOfUnits as Units) was now replaced by "GeV" (#include "CLHEP/Units/SystemOfUnits.h", using CLHEP::GeV)
78  MapVecDouble m04 = {
79  {"TauConstituents_BinEdges_Eta",{0.000, 0.800, 1.400, 1.500, 1.900, 9.900}},
80  {"TauConstituents_Selection_Neutral_EtaBinned_EtCut",{2.1*GeV, 2.5*GeV, 2.6*GeV, 2.4*GeV, 1.9*GeV}},
81  {"TauConstituents_Selection_Pi0Neut_EtaBinned_EtCut",{2.1*GeV, 2.5*GeV, 2.6*GeV, 2.4*GeV, 1.9*GeV}},
82  {"TauConstituents_Selection_Charged_EtaBinned_EtCut",{1.0*GeV, 1.0*GeV, 1.0*GeV, 1.0*GeV, 1.0*GeV}},
83  {"TauConstituents_Selection_OutNeut_EtaBinned_EtCut",{1.0*GeV, 1.0*GeV, 1.0*GeV, 1.0*GeV, 1.0*GeV}},
84  {"TauConstituents_Selection_OutChrg_EtaBinned_EtCut",{1.0*GeV, 1.0*GeV, 1.0*GeV, 1.0*GeV, 1.0*GeV}},
85  {"TauConstituents_Selection_NeutLowA_EtaBinned_EtCut",{1.85*GeV, 2.25*GeV, 2.35*GeV, 2.15*GeV, 1.65*GeV}},
86  {"TauConstituents_Selection_NeutLowB_EtaBinned_EtCut",{1.6*GeV, 2.0*GeV, 2.1*GeV, 1.9*GeV, 1.4*GeV}},
87  {"eflowRec_Selection_Pi0Neut_EtaBinned_EtCut_1prong",{2.5*GeV, 2.5*GeV, 1.9*GeV, 2.5*GeV, 2.3*GeV}},
88  {"eflowRec_Selection_Pi0Neut_EtaBinned_EtCut_3prong",{2.5*GeV, 2.5*GeV, 2.5*GeV, 2.5*GeV, 2.5*GeV}},
89  // Eta Binned P I 0 - B D T C U T S
90  {"CellBased_BinEdges_Eta",{0.000, 0.800, 1.400, 1.500, 1.900, 9.900}},
91  {"CellBased_EtaBinned_Pi0MVACut_1prong",{0.46, 0.39, 0.51, 0.47, 0.54}},
92  {"CellBased_EtaBinned_Pi0MVACut_3prong",{0.47, 0.52, 0.60, 0.55, 0.50}},
93  {"eflowRec_BinEdges_Eta",{0.000, 0.800, 1.400, 1.500, 1.900, 9.900}},
94  {"eflowRec_EtaBinned_Pi0MVACut_1prong",{0.09, 0.09, 0.09, 0.08, 0.05}},
95  {"eflowRec_EtaBinned_Pi0MVACut_3prong",{0.09, 0.09, 0.09, 0.09, 0.07}},
96  // P T B I N S
97  {"ModeDiscriminator_BinEdges_Pt",{10*GeV, 100000*GeV}},
98  {"ModeDiscriminator_BDTVariableDefaults_CellBased_1p0n_vs_1p1n", {-9.0, -0.2, -10.0, -0.2, -2.0}},
99  {"ModeDiscriminator_BDTVariableDefaults_CellBased_1p1n_vs_1pXn", {-9.0, -200.0, -0.2, -5.0, -2.0}},
100  {"ModeDiscriminator_BDTVariableDefaults_CellBased_3p0n_vs_3pXn", {-0.2, -9.0, -0.2, -2.0, -200.0}},
101  };
102  setMapVecDouble(m04);
103 
104  // vector<string> values
105  MapVecString m05 = {
106  {"Names_InputAlgorithms",{"CellBased"}},
107  {"Names_ModeCases",{"1p0n_vs_1p1n","1p1n_vs_1pXn","3p0n_vs_3pXn"}},
108  // ---> eflowRec BDT variables
109  {"ModeDiscriminator_BDTVariableNames_eflowRec_1p0n_vs_1p1n",{"Charged_Ratio_EtOverEtAllConsts","Basic_NPi0NeutConsts","Neutral_PID_BDTValues_EtSort_1","Combined_DeltaR1stNeutralTo1stCharged"}},
110  {"ModeDiscriminator_BDTVariableNames_eflowRec_1p1n_vs_1pXn",{"Neutral_PID_BDTValues_BDTSort_2","Neutral_Ratio_EtOverEtAllConsts","Basic_NNeutralConsts","Neutral_HLV_SumM"}},
111  {"ModeDiscriminator_BDTVariableNames_eflowRec_3p0n_vs_3pXn",{"Basic_NPi0NeutConsts","Neutral_PID_BDTValues_BDTSort_1","Charged_HLV_SumPt","Charged_Ratio_EtOverEtAllConsts","Neutral_Mean_DRToLeading_WrtEtAllConsts"}},
112  // ---> CellBased BDT variables
113  {"ModeDiscriminator_BDTVariableNames_CellBased_1p0n_vs_1p1n",{"Neutral_PID_BDTValues_BDTSort_1","Neutral_Ratio_1stBDTEtOverEtAllConsts","Combined_DeltaR1stNeutralTo1stCharged","Charged_JetMoment_EtDRxTotalEt","Neutral_Shots_NPhotonsInSeed"}},
114  {"ModeDiscriminator_BDTVariableNames_CellBased_1p1n_vs_1pXn",{"Neutral_PID_BDTValues_BDTSort_2","Neutral_HLV_SumM","Neutral_Ratio_EtOverEtAllConsts","Basic_NNeutralConsts","Neutral_Shots_NPhotonsInSeed"}},
115  {"ModeDiscriminator_BDTVariableNames_CellBased_3p0n_vs_3pXn",{"Neutral_Ratio_EtOverEtAllConsts","Neutral_PID_BDTValues_BDTSort_1","Charged_StdDev_Et_WrtEtAllConsts","Neutral_Shots_NPhotonsInSeed","Charged_HLV_SumM"}},
116  {"ModeDiscriminator_BDTVariableTypes_CellBased_1p0n_vs_1p1n", {"F","F","F","F","F"}},
117  {"ModeDiscriminator_BDTVariableTypes_CellBased_1p1n_vs_1pXn", {"F","F","F","F","F"}},
118  {"ModeDiscriminator_BDTVariableTypes_CellBased_3p0n_vs_3pXn", {"F","F","F","F","F"}},
119  };
120  setMapVecString(m05);
121 
122 #endif
123 }
124 
125 
127  asg::AsgTool(name)
128 {
129  declareProperty("Infos_String", m_Infos_String, "Map with string type infos");
130  declareProperty("Infos_VecString", m_Infos_VecString, "Map with vector<string> type infos");
131  declareProperty("Infos_Int", m_Infos_Int, "Map with int type infos");
132  declareProperty("Infos_Double", m_Infos_Double, "Map with double type infos");
133  declareProperty("Infos_VecDouble", m_Infos_VecDouble, "Map with double type infos");
134 }
135 
137 
139  ATH_MSG_INFO( name() << " initialize()" );
140  m_init=true;
141 
142  //This function does nothing in athena
143  ABRDefaultInit();
144 
145  ATH_CHECK( this->getInfo_String("Name_TauRecContainer", m_Name_Container_TauRec) );
146  ATH_CHECK( this->getInfo_String("Name_TrackParticleContainer", m_Name_Container_Tracks) );
147 
148  return StatusCode::SUCCESS;
149 }
150 
152  MapInt::const_iterator it = m_Infos_Int.find(varName);
153  if(it == m_Infos_Int.end()) {
154  ATH_MSG_ERROR("getInfo_Int: No integer information called " << varName << " present in InformationStore");
155  return StatusCode::FAILURE;
156  }
157  value = it->second;
158  return StatusCode::SUCCESS;
159 }
160 
162  MapDouble::const_iterator it = m_Infos_Double.find(varName);
163  if(it == m_Infos_Double.end()) {
164  ATH_MSG_ERROR("getInfo_Double: No double information called " << varName << " present in InformationStore");
165  return StatusCode::FAILURE;
166  }
167  value = it->second;
168  return StatusCode::SUCCESS;
169 }
170 
171 StatusCode PanTau::Tool_InformationStore::getInfo_VecDouble(const std::string& varName, std::vector<double>& value) const {
172  MapVecDouble::const_iterator it = m_Infos_VecDouble.find(varName);
173  if(it == m_Infos_VecDouble.end()) {
174  ATH_MSG_ERROR("getInfo_VecDouble: No double information called " << varName << " present in InformationStore");
175  return StatusCode::FAILURE;
176  }
177  value = it->second;
178  return StatusCode::SUCCESS;
179 }
180 
182  MapString::const_iterator it = m_Infos_String.find(varName);
183  if(it == m_Infos_String.end()) {
184  ATH_MSG_ERROR("getInfo_String: No string information called " << varName << " present in InformationStore");
185  return StatusCode::FAILURE;
186  }
187  value = it->second;
188  return StatusCode::SUCCESS;
189 }
190 
191 StatusCode PanTau::Tool_InformationStore::getInfo_VecString(const std::string& varName, std::vector<std::string>& value) const {
192  MapVecString::const_iterator it = m_Infos_VecString.find(varName);
193  if(it == m_Infos_VecString.end()) {
194  ATH_MSG_ERROR("getInfo_VecString: No std::string information called " << varName << " present in InformationStore");
195  return StatusCode::FAILURE;
196  }
197  value = it->second;
198  return StatusCode::SUCCESS;
199 }
PanTau::ITool_InformationStore::MapString
std::map< std::string, std::string > MapString
Definition: ITool_InformationStore.h:29
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PanTau::Tool_InformationStore::~Tool_InformationStore
virtual ~Tool_InformationStore()
PanTau::ITool_InformationStore::MapVecDouble
std::map< std::string, std::vector< double > > MapVecDouble
Definition: ITool_InformationStore.h:33
PanTau::ITool_InformationStore::MapInt
std::map< std::string, int > MapInt
Definition: ITool_InformationStore.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PanTau::Tool_InformationStore::m_Infos_VecString
MapVecString m_Infos_VecString
Definition: Tool_InformationStore.h:56
PanTau::Tool_InformationStore::m_Infos_String
MapString m_Infos_String
named strings, ints etc... for configuration
Definition: Tool_InformationStore.h:55
skel.it
it
Definition: skel.GENtoEVGEN.py:423
asg
Definition: DataHandleTestTool.h:28
athena.value
value
Definition: athena.py:122
PanTau::ITool_InformationStore::MapVecString
std::map< std::string, std::vector< std::string > > MapVecString
Definition: ITool_InformationStore.h:30
PanTau::Tool_InformationStore::getInfo_Double
virtual StatusCode getInfo_Double(const std::string &varName, double &value) const
Definition: Tool_InformationStore.cxx:161
PanTau::Tool_InformationStore::getInfo_Int
virtual StatusCode getInfo_Int(const std::string &varName, int &value) const
Definition: Tool_InformationStore.cxx:151
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
PixelAthClusterMonAlgCfg.varName
string varName
end cluster ToT and charge
Definition: PixelAthClusterMonAlgCfg.py:117
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PanTau::Tool_InformationStore::m_Infos_Int
MapInt m_Infos_Int
Definition: Tool_InformationStore.h:57
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
PanTau::Tool_InformationStore::getInfo_String
virtual StatusCode getInfo_String(const std::string &varName, std::string &value) const
Definition: Tool_InformationStore.cxx:181
GeV
#define GeV
Definition: Tool_InformationStore.cxx:7
PanTau::Tool_InformationStore::ABRDefaultInit
virtual void ABRDefaultInit()
Definition: Tool_InformationStore.cxx:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
PanTau::Tool_InformationStore::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: Tool_InformationStore.cxx:138
PanTau::Tool_InformationStore::Tool_InformationStore
Tool_InformationStore(const std::string &name)
Definition: Tool_InformationStore.cxx:126
PanTau::Tool_InformationStore::getInfo_VecDouble
virtual StatusCode getInfo_VecDouble(const std::string &varName, std::vector< double > &value) const
Definition: Tool_InformationStore.cxx:171
Tool_InformationStore.h
PanTau::Tool_InformationStore::m_Infos_VecDouble
MapVecDouble m_Infos_VecDouble
Definition: Tool_InformationStore.h:59
PanTau::Tool_InformationStore::getInfo_VecString
virtual StatusCode getInfo_VecString(const std::string &varName, std::vector< std::string > &value) const
Definition: Tool_InformationStore.cxx:191
PanTau::ITool_InformationStore::MapDouble
std::map< std::string, double > MapDouble
Definition: ITool_InformationStore.h:32
PanTau::Tool_InformationStore::m_Infos_Double
MapDouble m_Infos_Double
Definition: Tool_InformationStore.h:58