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 execute (xAOD::TauJet &pTau) const override
 Execute - called for each tau candidate.
virtual StatusCode executePi0CreateROI (xAOD::TauJet &pTau, CaloConstCellContainer &caloCellContainer, boost::dynamic_bitset<> &map) const override
virtual StatusCode executeVertexFinder (xAOD::TauJet &pTau, const xAOD::VertexContainer *vertexContainer=nullptr) const override
virtual StatusCode executeTrackFinder (xAOD::TauJet &pTau, xAOD::TauTrackContainer &tauTrackContainer) const override
virtual StatusCode executeTrackClassifier (xAOD::TauJet &pTau, xAOD::TauTrackContainer &tauTrackContainer) const override
virtual StatusCode executeShotFinder (xAOD::TauJet &pTau, xAOD::CaloClusterContainer &shotClusterContainer, xAOD::PFOContainer &PFOContainer) const override
virtual StatusCode executePi0ClusterCreator (xAOD::TauJet &pTau, xAOD::PFOContainer &neutralPFOContainer, xAOD::PFOContainer &hadronicPFOContainer, const xAOD::CaloClusterContainer &pCaloClusterContainer) const override
virtual StatusCode executeVertexVariables (xAOD::TauJet &pTau, xAOD::VertexContainer &vertexContainer) const override
virtual StatusCode executePi0ClusterScaler (xAOD::TauJet &pTau, xAOD::PFOContainer &neutralPFOContainer, xAOD::PFOContainer &chargedPFOContainer) const override
virtual StatusCode executePi0nPFO (xAOD::TauJet &pTau, xAOD::PFOContainer &neutralPFOContainer) const override
virtual StatusCode executePanTau (xAOD::TauJet &pTau, xAOD::ParticleContainer &particleContainer, xAOD::PFOContainer &neutralPFOContainer) 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 79 of file TauTrackRNNClassifier.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~TrackRNN()

TrackRNN::~TrackRNN ( )
private

Create a proper constructor for Athena.

Definition at line 237 of file TauTrackRNNClassifier.cxx.

238{
239}

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 368 of file TauTrackRNNClassifier.cxx.

