ATLAS Offline Software
Loading...
Searching...
No Matches
tauRecTools::TrackRNN Class Reference

#include <TauTrackRNNClassifier.h>

Inheritance diagram for tauRecTools::TrackRNN:
Collaboration diagram for tauRecTools::TrackRNN:

Public Member Functions

virtual StatusCode eventInitialize () override
 Event initializer - called at the beginning of each event.
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &) const override
 Execute - called for each tau candidate.
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, CaloConstCellContainer &, boost::dynamic_bitset<> &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, const xAOD::VertexContainer *) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::VertexContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::TauTrackContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::CaloClusterContainer &, xAOD::PFOContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::PFOContainer &, xAOD::PFOContainer &, const xAOD::CaloClusterContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::PFOContainer &, xAOD::PFOContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::PFOContainer &) const override
virtual StatusCode executeTool (xAOD::TauJet &, const EventContext &, xAOD::ParticleContainer &, xAOD::PFOContainer &) const override
virtual StatusCode eventFinalize () override
 Event finalizer - called at the end of each event.
virtual StatusCode finalize () override
 Finalizer.
std::string find_file (const std::string &fname) const
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

bool inTrigger () const
bool inAOD () const
bool inEleRM () const
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.

Protected Attributes

Gaudi::Property< bool > m_in_trigger {this, "inTrigger", false, "Indicate if the tool is running on trigger"}
Gaudi::Property< bool > m_in_AOD {this, "inAOD", false, "Indicate if the tool is running on AOD"}
Gaudi::Property< bool > m_in_EleRM {this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"}
Gaudi::Property< std::string > m_tauRecToolsTag {this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"}

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

ASG_TOOL_CLASS2(TrackRNN, TauRecToolBase, ITauToolBase) public ~TrackRNN ()
 Create a proper constructor for Athena.
virtual StatusCode initialize () override
 Tool initializer.
StatusCode classifyTracks (std::vector< xAOD::TauTrack * > &vTracks, xAOD::TauJet &xTau, const xAOD::VertexContainer *vertexContainer, const xAOD::TauTrackContainer &tauTrackContainer, bool skipTracks=false) const
StatusCode calculateVars (const std::vector< xAOD::TauTrack * > &vTracks, const xAOD::TauJet &xTau, const xAOD::VertexContainer *vertexContainer, VectorMap &valueMap) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::string > m_inputWeightsPath {this, "InputWeightsPath", ""}
Gaudi::Property< unsigned int > m_nMaxNtracks {this, "MaxNtracks", 0}
Gaudi::Property< bool > m_removeDuplicateChargedTracks {this, "removeDuplicateChargedTracks", false}
std::unique_ptr< lwtDev::LightweightGraph > m_RNNClassifier
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

Definition at line 83 of file TauTrackRNNClassifier.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~TrackRNN()

TrackRNN::~TrackRNN ( )
private

Create a proper constructor for Athena.

Definition at line 235 of file TauTrackRNNClassifier.cxx.

236{
237}

Member Function Documentation

◆ calculateVars()

StatusCode TrackRNN::calculateVars ( const std::vector< xAOD::TauTrack * > & vTracks,
const xAOD::TauJet & xTau,
const xAOD::VertexContainer * vertexContainer,
tauRecTools::VectorMap & valueMap ) const
private

Definition at line 366 of file TauTrackRNNClassifier.cxx.

370{
371 // initialize map with values
372 valueMap.clear();
373 unsigned int n_timeSteps = vTracks.size();
374 if(m_nMaxNtracks > 0 && n_timeSteps > m_nMaxNtracks) {
375 n_timeSteps = m_nMaxNtracks;
376 }
377
378 valueMap["log(trackPt)"] = std::vector<double>(n_timeSteps);
379 valueMap["log(jetSeedPt)"] = std::vector<double>(n_timeSteps);
380 valueMap["trackPt/tauPtIntermediateAxis"] = std::vector<double>(n_timeSteps);
381 valueMap["trackEta"] = std::vector<double>(n_timeSteps);
382 valueMap["z0sinthetaTJVA"] = std::vector<double>(n_timeSteps);
383 valueMap["z0sinthetaSigTJVA"] = std::vector<double>(n_timeSteps);
384 valueMap["log(rConv)"] = std::vector<double>(n_timeSteps);
385 valueMap["tanh(rConvII/500)"] = std::vector<double>(n_timeSteps);
386 valueMap["dRJetSeedAxis"] = std::vector<double>(n_timeSteps);
387 valueMap["dRIntermediateAxis"] = std::vector<double>(n_timeSteps);
388 valueMap["tanh(d0SigTJVA/10)"] = std::vector<double>(n_timeSteps);
389 valueMap["tanh(d0TJVA/10)"] = std::vector<double>(n_timeSteps);
390 valueMap["qOverP*1000"] = std::vector<double>(n_timeSteps);
391 valueMap["numberOfInnermostPixelLayerHits"] = std::vector<double>(n_timeSteps);
392 valueMap["numberOfPixelSharedHits"] = std::vector<double>(n_timeSteps);
393 valueMap["numberOfSCTSharedHits"] = std::vector<double>(n_timeSteps);
394 valueMap["numberOfTRTHits"] = std::vector<double>(n_timeSteps);
395 valueMap["eProbabilityHT"] = std::vector<double>(n_timeSteps);
396 valueMap["nPixHits"] = std::vector<double>(n_timeSteps);
397 valueMap["nSCTHits"] = std::vector<double>(n_timeSteps);
398 valueMap["dz0_TV_PV0"] = std::vector<double>(n_timeSteps);
399 valueMap["log_sumpt_TV"] = std::vector<double>(n_timeSteps);
400 valueMap["log_sumpt2_TV"] = std::vector<double>(n_timeSteps);
401 valueMap["log_sumpt_PV0"] = std::vector<double>(n_timeSteps);
402 valueMap["log_sumpt2_PV0"] = std::vector<double>(n_timeSteps);
403 valueMap["charge"] = std::vector<double>(n_timeSteps);
404 // used by RNN track classifier for upgrade
405 valueMap["(trackPt/jetSeedPt)"] = std::vector<double>(n_timeSteps);
406 valueMap["numberOfInnermostPixelLayerEndcapHits"] = std::vector<double>(n_timeSteps);
407 valueMap["nSiHits"] = std::vector<double>(n_timeSteps);
408
409 // tau variable
410 double log_ptJetSeed = std::log( xTau.ptJetSeed() );
411
412 // vertex variables
413 double dz0_TV_PV0 = 0., sumpt_TV = 0., sumpt2_TV = 0., sumpt_PV0 = 0., sumpt2_PV0 = 0.;
414 if(vertexContainer != nullptr && !vertexContainer->empty() && xTau.vertex()!=nullptr) {
415 dz0_TV_PV0 = xTau.vertex()->z() - vertexContainer->at(0)->z();
416
417 // Some AODs reconstructed before 22.0.48 contain rare cases of tracks with only dead sensors instead of hits
418 // due to an edge case in the Si Hit definitions see e.g https://its.cern.ch/jira/browse/ATLIDTRKCP-395
419 // These could be used in the primary vertexing but then were thinned away by the TRT Standalone thinning
420 // this only checked for nHits < 4 rather than the TRT Standalone bit pattern specifically, removing these only dead sensor tracks
421 // we guard against this unresolved track link issue by counting and skipping invalid links
422 // should be extremely rare, but prevents crashes
423 unsigned int nUnresolved = 0;
424 for (const ElementLink<xAOD::TrackParticleContainer>& trk : vertexContainer->at(0)->trackParticleLinks()) {
425 if (!trk.isValid()) { ++nUnresolved; continue; }
426 sumpt_PV0 += (*trk)->pt();
427 sumpt2_PV0 += pow((*trk)->pt(), 2.);
428 }
429 for (const ElementLink<xAOD::TrackParticleContainer>& trk : xTau.vertex()->trackParticleLinks()) {
430 if (!trk.isValid()) { ++nUnresolved; continue; }
431 sumpt_TV += (*trk)->pt();
432 sumpt2_TV += pow((*trk)->pt(), 2.);
433 }
434 if (nUnresolved > 0) {
435 ATH_MSG_WARNING(nUnresolved << " unresolvable track link(s) on the primary or tau "
436 << "vertex skipped: log_sumpt_PV0 / log_sumpt_TV inputs of "
437 << "the track RNN computed from remaining tracks");
438 }
439 }
440 //these are false positives
441 //cppcheck-suppress invalidFunctionArg
442 double log_sumpt_TV = (sumpt_TV>0.) ? std::log(sumpt_TV) : 0.;
443 //cppcheck-suppress invalidFunctionArg
444 double log_sumpt2_TV = (sumpt2_TV>0.) ? std::log(sumpt2_TV) : 0.;
445 //cppcheck-suppress invalidFunctionArg
446 double log_sumpt_PV0 = (sumpt_PV0>0.) ? std::log(sumpt_PV0) : 0.;
447 //cppcheck-suppress invalidFunctionArg
448 double log_sumpt2_PV0 = (sumpt2_PV0>0.) ? std::log(sumpt2_PV0) : 0.;
449
450 // track variables
451 unsigned int i = 0;
452
453 for(xAOD::TauTrack* xTrack : vTracks)
454 {
455 const xAOD::TrackParticle* xTrackParticle = xTrack->track();
456
457 uint8_t numberOfInnermostPixelLayerHits = 0; ATH_CHECK( xTrackParticle->summaryValue(numberOfInnermostPixelLayerHits, xAOD::numberOfInnermostPixelLayerHits) );
458 uint8_t nPixelHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nPixelHits, xAOD::numberOfPixelHits) );
459 uint8_t nPixelSharedHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nPixelSharedHits, xAOD::numberOfPixelSharedHits) );
460 uint8_t nPixelDeadSensors = 0; ATH_CHECK( xTrackParticle->summaryValue(nPixelDeadSensors, xAOD::numberOfPixelDeadSensors) );
461 uint8_t nSCTHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nSCTHits, xAOD::numberOfSCTHits) );
462 uint8_t nSCTSharedHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nSCTSharedHits, xAOD::numberOfSCTSharedHits) );
463 uint8_t nSCTDeadSensors = 0; ATH_CHECK( xTrackParticle->summaryValue(nSCTDeadSensors, xAOD::numberOfSCTDeadSensors) );
464 uint8_t nTRTHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nTRTHits, xAOD::numberOfTRTHits) );
465 float eProbabilityHT; ATH_CHECK( xTrackParticle->summaryValue( eProbabilityHT, xAOD::eProbabilityHT) );
466
467 // used by RNN track classifier for upgrade
469 uint8_t tmp_var = 0;
470 if(xTrackParticle->summaryValue(tmp_var, xAOD::numberOfInnermostPixelLayerEndcapHits) ){
472 }
474
475 valueMap["log(trackPt)"][i] = std::log( xTrackParticle->pt() );
476 valueMap["log(jetSeedPt)"][i] = log_ptJetSeed;
477 valueMap["trackPt/tauPtIntermediateAxis"][i] = xTrackParticle->pt()/xTau.ptIntermediateAxis();
478 valueMap["trackEta"][i] = xTrackParticle->eta();
479 valueMap["z0sinthetaTJVA"][i] = xTrack->z0sinthetaTJVA();
480 valueMap["z0sinthetaSigTJVA"][i] = xTrack->z0sinthetaSigTJVA();
481 valueMap["log(rConv)"][i] = std::log( xTrack->rConv() );
482 valueMap["tanh(rConvII/500)"][i] = std::tanh( xTrack->rConvII()/500. );
483 // there is no seed jets in AOD so dRJetSeedAxis wont work
484 valueMap["dRJetSeedAxis"][i] = xTrack->p4().DeltaR(xTau.p4(xAOD::TauJetParameters::JetSeed));
485 valueMap["dRIntermediateAxis"][i] = xTrack->p4().DeltaR( xTau.p4(xAOD::TauJetParameters::IntermediateAxis) );
486 valueMap["tanh(d0SigTJVA/10)"][i] = std::tanh( xTrack->d0SigTJVA()/10. );
487 valueMap["tanh(d0TJVA/10)"][i] = std::tanh( xTrack->d0TJVA()/10. );
488 valueMap["qOverP*1000"][i] = xTrackParticle->qOverP()*1000.;
489 valueMap["numberOfInnermostPixelLayerHits"][i] = numberOfInnermostPixelLayerHits;
490 valueMap["numberOfPixelSharedHits"][i] = nPixelSharedHits;
491 valueMap["numberOfSCTSharedHits"][i] = nSCTSharedHits;
492 valueMap["numberOfTRTHits"][i] = nTRTHits;
493 valueMap["eProbabilityHT"][i] = eProbabilityHT;
494 valueMap["nPixHits"][i] = nPixelHits + nPixelDeadSensors;
495 valueMap["nSCTHits"][i] = nSCTHits + nSCTDeadSensors;
496 valueMap["dz0_TV_PV0"][i] = dz0_TV_PV0;
497 valueMap["log_sumpt_TV"][i] = log_sumpt_TV;
498 valueMap["log_sumpt2_TV"][i] = log_sumpt2_TV;
499 valueMap["log_sumpt_PV0"][i] = log_sumpt_PV0;
500 valueMap["log_sumpt2_PV0"][i] = log_sumpt2_PV0;
501 valueMap["charge"][i] = xTrackParticle->charge();
502 // used by RNN track classifier for upgrade
503 valueMap["(trackPt/jetSeedPt)"][i] = xTrackParticle->pt()/xTau.ptJetSeed();
504 valueMap["numberOfInnermostPixelLayerEndcapHits"][i] = numberOfInnermostPixelLayerEndcapHits;
505 valueMap["nSiHits"][i] = nSiHits;
506
507 ++i;
508 if(m_nMaxNtracks > 0 && i >= m_nMaxNtracks) {
509 break;
510 }
511 }
512
513 return StatusCode::SUCCESS;
514}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x,...)
const T * at(size_type n) const
Access an element, as an rvalue.
bool empty() const noexcept
Returns true if the collection is empty.
Gaudi::Property< unsigned int > m_nMaxNtracks
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition TauJet_v3.cxx:96
double ptIntermediateAxis() const
const Vertex * vertex() const
double ptJetSeed() const
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
float qOverP() const
Returns the parameter.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float charge() const
Returns the charge.
float z() const
Returns the z position.
const TrackParticleLinks_t & trackParticleLinks() const
Get all the particles associated with the vertex.
float nPixelSharedHits(const U &p)
float nSCTSharedHits(const U &p)
float nPixelDeadSensors(const U &p)
float nSCTHits(const U &p)
float nSCTDeadSensors(const U &p)
float nTRTHits(const U &p)
float nSiHits(const U &p)
float nPixelHits(const U &p)
constexpr int pow(int x)
Definition conifer.h:27
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TauTrack_v1 TauTrack
Definition of the current version.
Definition TauTrack.h:16
@ numberOfInnermostPixelLayerEndcapHits
these are the hits in the 0th pixel layer endcap [unit8_t].
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
@ eProbabilityHT
Electron probability from High Threshold (HT) information [float].
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].

