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

#include <MuonTruthDecorationAlg.h>

Inheritance diagram for Muon::MuonTruthDecorationAlg:
Collaboration diagram for Muon::MuonTruthDecorationAlg:

Public Types

typedef std::map< Muon::MuonStationIndex::ChIndex, std::vector< Identifier > > ChamberIdMap
 

Public Member Functions

 MuonTruthDecorationAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &ctx) const override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
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 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
 

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

StatusCode addTrackRecords (const EventContext &ctx, xAOD::TruthParticle &truthParticle) const
 
StatusCode addHitCounts (const EventContext &ctx, xAOD::TruthParticle &truthParticle, ChamberIdMap &ids) const
 
void addHitIDVectors (xAOD::TruthParticle &truthParticle, const MuonTruthDecorationAlg::ChamberIdMap &ids) const
 
StatusCode createSegments (const EventContext &ctx, const ElementLink< xAOD::TruthParticleContainer > &truthLink, SG::WriteHandle< xAOD::MuonSegmentContainer > &segmentContainer, const ChamberIdMap &ids) const
 
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

SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthParticleContainerName {this, "TruthParticleContainerName", "TruthParticles"}
 
SG::WriteHandleKey< xAOD::TruthParticleContainerm_muonTruthParticleContainerName
 
SG::WriteHandleKey< xAOD::MuonSegmentContainerm_muonTruthSegmentContainerName {this, "MuonTruthSegmentName", "MuonTruthSegments"}
 
SG::ReadHandleKeyArray< TrackRecordCollectionm_trackRecordCollectionNames
 
SG::ReadHandleKeyArray< PRD_MultiTruthCollectionm_PRD_TruthNames
 
SG::ReadHandleKeyArray< MuonSimDataCollectionm_SDO_TruthNames
 
SG::ReadHandleKey< CscSimDataCollectionm_CSC_SDO_TruthNames {this, "CSCSDOs", "CSC_SDO"}
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandle< IMCTruthClassifierm_truthClassifier {this, "MCTruthClassifier", "MCTruthClassifier/MCTruthClassifier"}
 
ToolHandle< Trk::IExtrapolatorm_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
 
Gaudi::Property< bool > m_createTruthSegment {this, "CreateTruthSegments", true}
 
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_detMgrKey
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
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

Definition at line 39 of file MuonTruthDecorationAlg.h.

Member Typedef Documentation

◆ ChamberIdMap

Definition at line 41 of file MuonTruthDecorationAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonTruthDecorationAlg()

Muon::MuonTruthDecorationAlg::MuonTruthDecorationAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 65 of file MuonTruthDecorationAlg.cxx.

65  :
66  AthReentrantAlgorithm(name, pSvcLocator) {}

Member Function Documentation

◆ addHitCounts()

StatusCode Muon::MuonTruthDecorationAlg::addHitCounts ( const EventContext &  ctx,
xAOD::TruthParticle truthParticle,
ChamberIdMap ids 
) const
private

Definition at line 490 of file MuonTruthDecorationAlg.cxx.

