ATLAS Offline Software
Loading...
Searching...
No Matches
PanTau::Tool_DecayModeDeterminator Class Reference

Tool to store information needed in PanTau Algorithms. More...

#include <Tool_DecayModeDeterminator.h>

Inheritance diagram for PanTau::Tool_DecayModeDeterminator:
Collaboration diagram for PanTau::Tool_DecayModeDeterminator:

Public Types

enum  DecayModeTest {
  t_1p0n_vs_1p1n , t_1p1n_vs_1pXn , t_3p0n_vs_3pXn , t_UnknownTest ,
  t_nTests
}

Public Member Functions

 Tool_DecayModeDeterminator (const std::string &name)
virtual ~Tool_DecayModeDeterminator ()
virtual StatusCode initialize ()
 Dummy implementation of the initialisation function.
virtual StatusCode execute (PanTau::PanTauSeed *inSeed) const
bool isInitialized ()
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< PanTau::ITool_InformationStorem_Tool_InformationStore {this, "Tool_InformationStore", "PanTau::Tool_InformationStore/Tool_InformationStore", "Tool handle to the information store tool"}
ToolHandle< PanTau::ITool_ModeDiscriminatorm_Tool_ModeDiscriminator_1p0n_vs_1p1n {this, "Tool_ModeDiscriminator_1p0n_vs_1p1n", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 1p0n_vs_1p1n"}
ToolHandle< PanTau::ITool_ModeDiscriminatorm_Tool_ModeDiscriminator_1p1n_vs_1pXn {this, "Tool_ModeDiscriminator_1p1n_vs_1pXn", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 1p1n_vs_1pXn"}
ToolHandle< PanTau::ITool_ModeDiscriminatorm_Tool_ModeDiscriminator_3p0n_vs_3pXn {this, "Tool_ModeDiscriminator_3p0n_vs_3pXn", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 3p0n_vs_3pXn"}
Gaudi::Property< std::string > m_Tool_InformationStoreName {this, "Tool_InformationStoreName", "", "Tool handle to the information store tool"}
Gaudi::Property< std::string > m_Tool_ModeDiscriminator_1p0n_vs_1p1nName {this, "Tool_ModeDiscriminator_1p0n_vs_1p1nName", "", "Handle to the ModeDiscriminator tool for 1p0n_vs_1p1n"}
Gaudi::Property< std::string > m_Tool_ModeDiscriminator_1p1n_vs_1pXnName {this, "Tool_ModeDiscriminator_1p1n_vs_1pXnName", "", "Handle to the ModeDiscriminator tool for 1p1n_vs_1pXn"}
Gaudi::Property< std::string > m_Tool_ModeDiscriminator_3p0n_vs_3pXnName {this, "Tool_ModeDiscriminator_3p0n_vs_3pXnName", "", "Handle to the ModeDiscriminator tool for 3p0n_vs_3pXn"}
std::string m_varTypeName_Prefix_Basic
double m_BDTCutValue_R10X_CellBased = 0.0
double m_BDTCutValue_R11X_CellBased = 0.0
double m_BDTCutValue_R110_CellBased = 0.0
double m_BDTCutValue_R1XX_CellBased = 0.0
double m_BDTCutValue_R30X_CellBased = 0.0
double m_BDTCutValue_R3XX_CellBased = 0.0
bool m_init =false
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Tool to store information needed in PanTau Algorithms.

Author
Christian Limbach (limba.nosp@m.ch@p.nosp@m.hysik.nosp@m..uni.nosp@m.-bonn.nosp@m..de)

Definition at line 29 of file Tool_DecayModeDeterminator.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ DecayModeTest

Constructor & Destructor Documentation

◆ Tool_DecayModeDeterminator()

PanTau::Tool_DecayModeDeterminator::Tool_DecayModeDeterminator ( const std::string & name)

Definition at line 10 of file Tool_DecayModeDeterminator.cxx.

10 :
11 asg::AsgTool(name)
12{}

◆ ~Tool_DecayModeDeterminator()

PanTau::Tool_DecayModeDeterminator::~Tool_DecayModeDeterminator ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode PanTau::Tool_DecayModeDeterminator::execute ( PanTau::PanTauSeed * inSeed) const
virtual

Implements PanTau::ITool_PanTauTools.

Definition at line 47 of file Tool_DecayModeDeterminator.cxx.

47 {
48
49 PanTau::TauFeature* features = inSeed->getFeatures();
50
51 //check for invalid input seed
56 bool invalidForDecayMode = (noValidInput || noAnyConstituents || noSelConstituents || badPt);
57
58 int decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtModeNotSet;
59 xAOD::TauJet* tauJet = inSeed->getTauJet();
60
61 if(invalidForDecayMode) {
62 ATH_MSG_DEBUG("Seed has no constituents assigned and/or input seed has no substructure info - use NotSet mode for this");
63 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_RecoMode_PanTau", xAOD::TauJetParameters::Mode_NotSet);
64 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_RecoMode_PanTauExtended", PanTau::PanTauSeed::t_ExtModeNotSet);
66 return StatusCode::SUCCESS;
67 }
68
69 //get the mode as it was determined by the subalgorithm
70 int decayMode_SubAlg = inSeed->getDecayModeBySubAlg();
71 int decayMode_PanTau = xAOD::TauJetParameters::Mode_NotSet;
72
73 //and calc the number of additional neutrals, not tagged as pi0
76 int AdditionalNeutrals = nNeutrals_SubAlg - nPi0Neut_SubAlg;
77
78 //based on the subAlg decay mode, pass to corresponding PanTau BDT...
79 double bdtResponse = -5;
81 // 1p0n mode
82 if(decayMode_SubAlg == xAOD::TauJetParameters::Mode_1p0n) {
83
84 //1 prong, and no other objects at all -> use 1p0n
85 if(AdditionalNeutrals == 0) {
86 decayMode_PanTau = xAOD::TauJetParameters::Mode_1p0n;
87 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode100;
88 bdtResponse = -3.;
89
90 //if there are neutrals which are not pi0-tagged, check BDT to maybe set 1p1n
91 }
92 else {
93 bool isOK = false;
94 bdtResponse = m_Tool_ModeDiscriminator_1p0n_vs_1p1n->getResponse(inSeed, isOK);
95 bdtTest = t_1p0n_vs_1p1n;
96 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode10X;
97 if(!isOK) {
98 ATH_MSG_WARNING("WARNING: problems getting bdt response for 1p0n + X-neutrals. use subAlg mode");
99 decayMode_PanTau = decayMode_SubAlg;
100 }
101 else {
102 decayMode_PanTau = (bdtResponse > m_BDTCutValue_R10X_CellBased) ? xAOD::TauJetParameters::Mode_1p0n : xAOD::TauJetParameters::Mode_1p1n;
103 }
104 }
105 }//end 1p0n
106
107 //1p1n mode
108 else if (decayMode_SubAlg == xAOD::TauJetParameters::Mode_1p1n) {
109 //1prong, 1pi0 and no other neutrals. check 1p0n-vs-1p1n
110 if(AdditionalNeutrals == 0) {
111 bool isOK = false;
112 bdtResponse = m_Tool_ModeDiscriminator_1p0n_vs_1p1n->getResponse(inSeed, isOK);
113 bdtTest = t_1p0n_vs_1p1n;
114 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode110;
115 if(!isOK) {
116 ATH_MSG_WARNING("WARNING problems getting bdt response for 1p1n + 0-neutrals. use subAlg mode");
117 decayMode_PanTau = decayMode_SubAlg;
118 }
119 else {
120 decayMode_PanTau = (bdtResponse <= m_BDTCutValue_R110_CellBased) ? xAOD::TauJetParameters::Mode_1p1n : xAOD::TauJetParameters::Mode_1p0n;
121 }
122 //1prong, 1pi0 and additional neutrals. check 1p1n vs 1pXn
123 }
124 else {
125 //NOTE: May investigate chain of decisions here: first check 1p0n-1p1n, and then (in case of 1p1n) 1p1n-1pXn
126 bool isOK = false;
127 bdtResponse = m_Tool_ModeDiscriminator_1p1n_vs_1pXn->getResponse(inSeed, isOK);
128 bdtTest = t_1p1n_vs_1pXn;
129 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode11X;
130 if(!isOK) {
131 ATH_MSG_WARNING("WARNING problems getting bdt response for 1p1n + X-neutrals. use subAlg mode");
132 decayMode_PanTau = decayMode_SubAlg;
133 }
134 else {
135 decayMode_PanTau = (bdtResponse > m_BDTCutValue_R11X_CellBased) ? xAOD::TauJetParameters::Mode_1p1n: xAOD::TauJetParameters::Mode_1pXn;
136 }
137 }
138 }//end 1p1n
139
140 //1pXn mode
141 else if (decayMode_SubAlg == xAOD::TauJetParameters::Mode_1pXn) {
142 //1prong, Xpi0. check 1p1n-vs-1pXn
143 bool isOK = false;
144 bdtResponse = m_Tool_ModeDiscriminator_1p1n_vs_1pXn->getResponse(inSeed, isOK);
145 bdtTest = t_1p1n_vs_1pXn;
146 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode1XX;
147 if(!isOK) {
148 ATH_MSG_WARNING("WARNING problems getting bdt response for 1p1n + X-neutrals. use subAlg mode");
149 decayMode_PanTau = decayMode_SubAlg;
150 } else {
151 decayMode_PanTau = (bdtResponse > m_BDTCutValue_R1XX_CellBased) ? xAOD::TauJetParameters::Mode_1p1n : xAOD::TauJetParameters::Mode_1pXn;
152 }
153 }//end 1pXn
154
155 //3p0n mode
156 else if (decayMode_SubAlg == xAOD::TauJetParameters::Mode_3p0n) {
157 //no additional neutrals.
158 if(AdditionalNeutrals == 0) {
159 decayMode_PanTau = xAOD::TauJetParameters::Mode_3p0n;
160 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode300;
161 bdtResponse = -2.5;
162 //additional neutrals
163 }
164 else {
165 bool isOK = false;
166 bdtResponse = m_Tool_ModeDiscriminator_3p0n_vs_3pXn->getResponse(inSeed, isOK);
167 bdtTest = t_3p0n_vs_3pXn;
168 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode30X;
169 if(!isOK) {
170 ATH_MSG_WARNING("WARNING problems getting bdt response for 3p0n + X-neutrals. use subAlg mode");
171 decayMode_PanTau = decayMode_SubAlg;
172 }
173 else {
174 decayMode_PanTau = (bdtResponse > m_BDTCutValue_R30X_CellBased) ? xAOD::TauJetParameters::Mode_3p0n : xAOD::TauJetParameters::Mode_3pXn;
175 }
176 }
177 }//end 3p0n
178
179 //3pXn mode
180 else if (decayMode_SubAlg == xAOD::TauJetParameters::Mode_3pXn) {
181 //3prong, Xpi0. check 3p0n-vs-3pXn
182 bool isOK = false;
183 bdtResponse = m_Tool_ModeDiscriminator_3p0n_vs_3pXn->getResponse(inSeed, isOK);
184 bdtTest = t_3p0n_vs_3pXn;
185 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode3XX;
186 if(!isOK) {
187 ATH_MSG_WARNING("WARNING problems getting bdt response for 3p0n + X-neutrals. use subAlg mode");
188 decayMode_PanTau = decayMode_SubAlg;
189 }
190 else {
191 decayMode_PanTau = (bdtResponse > m_BDTCutValue_R3XX_CellBased) ? xAOD::TauJetParameters::Mode_3p0n: xAOD::TauJetParameters::Mode_3pXn;
192 }
193 } //end 3pXn
194
195 //it's none of 1p0n, 1p1n, 1pXn, 3p0n, 3pXn -> set other mode
196 else {
197 decayMode_PanTau = xAOD::TauJetParameters::Mode_Other;
198 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtModeOther;
199 bdtResponse = -4;
200 bdtTest = t_UnknownTest;
201 }
202
203 // this overrides Pantau BDT 1p1n decision in the following case:
204 // if cell based counted 1 charged, 1 pi0neut, and number of hits in EM1 for the pi0neut is 3 or larger, set 1pXn;
205 if(inSeed->getNumberOfConstituentsOfType(PanTau::TauConstituent::t_Charged) == 1 && nPi0Neut_SubAlg == 1) {
206 //check for shots in EM1
207 bool isOK = false;
208 PanTau::TauConstituent* pi0Neut = inSeed->getConstituentsOfType(PanTau::TauConstituent::t_Pi0Neut, isOK).at(0);
209 if(isOK) {
210 double nPhotons = 0.;
211 std::vector<PanTau::TauConstituent*> shots = pi0Neut->getShots();
212
213 for(unsigned int iShot=0; iShot<shots.size(); iShot++) {
214 nPhotons = nPhotons + static_cast<double>(shots.at(iShot)->getNPhotonsInShot());
215 }
216
217 if(nPhotons > 2.) {
218 decayMode_SubAlg = xAOD::TauJetParameters::Mode_1pXn;
219 decayMode_PanTau = xAOD::TauJetParameters::Mode_1pXn;
220 decayMode_PanTauExtended = PanTau::PanTauSeed::t_ExtMode11shots;
221 inSeed->setModeHackedByCellBased(true);
222 bdtResponse = -2.;
223 }
224 //end check for pi0 neutrals were found
225 }
226 else {
227 ATH_MSG_WARNING("Could not find expected CellBased neutral -> don't check for photons in cluster");
228 }
229 } //end hack check for 1p1n
230
231 //update mode of seed and store in features
232 inSeed->setDecayModeByPanTau(decayMode_PanTau);
233 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_RecoMode", static_cast<double>(decayMode_SubAlg));
234 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_RecoMode_PanTau", static_cast<double>(decayMode_PanTau));
235 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_RecoMode_PanTauExtended", static_cast<double>(decayMode_PanTauExtended));
236
238
239 if(bdtTest == t_1p0n_vs_1p1n) {
240 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_1p0n_vs_1p1n", bdtResponse);
241 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_1p1n_vs_1pXn", -5.);
242 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_3p0n_vs_3pXn", -5.);
243 }
244 if(bdtTest == t_1p1n_vs_1pXn) {
245 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_1p0n_vs_1p1n", -5.);
246 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_1p1n_vs_1pXn", bdtResponse);
247 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_3p0n_vs_3pXn", -5.);
248 }
249 if(bdtTest == t_3p0n_vs_3pXn) {
250 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_1p0n_vs_1p1n", -5.);
251 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_1p1n_vs_1pXn", -5.);
252 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_3p0n_vs_3pXn", bdtResponse);
253 }
254 if(bdtTest == t_UnknownTest) {
255 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_1p0n_vs_1p1n", -5.);
256 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_1p1n_vs_1pXn", -5.);
257 features->addFeature("CellBased_" + m_varTypeName_Prefix_Basic + "_BDTValue_3p0n_vs_3pXn", -5.);
258 }
259
260 return StatusCode::SUCCESS;
261}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
void setDecayModeByPanTau(int decayModePanTau)
Definition PanTauSeed.h:230
std::vector< PanTau::TauConstituent * > getConstituentsOfType(int tauConstituent_Type, bool &foundit)
int getNumberOfConstituentsOfType(int tauConstituent_Type)
bool isOfTechnicalQuality(int pantauSeed_TechnicalQuality) const
const xAOD::TauJet * getTauJet() const
Definition PanTauSeed.h:215
int getDecayModeBySubAlg() const
Definition PanTauSeed.h:224
void setModeHackedByCellBased(bool f)
Definition PanTauSeed.h:153
const PanTau::TauFeature * getFeatures() const
Definition PanTauSeed.h:217
const std::vector< TauConstituent * > & getShots() const
bool addFeature(const std::string &name, const double value)
adds a new feature
ToolHandle< PanTau::ITool_ModeDiscriminator > m_Tool_ModeDiscriminator_3p0n_vs_3pXn
ToolHandle< PanTau::ITool_ModeDiscriminator > m_Tool_ModeDiscriminator_1p1n_vs_1pXn
ToolHandle< PanTau::ITool_ModeDiscriminator > m_Tool_ModeDiscriminator_1p0n_vs_1p1n
void setPanTauDetail(TauJetParameters::PanTauDetails panTauDetail, int value)
TauJet_v3 TauJet
Definition of the current "tau version".

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode PanTau::Tool_DecayModeDeterminator::initialize ( void )
virtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 18 of file Tool_DecayModeDeterminator.cxx.

18 {
19
20 m_init=true;
21
26
27 //get the discri tools
31
32 //get the variable prefix
33 ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Basic", m_varTypeName_Prefix_Basic) );
34
35 //get the BDT cut values
36 ATH_CHECK( m_Tool_InformationStore->getInfo_Double("DecayModeDeterminator_BDTCutValue_R10X_CellBased", m_BDTCutValue_R10X_CellBased) );
37 ATH_CHECK( m_Tool_InformationStore->getInfo_Double("DecayModeDeterminator_BDTCutValue_R11X_CellBased", m_BDTCutValue_R11X_CellBased) );
38 ATH_CHECK( m_Tool_InformationStore->getInfo_Double("DecayModeDeterminator_BDTCutValue_R110_CellBased", m_BDTCutValue_R110_CellBased) );
39 ATH_CHECK( m_Tool_InformationStore->getInfo_Double("DecayModeDeterminator_BDTCutValue_R1XX_CellBased", m_BDTCutValue_R1XX_CellBased) );
40 ATH_CHECK( m_Tool_InformationStore->getInfo_Double("DecayModeDeterminator_BDTCutValue_R30X_CellBased", m_BDTCutValue_R30X_CellBased) );
41 ATH_CHECK( m_Tool_InformationStore->getInfo_Double("DecayModeDeterminator_BDTCutValue_R3XX_CellBased", m_BDTCutValue_R3XX_CellBased) );
42
43 return StatusCode::SUCCESS;
44}
#define ATH_CHECK
Evaluate an expression and check for errors.
static StatusCode bindToolHandle(ToolHandle< T > &, std::string)
Gaudi::Property< std::string > m_Tool_ModeDiscriminator_1p1n_vs_1pXnName
Gaudi::Property< std::string > m_Tool_InformationStoreName
Gaudi::Property< std::string > m_Tool_ModeDiscriminator_1p0n_vs_1p1nName
Gaudi::Property< std::string > m_Tool_ModeDiscriminator_3p0n_vs_3pXnName
ToolHandle< PanTau::ITool_InformationStore > m_Tool_InformationStore

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isInitialized()

bool PanTau::Tool_DecayModeDeterminator::isInitialized ( )
inlinevirtual

Implements PanTau::ITool_PanTauTools.

Definition at line 77 of file Tool_DecayModeDeterminator.h.

77{return m_init;}

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_BDTCutValue_R10X_CellBased

double PanTau::Tool_DecayModeDeterminator::m_BDTCutValue_R10X_CellBased = 0.0
private

Definition at line 68 of file Tool_DecayModeDeterminator.h.

◆ m_BDTCutValue_R110_CellBased

double PanTau::Tool_DecayModeDeterminator::m_BDTCutValue_R110_CellBased = 0.0
private

Definition at line 70 of file Tool_DecayModeDeterminator.h.

◆ m_BDTCutValue_R11X_CellBased

double PanTau::Tool_DecayModeDeterminator::m_BDTCutValue_R11X_CellBased = 0.0
private

Definition at line 69 of file Tool_DecayModeDeterminator.h.

◆ m_BDTCutValue_R1XX_CellBased

double PanTau::Tool_DecayModeDeterminator::m_BDTCutValue_R1XX_CellBased = 0.0
private

Definition at line 71 of file Tool_DecayModeDeterminator.h.

◆ m_BDTCutValue_R30X_CellBased

double PanTau::Tool_DecayModeDeterminator::m_BDTCutValue_R30X_CellBased = 0.0
private

Definition at line 72 of file Tool_DecayModeDeterminator.h.

◆ m_BDTCutValue_R3XX_CellBased

double PanTau::Tool_DecayModeDeterminator::m_BDTCutValue_R3XX_CellBased = 0.0
private

Definition at line 73 of file Tool_DecayModeDeterminator.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_init

bool PanTau::Tool_DecayModeDeterminator::m_init =false
private

Definition at line 75 of file Tool_DecayModeDeterminator.h.

◆ m_Tool_InformationStore

ToolHandle<PanTau::ITool_InformationStore> PanTau::Tool_DecayModeDeterminator::m_Tool_InformationStore {this, "Tool_InformationStore", "PanTau::Tool_InformationStore/Tool_InformationStore", "Tool handle to the information store tool"}
private

Definition at line 52 of file Tool_DecayModeDeterminator.h.

52{this, "Tool_InformationStore", "PanTau::Tool_InformationStore/Tool_InformationStore", "Tool handle to the information store tool"};

◆ m_Tool_InformationStoreName

Gaudi::Property<std::string> PanTau::Tool_DecayModeDeterminator::m_Tool_InformationStoreName {this, "Tool_InformationStoreName", "", "Tool handle to the information store tool"}
private

Definition at line 57 of file Tool_DecayModeDeterminator.h.

57{this, "Tool_InformationStoreName", "", "Tool handle to the information store tool"};

◆ m_Tool_ModeDiscriminator_1p0n_vs_1p1n

ToolHandle<PanTau::ITool_ModeDiscriminator> PanTau::Tool_DecayModeDeterminator::m_Tool_ModeDiscriminator_1p0n_vs_1p1n {this, "Tool_ModeDiscriminator_1p0n_vs_1p1n", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 1p0n_vs_1p1n"}
private

Definition at line 53 of file Tool_DecayModeDeterminator.h.

53{this, "Tool_ModeDiscriminator_1p0n_vs_1p1n", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 1p0n_vs_1p1n"};

◆ m_Tool_ModeDiscriminator_1p0n_vs_1p1nName

Gaudi::Property<std::string> PanTau::Tool_DecayModeDeterminator::m_Tool_ModeDiscriminator_1p0n_vs_1p1nName {this, "Tool_ModeDiscriminator_1p0n_vs_1p1nName", "", "Handle to the ModeDiscriminator tool for 1p0n_vs_1p1n"}
private

Definition at line 58 of file Tool_DecayModeDeterminator.h.

58{this, "Tool_ModeDiscriminator_1p0n_vs_1p1nName", "", "Handle to the ModeDiscriminator tool for 1p0n_vs_1p1n"};

◆ m_Tool_ModeDiscriminator_1p1n_vs_1pXn

ToolHandle<PanTau::ITool_ModeDiscriminator> PanTau::Tool_DecayModeDeterminator::m_Tool_ModeDiscriminator_1p1n_vs_1pXn {this, "Tool_ModeDiscriminator_1p1n_vs_1pXn", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 1p1n_vs_1pXn"}
private

Definition at line 54 of file Tool_DecayModeDeterminator.h.

54{this, "Tool_ModeDiscriminator_1p1n_vs_1pXn", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 1p1n_vs_1pXn"};

◆ m_Tool_ModeDiscriminator_1p1n_vs_1pXnName

Gaudi::Property<std::string> PanTau::Tool_DecayModeDeterminator::m_Tool_ModeDiscriminator_1p1n_vs_1pXnName {this, "Tool_ModeDiscriminator_1p1n_vs_1pXnName", "", "Handle to the ModeDiscriminator tool for 1p1n_vs_1pXn"}
private

Definition at line 59 of file Tool_DecayModeDeterminator.h.

59{this, "Tool_ModeDiscriminator_1p1n_vs_1pXnName", "", "Handle to the ModeDiscriminator tool for 1p1n_vs_1pXn"};

◆ m_Tool_ModeDiscriminator_3p0n_vs_3pXn

ToolHandle<PanTau::ITool_ModeDiscriminator> PanTau::Tool_DecayModeDeterminator::m_Tool_ModeDiscriminator_3p0n_vs_3pXn {this, "Tool_ModeDiscriminator_3p0n_vs_3pXn", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 3p0n_vs_3pXn"}
private

Definition at line 55 of file Tool_DecayModeDeterminator.h.

55{this, "Tool_ModeDiscriminator_3p0n_vs_3pXn", "PanTau::Tool_ModeDiscriminator/Tool_ModeDiscriminator", "Handle to the ModeDiscriminator tool for 3p0n_vs_3pXn"};

◆ m_Tool_ModeDiscriminator_3p0n_vs_3pXnName

Gaudi::Property<std::string> PanTau::Tool_DecayModeDeterminator::m_Tool_ModeDiscriminator_3p0n_vs_3pXnName {this, "Tool_ModeDiscriminator_3p0n_vs_3pXnName", "", "Handle to the ModeDiscriminator tool for 3p0n_vs_3pXn"}
private

Definition at line 60 of file Tool_DecayModeDeterminator.h.

60{this, "Tool_ModeDiscriminator_3p0n_vs_3pXnName", "", "Handle to the ModeDiscriminator tool for 3p0n_vs_3pXn"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_varTypeName_Prefix_Basic

std::string PanTau::Tool_DecayModeDeterminator::m_varTypeName_Prefix_Basic
private

Definition at line 65 of file Tool_DecayModeDeterminator.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: