ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Muon::MuonTrackTruthTool Class Reference

Tool to calculate track truth. More...

#include <MuonTrackTruthTool.h>

Inheritance diagram for Muon::MuonTrackTruthTool:
Collaboration diagram for Muon::MuonTrackTruthTool:

Classes

struct  SortResultByMatchedHits
 

Public Types

typedef std::pair< const Trk::Track *, MuonTrackTruthMatchResult
 
typedef std::vector< MatchResultResultVec
 
typedef std::pair< const Muon::MuonSegment *, MuonTrackTruthSegmentMatchResult
 
typedef std::vector< SegmentMatchResultSegmentResultVec
 
typedef std::map< int, TruthTreeEntryTruthTree
 
typedef TruthTree::iterator TruthTreeIt
 
typedef TruthTree::const_iterator TruthTreeConstIt
 

Public Member Functions

 MuonTrackTruthTool (const std::string &, const std::string &, const IInterface *)
 constructor More...
 
 ~MuonTrackTruthTool ()=default
 destructor More...
 
StatusCode initialize ()
 AlgTool initilize. More...
 
ResultVec match (const TruthTree &truth_tree, const TrackCollection &tracks) const
 perform truth matching for a given set of tracks More...
 
SegmentResultVec match (const TruthTree &truth_tree, const std::vector< const MuonSegment * > &segments) const
 perform truth matching for a given set of segments More...
 
MuonTrackTruth getTruth (const TruthTree &truth_tree, const Trk::Track &track, bool restrictedTruth=false) const
 get track truth More...
 
MuonTrackTruth getTruth (const TruthTree &truth_tree, const std::vector< const MuonSegment * > &segments, bool restrictedTruth=false) const
 get segment truth for a list of segments, the segments will be considered to belong to the same muon More...
 
MuonTrackTruth getTruth (const TruthTree &truth_tree, const Muon::MuonSegment &segment) const
 get segment truth More...
 
MuonTrackTruth getTruth (const TruthTree &truth_tree, const std::vector< const Trk::MeasurementBase * > &measurements, bool restrictedTruth=false) const
 get truth for a give set of hits. More...
 
const TruthTree createTruthTree (const TrackRecordCollection *truthTrackCol, const McEventCollection *mcEventCollection, const std::vector< const MuonSimDataCollection * > &muonSimData, const CscSimDataCollection *cscSimDataMap) const
 create truth tree from sim data More...
 
HepMC::ConstGenParticlePtr getMother (const TruthTrajectory &traj, const int barcodeIn) const
 Returns the mother particle of the particle with barcodeIn if it is found in the truth trajectory. More...
 
HepMC::ConstGenParticlePtr getAncestor (const TruthTrajectory &traj, const int barcodeIn) const
 Returns the ancestor particle of the particle with barcodeIn if it is found in the truth trajectory. More...
 
HepMC::ConstGenParticlePtr getInitial (const TruthTrajectory &traj, const int barcodeIn) const
 Returns the initial particle of the particle with barcodeIn if it is found in the truth trajectory. More...
 
unsigned int getNumberOfScatters (const TruthTrajectory &traj, const int barcodeIn) const
 Returns the number of steps a particle took while maintaining its PDG ID. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 access to tool interface More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

MuonTrackTruth getTruth (const std::vector< const Trk::MeasurementBase * > &measurements, const TruthTreeEntry &truthEntry, bool restrictedTruth) const
 
void addSimDataToTree (TruthTree &truth_tree, std::map< int, int > &barcode_map, const MuonSimDataCollection *simDataCol) const
 
void addCscSimDataToTree (TruthTree &truth_tree, std::map< int, int > &barcode_map, const CscSimDataCollection *simDataCol) const
 
void addMdtTruth (MuonTechnologyTruth &trackTruth, const Identifier &id, const Trk::MeasurementBase &meas, const MuonSimDataCollection &simCol) const
 
void addClusterTruth (MuonTechnologyTruth &trackTruth, const Identifier &id, const Trk::MeasurementBase &meas, const MuonSimDataCollection &simCol) const
 
void addClusterTruth (MuonTechnologyTruth &trackTruth, const Identifier &id, const Trk::MeasurementBase &meas, const CscSimDataCollection &simCol) const
 
void addMissedHits (MuonTechnologyTruth &truth, const std::set< Identifier > &ids, const std::set< Identifier > &chids, const MuonSimDataCollection &simCol, bool restrictedTruth) const
 
void addMissedHits (MuonTechnologyTruth &truth, const std::set< Identifier > &ids, const std::set< Identifier > &chids, const CscSimDataCollection &simCol, bool restrictedTruth) const
 
int manipulateBarCode (int barcode) const
 
bool selectPdg (int pdg) const
 