492  {
493 
494  std::vector<unsigned int> nprecHitsPerChamberLayer;
495  nprecHitsPerChamberLayer.resize(Muon::MuonStationIndex::ChIndexMax);
496  std::vector<unsigned int> nphiHitsPerChamberLayer;
497  nphiHitsPerChamberLayer.resize(Muon::MuonStationIndex::PhiIndexMax);
498  std::vector<unsigned int> ntrigEtaHitsPerChamberLayer;
499  ntrigEtaHitsPerChamberLayer.resize(Muon::MuonStationIndex::PhiIndexMax);
500  ATH_MSG_DEBUG("addHitCounts: barcode " << HepMC::barcode(truthParticle)); // FIXME barcode-based
501  auto truthParticleHistory = HepMC::simulation_history(&truthParticle, -1); // Returns a list of uniqueIDs (currently for xAOD::TruthParticle these would be barcodes)
502  // loop over detector technologies
504  if (!col.isPresent()) {
505  ATH_MSG_FATAL("PRD_MultiTruthCollection " << col.name() << " not in StoreGate");
506  return StatusCode::FAILURE;
507  }
508  // loop over trajectories
509  for (const auto& trajectory : *col) {
510  // check if gen particle same as input
511  if (std::find(truthParticleHistory.begin(),truthParticleHistory.end(), HepMC::barcode(trajectory.second)) == truthParticleHistory.end()) continue; // FIXME barcode-based TrackRecords read in from existing inputs will not have valid id values.
512 
513  const Identifier& id = trajectory.first;
514  bool measPhi = m_idHelperSvc->measuresPhi(id);
515  bool isTgc = m_idHelperSvc->isTgc(id);
517  // add identifier to map
518  if (isTgc) { // TGCS should be added to both EIL and EIS
521  ids[Muon::MuonStationIndex::EIS].push_back(id);
522  ids[Muon::MuonStationIndex::EIL].push_back(id);
523  } else {
524  ids[Muon::MuonStationIndex::EMS].push_back(id);
525  ids[Muon::MuonStationIndex::EML].push_back(id);
526  }
527  } else {
528  ids[chIndex].push_back(id);
529  }
530 
531  if (m_idHelperSvc->issTgc(id)) {
532  if (measPhi) {
533  int index = m_idHelperSvc->phiIndex(id);
534  ++nphiHitsPerChamberLayer.at(index);
535  } else {
536  ++nprecHitsPerChamberLayer.at(chIndex);
537  }
538  } else if (m_idHelperSvc->isMM(id)) {
539  ++nprecHitsPerChamberLayer.at(chIndex);
540  } else if (m_idHelperSvc->isTrigger(id)) {
541  int index = m_idHelperSvc->phiIndex(id);
542  if (index >= 0) {
543  if (measPhi)
544  ++nphiHitsPerChamberLayer.at(index);
545  else
546  ++ntrigEtaHitsPerChamberLayer.at(index);
547  }
548  } else {
549  if (measPhi) {
551  ++nphiHitsPerChamberLayer.at(index);
552 
553  } else {
554  ++nprecHitsPerChamberLayer.at(chIndex);
555  }
556  }
557  }
558  }
559 
560  uint8_t innerSmallHits = nprecHitsPerChamberLayer[Muon::MuonStationIndex::BIS] +
561  nprecHitsPerChamberLayer[Muon::MuonStationIndex::EIS] +
562  nprecHitsPerChamberLayer[Muon::MuonStationIndex::CSS];
563 
564  uint8_t innerLargeHits = nprecHitsPerChamberLayer[Muon::MuonStationIndex::BIL] +
565  nprecHitsPerChamberLayer[Muon::MuonStationIndex::EIL] +
566  nprecHitsPerChamberLayer[Muon::MuonStationIndex::CSL];
567 
568  uint8_t middleSmallHits = nprecHitsPerChamberLayer[Muon::MuonStationIndex::BMS] +
569  nprecHitsPerChamberLayer[Muon::MuonStationIndex::EMS];
570 
571  uint8_t middleLargeHits = nprecHitsPerChamberLayer[Muon::MuonStationIndex::BML] +
572  nprecHitsPerChamberLayer[Muon::MuonStationIndex::EML];
573 
574  uint8_t outerSmallHits = nprecHitsPerChamberLayer[Muon::MuonStationIndex::BOS] +
575  nprecHitsPerChamberLayer[Muon::MuonStationIndex::EOS];
576 
577  uint8_t outerLargeHits = nprecHitsPerChamberLayer[Muon::MuonStationIndex::BML] +
578  nprecHitsPerChamberLayer[Muon::MuonStationIndex::EOL];
579 
580  uint8_t extendedSmallHits = nprecHitsPerChamberLayer[Muon::MuonStationIndex::EES] +
581  nprecHitsPerChamberLayer[Muon::MuonStationIndex::BEE];
582 
583  uint8_t extendedLargeHits = nprecHitsPerChamberLayer[Muon::MuonStationIndex::EEL];
584 
585  uint8_t phiLayer1Hits = nphiHitsPerChamberLayer[Muon::MuonStationIndex::BM1] +
586  nphiHitsPerChamberLayer[Muon::MuonStationIndex::T4] +
587  nphiHitsPerChamberLayer[Muon::MuonStationIndex::CSC] +
588  nphiHitsPerChamberLayer[Muon::MuonStationIndex::STGC1] +
589  nphiHitsPerChamberLayer[Muon::MuonStationIndex::STGC2];
590 
591  uint8_t phiLayer2Hits = nphiHitsPerChamberLayer[Muon::MuonStationIndex::BM2] +
592  nphiHitsPerChamberLayer[Muon::MuonStationIndex::T1];
593 
594  uint8_t phiLayer3Hits = nphiHitsPerChamberLayer[Muon::MuonStationIndex::BO1] +
595  nphiHitsPerChamberLayer[Muon::MuonStationIndex::T2];
596 
597  uint8_t phiLayer4Hits = nphiHitsPerChamberLayer[Muon::MuonStationIndex::BO2] +
598  nphiHitsPerChamberLayer[Muon::MuonStationIndex::T3];
599 
600  uint8_t etaLayer1Hits = ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::BM1] +
601  ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::T4] +
602  ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::CSC] +
603  ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::STGC1] +
604  ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::STGC2];
605 
606  uint8_t etaLayer2Hits = ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::BM2] +
607  ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::T1];
608 
609  uint8_t etaLayer3Hits = ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::BO1] +
610  ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::T2];
611 
612  uint8_t etaLayer4Hits = ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::BO2] +
613  ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::T3];
614 
615  uint8_t nprecLayers = 0;
616  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::BIS] + nprecHitsPerChamberLayer[Muon::MuonStationIndex::BIL] > 3)
617  ++nprecLayers;
618  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::BMS] + nprecHitsPerChamberLayer[Muon::MuonStationIndex::BML] > 2)
619  ++nprecLayers;
620  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::BOS] + nprecHitsPerChamberLayer[Muon::MuonStationIndex::BOL] > 2)
621  ++nprecLayers;
622  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::EIS] + nprecHitsPerChamberLayer[Muon::MuonStationIndex::EIL] > 3)
623  ++nprecLayers;
624  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::EMS] + nprecHitsPerChamberLayer[Muon::MuonStationIndex::EML] > 2)
625  ++nprecLayers;
626  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::EOS] + nprecHitsPerChamberLayer[Muon::MuonStationIndex::EOL] > 2)
627  ++nprecLayers;
628  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::EES] + nprecHitsPerChamberLayer[Muon::MuonStationIndex::EEL] > 3)
629  ++nprecLayers;
630  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::CSS] + nprecHitsPerChamberLayer[Muon::MuonStationIndex::CSL] > 2)
631  ++nprecLayers;
632  if (nprecHitsPerChamberLayer[Muon::MuonStationIndex::BEE] > 3) ++nprecLayers;
633 
634  uint8_t nphiLayers = 0;
635  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::BM1] > 0) ++nphiLayers;
636  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::BM2] > 0) ++nphiLayers;
637  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::BO1] > 0) ++nphiLayers;
638  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::BO2] > 0) ++nphiLayers;
639  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::T1] > 0) ++nphiLayers;
640  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::T2] > 0) ++nphiLayers;
641  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::T3] > 0) ++nphiLayers;
642  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::T4] > 0) ++nphiLayers;
643  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::CSC] > 2) ++nphiLayers;
644  if (nphiHitsPerChamberLayer[Muon::MuonStationIndex::STGC1] + nphiHitsPerChamberLayer[Muon::MuonStationIndex::STGC2] > 3)
645  ++nphiLayers;
646 
647  uint8_t ntrigEtaLayers = 0;
648  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::BM1] > 0) ++ntrigEtaLayers;
649  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::BM2] > 0) ++ntrigEtaLayers;
650  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::BO1] > 0) ++ntrigEtaLayers;
651  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::BO2] > 0) ++ntrigEtaLayers;
652  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::T1] > 0) ++ntrigEtaLayers;
653  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::T2] > 0) ++ntrigEtaLayers;
654  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::T3] > 0) ++ntrigEtaLayers;
655  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::T4] > 0) ++ntrigEtaLayers;
656  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::CSC] > 2) ++ntrigEtaLayers;
657  if (ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::STGC1] + ntrigEtaHitsPerChamberLayer[Muon::MuonStationIndex::STGC2] > 3)
658  ++ntrigEtaLayers;
659 
660  // copy hit counts onto TruthParticle
661  static const SG::Accessor<uint8_t> nprecLayersAcc("nprecLayers");
662  static const SG::Accessor<uint8_t> nphiLayersAcc("nphiLayers");
663  static const SG::Accessor<uint8_t> ntrigEtaLayersAcc("ntrigEtaLayers");
664  static const SG::Accessor<uint8_t> innerSmallHitsAcc("innerSmallHits");
665  static const SG::Accessor<uint8_t> innerLargeHitsAcc("innerLargeHits");
666  static const SG::Accessor<uint8_t> middleSmallHitsAcc("middleSmallHits");
667  static const SG::Accessor<uint8_t> middleLargeHitsAcc("middleLargeHits");
668  static const SG::Accessor<uint8_t> outerSmallHitsAcc("outerSmallHits");
669  static const SG::Accessor<uint8_t> outerLargeHitsAcc("outerLargeHits");
670  static const SG::Accessor<uint8_t> extendedSmallHitsAcc("extendedSmallHits");
671  static const SG::Accessor<uint8_t> extendedLargeHitsAcc("extendedLargeHits");
672  nprecLayersAcc(truthParticle) = nprecLayers;
673  nphiLayersAcc(truthParticle) = nphiLayers;
674  ntrigEtaLayersAcc(truthParticle) = ntrigEtaLayers;
675  innerSmallHitsAcc(truthParticle) = innerSmallHits;
676  innerLargeHitsAcc(truthParticle) = innerLargeHits;
677  middleSmallHitsAcc(truthParticle) = middleSmallHits;
678  middleLargeHitsAcc(truthParticle) = middleLargeHits;
679  outerSmallHitsAcc(truthParticle) = outerSmallHits;
680  outerLargeHitsAcc(truthParticle) = outerLargeHits;
681  extendedSmallHitsAcc(truthParticle) = extendedSmallHits;
682  extendedLargeHitsAcc(truthParticle) = extendedLargeHits;
683 
684  static const SG::Accessor<uint8_t> phiLayer1HitsAcc("phiLayer1Hits");
685  static const SG::Accessor<uint8_t> phiLayer2HitsAcc("phiLayer2Hits");
686  static const SG::Accessor<uint8_t> phiLayer3HitsAcc("phiLayer3Hits");
687  static const SG::Accessor<uint8_t> phiLayer4HitsAcc("phiLayer4Hits");
688  phiLayer1HitsAcc(truthParticle) = phiLayer1Hits;
689  phiLayer2HitsAcc(truthParticle) = phiLayer2Hits;
690  phiLayer3HitsAcc(truthParticle) = phiLayer3Hits;
691  phiLayer4HitsAcc(truthParticle) = phiLayer4Hits;
692 
693  static const SG::Accessor<uint8_t> etaLayer1HitsAcc("etaLayer1Hits");
694  static const SG::Accessor<uint8_t> etaLayer2HitsAcc("etaLayer2Hits");
695  static const SG::Accessor<uint8_t> etaLayer3HitsAcc("etaLayer3Hits");
696  static const SG::Accessor<uint8_t> etaLayer4HitsAcc("etaLayer4Hits");
697  etaLayer1HitsAcc(truthParticle) = etaLayer1Hits;
698  etaLayer2HitsAcc(truthParticle) = etaLayer2Hits;
699  etaLayer3HitsAcc(truthParticle) = etaLayer3Hits;
700  etaLayer4HitsAcc(truthParticle) = etaLayer4Hits;
701 
702  if (msgLvl(MSG::DEBUG)) {
703  ATH_MSG_DEBUG("Precision layers " << static_cast<int>(nprecLayers) << " phi layers " << static_cast<int>(nphiLayers)
704  << " triggerEta layers " << static_cast<int>(ntrigEtaLayers));
705 
706  if (nprecLayers > 0) {
707  msg(MSG::VERBOSE) << " Precision chambers ";
708 
709  for (int index = 0; index < static_cast<int>(nprecHitsPerChamberLayer.size()); ++index) {
710  if (nprecHitsPerChamberLayer[index] > 0)
712  << " hits " << nprecHitsPerChamberLayer[index];
713  }
714  }
715  if (nphiLayers > 0) {
716  msg(MSG::VERBOSE) << endmsg << " Phi chambers ";
717  for (int index = 0; index < static_cast<int>(nphiHitsPerChamberLayer.size()); ++index) {
718  if (nphiHitsPerChamberLayer[index] > 0)
720  << " hits " << nphiHitsPerChamberLayer[index];
721  }
722  }
723 
724  if (ntrigEtaLayers > 0) {
725  msg(MSG::VERBOSE) << endmsg << " Trigger Eta ";
726  for (int index = 0; index < static_cast<int>(ntrigEtaHitsPerChamberLayer.size()); ++index) {
727  if (ntrigEtaHitsPerChamberLayer[index] > 0)
729  << " hits " << ntrigEtaHitsPerChamberLayer[index];
730  }
731  }
732  msg(MSG::VERBOSE) << endmsg;
733  }
734  return StatusCode::SUCCESS;
735  }