◆ classifyTracks()

StatusCode TrackRNN::classifyTracks ( std::vector< xAOD::TauTrack * > & vTracks,
xAOD::TauJet & xTau,
const xAOD::VertexContainer * vertexContainer,
const xAOD::TauTrackContainer & tauTrackContainer,
bool skipTracks = false ) const
private

Definition at line 259 of file TauTrackRNNClassifier.cxx.

264{
265 if(vTracks.empty()) {
266 return StatusCode::SUCCESS;
267 }
268
269 static const SG::Accessor<float> idScoreCharged("rnn_chargedScore");
270 static const SG::Accessor<float> idScoreIso("rnn_isolationScore");
271 static const SG::Accessor<float> idScoreConv("rnn_conversionScore");
272 static const SG::Accessor<float> idScoreFake("rnn_fakeScore");
273
274 // don't classify tracks, set default decorations
275 if(skipTracks) {
276 for(xAOD::TauTrack* track : vTracks) {
277 idScoreCharged(*track) = 0.;
278 idScoreConv(*track) = 0.;
279 idScoreIso(*track) = 0.;
280 idScoreFake(*track) = 0.;
281 }
282 return StatusCode::SUCCESS;
283 }
284
285 std::sort(vTracks.begin(), vTracks.end(), [](const xAOD::TauTrack * a, const xAOD::TauTrack * b) {return a->pt() > b->pt();});
286
287 VectorMap valueMap;
288 ATH_CHECK(calculateVars(vTracks, xTau, vertexContainer, valueMap));
289
290 SeqNodeMap seqInput;
291 NodeMap nodeInput;
292
293 seqInput["input_1"] = std::move(valueMap);
294
295 VectorMap mValue = m_RNNClassifier->scan(nodeInput, seqInput, "time_distributed_2");
296
297 std::vector<double> vClassProb(5);
298
299 for (unsigned int i = 0; i < vTracks.size(); ++i){
300
301 if(i >= m_nMaxNtracks && m_nMaxNtracks > 0){
302 vClassProb[0] = 0.0;
303 vClassProb[1] = 0.0;
304 vClassProb[2] = 0.0;
305 vClassProb[3] = 0.0;
306 vClassProb[4] = 1.0;
307 }else{
308 vClassProb[0] = mValue["type_0"][i];
309 vClassProb[1] = mValue["type_1"][i];
310 vClassProb[2] = mValue["type_2"][i];
311 vClassProb[3] = mValue["type_3"][i];
312 vClassProb[4] = 0.0;
313 }
314
315 idScoreCharged(*vTracks[i]) = vClassProb[0];
316 idScoreConv(*vTracks[i]) = vClassProb[1];
317 idScoreIso(*vTracks[i]) = vClassProb[2];
318 idScoreFake(*vTracks[i]) = vClassProb[3];
319
320 int iMaxIndex = 0;
321 for (unsigned int j = 1; j < vClassProb.size(); ++j){
322 if(vClassProb[j] > vClassProb[iMaxIndex]) iMaxIndex = j;
323 }
324
325 if(iMaxIndex < 4) {
326 vTracks[i]->setFlag(xAOD::TauJetParameters::unclassified, false);
327 }
328
329 if(iMaxIndex == 3){
330 vTracks[i]->setFlag(xAOD::TauJetParameters::classifiedFake, true);
331 }else if(iMaxIndex == 0){
332 vTracks[i]->setFlag(xAOD::TauJetParameters::classifiedCharged, true);
333 }else if(iMaxIndex == 1){
334 vTracks[i]->setFlag(xAOD::TauJetParameters::classifiedConversion, true);
335 }else if(iMaxIndex == 2){
336 vTracks[i]->setFlag(xAOD::TauJetParameters::classifiedIsolation, true);
337 }
338 }
339
341 bool alreadyUsed = false;
342 for (unsigned int i = 0; i < vTracks.size(); ++i){
343 alreadyUsed = false;
344 //loop over all up-to-now charged tracks
345 for( const xAOD::TauTrack* tau_trk : tauTrackCon ) {
347 if( vTracks[i]->track() == tau_trk->track()) alreadyUsed = true;
348 }
349 //if this track has already been used by another tau, don't consider
350 if (alreadyUsed) {
351 ATH_MSG_INFO( "Found Already Used charged track new, now putting it as unclassified" );
352 vTracks[i]->setFlag(xAOD::TauJetParameters::classifiedCharged, false);
354 } else {
355 ++i;
356 }
357 }
358 }
359
360
361 return StatusCode::SUCCESS;
362}
#define ATH_MSG_INFO(x,...)
static Double_t a
Gaudi::Property< bool > m_removeDuplicateChargedTracks
StatusCode calculateVars(const std::vector< xAOD::TauTrack * > &vTracks, const xAOD::TauJet &xTau, const xAOD::VertexContainer *vertexContainer, VectorMap &valueMap) const
std::unique_ptr< lwtDev::LightweightGraph > m_RNNClassifier
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
bool flag
Definition master.py:29
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
std::map< std::string, std::vector< double > > VectorMap
std::map< std::string, ValueMap > NodeMap
std::map< std::string, VectorMap > SeqNodeMap