const std::pair< HepMC::ConstGenParticlePtr, unsigned int > getInitialPair (const TruthTrajectory &traj, const int barcodeIn) const
 Returns the initial particle of the particle with barcodeIn if it is found in the truth trajectory. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const MuonGM::MuonDetectorManagerm_detMgr
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandle< Muon::MuonEDMPrinterToolm_printer {this, "Printer", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"}
 
ToolHandle< Trk::ITruthTrajectoryBuilderm_truthTrajectoryBuilder
 
Gaudi::Property< bool > m_manipulateBarCode {this, "ManipulateBarCode", false}
 
Gaudi::Property< bool > m_doSummary {this, "DoSummary", false}
 
Gaudi::Property< bool > m_matchAllParticles {this, "MatchAllParticles", true}
 
Gaudi::Property< unsigned int > m_minHits {this, "MinHits", 4}
 
Gaudi::Property< std::vector< int > > m_pdgsToBeConsidered {this, "ConsideredPDGs", {}}
 
std::set< int > m_selectedPdgs
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Tool to calculate track truth.

Definition at line 47 of file MuonTrackTruthTool.h.

Member Typedef Documentation

◆ MatchResult

Definition at line 86 of file IMuonTrackTruthTool.h.

◆ ResultVec

typedef std::vector<MatchResult> Muon::IMuonTrackTruthTool::ResultVec
inherited

Definition at line 87 of file IMuonTrackTruthTool.h.

◆ SegmentMatchResult

Definition at line 89 of file IMuonTrackTruthTool.h.

◆ SegmentResultVec

Definition at line 90 of file IMuonTrackTruthTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TruthTree

typedef std::map<int, TruthTreeEntry> Muon::IMuonTrackTruthTool::TruthTree
inherited

Definition at line 93 of file IMuonTrackTruthTool.h.

◆ TruthTreeConstIt

typedef TruthTree::const_iterator Muon::IMuonTrackTruthTool::TruthTreeConstIt
inherited

Definition at line 95 of file IMuonTrackTruthTool.h.

◆ TruthTreeIt

typedef TruthTree::iterator Muon::IMuonTrackTruthTool::TruthTreeIt
inherited

Definition at line 94 of file IMuonTrackTruthTool.h.

Constructor & Destructor Documentation

◆ MuonTrackTruthTool()

Muon::MuonTrackTruthTool::MuonTrackTruthTool ( const std::string &  ty,
const std::string &  na,
const IInterface *  pa 
)

constructor

Definition at line 25 of file MuonTrackTruthTool.cxx.

25  :
26  AthAlgTool(ty, na, pa), m_detMgr(nullptr) {
27  declareInterface<IMuonTrackTruthTool>(this);
28  }

◆ ~MuonTrackTruthTool()

Muon::MuonTrackTruthTool::~MuonTrackTruthTool ( )
default

destructor

Member Function Documentation

◆ addClusterTruth() [1/2]

void Muon::MuonTrackTruthTool::addClusterTruth ( MuonTechnologyTruth trackTruth,
const Identifier id,
const Trk::MeasurementBase meas,
const CscSimDataCollection simCol 
) const
private

Definition at line 647 of file MuonTrackTruthTool.cxx.

648  {
649  Identifier layid = m_idHelperSvc->layerId(id);
650  Identifier chid = m_idHelperSvc->chamberId(id);
651  // find SimData corresponding to identifier
652  CscSimDataCollection::const_iterator it = simCol.find(id);
653  if (it == simCol.end()) {
654  truth.wrongHits.insert(layid);
655  truth.wrongChambers.insert(chid);
656  return;
657  }
658 
659  std::vector<CscSimData::Deposit>::const_iterator dit = it->second.getdeposits().begin();
660  std::vector<CscSimData::Deposit>::const_iterator dit_end = it->second.getdeposits().end();
661  for (; dit != dit_end; ++dit) {
662  truth.matchedHits.insert(layid);
663  truth.matchedChambers.insert(chid);
664  }
665  }

◆ addClusterTruth() [2/2]

void Muon::MuonTrackTruthTool::addClusterTruth ( MuonTechnologyTruth trackTruth,
const Identifier id,
const Trk::MeasurementBase meas,
const MuonSimDataCollection simCol 
) const
private

Definition at line 591 of file MuonTrackTruthTool.cxx.

592  {
593  Identifier layid = m_idHelperSvc->layerId(id);
594  Identifier chid = m_idHelperSvc->chamberId(id);
595 
596  MuonSimDataCollection::const_iterator it = simCol.end();
597 
598  bool goodCluster = false;
599  const CompetingMuonClustersOnTrack* crot = dynamic_cast<const CompetingMuonClustersOnTrack*>(&meas);
600  if (crot) {
601  for (unsigned int i = 0; i < crot->numberOfContainedROTs(); ++i) {
602  const MuonClusterOnTrack* cluster = &crot->rioOnTrack(i);
603  if (!cluster) continue;
604  // find SimData corresponding to identifier
605  it = simCol.find(cluster->identify());
606  if (it != simCol.end()) {
607  goodCluster = true;
608  break;
609  }
610  }
611  } else {
612  // Find SimData corresponding to identifier
613  const Trk::RIO_OnTrack* rot = nullptr;
614  Trk::RoT_Extractor::extract(rot, &meas);
615  const Trk::PrepRawData* prd = rot->prepRawData();
616  if (prd) {
617  // check if an identifier from the list of RDOs is matched to that in the SDO collection
618  const std::vector<Identifier> &rdoList = prd->rdoList();
619  std::vector<Identifier>::const_iterator rit = rdoList.begin();
620  std::vector<Identifier>::const_iterator rit_end = rdoList.end();
621  for (; rit != rit_end; ++rit) {
622  it = simCol.find(*rit);
623  if (it != simCol.end()) {
624  goodCluster = true;
625  break;
626  }
627  }
628  } else {
629  it = simCol.find(id);
630  if (it != simCol.end()) goodCluster = true;
631  }
632  }
633 
634  if (!goodCluster || it == simCol.end()) {
635  truth.wrongHits.insert(id);
636  return;
637  }
638 
639  std::vector<MuonSimData::Deposit>::const_iterator dit = it->second.getdeposits().begin();
640  std::vector<MuonSimData::Deposit>::const_iterator dit_end = it->second.getdeposits().end();
641  for (; dit != dit_end; ++dit) {
642  truth.matchedHits.insert(layid);
643  truth.matchedChambers.insert(chid);
644  }
645  }

◆ addCscSimDataToTree()

void Muon::MuonTrackTruthTool::addCscSimDataToTree ( TruthTree truth_tree,
std::map< int, int > &  barcode_map,
const CscSimDataCollection simDataCol 
) const
private

Definition at line 350 of file MuonTrackTruthTool.cxx.

351  {
352  // loop over sim collection and check whether identifiers are on track
353  CscSimDataCollection::const_iterator it = simDataCol->begin();
354  CscSimDataCollection::const_iterator it_end = simDataCol->end();
355  for (; it != it_end; ++it) {
356  Identifier id = it->first;
357 
358  // loop over deposits
359  std::vector<CscSimData::Deposit>::const_iterator dit = it->second.getdeposits().begin();
360  std::vector<CscSimData::Deposit>::const_iterator dit_end = it->second.getdeposits().end();
361  for (; dit != dit_end; ++dit) {
362  int barcodeIn = manipulateBarCode(dit->first.barcode());
363  std::map<int, int>::const_iterator bit = barcode_map.find(barcodeIn);
364  if (bit == barcode_map.end()) {
365  ATH_MSG_VERBOSE(" discarding "
366  << " " << m_idHelperSvc->toString(id) << " barcode " << barcodeIn);
367  continue;
368  }
369  // replace barcode with barcode from map
370  int barcode = bit->second;
371 
372  TruthTreeIt eit = truth_tree.find(barcode);
373  if (eit == truth_tree.end()) {
374  ATH_MSG_VERBOSE(" discarding "
375  << " " << m_idHelperSvc->toString(id) << " barcode " << barcode);
376  continue;
377  }
378 
379  if (msgLvl(MSG::VERBOSE)) {
380  ATH_MSG_VERBOSE(" adding hit " << m_idHelperSvc->toString(id) << " barcode " << barcode);
381  if (barcode != barcodeIn) ATH_MSG_VERBOSE(" hit barcode " << barcodeIn);
382  }
383  eit->second.cscHits.insert(*it);
384  }
385  }
386  }

◆ addMdtTruth()

void Muon::MuonTrackTruthTool::addMdtTruth ( MuonTechnologyTruth trackTruth,
const Identifier id,
const Trk::MeasurementBase meas,
const MuonSimDataCollection simCol 
) const
private

Definition at line 556 of file MuonTrackTruthTool.cxx.

557  {
558  const MdtDriftCircleOnTrack* mdt = dynamic_cast<const MdtDriftCircleOnTrack*>(&meas);
559  if (!mdt) {
560  ATH_MSG_WARNING(" dynamic_cast to MdtDriftCircleOnTrack failed for measurement with id " << m_idHelperSvc->toString(id));
561  return;
562  }
563 
564  Identifier chid = m_idHelperSvc->chamberId(id);
565 
566  // find SimData corresponding to identifier
567  MuonSimDataCollection::const_iterator it = simCol.find(id);
568  if (it == simCol.end()) {
569  truth.wrongHits.insert(id);
570  truth.wrongChambers.insert(chid);
571  return;
572  }
573 
574  std::vector<MuonSimData::Deposit>::const_iterator dit = it->second.getdeposits().begin();
575  std::vector<MuonSimData::Deposit>::const_iterator dit_end = it->second.getdeposits().end();
576  for (; dit != dit_end; ++dit) {
577  double radius = dit->second.firstEntry();
578 
579  // check whether SDO and hit have same sign, don't check sign if drift radius < 0.3 mm as it will be badly determined
580  double checkSign = fabs(mdt->driftRadius()) > 0.3 ? radius * mdt->driftRadius() : 1;
581  if (checkSign >= 0) {
582  truth.matchedHits.insert(id);
583  truth.matchedChambers.insert(chid);
584  } else {
585  truth.wrongHits.insert(id);
586  truth.wrongChambers.insert(chid);
587  }
588  }
589  }

◆ addMissedHits() [1/2]

void Muon::MuonTrackTruthTool::addMissedHits ( MuonTechnologyTruth truth,
const std::set< Identifier > &  ids,
const std::set< Identifier > &  chids,
const CscSimDataCollection simCol,
bool  restrictedTruth 
) const
private

Definition at line 529 of file MuonTrackTruthTool.cxx.

530  {
531  // loop over sim collection and check whether identifiers are on track
532  CscSimDataCollection::const_iterator it = simCol.begin();
533  CscSimDataCollection::const_iterator it_end = simCol.end();
534  for (; it != it_end; ++it) {
535  Identifier id = m_idHelperSvc->layerId(it->first);
536 
537  int isOnTrack = ids.count(id);
538  if (isOnTrack) continue;
539 
540  // if restricted truth mode, skip if chamber has not hits
541  Identifier chid = m_idHelperSvc->chamberId(id);
542  bool chamberHasHits = chids.count(chid);
543  if (restrictedTruth && !chamberHasHits) continue;
544 
545  // loop over deposits
546  std::vector<CscSimData::Deposit>::const_iterator dit = it->second.getdeposits().begin();
547  std::vector<CscSimData::Deposit>::const_iterator dit_end = it->second.getdeposits().end();
548  for (; dit != dit_end; ++dit) {
549  truth.missedHits.insert(id);
550  // only fill a missed chamber if the chamber had no hits
551  if (!chamberHasHits) truth.missedChambers.insert(chid);
552  }
553  }
554  }

◆ addMissedHits() [2/2]

void Muon::MuonTrackTruthTool::addMissedHits ( MuonTechnologyTruth truth,
const std::set< Identifier > &  ids,
const std::set< Identifier > &  chids,
const MuonSimDataCollection simCol,
bool  restrictedTruth 
) const
private

Definition at line 500 of file MuonTrackTruthTool.cxx.

501  {
502  // loop over sim collection and check whether identifiers are on track
503  MuonSimDataCollection::const_iterator it = simCol.begin();
504  MuonSimDataCollection::const_iterator it_end = simCol.end();
505  for (; it != it_end; ++it) {
506  Identifier id = it->first;
507  // for trigger chambers use layer id
508  if (m_idHelperSvc->isTrigger(id) || m_idHelperSvc->isCsc(id)) id = m_idHelperSvc->layerId(id);
509 
510  int isOnTrack = ids.count(id);
511  if (isOnTrack) continue;
512 
513  // if restricted truth mode, skip if chamber has not hits
514  Identifier chid = m_idHelperSvc->chamberId(id);
515  bool chamberHasHits = chids.count(chid);
516  if (restrictedTruth && !chamberHasHits) continue;
517 
518  // loop over deposits
519  std::vector<MuonSimData::Deposit>::const_iterator dit = it->second.getdeposits().begin();
520  std::vector<MuonSimData::Deposit>::const_iterator dit_end = it->second.getdeposits().end();
521  for (; dit != dit_end; ++dit) {
522  truth.missedHits.insert(id);
523  // only fill a missed chamber if the chamber had no hits
524  if (!chamberHasHits) truth.missedChambers.insert(chid);
525  }
526  }
527  }

◆ addSimDataToTree()

void Muon::MuonTrackTruthTool::addSimDataToTree ( TruthTree truth_tree,
std::map< int, int > &  barcode_map,
const MuonSimDataCollection simDataCol 
) const
private

Definition at line 271 of file MuonTrackTruthTool.cxx.

272  {
273  // loop over sim collection and check whether identifiers are on track
274  MuonSimDataCollection::const_iterator it = simDataCol->begin();
275  MuonSimDataCollection::const_iterator it_end = simDataCol->end();
276  for (; it != it_end; ++it) {
277  Identifier id = it->first;
278 
279  // loop over deposits
280  std::vector<MuonSimData::Deposit>::const_iterator dit = it->second.getdeposits().begin();
281  std::vector<MuonSimData::Deposit>::const_iterator dit_end = it->second.getdeposits().end();
282  for (; dit != dit_end; ++dit) {
283  int barcodeIn = dit->first.barcode();
284  std::map<int, int>::const_iterator bit = barcode_map.find(barcodeIn);
285  if (bit == barcode_map.end()) {
286  ATH_MSG_VERBOSE(" discarding "
287  << " " << m_idHelperSvc->toString(id) << " barcode " << barcodeIn);
288  continue;
289  }
290  // replace barcode with barcode from map
291  int barcode = bit->second;
292 
293  TruthTreeIt eit = truth_tree.find(barcode);
294  if (eit == truth_tree.end()) {
295  ATH_MSG_VERBOSE(" discarding "
296  << " " << m_idHelperSvc->toString(id) << " barcode " << barcode);
297  continue;
298  }
299 
300  if (m_idHelperSvc->isMdt(id)) {
301  if (m_detMgr && !m_detMgr->getMdtReadoutElement(id)) {
302  ATH_MSG_VERBOSE(" discarding: no detEl "
303  << " " << m_idHelperSvc->toString(id) << " barcode " << barcode);
304  continue;
305  }
306  eit->second.mdtHits.insert(*it);
307  } else if (m_idHelperSvc->isRpc(id)) {
308  if (m_detMgr && !m_detMgr->getRpcReadoutElement(id)) {
309  ATH_MSG_VERBOSE(" discarding: no detEl "
310  << " " << m_idHelperSvc->toString(id) << " barcode " << barcode);
311  continue;
312  }
313 
314  if (m_idHelperSvc->stationIndex(id) == MuonStationIndex::BO && m_idHelperSvc->rpcIdHelper().doubletR(id) == 2) {
315  ATH_MSG_VERBOSE(" Discarding non existing RPC hit " << m_idHelperSvc->toString(id));
316  continue;
317  }
318 
319  eit->second.rpcHits.insert(*it);
320  } else if (m_idHelperSvc->isTgc(id)) {
321  if (m_detMgr && !m_detMgr->getTgcReadoutElement(id)) {
322  ATH_MSG_VERBOSE(" discarding: no detEl "
323  << " " << m_idHelperSvc->toString(id) << " barcode " << barcode);
324  continue;
325  }
326  eit->second.tgcHits.insert(*it);
327  } else if (m_idHelperSvc->issTgc(id)) {
328  if (m_detMgr && !m_detMgr->getsTgcReadoutElement(id)) {
329  ATH_MSG_VERBOSE(" discarding: no detEl "
330  << " " << m_idHelperSvc->toString(id) << " barcode " << barcode);
331  continue;
332  }
333  eit->second.stgcHits.insert(*it);
334  } else if (m_idHelperSvc->isMM(id)) {
335  if (m_detMgr && !m_detMgr->getMMReadoutElement(id)) {
336  ATH_MSG_VERBOSE(" discarding: no detEl "
337  << " " << m_idHelperSvc->toString(id) << " barcode " << barcode);
338  continue;
339  }
340  eit->second.mmHits.insert(*it);
341  }
342  if (msgLvl(MSG::VERBOSE)) {
343  ATH_MSG_VERBOSE(" adding hit " << m_idHelperSvc->toString(id) << " barcode " << barcode);
344  if (barcode != barcodeIn) ATH_MSG_VERBOSE(" hit barcode " << barcodeIn);
345  }
346  }
347  }
348  }

◆ createTruthTree()

const MuonTrackTruthTool::TruthTree Muon::MuonTrackTruthTool::createTruthTree ( const TrackRecordCollection truthTrackCol,
const McEventCollection mcEventCollection,
const std::vector< const MuonSimDataCollection * > &  muonSimData,
const CscSimDataCollection cscSimDataMap 
) const
virtual

create truth tree from sim data

Implements Muon::IMuonTrackTruthTool.

Definition at line 115 of file MuonTrackTruthTool.cxx.

118  {
119  std::map<int, int> barcode_map;
121  if (truthTrackCol->empty()) {
122  ATH_MSG_WARNING(" TrackRecordCollection is empty ");
123  return truth_tree;
124  }
125 
126  const HepMC::GenEvent* genEvent = nullptr;
127  if (!mcEventCollection->empty()) {
128  ATH_MSG_VERBOSE("McEventCollection size " << mcEventCollection->size());
129  if (mcEventCollection->size() == 1) genEvent = mcEventCollection->front();
130  }
131 
132  ATH_MSG_VERBOSE(" creating truth tree from track record " << truthTrackCol->size());
133 
134  TrackRecordConstIterator tr_it = truthTrackCol->begin();
135  TrackRecordConstIterator tr_it_end = truthTrackCol->end();
136  for (; tr_it != tr_it_end; ++tr_it) {
137  int PDGCode((*tr_it).GetPDGCode());
138  int barcode = (*tr_it).barcode(); // FIXME barcode-based
139  if (!m_matchAllParticles && !selectPdg(PDGCode)) {
140  ATH_MSG_VERBOSE(" discarding truth track: pdg " << PDGCode << " barcode " << barcode);
141  continue;
142  }
143 
144  // check whether barcode is already in, skip if that is the case
145  if (barcode_map.count(barcode)) {
146  ATH_MSG_VERBOSE(" barcode " << barcode << " already in map, final state barcode " << barcode_map[barcode]);
147  continue;
148  }
149  ATH_MSG_VERBOSE(" found new particle with pdgid " << PDGCode << " in truth record, barcode " << barcode);
150 
151  std::unique_ptr<TruthTrajectory> truthTrajectory;
152  // associate the muon truth with the gen event info
153  if (genEvent) {
154  HepMC::ConstGenParticlePtr genParticle = HepMC::barcode_to_particle(genEvent, (*tr_it).barcode()); // FIXME barcode-based
155  if (genParticle) {
156  truthTrajectory = std::make_unique<TruthTrajectory>();
157  m_truthTrajectoryBuilder->buildTruthTrajectory(truthTrajectory.get(), genParticle);
158  if (!truthTrajectory->empty()) {
159  // always use barcode of the 'final' particle in chain in map
160  barcode = truthTrajectory->front().barcode();
161 
162  if (msgLvl(MSG::VERBOSE)) {
163  auto particle = truthTrajectory->front().cptr();
164  ATH_MSG_VERBOSE(" found GenParticle: size " << truthTrajectory->size() << " fs barcode " << barcode << "particle "<< particle);
165  if (particle->production_vertex()) {
166  ATH_MSG_VERBOSE(" vertex: r " << particle->production_vertex()->position().perp() << " z "
167  << particle->production_vertex()->position().z());
168  }
169  }
170 
171  // now collect all barcodes beloning to this TruthTrajectory
172  std::vector<HepMcParticleLink>::const_iterator pit = truthTrajectory->begin();
173  std::vector<HepMcParticleLink>::const_iterator pit_end = truthTrajectory->end();
174  for (; pit != pit_end; ++pit) {
175  int code = (*pit).barcode();
176 
177  if (msgLvl(MSG::VERBOSE) && code != barcode) {
178  auto particle = (*pit).cptr();
179  ATH_MSG_VERBOSE(" secondary barcode: " << code << "particle "<< particle);
180  if (particle->production_vertex())
181  ATH_MSG_VERBOSE(" vertex: r " <<particle->production_vertex()->position().perp() << " z "
182  << particle->production_vertex()->position().z());
183  // sanity check
184  if (barcode_map.count(code)) ATH_MSG_VERBOSE(" pre-existing barcode " << code);
185  }
186 
187  // enter barcode
188  barcode_map[code] = barcode;
189  }
190  } else {
191  ATH_MSG_WARNING(" empty truth trajectory " << barcode);
192  }
193  }
194  } else {
195  // add one to one relation
196  barcode_map[barcode] = barcode;
197  }
198 
199  if (truth_tree.count(barcode)) {
200  ATH_MSG_WARNING(" found muon barcode twice in truth record: " << barcode);
201  continue;
202  }
203 
204  TruthTreeEntry& entry = truth_tree[barcode];
205  entry.truthTrack = &(*tr_it);
206  // entry.truthTrajectory = truthTrajectory.get();
207  entry.truthTrajectory = std::move(truthTrajectory);
208  // m_truthTrajectoriesToBeDeleted.push_back(std::move(truthTrajectory));
209  }
210 
211  // add sim data collections
212  for (const MuonSimDataCollection* simDataMap : muonSimData) { addSimDataToTree(truth_tree, barcode_map, simDataMap); }
213  if (cscSimDataMap) { addCscSimDataToTree(truth_tree, barcode_map, cscSimDataMap); }
214 
215  unsigned int ngood(0);
216  std::vector<int> badBarcodes;
217  // erase entries with too few hits or no track record
218  TruthTreeIt it = truth_tree.begin();
219  for (; it != truth_tree.end(); ++it) {
220  bool erase = false;
221  unsigned int nhits = it->second.mdtHits.size() + it->second.rpcHits.size() + it->second.tgcHits.size() +
222  it->second.cscHits.size() + it->second.stgcHits.size() + it->second.mmHits.size();
223  if (!it->second.truthTrack) erase = true;
224  if (nhits < m_minHits) erase = true;
225 
226  if (erase) {
227  ATH_MSG_VERBOSE(" Erasing entry: barcode " << it->second.truthTrack->barcode() << " manip "
228  << manipulateBarCode(it->second.truthTrack->barcode()) << " hits " << nhits); // FIXME barcode-based
229  badBarcodes.push_back(it->first);
230  } else {
231  ++ngood;
232  ATH_MSG_VERBOSE(" Keeping entry: barcode " << it->second.truthTrack->barcode() << " manip "
233  << manipulateBarCode(it->second.truthTrack->barcode()) << " hits " << nhits); // FIXME barcode-based
234  }
235  }
236 
237  std::vector<int>::iterator badIt = badBarcodes.begin();
238  std::vector<int>::iterator badIt_end = badBarcodes.end();
239  for (; badIt != badIt_end; ++badIt) truth_tree.erase(*badIt);
240 
241  if (ngood != truth_tree.size()) {
242  ATH_MSG_WARNING(" Problem cleaning map: size " << truth_tree.size() << " accepted entries " << ngood);
243  }
244 
245  if (m_doSummary || msgLvl(MSG::DEBUG)) {
246  ATH_MSG_INFO(" summarizing truth tree: number of particles " << truth_tree.size());
247  TruthTreeIt it = truth_tree.begin();
248  TruthTreeIt it_end = truth_tree.end();
249  for (; it != it_end; ++it) {
250  if (!it->second.truthTrack)
251  ATH_MSG_INFO(" no TrackRecord ");
252  else {
253  ATH_MSG_INFO(" PDG " << it->second.truthTrack->GetPDGCode() << " barcode " << it->second.truthTrack->barcode()
254  << " manip " << manipulateBarCode(it->second.truthTrack->barcode())); // FIXME barcode-based
255  }
256  if (!it->second.mdtHits.empty()) ATH_MSG_INFO(" mdt " << it->second.mdtHits.size());
257  if (!it->second.rpcHits.empty()) ATH_MSG_INFO(" rpc " << it->second.rpcHits.size());
258  if (!it->second.tgcHits.empty()) ATH_MSG_INFO(" tgc " << it->second.tgcHits.size());
259  if (!it->second.cscHits.empty()) ATH_MSG_INFO(" csc " << it->second.cscHits.size());
260  if (!it->second.stgcHits.empty()) ATH_MSG_INFO(" stgc " << it->second.stgcHits.size());
261  if (!it->second.mmHits.empty()) ATH_MSG_INFO(" mm " << it->second.mmHits.size());
262  if (it->second.mdtHits.empty() && it->second.rpcHits.empty() && it->second.tgcHits.empty() && it->second.cscHits.empty() &&
263  it->second.stgcHits.empty() && it->second.mmHits.empty())
264  ATH_MSG_INFO(" no hits ");
265  }
266  }
267 
268  return truth_tree;
269  }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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

◆ getAncestor()

HepMC::ConstGenParticlePtr Muon::MuonTrackTruthTool::getAncestor ( const TruthTrajectory traj,
const int  barcodeIn 
) const
virtual

Returns the ancestor particle of the particle with barcodeIn if it is found in the truth trajectory.

Ancestor here means the last particle at generator level that has a status code different from final state, e.g. Z

Implements Muon::IMuonTrackTruthTool.

Definition at line 689 of file MuonTrackTruthTool.cxx.

689  {
690  bool foundBC = false;
691  for (const auto& pit : traj) {
692  if (!pit) continue;
693  if (pit.barcode() == barcodeIn || foundBC) {
694  foundBC = true;
695 #ifdef HEPMC3
696  auto particle = pit.scptr();
697 #else
698  auto particle = pit.cptr();
699 #endif
700  if (!MC::isStable(particle)) { // first non final state particle
701  return particle;
702  }
703  }
704  }
705  return nullptr;
706  }

◆ getInitial()

HepMC::ConstGenParticlePtr Muon::MuonTrackTruthTool::getInitial ( const TruthTrajectory traj,
const int  barcodeIn 
) const
virtual

Returns the initial particle of the particle with barcodeIn if it is found in the truth trajectory.

For example a mu undergoing a mubrem would create a second mu, in which case this method returns the mu prior to bremsstrahlung. This interface calls the method getInitialPair.

Implements Muon::IMuonTrackTruthTool.

Definition at line 768 of file MuonTrackTruthTool.cxx.

768  {
769  return getInitialPair(traj, barcodeIn).first;
770  }

◆ getInitialPair()

const std::pair< HepMC::ConstGenParticlePtr, unsigned int > Muon::MuonTrackTruthTool::getInitialPair ( const TruthTrajectory traj,
const int  barcodeIn 
) const
private

Returns the initial particle of the particle with barcodeIn if it is found in the truth trajectory.

For example a mu undergoing a mubrem would create a second mu, in which case this method returns the mu prior to bremsstrahlung. The number of such scatters is returned in the .second.

Definition at line 708 of file MuonTrackTruthTool.cxx.

709  {
710  std::pair<HepMC::ConstGenParticlePtr, unsigned int> thePair(nullptr, 0);
711  unsigned int scat = 0;
712  ATH_MSG_DEBUG("getFirst() : size = " << traj.size());
713  bool foundBC = false;
714  int pdgFinal = 0;
715  double ePrev = 0.;
716  HepMC::ConstGenParticlePtr theFirst{nullptr};
717  for (auto pit = traj.begin(); pit != traj.end(); ++pit) {
718  if ((*pit).barcode() == barcodeIn || foundBC) {
719  auto particle = (*pit).scptr();
720 #ifdef HEPMC3
721  if (!foundBC) {
722  foundBC = true;
723  theFirst = particle;
724  pdgFinal = particle->pdg_id();
725  } else {
726  if (particle->pdg_id() == pdgFinal) {
727  const auto& pit_p = *pit;
728  if ((theFirst != pit_p.scptr()) && (particle->momentum().t() != ePrev))
729  ++scat; // if the particle has not changed pdgid after the first step count as scatter. also avoid counting
730  // pure interface changes as scatter
731  } else { // the first time this particle appears
732  --pit; // AV This is confusing
733  theFirst = (*pit).scptr();
734  break;
735  }
736  }
737 #else
738  if (!foundBC) {
739  foundBC = true;
740  theFirst = (*pit).cptr();
741  pdgFinal = (*pit)->pdg_id();
742  } else {
743  if ((*pit)->pdg_id() == pdgFinal) {
744  auto pit_p = *pit;
745  if ((theFirst != pit_p.cptr()) && ((*pit).cptr()->momentum().t() != ePrev))
746  ++scat; // if the particle has not changed pdgid after the first step count as scatter. also avoid counting
747  // pure interface changes as scatter
748  } else { // the first time this particle appears
749  --pit;
750  theFirst = (*pit).cptr();
751  break;
752  }
753  }
754 #endif
755  ATH_MSG_DEBUG("getFirst() : pt = " << particle->momentum().perp() << " scat = " << scat);
756  ePrev = particle->momentum().t(); // prepare for comparing this entry with the next one
757  }
758  }
759  // sanity check
760  if (theFirst && theFirst->pdg_id() != pdgFinal) ATH_MSG_ERROR("Wrong pdgId association in getFirst()");
761  ATH_MSG_DEBUG("Number of scatters = " << scat << " pdgId = " << pdgFinal);
762 
763  thePair.first = theFirst;
764  thePair.second = scat;
765  return thePair;
766  }

◆ getMother()

HepMC::ConstGenParticlePtr Muon::MuonTrackTruthTool::getMother ( const TruthTrajectory traj,
const int  barcodeIn 
) const
virtual

Returns the mother particle of the particle with barcodeIn if it is found in the truth trajectory.

It traces the decay chain until if finds the first particle that is different flavor from the starting one.

Implements Muon::IMuonTrackTruthTool.

Definition at line 667 of file MuonTrackTruthTool.cxx.

667  {
668  ATH_MSG_DEBUG("getMother() : size = " << traj.size());
669  int pdgFinal = ((traj.empty()) ? -999 : traj.front().cptr()->pdg_id());
670  bool foundBC = false;
671  for (const auto& pit : traj) {
672  if (!pit) continue;
673  if (pit.barcode() == barcodeIn || foundBC) {
674  foundBC = true;
675  ATH_MSG_DEBUG("getMother() : " << pit );
676 #ifdef HEPMC3
677  auto particle = pit.scptr();
678 #else
679  auto particle = pit.cptr();
680 #endif
681  if (particle->pdg_id() != pdgFinal) { // the first case a track had a different flavour
682  break;
683  }
684  }
685  }
686  return nullptr;
687  }

◆ getNumberOfScatters()

unsigned int Muon::MuonTrackTruthTool::getNumberOfScatters ( const TruthTrajectory traj,
const int  barcodeIn 
) const
virtual

Returns the number of steps a particle took while maintaining its PDG ID.

This method calls getInitialPair for calculating this number.

Implements Muon::IMuonTrackTruthTool.

Definition at line 772 of file MuonTrackTruthTool.cxx.

772  {
773  return (getInitialPair(traj, barcodeIn)).second;
774  }

◆ getTruth() [1/5]

MuonTrackTruth Muon::MuonTrackTruthTool::getTruth ( const std::vector< const Trk::MeasurementBase * > &  measurements,
const TruthTreeEntry truthEntry,
bool  restrictedTruth 
) const
private

Definition at line 452 of file MuonTrackTruthTool.cxx.

453  {
454  MuonTrackTruth trackTruth;
455  trackTruth.truthTrack = truthEntry.truthTrack;
456  trackTruth.truthTrajectory = truthEntry.truthTrajectory;
457 
458  std::vector<const Trk::MeasurementBase*>::const_iterator mit = measurements.begin();
459  std::vector<const Trk::MeasurementBase*>::const_iterator mit_end = measurements.end();
460  for (; mit != mit_end; ++mit) {
461  // check whether state is a measurement
462  const Trk::MeasurementBase* meas = *mit;
463  if (!meas) { continue; }
464 
465  const Trk::RIO_OnTrack* rot = nullptr;
466  Trk::RoT_Extractor::extract(rot, meas);
467  if (!rot) {
468  if (!dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(meas)) ATH_MSG_WARNING(" Could not get rot from measurement ");
469  continue;
470  }
471  Identifier id = rot->identify();
472  if (!id.is_valid() || !m_idHelperSvc->mdtIdHelper().is_muon(id)) continue;
473 
474  if (m_idHelperSvc->isMdt(id)) {
475  addMdtTruth(trackTruth.mdts, id, *meas, truthEntry.mdtHits);
476  } else if (m_idHelperSvc->isCsc(id)) {
477  addClusterTruth(trackTruth.cscs, id, *meas, truthEntry.cscHits);
478  } else if (m_idHelperSvc->isRpc(id)) {
479  addClusterTruth(trackTruth.rpcs, id, *meas, truthEntry.rpcHits);
480  } else if (m_idHelperSvc->isTgc(id)) {
481  addClusterTruth(trackTruth.tgcs, id, *meas, truthEntry.tgcHits);
482  } else if (m_idHelperSvc->issTgc(id)) {
483  addClusterTruth(trackTruth.stgcs, id, *meas, truthEntry.stgcHits);
484  } else if (m_idHelperSvc->isMM(id)) {
485  addClusterTruth(trackTruth.mms, id, *meas, truthEntry.mmHits);
486  }
487  }
488 
489  addMissedHits(trackTruth.mdts, trackTruth.mdts.matchedHits, trackTruth.mdts.matchedChambers, truthEntry.mdtHits, restrictedTruth);
490  addMissedHits(trackTruth.cscs, trackTruth.cscs.matchedHits, trackTruth.cscs.matchedChambers, truthEntry.cscHits, restrictedTruth);
491  addMissedHits(trackTruth.rpcs, trackTruth.rpcs.matchedHits, trackTruth.rpcs.matchedChambers, truthEntry.rpcHits, restrictedTruth);
492  addMissedHits(trackTruth.tgcs, trackTruth.tgcs.matchedHits, trackTruth.tgcs.matchedChambers, truthEntry.tgcHits, restrictedTruth);
493  addMissedHits(trackTruth.stgcs, trackTruth.stgcs.matchedHits, trackTruth.stgcs.matchedChambers, truthEntry.stgcHits,
494  restrictedTruth);
495  addMissedHits(trackTruth.mms, trackTruth.mms.matchedHits, trackTruth.mms.matchedChambers, truthEntry.mmHits, restrictedTruth);
496 
497  return trackTruth;
498  }

◆ getTruth() [2/5]

MuonTrackTruth Muon::MuonTrackTruthTool::getTruth ( const TruthTree truth_tree,
const Muon::MuonSegment segment 
) const
virtual

get segment truth

Implements Muon::IMuonTrackTruthTool.

Definition at line 388 of file MuonTrackTruthTool.cxx.

388  {
389  return getTruth(truth_tree, segment.containedMeasurements(), true);
390  }

◆ getTruth() [3/5]

MuonTrackTruth Muon::MuonTrackTruthTool::getTruth ( const TruthTree truth_tree,
const std::vector< const MuonSegment * > &  segments,
bool  restrictedTruth = false 
) const
virtual

get segment truth for a list of segments, the segments will be considered to belong to the same muon

Implements Muon::IMuonTrackTruthTool.

Definition at line 397 of file MuonTrackTruthTool.cxx.

398  {
399  std::set<Identifier> ids;
400  std::vector<const Trk::MeasurementBase*> measurements;
401  std::vector<const MuonSegment*>::const_iterator sit = segments.begin();
402  std::vector<const MuonSegment*>::const_iterator sit_end = segments.end();
403  for (; sit != sit_end; ++sit) {
404  std::vector<const Trk::MeasurementBase*>::const_iterator mit = (*sit)->containedMeasurements().begin();
405  std::vector<const Trk::MeasurementBase*>::const_iterator mit_end = (*sit)->containedMeasurements().end();
406  for (; mit != mit_end; ++mit) {
407  const Trk::MeasurementBase* meas = *mit;
408  const Trk::RIO_OnTrack* rot = nullptr;
409  Trk::RoT_Extractor::extract(rot, meas);
410  if (!rot) {
411  if (!dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(meas)) ATH_MSG_WARNING(" Could not get rot from measurement ");
412  continue;
413  }
414  Identifier id = rot->identify();
415  if (!id.is_valid() || !m_idHelperSvc->mdtIdHelper().is_muon(id)) continue;
416  if (ids.count(id)) continue;
417  measurements.push_back(meas);
418  ids.insert(id);
419  }
420  }
421  return getTruth(truth_tree, measurements, restrictedTruth);
422  }

◆ getTruth() [4/5]

MuonTrackTruth Muon::MuonTrackTruthTool::getTruth ( const TruthTree truth_tree,
const std::vector< const Trk::MeasurementBase * > &  measurements,
bool  restrictedTruth = false 
) const
virtual

get truth for a give set of hits.

If restrictedTruth is set to true only missed hits in chambers with hits will be counted.

Implements Muon::IMuonTrackTruthTool.

Definition at line 424 of file MuonTrackTruthTool.cxx.

425  {
426  MuonTrackTruth bestMatch;
427  bestMatch.truthTrack = nullptr;
428  bestMatch.truthTrajectory = nullptr;
429 
430  unsigned int nmatchedHitsBest = 0;
431  // loop over muons and match hits
432  TruthTreeConstIt tit = truth_tree.begin();
433  TruthTreeConstIt tit_end = truth_tree.end();
434  for (; tit != tit_end; ++tit) {
435  unsigned int nhits = tit->second.mdtHits.size() + tit->second.cscHits.size() + tit->second.rpcHits.size() +
436  tit->second.tgcHits.size() + tit->second.stgcHits.size() + tit->second.mmHits.size();
437  if (nhits == 0) continue;
438 
439  MuonTrackTruth trackTruth = getTruth(measurements, tit->second, restrictedTruth);
440  unsigned int nmatchedHits = trackTruth.numberOfMatchedHits();
441  ATH_MSG_DEBUG(" performed truth match for particle with barcode: " << tit->first << " overlap " << nmatchedHits << " fraction "
442  << (double)nmatchedHits / (double)nhits);
443  if (nmatchedHits > 0 && nmatchedHits > nmatchedHitsBest) {
444  bestMatch = trackTruth;
445  nmatchedHitsBest = nmatchedHits;
446  }
447  }
448 
449  return bestMatch;
450  }

◆ getTruth() [5/5]

MuonTrackTruth Muon::MuonTrackTruthTool::getTruth ( const TruthTree truth_tree,
const Trk::Track track,
bool  restrictedTruth = false 
) const
virtual

get track truth

Implements Muon::IMuonTrackTruthTool.

Definition at line 392 of file MuonTrackTruthTool.cxx.

392  {
393  if (track.measurementsOnTrack()) return getTruth(truth_tree, track.measurementsOnTrack()->stdcont(), restrictedTruth);
394  return {};
395  }

◆ initialize()

StatusCode Muon::MuonTrackTruthTool::initialize ( )

AlgTool initilize.

Definition at line 30 of file MuonTrackTruthTool.cxx.

30  {
32  ATH_CHECK(m_idHelperSvc.retrieve());
33  ATH_CHECK(m_printer.retrieve());
35 
36  // add muons
37  if (m_pdgsToBeConsidered.value().empty()) {
38  m_selectedPdgs.insert(13);
39  m_selectedPdgs.insert(-13);
40  } else {
41  // add pdgs
42  for (auto pdg : m_pdgsToBeConsidered.value()) { m_selectedPdgs.insert(pdg); }
43  ATH_MSG_DEBUG(" PDG codes used for matching");
44  for (auto val : m_selectedPdgs) { ATH_MSG_DEBUG(" " << val); }
45  }
46  return StatusCode::SUCCESS;
47  }

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

◆ interfaceID()

const InterfaceID & Muon::IMuonTrackTruthTool::interfaceID ( )
inlinestaticinherited

access to tool interface

Definition at line 144 of file IMuonTrackTruthTool.h.

144 { return IID_IMuonTrackTruthTool; }

◆ manipulateBarCode()

int Muon::MuonTrackTruthTool::manipulateBarCode ( int  barcode) const
private

Definition at line 49 of file MuonTrackTruthTool.cxx.

49  {
50  if (m_manipulateBarCode) return barcode % 10000;
51  return barcode;
52  }

◆ match() [1/2]

MuonTrackTruthTool::SegmentResultVec Muon::MuonTrackTruthTool::match ( const TruthTree truth_tree,
const std::vector< const MuonSegment * > &  segments 
) const
virtual

perform truth matching for a given set of segments

Implements Muon::IMuonTrackTruthTool.

Definition at line 96 of file MuonTrackTruthTool.cxx.

97  {
99  result.reserve(segments.size());
100 
101  // loop over tracks and match each of them with truth
102  std::vector<const MuonSegment*>::const_iterator sit = segments.begin();
103  std::vector<const MuonSegment*>::const_iterator sit_end = segments.end();
104  for (; sit != sit_end; ++sit) {
105  // create truth association
106  result.emplace_back(*sit, getTruth(truth_tree, **sit));
107  }
108 
109  // sort result per muon and per number of matched hits
110  std::stable_sort(result.begin(), result.end(), SortResultByMatchedHits());
111 
112  return result;
113  }

◆ match() [2/2]

MuonTrackTruthTool::ResultVec Muon::MuonTrackTruthTool::match ( const TruthTree truth_tree,
const TrackCollection tracks 
) const
virtual

perform truth matching for a given set of tracks

Implements Muon::IMuonTrackTruthTool.

Definition at line 73 of file MuonTrackTruthTool.cxx.

73  {
75  result.reserve(tracks.size());
76 
77  // loop over tracks and match each of them with truth
79  TrackCollection::const_iterator tit_end = tracks.end();
80  for (; tit != tit_end; ++tit) {
81  MuonTrackTruth match = getTruth(truth_tree, **tit);
82  if (!match.truthTrack) continue;
83 
84  if (match.numberOfMatchedHits() == 0) continue;
85 
86  // create truth association
87  result.emplace_back(*tit, match);
88  }
89 
90  // sort result per muon and per number of matched hits
91  std::stable_sort(result.begin(), result.end(), SortResultByMatchedHits());
92 
93  return result;
94  }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

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

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ selectPdg()

bool Muon::MuonTrackTruthTool::selectPdg ( int  pdg) const
inlineprivate

Definition at line 132 of file MuonTrackTruthTool.h.

132 { return m_selectedPdgs.count(pdg); }

◆ 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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detMgr

const MuonGM::MuonDetectorManager* Muon::MuonTrackTruthTool::m_detMgr
private

Definition at line 139 of file MuonTrackTruthTool.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_doSummary

Gaudi::Property<bool> Muon::MuonTrackTruthTool::m_doSummary {this, "DoSummary", false}
private

Definition at line 148 of file MuonTrackTruthTool.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_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonTrackTruthTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 141 of file MuonTrackTruthTool.h.

◆ m_manipulateBarCode

Gaudi::Property<bool> Muon::MuonTrackTruthTool::m_manipulateBarCode {this, "ManipulateBarCode", false}
private

Definition at line 147 of file MuonTrackTruthTool.h.

◆ m_matchAllParticles

Gaudi::Property<bool> Muon::MuonTrackTruthTool::m_matchAllParticles {this, "MatchAllParticles", true}
private

Definition at line 149 of file MuonTrackTruthTool.h.

◆ m_minHits

Gaudi::Property<unsigned int> Muon::MuonTrackTruthTool::m_minHits {this, "MinHits", 4}
private

Definition at line 150 of file MuonTrackTruthTool.h.

◆ m_pdgsToBeConsidered

Gaudi::Property<std::vector<int> > Muon::MuonTrackTruthTool::m_pdgsToBeConsidered {this, "ConsideredPDGs", {}}
private

Definition at line 151 of file MuonTrackTruthTool.h.

◆ m_printer

ToolHandle<Muon::MuonEDMPrinterTool> Muon::MuonTrackTruthTool::m_printer {this, "Printer", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"}
private

Definition at line 143 of file MuonTrackTruthTool.h.

◆ m_selectedPdgs

std::set<int> Muon::MuonTrackTruthTool::m_selectedPdgs
private

Definition at line 153 of file MuonTrackTruthTool.h.

◆ m_truthTrajectoryBuilder

ToolHandle<Trk::ITruthTrajectoryBuilder> Muon::MuonTrackTruthTool::m_truthTrajectoryBuilder
private
Initial value:
{
this, "TruthTrajectoryBuilder", "Muon::MuonDecayTruthTrajectoryBuilder/MuonDecayTruthTrajectoryBuilder"}

Definition at line 144 of file MuonTrackTruthTool.h.

◆ 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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonGM::MuonDetectorManager::getRpcReadoutElement
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:168
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
get_generator_info.result
result
Definition: get_generator_info.py:21
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Muon::MuonTrackTruthTool::m_printer
ToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: MuonTrackTruthTool.h:143
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Muon::MuonTrackTruthTool::m_selectedPdgs
std::set< int > m_selectedPdgs
Definition: MuonTrackTruthTool.h:153
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Muon::IMuonTrackTruthTool::TruthTreeIt
TruthTree::iterator TruthTreeIt
Definition: IMuonTrackTruthTool.h:94
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Muon::MuonTrackTruthTool::addClusterTruth
void addClusterTruth(MuonTechnologyTruth &trackTruth, const Identifier &id, const Trk::MeasurementBase &meas, const MuonSimDataCollection &simCol) const
Definition: MuonTrackTruthTool.cxx:591
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TrackRecordConstIterator
AtlasHitsVector< TrackRecord >::const_iterator TrackRecordConstIterator
Definition: TrackRecordCollection.h:14
Muon::MuonTrackTruthTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonTrackTruthTool.h:141
AtlasHitsVector::begin
const_iterator begin() const
Definition: AtlasHitsVector.h:131
std::stable_sort
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
Definition: DVL_algorithms.h:711
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::RoT_Extractor::extract
static void extract(std::vector< const RIO_OnTrack * > &rots, const std::vector< const MeasurementBase * > &measurements)
AtlasHitsVector::empty
bool empty() const
Definition: AtlasHitsVector.h:129
MuonGM::MuonDetectorManager::getTgcReadoutElement
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:247
inspect_truth_file.truth_tree
truth_tree
Definition: inspect_truth_file.py:75
Trk::PseudoMeasurementOnTrack
Class to handle pseudo-measurements in fitters and on track objects.
Definition: PseudoMeasurementOnTrack.h:44
TileDCSDataPlotter.tit
tit
Definition: TileDCSDataPlotter.py:890
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MuonGM::MuonDetectorManager::getMdtReadoutElement
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:204
HepMC::barcode_to_particle
GenParticle * barcode_to_particle(const GenEvent *e, int id)
Definition: GenEvent.h:506
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
MuonSimDataCollection
Definition: MuonSimDataCollection.h:21
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
Muon::MuonTrackTruthTool::m_manipulateBarCode
Gaudi::Property< bool > m_manipulateBarCode
Definition: MuonTrackTruthTool.h:147
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MuonTrackTruthTool::getTruth
MuonTrackTruth getTruth(const TruthTree &truth_tree, const Trk::Track &track, bool restrictedTruth=false) const
get track truth
Definition: MuonTrackTruthTool.cxx:392
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Muon::MuonTrackTruthTool::m_truthTrajectoryBuilder
ToolHandle< Trk::ITruthTrajectoryBuilder > m_truthTrajectoryBuilder
Definition: MuonTrackTruthTool.h:144
Muon::MuonTrackTruthTool::m_matchAllParticles
Gaudi::Property< bool > m_matchAllParticles
Definition: MuonTrackTruthTool.h:149
Muon::MuonTrackTruthTool::addSimDataToTree
void addSimDataToTree(TruthTree &truth_tree, std::map< int, int > &barcode_map, const MuonSimDataCollection *simDataCol) const
Definition: MuonTrackTruthTool.cxx:271
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
Muon::IMuonTrackTruthTool::TruthTreeConstIt
TruthTree::const_iterator TruthTreeConstIt
Definition: IMuonTrackTruthTool.h:95
Muon::MuonTrackTruthTool::m_detMgr
const MuonGM::MuonDetectorManager * m_detMgr
Definition: MuonTrackTruthTool.h:139
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Trk::PrepRawData
Definition: PrepRawData.h:62
Trk::MeasurementBase
Definition: MeasurementBase.h:58
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
Muon::MuonTrackTruthTool::m_pdgsToBeConsidered
Gaudi::Property< std::vector< int > > m_pdgsToBeConsidered
Definition: MuonTrackTruthTool.h:151
pmontree.code
code
Definition: pmontree.py:443
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Muon::MuonTrackTruthTool::m_minHits
Gaudi::Property< unsigned int > m_minHits
Definition: MuonTrackTruthTool.h:150
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
Muon::MuonTrackTruthTool::selectPdg
bool selectPdg(int pdg) const
Definition: MuonTrackTruthTool.h:132
Muon::IMuonTrackTruthTool::SegmentResultVec
std::vector< SegmentMatchResult > SegmentResultVec
Definition: IMuonTrackTruthTool.h:90
Muon::MuonTrackTruthTool::addMissedHits
void addMissedHits(MuonTechnologyTruth &truth, const std::set< Identifier > &ids, const std::set< Identifier > &chids, const MuonSimDataCollection &simCol, bool restrictedTruth) const
Definition: MuonTrackTruthTool.cxx:500
Muon::MuonTrackTruthTool::manipulateBarCode
int manipulateBarCode(int barcode) const
Definition: MuonTrackTruthTool.cxx:49
Trk::RIO_OnTrack::prepRawData
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
Muon::MuonTrackTruthTool::getInitialPair
const std::pair< HepMC::ConstGenParticlePtr, unsigned int > getInitialPair(const TruthTrajectory &traj, const int barcodeIn) const
Returns the initial particle of the particle with barcodeIn if it is found in the truth trajectory.
Definition: MuonTrackTruthTool.cxx:708
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Muon::IMuonTrackTruthTool::TruthTree
std::map< int, TruthTreeEntry > TruthTree
Definition: IMuonTrackTruthTool.h:93
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Muon::MuonStationIndex::BO
@ BO
Definition: MuonStationIndex.h:25
Muon::MuonTrackTruthTool::match
ResultVec match(const TruthTree &truth_tree, const TrackCollection &tracks) const
perform truth matching for a given set of tracks
Definition: MuonTrackTruthTool.cxx:73
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AtlasHitsVector::end
const_iterator end() const
Definition: AtlasHitsVector.h:134
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
Muon::MuonTrackTruthTool::m_doSummary
Gaudi::Property< bool > m_doSummary
Definition: MuonTrackTruthTool.h:148
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:255
DEBUG
#define DEBUG
Definition: page_access.h:11
Trk::RIO_OnTrack::identify
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:155
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AtlasHitsVector::size
size_type size() const
Definition: AtlasHitsVector.h:143
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Muon::IMuonTrackTruthTool::ResultVec
std::vector< MatchResult > ResultVec
Definition: IMuonTrackTruthTool.h:87
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
MuonGM::MuonDetectorManager::getsTgcReadoutElement
const sTgcReadoutElement * getsTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:259
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
Muon::MuonTrackTruthTool::addCscSimDataToTree
void addCscSimDataToTree(TruthTree &truth_tree, std::map< int, int > &barcode_map, const CscSimDataCollection *simDataCol) const
Definition: MuonTrackTruthTool.cxx:350
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
Muon::MuonTrackTruthTool::addMdtTruth
void addMdtTruth(MuonTechnologyTruth &trackTruth, const Identifier &id, const Trk::MeasurementBase &meas, const MuonSimDataCollection &simCol) const
Definition: MuonTrackTruthTool.cxx:556