◆ addHitIDVectors()

void Muon::MuonTruthDecorationAlg::addHitIDVectors ( xAOD::TruthParticle truthParticle,
const MuonTruthDecorationAlg::ChamberIdMap ids 
) const
private

Definition at line 737 of file MuonTruthDecorationAlg.cxx.

738  {
739 
741  truthMdtHitsAcc("truthMdtHits");
743  truthTgcHitsAcc("truthTgcHits");
745  truthRpcHitsAcc("truthRpcHits");
746  std::vector<unsigned long long>& mdtTruthHits = truthMdtHitsAcc(truthParticle);
747  std::vector<unsigned long long>& tgcTruthHits = truthTgcHitsAcc(truthParticle);
748  std::vector<unsigned long long>& rpcTruthHits = truthRpcHitsAcc(truthParticle);
749 
750  std::vector<unsigned long long> stgcTruthHits;
751  std::vector<unsigned long long> cscTruthHits;
752  std::vector<unsigned long long> mmTruthHits;
753 
754  // loop over chamber layers
755  int nEI = 0, nEM = 0;
756  for (const auto& lay : ids) {
757  // loop over hits
758  if (lay.first == Muon::MuonStationIndex::EIS || lay.first == Muon::MuonStationIndex::EIL) nEI++;
759  if (lay.first == Muon::MuonStationIndex::EMS || lay.first == Muon::MuonStationIndex::EML) nEM++;
760  for (const auto& id : lay.second) {
761  if (m_idHelperSvc->isMdt(id))
762  mdtTruthHits.push_back(id.get_compact());
763  else if (m_idHelperSvc->isCsc(id))
764  cscTruthHits.push_back(id.get_compact());
765  else if (m_idHelperSvc->isTgc(id)) {
766  if ((lay.first == Muon::MuonStationIndex::EIS || lay.first == Muon::MuonStationIndex::EIL) && nEI > 1)
767  continue; // otherwise we double-count
768  if ((lay.first == Muon::MuonStationIndex::EMS || lay.first == Muon::MuonStationIndex::EML) && nEM > 1)
769  continue; // otherwise we double-count
770  tgcTruthHits.push_back(id.get_compact());
771  } else if (m_idHelperSvc->issTgc(id))
772  stgcTruthHits.push_back(id.get_compact());
773  else if (m_idHelperSvc->isRpc(id))
774  rpcTruthHits.push_back(id.get_compact());
775  else if (m_idHelperSvc->isMM(id))
776  mmTruthHits.push_back(id.get_compact());
777  }
778  }
779  if (m_idHelperSvc->hasCSC()) {
781  truthCscHitsAcc("truthCscHits");
782  truthCscHitsAcc(truthParticle) = std::move(cscTruthHits);
783  }
784  if (m_idHelperSvc->hasSTGC()) {
786  truthStgcHitsAcc("truthStgcHits");
787  truthStgcHitsAcc(truthParticle) = std::move(stgcTruthHits);
788  }
789  if (m_idHelperSvc->hasMM()) {
791  truthMMHitsAcc("truthMMHits");
792  truthMMHitsAcc(truthParticle) = std::move(mmTruthHits);
793  }
794  ATH_MSG_VERBOSE("Added " << mdtTruthHits.size() << " mdt truth hits, " << cscTruthHits.size() << " csc truth hits, "
795  << rpcTruthHits.size() << " rpc truth hits, and " << tgcTruthHits.size() << " tgc truth hits");
796  }

◆ addTrackRecords()

StatusCode Muon::MuonTruthDecorationAlg::addTrackRecords ( const EventContext &  ctx,
xAOD::TruthParticle truthParticle 
) const
private

Make sure that the parameter vector has the same size

Second loop, extrapolate between the points

extrapolation needs to be setup correctly

If the track record is named, then we should have a volume

Definition at line 331 of file MuonTruthDecorationAlg.cxx.

