ATLAS Offline Software
MuonTruthDecorationAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRUTHPARTICLEALGS_MUONTRUTHDECORATIONALG_H
6 #define TRUTHPARTICLEALGS_MUONTRUTHDECORATIONALG_H
7 
8 #include <map>
9 #include <string>
10 #include <vector>
11 
13 #include "GaudiKernel/ServiceHandle.h"
14 #include "GaudiKernel/ToolHandle.h"
28 #include "xAODTruth/TruthVertex.h"
29 
32 
33 namespace MuonGM {
34  class MuonDetectorManager;
35 }
36 
37 namespace Muon {
38 
40  public:
41  typedef std::map<Muon::MuonStationIndex::ChIndex, std::vector<Identifier> > ChamberIdMap;
42 
43  // Constructor with parameters:
44  MuonTruthDecorationAlg(const std::string& name, ISvcLocator* pSvcLocator);
45 
46  // Basic algorithm methods:
47  virtual StatusCode initialize() override;
48  virtual StatusCode execute(const EventContext& ctx) const override;
49 
50  private:
51  StatusCode addTrackRecords(const EventContext& ctx,
52  xAOD::TruthParticle& truthParticle) const;
53 
54 
55  StatusCode addHitCounts(const EventContext& ctx,
56  xAOD::TruthParticle& truthParticle,
57  ChamberIdMap& ids) const;
58 
60 
61  StatusCode createSegments(const EventContext& ctx,
64  const ChamberIdMap& ids) const;
65 
66  SG::ReadHandleKey<xAOD::TruthParticleContainer> m_truthParticleContainerName{this, "TruthParticleContainerName", "TruthParticles"};
68  "MuonTruthParticles"};
69  SG::WriteHandleKey<xAOD::MuonSegmentContainer> m_muonTruthSegmentContainerName{this, "MuonTruthSegmentName", "MuonTruthSegments"};
70 
72  this, "TrackRecordCollectionNames", {"CaloEntryLayer", "MuonEntryLayer", "MuonExitLayer"}};
74  this,
75  "PRD_TruthMaps",
76  {"CSC_TruthMap", "RPC_TruthMap", "TGC_TruthMap", "MDT_TruthMap"},
77  "remove NSW by default for now, can always be changed in the configuration"};
79  this, "SDOs", {"RPC_SDO", "TGC_SDO", "MDT_SDO"}, "remove NSW by default for now, can always be changed in the configuration"};
81 
82  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
83 
84  ToolHandle<IMCTruthClassifier> m_truthClassifier{this, "MCTruthClassifier", "MCTruthClassifier/MCTruthClassifier"};
85  ToolHandle<Trk::IExtrapolator> m_extrapolator{this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"};
86 
87  Gaudi::Property<bool> m_createTruthSegment{this, "CreateTruthSegments", true};
88 
89  // MuonDetectorManager from the conditions store
90  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_detMgrKey{this, "DetectorManagerKey", "MuonDetectorManager",
91  "Key of input MuonDetectorManager condition data"};
92 
93  };
94 
95 } // namespace Muon
96 
97 #endif // TRUTHPARTICLEALGS_MUONTRUTHDECORATIONALG_H
Muon::MuonTruthDecorationAlg::m_detMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
Definition: MuonTruthDecorationAlg.h:90
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
Muon::MuonTruthDecorationAlg::addTrackRecords
StatusCode addTrackRecords(const EventContext &ctx, xAOD::TruthParticle &truthParticle) const
Definition: MuonTruthDecorationAlg.cxx:331
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
Muon::MuonTruthDecorationAlg::m_SDO_TruthNames
SG::ReadHandleKeyArray< MuonSimDataCollection > m_SDO_TruthNames
Definition: MuonTruthDecorationAlg.h:78
MuonEDMPrinterTool.h
Muon::MuonTruthDecorationAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonTruthDecorationAlg.h:82
TruthParticleContainer.h
Muon::MuonTruthDecorationAlg::m_muonTruthSegmentContainerName
SG::WriteHandleKey< xAOD::MuonSegmentContainer > m_muonTruthSegmentContainerName
Definition: MuonTruthDecorationAlg.h:69
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
IExtrapolator.h
Muon::MuonTruthDecorationAlg::m_trackRecordCollectionNames
SG::ReadHandleKeyArray< TrackRecordCollection > m_trackRecordCollectionNames
Definition: MuonTruthDecorationAlg.h:71
SG::ReadHandleKey< xAOD::TruthParticleContainer >
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
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
MuonSegmentContainer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
Muon::MuonTruthDecorationAlg::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: MuonTruthDecorationAlg.h:85
IMCTruthClassifier.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
Muon::MuonTruthDecorationAlg::addHitIDVectors
void addHitIDVectors(xAOD::TruthParticle &truthParticle, const MuonTruthDecorationAlg::ChamberIdMap &ids) const
Definition: MuonTruthDecorationAlg.cxx:737
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
MuonSimDataCollection
Definition: MuonSimDataCollection.h:21
CscSimDataCollection
Definition: CscSimDataCollection.h:29
Muon::MuonTruthDecorationAlg::addHitCounts
StatusCode addHitCounts(const EventContext &ctx, xAOD::TruthParticle &truthParticle, ChamberIdMap &ids) const
Definition: MuonTruthDecorationAlg.cxx:490
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.h
TruthVertex.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
WriteHandleKeyArray.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
python.subdetectors.mmg.ids
ids
Definition: mmg.py:8
Muon::MuonTruthDecorationAlg::initialize
virtual StatusCode initialize() override
Definition: MuonTruthDecorationAlg.cxx:69
TrackRecordCollection.h
Muon::MuonTruthDecorationAlg
Definition: MuonTruthDecorationAlg.h:39
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager >
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
Muon::MuonTruthDecorationAlg::m_truthClassifier
ToolHandle< IMCTruthClassifier > m_truthClassifier
Definition: MuonTruthDecorationAlg.h:84
Muon::MuonTruthDecorationAlg::m_CSC_SDO_TruthNames
SG::ReadHandleKey< CscSimDataCollection > m_CSC_SDO_TruthNames
Definition: MuonTruthDecorationAlg.h:80
Muon::MuonTruthDecorationAlg::MuonTruthDecorationAlg
MuonTruthDecorationAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonTruthDecorationAlg.cxx:65
PRD_MultiTruthCollection.h
Muon::MuonTruthDecorationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: MuonTruthDecorationAlg.cxx:85
TruthParticle.h
Muon::MuonTruthDecorationAlg::m_truthParticleContainerName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleContainerName
Definition: MuonTruthDecorationAlg.h:66
IMuonIdHelperSvc.h
Muon::MuonTruthDecorationAlg::m_createTruthSegment
Gaudi::Property< bool > m_createTruthSegment
Definition: MuonTruthDecorationAlg.h:87
ServiceHandle< Muon::IMuonIdHelperSvc >