◆ 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.

◆ eventFinalize()

StatusCode TauRecToolBase::eventFinalize ( )
overridevirtualinherited

Event finalizer - called at the end of each event.

Implements ITauToolBase.

Definition at line 123 of file TauRecToolBase.cxx.

123 {
124 return StatusCode::SUCCESS;
125}

◆ eventInitialize()

StatusCode TauRecToolBase::eventInitialize ( )
overridevirtualinherited

Event initializer - called at the beginning of each event.

Implements ITauToolBase.

Definition at line 36 of file TauRecToolBase.cxx.

36 {
37 return StatusCode::SUCCESS;
38}

◆ 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.

◆ executeTool() [1/10]

◆ executeTool() [2/10]

◆ executeTool() [3/10]

◆ executeTool() [4/10]

◆ executeTool() [5/10]

◆ executeTool() [6/10]

◆ executeTool() [7/10]

◆ executeTool() [8/10]

◆ executeTool() [9/10]

◆ executeTool() [10/10]

◆ 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

◆ finalize()

StatusCode TauRecToolBase::finalize ( )
overridevirtualinherited

Finalizer.

Implements ITauToolBase.

Reimplemented in PanTau::PanTauProcessor.

Definition at line 127 of file TauRecToolBase.cxx.

127 {
128 return StatusCode::SUCCESS;
129}