331  {
332  // first loop over track records, store parameters at the different positions
333  const xAOD::TruthVertex* vertex = truthParticle.prodVtx();
334  const Trk::TrackingGeometry* trackingGeometry = !m_extrapolator.empty()? m_extrapolator->trackingGeometry() : nullptr;
335 
336  std::vector<RecordPars> parameters;
337  if (vertex) {
338  parameters.emplace_back(Amg::Vector3D{vertex->x(), vertex->y(), vertex->z()},
339  Amg::Vector3D{truthParticle.px(), truthParticle.py(), truthParticle.pz()});
340  }
342  if (!col.isPresent()) {
343  ATH_MSG_FATAL("Failed to retrieve "<<col.key());
344  return StatusCode::FAILURE;
345  }
346  const std::string r_name = col.key();
347 
348  SG::Accessor<float> xAcc (r_name + "_x");
349  SG::Accessor<float> yAcc (r_name + "_y");
350  SG::Accessor<float> zAcc (r_name + "_z");
351  SG::Accessor<float> pxAcc (r_name + "_px");
352  SG::Accessor<float> pyAcc (r_name + "_py");
353  SG::Accessor<float> pzAcc (r_name + "_pz");
354  float& x = xAcc(truthParticle);
355  float& y = yAcc(truthParticle);
356  float& z = zAcc(truthParticle);
357  float& px = pxAcc(truthParticle);
358  float& py = pyAcc(truthParticle);
359  float& pz = pzAcc(truthParticle);
360 
361  SG::Accessor<bool> matchedAcc (r_name + "_is_matched");
362  bool& found_truth = matchedAcc(truthParticle);
363 
364  x = y = z = px = py = pz = dummy_val;
365  found_truth = false;
366 
367  // Need to always make these, to avoid crashes later
368  SG::Accessor<float> exAcc (r_name + "_x_extr");
369  SG::Accessor<float> eyAcc (r_name + "_y_extr");
370  SG::Accessor<float> ezAcc (r_name + "_z_extr");
371  SG::Accessor<float> epxAcc (r_name + "_px_extr");
372  SG::Accessor<float> epyAcc (r_name + "_py_extr");
373  SG::Accessor<float> epzAcc (r_name + "_pz_extr");
374  float& ex = exAcc(truthParticle);
375  float& ey = eyAcc(truthParticle);
376  float& ez = ezAcc(truthParticle);
377  float& epx = epxAcc(truthParticle);
378  float& epy = epyAcc(truthParticle);
379  float& epz = epzAcc(truthParticle);
380 
381  SG::Accessor<std::vector<float> > ecovAcc (r_name + "_cov_extr");
382  ecovAcc(truthParticle) = emptyVec;
383 
384  SG::Accessor<bool> eisAcc (r_name+"_is_extr");
385  eisAcc(truthParticle) = false;
386  ex = ey = ez = epx = epy = epz = dummy_val;
387 
388  // loop over collection and find particle with the same bar code
389  for (const auto& particle : *col) {
390  if (!HepMC::is_sim_descendant(&particle,&truthParticle)) continue;
391  CLHEP::Hep3Vector pos = particle.GetPosition();
392  CLHEP::Hep3Vector mom = particle.GetMomentum();
393  ATH_MSG_VERBOSE("Found associated " << r_name << " pt " << mom.perp() << " position: r " << pos.perp() << " z " << pos.z());
394  x = pos.x(); y = pos.y(); z = pos.z();
395  px = mom.x(); py = mom.y(); pz = mom.z();
396  parameters.emplace_back(pos, mom);
397  found_truth = true;
398  break;
399  }
400 
401  if (!trackingGeometry) continue;
402 
404  if (!found_truth) parameters.emplace_back();
405  RecordPars& r_pars = parameters.back();
406  r_pars.record_name = r_name;
407  const Trk::TrackingVolume* volume = nullptr;
408  if (r_name == "CaloEntryLayer")
409  volume = trackingGeometry->trackingVolume("InDet::Containers::InnerDetector");
410  else if (r_name == "MuonEntryLayer")
411  volume = trackingGeometry->trackingVolume("Calo::Container");
412  else if (r_name == "MuonExitLayer")
413  volume = trackingGeometry->trackingVolume("Muon::Containers::MuonSystem");
414  else {
415  ATH_MSG_WARNING("no destination surface for track record "<<r_name);
416  }
417  r_pars.volume = found_truth ? volume : nullptr;
418  }
420 
422  if (!trackingGeometry) return StatusCode::SUCCESS;
423 
424 
425  AmgSymMatrix(5) cov{AmgSymMatrix(5)::Identity()};
426  cov(0, 0) = cov(1, 1) = 1e-3;
427  cov(2, 2) = cov(3, 3) = 1e-6;
428  cov(4, 4) = 1e-3 / truthParticle.p4().P();
429  for (unsigned int i = 0; i < parameters.size() - 1; ++i) {
430  const RecordPars& start_pars = parameters[i];
431  const RecordPars& end_pars = parameters[i+1];
433  if ( (!start_pars.record_name.empty() && !start_pars.volume) || !end_pars.volume) continue;
434  Trk::CurvilinearParameters pars(start_pars.pos, start_pars.mom, truthParticle.charge(), cov);
435 
436  const Trk::TrackingVolume* volume = end_pars.volume;
437  const std::string& r_name = end_pars.record_name;
438  SG::Accessor<float> exAcc (r_name + "_x_extr");
439  SG::Accessor<float> eyAcc (r_name + "_y_extr");
440  SG::Accessor<float> ezAcc (r_name + "_z_extr");
441  SG::Accessor<float> epxAcc (r_name + "_px_extr");
442  SG::Accessor<float> epyAcc (r_name + "_py_extr");
443  SG::Accessor<float> epzAcc (r_name + "_pz_extr");
444  float& ex = exAcc(truthParticle);
445  float& ey = eyAcc(truthParticle);
446  float& ez = ezAcc(truthParticle);
447  float& epx = epxAcc(truthParticle);
448  float& epy = epyAcc(truthParticle);
449  float& epz = epzAcc(truthParticle);
450 
451  SG::Accessor<std::vector<float> > ecovAcc (r_name + "_cov_extr");
452  std::vector<float>& covMat = ecovAcc(truthParticle);
453 
454  std::unique_ptr<Trk::TrackParameters> exPars{
455  m_extrapolator->extrapolateToVolume(ctx, pars, *volume, Trk::alongMomentum, Trk::muon)};
456  if (! exPars || !exPars->covariance() || !Amg::hasPositiveDiagElems(*exPars->covariance())) {
457  ATH_MSG_VERBOSE("Extrapolation to "<<r_name<<" failed. ");
458  continue;
459  }
460  SG::Accessor<bool> eisAcc (r_name+"_is_extr");
461  eisAcc(truthParticle) = true;
462  ex = exPars->position().x();
463  ey = exPars->position().y();
464  ez = exPars->position().z();
465  epx = exPars->momentum().x();
466  epy = exPars->momentum().y();
467  epz = exPars->momentum().z();
468  Amg::compress(*exPars->covariance(), covMat);
469 
470  const double errorp = Amg::error(*exPars->covariance(), Trk::qOverP);
471  ATH_MSG_VERBOSE( " Extrapolated to " << r_name << std::endl
472  << " truth: r " << end_pars.pos.perp() << " z "
473  << end_pars.pos.z() << " p "
474  << end_pars.mom.mag() << std::endl
475  << " extrp: r " << exPars->position().perp() << " z "
476  << exPars->position().z() << " p "
477  << exPars->momentum().mag() << " res p "
478  << (end_pars.mom.mag() -
479  exPars->momentum().mag())
480  << " error " << errorp << " cov "
481  << (*exPars->covariance())(Trk::qOverP, Trk::qOverP)
482  << " pull p "
483  << (end_pars.mom.mag() -
484  exPars->momentum().mag()) /
485  errorp);
486  }
487  return StatusCode::SUCCESS;
488  }

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ createSegments()