372{
373 // initialize map with values
374 valueMap.clear();
375 unsigned int n_timeSteps = vTracks.size();
376 if(m_nMaxNtracks > 0 && n_timeSteps > m_nMaxNtracks) {
377 n_timeSteps = m_nMaxNtracks;
378 }
379
380 valueMap["log(trackPt)"] = std::vector<double>(n_timeSteps);
381 valueMap["log(jetSeedPt)"] = std::vector<double>(n_timeSteps);
382 valueMap["trackPt/tauPtIntermediateAxis"] = std::vector<double>(n_timeSteps);
383 valueMap["trackEta"] = std::vector<double>(n_timeSteps);
384 valueMap["z0sinthetaTJVA"] = std::vector<double>(n_timeSteps);
385 valueMap["z0sinthetaSigTJVA"] = std::vector<double>(n_timeSteps);
386 valueMap["log(rConv)"] = std::vector<double>(n_timeSteps);
387 valueMap["tanh(rConvII/500)"] = std::vector<double>(n_timeSteps);
388 valueMap["dRJetSeedAxis"] = std::vector<double>(n_timeSteps);
389 valueMap["dRIntermediateAxis"] = std::vector<double>(n_timeSteps);
390 valueMap["tanh(d0SigTJVA/10)"] = std::vector<double>(n_timeSteps);
391 valueMap["tanh(d0TJVA/10)"] = std::vector<double>(n_timeSteps);
392 valueMap["qOverP*1000"] = std::vector<double>(n_timeSteps);
393 valueMap["numberOfInnermostPixelLayerHits"] = std::vector<double>(n_timeSteps);
394 valueMap["numberOfPixelSharedHits"] = std::vector<double>(n_timeSteps);
395 valueMap["numberOfSCTSharedHits"] = std::vector<double>(n_timeSteps);
396 valueMap["numberOfTRTHits"] = std::vector<double>(n_timeSteps);
397 valueMap["eProbabilityHT"] = std::vector<double>(n_timeSteps);
398 valueMap["nPixHits"] = std::vector<double>(n_timeSteps);
399 valueMap["nSCTHits"] = std::vector<double>(n_timeSteps);
400 valueMap["dz0_TV_PV0"] = std::vector<double>(n_timeSteps);
401 valueMap["log_sumpt_TV"] = std::vector<double>(n_timeSteps);
402 valueMap["log_sumpt2_TV"] = std::vector<double>(n_timeSteps);
403 valueMap["log_sumpt_PV0"] = std::vector<double>(n_timeSteps);
404 valueMap["log_sumpt2_PV0"] = std::vector<double>(n_timeSteps);
405 valueMap["charge"] = std::vector<double>(n_timeSteps);
406 // used by RNN track classifier for upgrade
407 valueMap["(trackPt/jetSeedPt)"] = std::vector<double>(n_timeSteps);
408 valueMap["numberOfInnermostPixelLayerEndcapHits"] = std::vector<double>(n_timeSteps);
409 valueMap["nSiHits"] = std::vector<double>(n_timeSteps);
410
411 // tau variable
412 double log_ptJetSeed = std::log( xTau.ptJetSeed() );
413
414 // vertex variables
415 double dz0_TV_PV0 = 0., sumpt_TV = 0., sumpt2_TV = 0., sumpt_PV0 = 0., sumpt2_PV0 = 0.;
416 if(vertexContainer != nullptr && !vertexContainer->empty() && xTau.vertex()!=nullptr) {
417 dz0_TV_PV0 = xTau.vertex()->z() - vertexContainer->at(0)->z();
418
419 // Some AODs reconstructed before 22.0.48 contain rare cases of tracks with only dead sensors instead of hits
420 // due to an edge case in the Si Hit definitions see e.g https://its.cern.ch/jira/browse/ATLIDTRKCP-395
421 // These could be used in the primary vertexing but then were thinned away by the TRT Standalone thinning
422 // this only checked for nHits < 4 rather than the TRT Standalone bit pattern specifically, removing these only dead sensor tracks
423 // we guard against this unresolved track link issue by counting and skipping invalid links
424 // should be extremely rare, but prevents crashes
425 unsigned int nUnresolved = 0;
426 for (const ElementLink<xAOD::TrackParticleContainer>& trk : vertexContainer->at(0)->trackParticleLinks()) {
427 if (!trk.isValid()) { ++nUnresolved; continue; }
428 sumpt_PV0 += (*trk)->pt();
429 sumpt2_PV0 += pow((*trk)->pt(), 2.);
430 }
431 for (const ElementLink<xAOD::TrackParticleContainer>& trk : xTau.vertex()->trackParticleLinks()) {
432 if (!trk.isValid()) { ++nUnresolved; continue; }
433 sumpt_TV += (*trk)->pt();
434 sumpt2_TV += pow((*trk)->pt(), 2.);
435 }
436 if (nUnresolved > 0) {
437 ATH_MSG_WARNING(nUnresolved << " unresolvable track link(s) on the primary or tau "
438 << "vertex skipped: log_sumpt_PV0 / log_sumpt_TV inputs of "
439 << "the track RNN computed from remaining tracks");
440 }
441 }
442 //these are false positives
443 //cppcheck-suppress invalidFunctionArg
444 double log_sumpt_TV = (sumpt_TV>0.) ? std::log(sumpt_TV) : 0.;
445 //cppcheck-suppress invalidFunctionArg
446 double log_sumpt2_TV = (sumpt2_TV>0.) ? std::log(sumpt2_TV) : 0.;
447 //cppcheck-suppress invalidFunctionArg
448 double log_sumpt_PV0 = (sumpt_PV0>0.) ? std::log(sumpt_PV0) : 0.;
449 //cppcheck-suppress invalidFunctionArg
450 double log_sumpt2_PV0 = (sumpt2_PV0>0.) ? std::log(sumpt2_PV0) : 0.;
451
452 // track variables
453 unsigned int i = 0;
454
455 for(xAOD::TauTrack* xTrack : vTracks)
456 {
457 const xAOD::TrackParticle* xTrackParticle = xTrack->track();
458
459 uint8_t numberOfInnermostPixelLayerHits = 0; ATH_CHECK( xTrackParticle->summaryValue(numberOfInnermostPixelLayerHits, xAOD::numberOfInnermostPixelLayerHits) );
460 uint8_t nPixelHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nPixelHits, xAOD::numberOfPixelHits) );
461 uint8_t nPixelSharedHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nPixelSharedHits, xAOD::numberOfPixelSharedHits) );
462 uint8_t nPixelDeadSensors = 0; ATH_CHECK( xTrackParticle->summaryValue(nPixelDeadSensors, xAOD::numberOfPixelDeadSensors) );
463 uint8_t nSCTHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nSCTHits, xAOD::numberOfSCTHits) );
464 uint8_t nSCTSharedHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nSCTSharedHits, xAOD::numberOfSCTSharedHits) );
465 uint8_t nSCTDeadSensors = 0; ATH_CHECK( xTrackParticle->summaryValue(nSCTDeadSensors, xAOD::numberOfSCTDeadSensors) );
466 uint8_t nTRTHits = 0; ATH_CHECK( xTrackParticle->summaryValue(nTRTHits, xAOD::numberOfTRTHits) );
467 float eProbabilityHT; ATH_CHECK( xTrackParticle->summaryValue( eProbabilityHT, xAOD::eProbabilityHT) );
468
469 // used by RNN track classifier for upgrade
471 uint8_t tmp_var = 0;
472 if(xTrackParticle->summaryValue(tmp_var, xAOD::numberOfInnermostPixelLayerEndcapHits) ){
474 }
476
477 valueMap["log(trackPt)"][i] = std::log( xTrackParticle->pt() );
478 valueMap["log(jetSeedPt)"][i] = log_ptJetSeed;
479 valueMap["trackPt/tauPtIntermediateAxis"][i] = xTrackParticle->pt()/xTau.ptIntermediateAxis();
480 valueMap["trackEta"][i] = xTrackParticle->eta();
481 valueMap["z0sinthetaTJVA"][i] = xTrack->z0sinthetaTJVA();
482 valueMap["z0sinthetaSigTJVA"][i] = xTrack->z0sinthetaSigTJVA();
483 valueMap["log(rConv)"][i] = std::log( xTrack->rConv() );
484 valueMap["tanh(rConvII/500)"][i] = std::tanh( xTrack->rConvII()/500. );
485 // there is no seed jets in AOD so dRJetSeedAxis wont work
486 valueMap["dRJetSeedAxis"][i] = xTrack->p4().DeltaR(xTau.p4(xAOD::TauJetParameters::JetSeed));
487 valueMap["dRIntermediateAxis"][i] = xTrack->p4().DeltaR( xTau.p4(xAOD::TauJetParameters::IntermediateAxis) );
488 valueMap["tanh(d0SigTJVA/10)"][i] = std::tanh( xTrack->d0SigTJVA()/10. );
489 valueMap["tanh(d0TJVA/10)"][i] = std::tanh( xTrack->d0TJVA()/10. );
490 valueMap["qOverP*1000"][i] = xTrackParticle->qOverP()*1000.;
491 valueMap["numberOfInnermostPixelLayerHits"][i] = numberOfInnermostPixelLayerHits;
492 valueMap["numberOfPixelSharedHits"][i] = nPixelSharedHits;
493 valueMap["numberOfSCTSharedHits"][i] = nSCTSharedHits;
494 valueMap["numberOfTRTHits"][i] = nTRTHits;
495 valueMap["eProbabilityHT"][i] = eProbabilityHT;
496 valueMap["nPixHits"][i] = nPixelHits + nPixelDeadSensors;
497 valueMap["nSCTHits"][i] = nSCTHits + nSCTDeadSensors;
498 valueMap["dz0_TV_PV0"][i] = dz0_TV_PV0;
499 valueMap["log_sumpt_TV"][i] = log_sumpt_TV;
500 valueMap["log_sumpt2_TV"][i] = log_sumpt2_TV;
501 valueMap["log_sumpt_PV0"][i] = log_sumpt_PV0;
502 valueMap["log_sumpt2_PV0"][i] = log_sumpt2_PV0;
503 valueMap["charge"][i] = xTrackParticle->charge();
504 // used by RNN track classifier for upgrade
505 valueMap["(trackPt/jetSeedPt)"][i] = xTrackParticle->pt()/xTau.ptJetSeed();
506 valueMap["numberOfInnermostPixelLayerEndcapHits"][i] = numberOfInnermostPixelLayerEndcapHits;
507 valueMap["nSiHits"][i] = nSiHits;
508
509 ++i;
510 if(m_nMaxNtracks > 0 && i >= m_nMaxNtracks) {
511 break;
512 }
513 }
514
515 return StatusCode::SUCCESS;
516}
#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 261 of file TauTrackRNNClassifier.cxx.

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