◆ find_file()

std::string TauRecToolBase::find_file ( const std::string & fname) const
inherited

Definition at line 19 of file TauRecToolBase.cxx.

19 {
20 std::string full_path;
21 //offline calib files are in GroupData
22 //online calib files are in release
23 full_path = PathResolverFindCalibFile(m_tauRecToolsTag+"/"+fname);
24 if(full_path.empty()) full_path = PathResolverFindCalibFile(fname);
25 return full_path;
26}
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::string > m_tauRecToolsTag

◆ 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::Event 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::Event, 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::Event 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::Event, 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.

◆ inAOD()

bool TauRecToolBase::inAOD ( ) const
inlineprotectedinherited

Definition at line 116 of file TauRecToolBase.h.

116{ return m_in_AOD; }
Gaudi::Property< bool > m_in_AOD

◆ inEleRM()

bool TauRecToolBase::inEleRM ( ) const
inlineprotectedinherited

Definition at line 117 of file TauRecToolBase.h.

117{ return m_in_EleRM; }
Gaudi::Property< bool > m_in_EleRM

◆ initialize()

StatusCode TrackRNN::initialize ( void )
overrideprivatevirtual

Tool initializer.

Reimplemented from TauRecToolBase.

Definition at line 240 of file TauTrackRNNClassifier.cxx.