StatusCode Muon::MuonTruthDecorationAlg::createSegments ( const EventContext &  ctx,
const ElementLink< xAOD::TruthParticleContainer > &  truthLink,
SG::WriteHandle< xAOD::MuonSegmentContainer > &  segmentContainer,
const ChamberIdMap ids 
) const
private

Definition at line 168 of file MuonTruthDecorationAlg.cxx.

171  {
173 
174  std::vector<SG::ReadHandle<MuonSimDataCollection> > sdoCollections(6);
177  if (!col.isPresent()) {
178  ATH_MSG_ERROR("MuonSimDataCollection " << col.name() << " not in StoreGate");
179  return StatusCode::FAILURE;
180  }
181  if (col->empty()) {
182  continue;
183  }
184  Identifier id = col->begin()->first;
185  int index = m_idHelperSvc->technologyIndex(id);
186  if (index >= (int)sdoCollections.size()) {
187  ATH_MSG_WARNING("SDO collection index out of range " << index << " " << m_idHelperSvc->toStringChamber(id));
188  } else {
189  sdoCollections[index] = std::move(col);
190  }
191 
192  }
193 
194  bool useSDO = (!sdoCollections.empty() || !m_CSC_SDO_TruthNames.empty());
195  std::map<Muon::MuonStationIndex::ChIndex, int> matchMap;
196  ATH_MSG_DEBUG(" Creating Truth segments ");
197  // loop over chamber layers
198  for (const auto& lay : ids) {
199  // skip empty layers
200  Amg::Vector3D firstPos{Amg::Vector3D::Zero()}, secondPos{Amg::Vector3D::Zero()};
201  bool firstPosSet{false}, secondPosSet{false};
202  Identifier chId;
203  int index = -1;
204  uint8_t nprecLayers{0}, nphiLayers{0}, ntrigEtaLayers{0};
205  std::set<int> phiLayers, etaLayers, precLayers;
206  ATH_MSG_DEBUG(" new chamber layer " << Muon::MuonStationIndex::chName(lay.first) << " hits " << ids.size());
207  // loop over hits
208  for (const auto& id : lay.second) {
209  ATH_MSG_VERBOSE(" hit " << m_idHelperSvc->toString(id));
210  bool measPhi = m_idHelperSvc->measuresPhi(id);
211  bool isCsc = m_idHelperSvc->isCsc(id);
212  bool isMM = m_idHelperSvc->isMM(id);
213  bool isTrig = m_idHelperSvc->isTrigger(id);
214  bool isEndcap = m_idHelperSvc->isEndcap(id);
215  if (measPhi) {
216  phiLayers.insert(m_idHelperSvc->gasGap(id));
217  } else {
218  if (!isTrig) {
219  if (!chId.is_valid()) chId = id; // use first precision hit in list
220  if (isCsc || isMM) {
221  precLayers.insert(m_idHelperSvc->gasGap(id));
222  } else {
223  int iid = 10 * m_idHelperSvc->mdtIdHelper().multilayer(id) + m_idHelperSvc->mdtIdHelper().tubeLayer(id);
224  precLayers.insert(iid);
225  // ATH_MSG_VERBOSE("iid " << iid << " precLayers size " << precLayers.size() );
226  }
227  } else {
228  etaLayers.insert(m_idHelperSvc->gasGap(id));
229  }
230  }
231  // use SDO to look-up truth position of the hit
232  if (!useSDO) {
233  continue;
234  }
236  if (!isCsc) {
237  bool ok = false;
238  int index = m_idHelperSvc->technologyIndex(id);
239  if (index < (int)sdoCollections.size() && !sdoCollections[index]->empty()) {
240  auto pos = sdoCollections[index]->find(id);
241  if (pos != sdoCollections[index]->end()) {
242  gpos = pos->second.globalPosition();
243  if (gpos.perp() > 0.1) ok = true; // sanity check
244  }
245  }
246  // look up successful, calculate
247  if (!ok) continue;
248 
249  // small comparison function
250  auto isSmaller = [isEndcap](const Amg::Vector3D& p1, const Amg::Vector3D& p2) {
251  if (isEndcap)
252  return std::abs(p1.z()) < std::abs(p2.z());
253  else
254  return p1.perp() < p2.perp();
255  };
256  if (!firstPosSet) {
257  firstPos = gpos;
258  firstPosSet = true;
259  } else if (!secondPosSet) {
260  secondPos = gpos;
261  secondPosSet = true;
262  if (isSmaller(secondPos, firstPos)) std::swap(firstPos, secondPos);
263  } else {
264  // update position if we can increase the distance between the two positions
265  if (isSmaller(gpos, firstPos))
266  firstPos = gpos;
267  else if (isSmaller(secondPos, gpos))
268  secondPos = gpos;
269  }
270  } else {
272  auto pos = cscCollection->find(id);
273  if (pos == cscCollection->end()) {
274  continue;
275  }
276  const MuonGM::CscReadoutElement* descriptor = detMgr->getCscReadoutElement(id);
277  ATH_MSG_DEBUG("found csc sdo with " << pos->second.getdeposits().size() << " deposits");
278  Amg::Vector3D locpos(0, pos->second.getdeposits()[0].second.ypos(), pos->second.getdeposits()[0].second.zpos());
279  gpos = descriptor->localToGlobalCoords(locpos, m_idHelperSvc->cscIdHelper().elementID(id));
280  ATH_MSG_DEBUG("got CSC global position " << gpos);
281  if (!firstPosSet) {
282  firstPos = gpos;
283  firstPosSet = true;
284  } else if (!secondPosSet) {
285  secondPos = gpos;
286  secondPosSet = true;
287  if (secondPos.perp() < firstPos.perp()) std::swap(firstPos, secondPos);
288  } else {
289  if (gpos.perp() < firstPos.perp())
290  firstPos = gpos;
291  else if (secondPos.perp() < gpos.perp())
292  secondPos = gpos;
293  }
294  }
295  }
296  if (precLayers.size() > 2) {
297  matchMap[lay.first] = index;
298  if (!phiLayers.empty()) nphiLayers = phiLayers.size();
299  ntrigEtaLayers = etaLayers.size();
300  nprecLayers = precLayers.size();
301  ATH_MSG_DEBUG(" total counts: precision " << static_cast<int>(nprecLayers) << " phi layers " << static_cast<int>(nphiLayers)
302  << " eta trig layers " << static_cast<int>(ntrigEtaLayers)
303  << " associated reco muon " << index << " barcode " << HepMC::barcode(*truthLink) // FIXME barcode-based
304  << " truthLink " << truthLink);
306  segmentContainer->push_back(segment);
307  segment->setNHits(nprecLayers, nphiLayers, ntrigEtaLayers);
309  truthParticleLinkAcc("truthParticleLink");
310  truthParticleLinkAcc(*segment) = truthLink;
311  if (chId.is_valid()) {
312  int eta = m_idHelperSvc->stationEta(chId);
313  int sector = m_idHelperSvc->sector(chId);
314  MuonStationIndex::TechnologyIndex technology = m_idHelperSvc->technologyIndex(chId);
315  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
316  segment->setIdentifier(sector, chIndex, eta, technology);
317  }
318  if (firstPosSet && secondPosSet) {
319  Amg::Vector3D gpos = (firstPos + secondPos) / 2.;
320  Amg::Vector3D gdir = (firstPos - secondPos).unit();
321  ATH_MSG_DEBUG(" got position : r " << gpos.perp() << " z " << gpos.z() << " and direction: theta " << gdir.theta()
322  << " phi " << gdir.phi());
323  segment->setPosition(gpos.x(), gpos.y(), gpos.z());
324  segment->setDirection(gdir.x(), gdir.y(), gdir.z());
325  }
326  }
327  }
328  return StatusCode::SUCCESS;
329  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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; }