105 {
106 return StatusCode::SUCCESS;
107}

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

◆ execute()

StatusCode TauRecToolBase::execute ( xAOD::TauJet & pTau) const
overridevirtualinherited

◆ executePanTau()

StatusCode TauRecToolBase::executePanTau ( xAOD::TauJet & pTau,
xAOD::ParticleContainer & particleContainer,
xAOD::PFOContainer & neutralPFOContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in PanTau::PanTauProcessor.

Definition at line 100 of file TauRecToolBase.cxx.

100 {
101 ATH_MSG_ERROR("function not implemented");
102 return StatusCode::FAILURE;
103}

◆ executePi0ClusterCreator()

StatusCode TauRecToolBase::executePi0ClusterCreator ( xAOD::TauJet & pTau,
xAOD::PFOContainer & neutralPFOContainer,
xAOD::PFOContainer & hadronicPFOContainer,
const xAOD::CaloClusterContainer & pCaloClusterContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauPi0ClusterCreator.

Definition at line 78 of file TauRecToolBase.cxx.

80 {
81 ATH_MSG_ERROR("function not implemented");
82 return StatusCode::FAILURE;
83}

◆ executePi0ClusterScaler()

StatusCode TauRecToolBase::executePi0ClusterScaler ( xAOD::TauJet & pTau,
xAOD::PFOContainer & neutralPFOContainer,
xAOD::PFOContainer & chargedPFOContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauPi0ClusterScaler.

Definition at line 90 of file TauRecToolBase.cxx.

90 {
91 ATH_MSG_ERROR("function not implemented");
92 return StatusCode::FAILURE;
93}

◆ executePi0CreateROI()

StatusCode TauRecToolBase::executePi0CreateROI ( xAOD::TauJet & pTau,
CaloConstCellContainer & caloCellContainer,
boost::dynamic_bitset<> & map ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauPi0CreateROI.

Definition at line 52 of file TauRecToolBase.cxx.

52 {
53 ATH_MSG_ERROR("function not implemented");
54 return StatusCode::FAILURE;
55}

◆ executePi0nPFO()

StatusCode TauRecToolBase::executePi0nPFO ( xAOD::TauJet & pTau,
xAOD::PFOContainer & neutralPFOContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauPi0ScoreCalculator, and TauPi0Selector.

Definition at line 95 of file TauRecToolBase.cxx.

95 {
96 ATH_MSG_ERROR("function not implemented");
97 return StatusCode::FAILURE;
98}

◆ executeShotFinder()

StatusCode TauRecToolBase::executeShotFinder ( xAOD::TauJet & pTau,
xAOD::CaloClusterContainer & shotClusterContainer,
xAOD::PFOContainer & PFOContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauShotFinder.

Definition at line 73 of file TauRecToolBase.cxx.

73 {
74 ATH_MSG_ERROR("function not implemented");
75 return StatusCode::FAILURE;
76}

◆ executeTrackClassifier()

StatusCode TauRecToolBase::executeTrackClassifier ( xAOD::TauJet & pTau,
xAOD::TauTrackContainer & tauTrackContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in tauRecTools::TauTrackRNNClassifier.

Definition at line 68 of file TauRecToolBase.cxx.

68 {
69 ATH_MSG_ERROR("function not implemented");
70 return StatusCode::FAILURE;
71}

◆ executeTrackFinder()

StatusCode TauRecToolBase::executeTrackFinder ( xAOD::TauJet & pTau,
xAOD::TauTrackContainer & tauTrackContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauTrackFinder.

Definition at line 63 of file TauRecToolBase.cxx.

63 {
64 ATH_MSG_ERROR("function not implemented");
65 return StatusCode::FAILURE;
66}

◆ executeVertexFinder()

StatusCode TauRecToolBase::executeVertexFinder ( xAOD::TauJet & pTau,
const xAOD::VertexContainer * vertexContainer = nullptr ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauVertexFinder.

Definition at line 58 of file TauRecToolBase.cxx.

58 {
59 ATH_MSG_ERROR("function not implemented");
60 return StatusCode::FAILURE;
61}

◆ executeVertexVariables()

StatusCode TauRecToolBase::executeVertexVariables ( xAOD::TauJet & pTau,
xAOD::VertexContainer & vertexContainer ) const
overridevirtualinherited

Implements ITauToolBase.

Reimplemented in TauVertexVariables.

Definition at line 85 of file TauRecToolBase.cxx.

85 {
86 ATH_MSG_ERROR("function not implemented");
87 return StatusCode::FAILURE;
88}

◆ 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 109 of file TauRecToolBase.cxx.

109 {
110 return StatusCode::SUCCESS;
111}

◆ 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 87 of file TauRecToolBase.h.

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

◆ inEleRM()

bool TauRecToolBase::inEleRM ( ) const
inlineprotectedinherited

Definition at line 88 of file TauRecToolBase.h.

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

◆ initialize()

StatusCode TrackRNN::initialize ( void )
overrideprivatevirtual

Tool initializer.

Reimplemented from TauRecToolBase.

Definition at line 242 of file TauTrackRNNClassifier.cxx.

243{
244 std::string inputWeightsPath = find_file(m_inputWeightsPath);
245 ATH_MSG_INFO("Using calibration file: " << inputWeightsPath);
246
247 std::ifstream nn_config_istream(inputWeightsPath);
248
249 lwtDev::GraphConfig NNconfig = lwtDev::parse_json_graph(nn_config_istream);
250
251 m_RNNClassifier = std::make_unique<lwtDev::LightweightGraph>(NNconfig, NNconfig.outputs.begin()->first);
252 if(!m_RNNClassifier) {
253 ATH_MSG_FATAL("Couldn't configure neural network!");
254 return StatusCode::FAILURE;
255 }
256
257 return StatusCode::SUCCESS;
258}
#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 86 of file TauRecToolBase.h.

86{ 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 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 >, 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 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_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_in_AOD

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

Definition at line 76 of file TauRecToolBase.h.

76{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 77 of file TauRecToolBase.h.

77{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 75 of file TauRecToolBase.h.

75{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 112 of file TauTrackRNNClassifier.h.

112{this, "InputWeightsPath", ""};

◆ m_nMaxNtracks

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

Definition at line 113 of file TauTrackRNNClassifier.h.

113{this, "MaxNtracks", 0};

◆ m_removeDuplicateChargedTracks

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

Definition at line 114 of file TauTrackRNNClassifier.h.

114{this, "removeDuplicateChargedTracks", false};

◆ m_RNNClassifier

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

Definition at line 116 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 78 of file TauRecToolBase.h.

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

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.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: