 |
ATLAS Offline Software
|
Go to the documentation of this file.
11 using SimHitVec_t = std::vector<const xAOD::MuonSimHit*>;
12 using MCPartSimMap_t = std::unordered_map<HepMC::ConstGenParticlePtr, SimHitVec_t>;
22 return StatusCode::SUCCESS;
29 MCPartSimMap_t hitIdMap{};
31 if (!hit->genParticleLink().isValid()){
34 const auto& pl{hit->genParticleLink()};
35 hitIdMap[pl].push_back(hit);
42 std::vector<unsigned long long>& hitIds{idDecorator(*
muon)};
44 for (
const auto& [pl,
hits] : hitIdMap) {
46 if (std::ranges::any_of(history,[&linkId](
const auto uniqueId){
47 return linkId == uniqueId;
51 return hit->
identify().get_compact();
56 return StatusCode::SUCCESS;
Identifier identify() const
Returns the global ATLAS identifier of the SimHit.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
IdHelperSvc for Identifier printing / manipulation.
SG::ReadHandleKey< xAOD::MuonSimHitContainer > m_simHitKey
Data dependency on the sim hit container.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_hitDecorKey
Decoration to the hit identifier vector.
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthKey
Data dependency on the truth input container to decorate.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode initialize() override final
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
std::deque< int > simulation_history(const T &p, const int direction)
Function to calculate all the descendants(direction=1)/ancestors(direction=-1) of the particle.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
This header ties the generic definitions in this package.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Handle class for reading from StoreGate.