◆ execute()

StatusCode Muon::MuonTruthDecorationAlg::execute ( const EventContext &  ctx) const
overridevirtual

add track records

Definition at line 85 of file MuonTruthDecorationAlg.cxx.

85  {
86  // skip if no input data found
88  if (!truthContainer.isPresent()) return StatusCode::SUCCESS;
89  if (!truthContainer.isValid()) {
90  ATH_MSG_WARNING("truth container " << truthContainer.name() << " not valid");
91  return StatusCode::FAILURE;
92  }
93 
94  // create output container
96  ATH_CHECK(muonTruthContainer.record(std::make_unique<xAOD::TruthParticleContainer>(),
97  std::make_unique<xAOD::TruthParticleAuxContainer>()));
98  ATH_MSG_DEBUG("Recorded TruthParticleContainer with key: " << m_muonTruthParticleContainerName);
99 
101  if (m_createTruthSegment) {
102  ATH_CHECK(
103  segmentContainer.record(std::make_unique<xAOD::MuonSegmentContainer>(), std::make_unique<xAOD::MuonSegmentAuxContainer>()));
104  ATH_MSG_DEBUG("Recorded MuonSegmentContainer with key: " << segmentContainer.name());
105  }
106 
107  // loop over truth coll
108  for (const xAOD::TruthParticle* truth : *truthContainer) {
109  if (!MC::isStable(truth) || !truth->isMuon() || truth->pt() < 1000.) continue;
110  xAOD::TruthParticle* truthParticle = new xAOD::TruthParticle();
111  muonTruthContainer->push_back(truthParticle);
112  truthParticle->setPdgId(truth->pdgId());
113  truthParticle->setBarcode(HepMC::barcode(truth)); // FIXME barcode-based
114  truthParticle->setStatus(truth->status());
115  truthParticle->setPx(truth->px());
116  truthParticle->setPy(truth->py());
117  truthParticle->setPz(truth->pz());
118  truthParticle->setE(truth->e());
119  truthParticle->setM(truth->m());
120  if (truth->hasProdVtx()) truthParticle->setProdVtxLink(truth->prodVtxLink());
121  ElementLink<xAOD::TruthParticleContainer> truthLink(*muonTruthContainer, muonTruthContainer->size() - 1);
122  truthLink.toPersistent();
123  ATH_MSG_DEBUG("Found stable muon: " << truth->pt() << " eta " << truth->eta() << " phi " << truth->phi() << " mass "
124  << truth->m() << " barcode " << HepMC::barcode(truth) << " truthParticle->barcode "
125  << HepMC::barcode(truthParticle) << " (*truthLink)->barcode " << HepMC::barcode(*truthLink) << " "
126  << truthLink); // FIXME barcode-based
127  int iType = 0;
128  int iOrigin = 0;
129 
130  // if configured look up truth classification
131  if (!m_truthClassifier.empty()) {
132  // if configured also get truth classification
133  std::pair<MCTruthPartClassifier::ParticleType, MCTruthPartClassifier::ParticleOrigin> truthClass =
134  m_truthClassifier->particleTruthClassifier(truth);
135  iType = truthClass.first;
136  iOrigin = truthClass.second;
137  ATH_MSG_VERBOSE("Got truth type " << iType << " origin " << iOrigin);
138  dec_truthOrigin(*truthParticle) = iOrigin;
139  dec_truthType(*truthParticle) = iType;
140  }
141 
143  ATH_CHECK(addTrackRecords(ctx, *truthParticle));
145 
146  // add hit counts
147  ATH_CHECK(addHitCounts(ctx, *truthParticle, ids));
148 
149  // add hit ID vectors
150  addHitIDVectors(*truthParticle, ids);
151 
152  bool goodMuon = bad_origins.find(iOrigin) == bad_origins.end();
153 
154  ATH_MSG_DEBUG("good muon with type " << iType << " and origin" << iOrigin);
155 
156  // create segments
157  if (m_createTruthSegment && goodMuon) {
158  ATH_CHECK(createSegments(ctx, truthLink, segmentContainer, ids));
159  }
160  }
161 
162  ATH_MSG_DEBUG("Registered " << muonTruthContainer->size() << " truth muons ");
163  if (m_createTruthSegment) ATH_MSG_DEBUG("Registered " << segmentContainer->size() << " truth muon segments ");
164 
165  return StatusCode::SUCCESS;
166  }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ initialize()

StatusCode Muon::MuonTruthDecorationAlg::initialize ( )
overridevirtual

Definition at line 69 of file MuonTruthDecorationAlg.cxx.