241{
242 std::string inputWeightsPath = find_file(m_inputWeightsPath);
243 ATH_MSG_INFO("Using calibration file: " << inputWeightsPath);
244
245 std::ifstream nn_config_istream(inputWeightsPath);
246
247 lwtDev::GraphConfig NNconfig = lwtDev::parse_json_graph(nn_config_istream);
248
249 m_RNNClassifier = std::make_unique<lwtDev::LightweightGraph>(NNconfig, NNconfig.outputs.begin()->first);
250 if(!m_RNNClassifier) {
251 ATH_MSG_FATAL("Couldn't configure neural network!");
252 return StatusCode::FAILURE;
253 }
254
255 return StatusCode::SUCCESS;
256}
#define ATH_MSG_FATAL(x,...)
std::string find_file(const std::string &fname) const
Gaudi::Property< std::string > m_inputWeightsPath
GraphConfig parse_json_graph(std::istream &json)
std::map< std::string, OutputNodeConfig > outputs

◆ 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.

◆ inTrigger()

bool TauRecToolBase::inTrigger ( ) const
inlineprotectedinherited

Definition at line 115 of file TauRecToolBase.h.

115{ return m_in_trigger; }
Gaudi::Property< bool > m_in_trigger

◆ 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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_in_AOD

Gaudi::Property<bool> TauRecToolBase::m_in_AOD {this, "inAOD", false, "Indicate if the tool is running on AOD"}
protectedinherited