69  {
74  ATH_CHECK(m_PRD_TruthNames.initialize());
75  ATH_CHECK(m_SDO_TruthNames.initialize());
77  ATH_CHECK(m_idHelperSvc.retrieve());
78  ATH_CHECK(m_truthClassifier.retrieve());
79  ATH_CHECK(m_extrapolator.retrieve());
81  return StatusCode::SUCCESS;
82  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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_createTruthSegment

Gaudi::Property<bool> Muon::MuonTruthDecorationAlg::m_createTruthSegment {this, "CreateTruthSegments", true}
private

Definition at line 87 of file MuonTruthDecorationAlg.h.

◆ m_CSC_SDO_TruthNames

SG::ReadHandleKey<CscSimDataCollection> Muon::MuonTruthDecorationAlg::m_CSC_SDO_TruthNames {this, "CSCSDOs", "CSC_SDO"}
private

Definition at line 80 of file MuonTruthDecorationAlg.h.

◆ m_detMgrKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> Muon::MuonTruthDecorationAlg::m_detMgrKey
private
Initial value:
{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}

Definition at line 90 of file MuonTruthDecorationAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_extrapolator

ToolHandle<Trk::IExtrapolator> Muon::MuonTruthDecorationAlg::m_extrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
private

Definition at line 85 of file MuonTruthDecorationAlg.h.

◆ m_idHelperSvc

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

Definition at line 82 of file MuonTruthDecorationAlg.h.

◆ m_muonTruthParticleContainerName

SG::WriteHandleKey<xAOD::TruthParticleContainer> Muon::MuonTruthDecorationAlg::m_muonTruthParticleContainerName
private
Initial value:
{this, "MuonTruthParticleContainerName",
"MuonTruthParticles"}

Definition at line 67 of file MuonTruthDecorationAlg.h.

◆ m_muonTruthSegmentContainerName

SG::WriteHandleKey<xAOD::MuonSegmentContainer> Muon::MuonTruthDecorationAlg::m_muonTruthSegmentContainerName {this, "MuonTruthSegmentName", "MuonTruthSegments"}
private

Definition at line 69 of file MuonTruthDecorationAlg.h.

◆ m_PRD_TruthNames

SG::ReadHandleKeyArray<PRD_MultiTruthCollection> Muon::MuonTruthDecorationAlg::m_PRD_TruthNames
private
Initial value:
{
this,
"PRD_TruthMaps",
{"CSC_TruthMap", "RPC_TruthMap", "TGC_TruthMap", "MDT_TruthMap"},
"remove NSW by default for now, can always be changed in the configuration"}

Definition at line 73 of file MuonTruthDecorationAlg.h.

◆ m_SDO_TruthNames

SG::ReadHandleKeyArray<MuonSimDataCollection> Muon::MuonTruthDecorationAlg::m_SDO_TruthNames
private
Initial value:
{
this, "SDOs", {"RPC_SDO", "TGC_SDO", "MDT_SDO"}, "remove NSW by default for now, can always be changed in the configuration"}

Definition at line 78 of file MuonTruthDecorationAlg.h.

◆ m_trackRecordCollectionNames

SG::ReadHandleKeyArray<TrackRecordCollection> Muon::MuonTruthDecorationAlg::m_trackRecordCollectionNames
private
Initial value:
{
this, "TrackRecordCollectionNames", {"CaloEntryLayer", "MuonEntryLayer", "MuonExitLayer"}}

Definition at line 71 of file MuonTruthDecorationAlg.h.

◆ m_truthClassifier

ToolHandle<IMCTruthClassifier> Muon::MuonTruthDecorationAlg::m_truthClassifier {this, "MCTruthClassifier", "MCTruthClassifier/MCTruthClassifier"}
private

Definition at line 84 of file MuonTruthDecorationAlg.h.

◆ m_truthParticleContainerName

SG::ReadHandleKey<xAOD::TruthParticleContainer> Muon::MuonTruthDecorationAlg::m_truthParticleContainerName {this, "TruthParticleContainerName", "TruthParticles"}
private

Definition at line 66 of file MuonTruthDecorationAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
Muon::MuonTruthDecorationAlg::m_detMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
Definition: MuonTruthDecorationAlg.h:90
Muon::MuonStationIndex::BIS
@ BIS
Definition: MuonStationIndex.h:17
Muon::MuonStationIndex::chName
static const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition: MuonStationIndex.cxx:157
xAOD::phiLayer1Hits
@ phiLayer1Hits
number of phi hits in the first trigger layer (BML1 ot T4)
Definition: TrackingPrimitives.h:348
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
xAOD::TruthParticle_v1::setStatus
void setStatus(int value)
Set status code.
Muon::MuonStationIndex::CSS
@ CSS
Definition: MuonStationIndex.h:18
Muon::MuonTruthDecorationAlg::addTrackRecords
StatusCode addTrackRecords(const EventContext &ctx, xAOD::TruthParticle &truthParticle) const
Definition: MuonTruthDecorationAlg.cxx:331
xAOD::etaLayer1Hits
@ etaLayer1Hits
number of eta hits in the first trigger layer (BML1 ot T4)
Definition: TrackingPrimitives.h:353
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Muon::MuonTruthDecorationAlg::m_SDO_TruthNames
SG::ReadHandleKeyArray< MuonSimDataCollection > m_SDO_TruthNames
Definition: MuonTruthDecorationAlg.h:78
Amg::hasPositiveDiagElems
bool hasPositiveDiagElems(const AmgSymMatrix(N) &mat)
Returns true if all diagonal elements of the covariance matrix are finite aka sane in the above defin...
Definition: EventPrimitivesCovarianceHelpers.h:96
test_pyathena.px
px
Definition: test_pyathena.py:18
xAOD::phiLayer3Hits
@ phiLayer3Hits
number of phi hits in the third trigger layer (BOL1 ot T2)
Definition: TrackingPrimitives.h:350
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Amg::compress
void compress(const AmgSymMatrix(N) &covMatrix, std::vector< float > &vec)
Definition: EventPrimitivesHelpers.h:56
xAOD::phiLayer4Hits
@ phiLayer4Hits
number of phi hits in the fourth trigger layer (T3)
Definition: TrackingPrimitives.h:351
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Muon::MuonStationIndex::STGC1
@ STGC1
Definition: MuonStationIndex.h:33
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
Muon::MuonStationIndex::T1
@ T1
Definition: MuonStationIndex.h:33
xAOD::TruthParticle_v1::pz
float pz() const
The z component of the particle's momentum.
Muon::MuonStationIndex::EEL
@ EEL
Definition: MuonStationIndex.h:18
SG::Accessor< uint8_t >
Muon::MuonTruthDecorationAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonTruthDecorationAlg.h:82
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
xAOD::TruthParticle_v1::setE
void setE(float value)
Set the energy of the particle.
Definition: TruthParticle_v1.cxx:235
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Muon::MuonStationIndex::BO1
@ BO1
Definition: MuonStationIndex.h:33
xAOD::TruthParticle_v1::setBarcode
void setBarcode(int value)
Set barcode.
Muon::MuonStationIndex::BML
@ BML
Definition: MuonStationIndex.h:17
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
xAOD::TruthParticle_v1::px
float px() const
The x component of the particle's momentum.
Muon::MuonTruthDecorationAlg::m_muonTruthSegmentContainerName
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_muonTruthSegmentContainerName
Definition: MuonTruthDecorationAlg.h:69
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
xAOD::TruthParticle_v1::setPx
void setPx(float value)
Set the x component of the particle's momentum.
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
xAOD::TruthParticle_v1::py
float py() const
The y component of the particle's momentum.
Muon::MuonStationIndex::BOS
@ BOS
Definition: MuonStationIndex.h:17
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
Muon::MuonStationIndex::T4
@ T4
Definition: MuonStationIndex.h:33
Muon::MuonTruthDecorationAlg::m_trackRecordCollectionNames
SG::ReadHandleKeyArray< TrackRecordCollection > m_trackRecordCollectionNames
Definition: MuonTruthDecorationAlg.h:71
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon::MuonStationIndex::BMS
@ BMS
Definition: MuonStationIndex.h:17
Muon::MuonStationIndex::PhiIndexMax
@ PhiIndexMax
Definition: MuonStationIndex.h:34
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::ReadHandleKey< MuonSimDataCollection >
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
x
#define x
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
Muon::MuonStationIndex::PhiIndex
PhiIndex
enum to classify the different phi layers in the muon spectrometer
Definition: MuonStationIndex.h:31
Muon::MuonTruthDecorationAlg::createSegments
StatusCode createSegments(const EventContext &ctx, const ElementLink< xAOD::TruthParticleContainer > &truthLink, SG::WriteHandle< xAOD::MuonSegmentContainer > &segmentContainer, const ChamberIdMap &ids) const
Definition: MuonTruthDecorationAlg.cxx:168
Muon::MuonTruthDecorationAlg::ChamberIdMap
std::map< Muon::MuonStationIndex::ChIndex, std::vector< Identifier > > ChamberIdMap
Definition: MuonTruthDecorationAlg.h:41
Muon::MuonStationIndex::EIS
@ EIS
Definition: MuonStationIndex.h:18
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:52
xAOD::innerLargeHits
@ innerLargeHits
number of precision hits in the inner large layer
Definition: TrackingPrimitives.h:331
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Muon::MuonStationIndex::T2
@ T2
Definition: MuonStationIndex.h:33
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Muon::MuonStationIndex::EOS
@ EOS
Definition: MuonStationIndex.h:18
xAOD::etaLayer3Hits
@ etaLayer3Hits
number of eta hits in the third trigger layer (BOL1 ot T2)
Definition: TrackingPrimitives.h:355
xAOD::middleLargeHits
@ middleLargeHits
number of precision hits in the middle large layer
Definition: TrackingPrimitives.h:333
Muon::MuonStationIndex::T3
@ T3
Definition: MuonStationIndex.h:33
xAOD::phiLayer2Hits
@ phiLayer2Hits
number of phi hits in the second trigger layer (BML2 ot T1)
Definition: TrackingPrimitives.h:349
xAOD::etaLayer2Hits
@ etaLayer2Hits
number of eta hits in the second trigger layer (BML2 ot T1)
Definition: TrackingPrimitives.h:354
xAOD::TruthParticle_v1::setM
void setM(float value)
Also store the mass.
Definition: TruthParticle_v1.cxx:241
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
Muon::MuonTruthDecorationAlg::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MuonTruthDecorationAlg.h:85
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Muon::MuonStationIndex::BM1
@ BM1
Definition: MuonStationIndex.h:33
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Muon::MuonStationIndex::BO2
@ BO2
Definition: MuonStationIndex.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
Muon::MuonTruthDecorationAlg::addHitIDVectors
void addHitIDVectors(xAOD::TruthParticle &truthParticle, const MuonTruthDecorationAlg::ChamberIdMap &ids) const
Definition: MuonTruthDecorationAlg.cxx:737
xAOD::extendedLargeHits
@ extendedLargeHits
number of precision hits in the extended large layer
Definition: TrackingPrimitives.h:337
z
#define z
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Trk::TrackingGeometry
Definition: TrackingGeometry.h:67
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
HepMC::simulation_history
std::deque< int > simulation_history(const T &p, int direction)
Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle.
Definition: MagicNumbers.h:185
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
xAOD::TruthParticle_v1::setPy
void setPy(float value)
Set the y component of the particle's momentum.
Muon::MuonStationIndex::STGC2
@ STGC2
Definition: MuonStationIndex.h:33
Muon::MuonStationIndex::phiName
static const std::string & phiName(PhiIndex index)
convert PhiIndex into a string
Definition: MuonStationIndex.cxx:124
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Trk::CurvilinearParametersT
Definition: CurvilinearParametersT.h:48
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
Muon::MuonTruthDecorationAlg::addHitCounts
StatusCode addHitCounts(const EventContext &ctx, xAOD::TruthParticle &truthParticle, ChamberIdMap &ids) const
Definition: MuonTruthDecorationAlg.cxx:490
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
Muon::MuonTruthDecorationAlg::m_PRD_TruthNames
SG::ReadHandleKeyArray< PRD_MultiTruthCollection > m_PRD_TruthNames
Definition: MuonTruthDecorationAlg.h:73
Muon::MuonTruthDecorationAlg::m_muonTruthParticleContainerName
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_muonTruthParticleContainerName
Definition: MuonTruthDecorationAlg.h:67
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
Muon::MuonStationIndex::EES
@ EES
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::ChUnknown
@ ChUnknown
Definition: MuonStationIndex.h:16
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
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
MuonGM::CscReadoutElement::localToGlobalCoords
Amg::Vector3D localToGlobalCoords(const Amg::Vector3D &x, const Identifier &id) const
localToGlobalCoords and Transf connect the Gas Gap Frame (defined as a Sensitive Detector) to the Glo...
Definition: CscReadoutElement.cxx:97
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
Amg::py
@ py
Definition: GeoPrimitives.h:39
xAOD::TruthParticle_v1::setPdgId
void setPdgId(int pid)
Set PDG ID code.
xAOD::middleSmallHits
@ middleSmallHits
number of precision hits in the middle small layer
Definition: TrackingPrimitives.h:332
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
xAOD::outerSmallHits
@ outerSmallHits
number of precision hits in the outer small layer
Definition: TrackingPrimitives.h:334
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
query_example.col
col
Definition: query_example.py:7
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Muon::MuonStationIndex::ChIndexMax
@ ChIndexMax
Definition: MuonStationIndex.h:19
Muon::MuonStationIndex::EML
@ EML
Definition: MuonStationIndex.h:18
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
xAOD::outerLargeHits
@ outerLargeHits
number of precision hits in the outer large layer
Definition: TrackingPrimitives.h:335
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
DeMoScan.index
string index
Definition: DeMoScan.py:362
Muon::MuonTruthDecorationAlg::m_truthClassifier
ToolHandle< IMCTruthClassifier > m_truthClassifier
Definition: MuonTruthDecorationAlg.h:84
MC::isStable
bool isStable(const T &p)
Definition: HepMCHelpers.h:30
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::MuonStationIndex::BIL
@ BIL
Definition: MuonStationIndex.h:17
Muon::MuonTruthDecorationAlg::m_CSC_SDO_TruthNames
SG::ReadHandleKey< CscSimDataCollection > m_CSC_SDO_TruthNames
Definition: MuonTruthDecorationAlg.h:80
Muon::MuonStationIndex::BEE
@ BEE
Definition: MuonStationIndex.h:17
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:20
xAOD::TruthParticle_v1::setPz
void setPz(float value)
Set the z component of the particle's momentum.
DEBUG
#define DEBUG
Definition: page_access.h:11
Muon::MuonStationIndex::CSC
@ CSC
Definition: MuonStationIndex.h:33
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
Trk::TrackingGeometry::trackingVolume
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
xAOD::TruthParticle_v1::setProdVtxLink
void setProdVtxLink(const ElementLink< TruthVertexContainer > &link)
Set the production vertex of the particle.
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
HepMC::is_sim_descendant
bool is_sim_descendant(const T1 &p1, const T2 &p2)
Method to check if the first particle is a descendant of the second in the simulation,...
Definition: MagicNumbers.h:313
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
xAOD::TruthParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TruthParticle_v1.cxx:196
xAOD::extendedSmallHits
@ extendedSmallHits
number of precision hits in the extended small layer
Definition: TrackingPrimitives.h:336
Muon::MuonStationIndex::EMS
@ EMS
Definition: MuonStationIndex.h:18
xAOD::innerSmallHits
@ innerSmallHits
number of precision hits in the inner small layer
Definition: TrackingPrimitives.h:330
Muon::MuonStationIndex::EOL
@ EOL
Definition: MuonStationIndex.h:18
Trk::TrackingVolume
Definition: TrackingVolume.h:121
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
Muon::MuonStationIndex::BOL
@ BOL
Definition: MuonStationIndex.h:17
Muon::MuonStationIndex::BM2
@ BM2
Definition: MuonStationIndex.h:33
Muon::MuonTruthDecorationAlg::m_truthParticleContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerName
Definition: MuonTruthDecorationAlg.h:66
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::etaLayer4Hits
@ etaLayer4Hits
number of eta hits in the fourth trigger layer (T3)
Definition: TrackingPrimitives.h:356
xAOD::TruthParticle_v1::charge
double charge() const
Physical charge.
Muon::MuonTruthDecorationAlg::m_createTruthSegment
Gaudi::Property< bool > m_createTruthSegment
Definition: MuonTruthDecorationAlg.h:87
Muon::MuonStationIndex::CSL
@ CSL
Definition: MuonStationIndex.h:18
fitman.k
k
Definition: fitman.py:528
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
ServiceHandle< ICondSvc >
Muon::MuonStationIndex::EIL
@ EIL
Definition: MuonStationIndex.h:18