Definition at line 105 of file TauRecToolBase.h.

105{this, "inAOD", false, "Indicate if the tool is running on AOD"};

◆ m_in_EleRM

Gaudi::Property<bool> TauRecToolBase::m_in_EleRM {this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"}
protectedinherited

Definition at line 106 of file TauRecToolBase.h.

106{this, "inEleRM", false, "Indicate if the tool is running on EleRM routine"};

◆ m_in_trigger

Gaudi::Property<bool> TauRecToolBase::m_in_trigger {this, "inTrigger", false, "Indicate if the tool is running on trigger"}
protectedinherited

Definition at line 104 of file TauRecToolBase.h.

104{this, "inTrigger", false, "Indicate if the tool is running on trigger"};

◆ m_inputWeightsPath

Gaudi::Property<std::string> tauRecTools::TrackRNN::m_inputWeightsPath {this, "InputWeightsPath", ""}
private

Definition at line 116 of file TauTrackRNNClassifier.h.

116{this, "InputWeightsPath", ""};

◆ m_nMaxNtracks

Gaudi::Property<unsigned int> tauRecTools::TrackRNN::m_nMaxNtracks {this, "MaxNtracks", 0}
private

Definition at line 117 of file TauTrackRNNClassifier.h.

117{this, "MaxNtracks", 0};

◆ m_removeDuplicateChargedTracks

Gaudi::Property<bool> tauRecTools::TrackRNN::m_removeDuplicateChargedTracks {this, "removeDuplicateChargedTracks", false}
private

Definition at line 118 of file TauTrackRNNClassifier.h.

118{this, "removeDuplicateChargedTracks", false};

◆ m_RNNClassifier

std::unique_ptr<lwtDev::LightweightGraph> tauRecTools::TrackRNN::m_RNNClassifier
private

Definition at line 120 of file TauTrackRNNClassifier.h.

◆ m_tauRecToolsTag

Gaudi::Property<std::string> TauRecToolBase::m_tauRecToolsTag {this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"}
protectedinherited

Definition at line 107 of file TauRecToolBase.h.

107{this, "calibFolder", "tauRecTools/R22_preprod", "CVMFS path to the tau calibration folder"};

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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