22 return StatusCode::FAILURE;
24 return StatusCode::SUCCESS;
30 std::map<Identifier, std::vector<const xAOD::MuonSimHit*>,
40 overlayed[hit->identify()].push_back(hit);
42 }
while (viewer.
next());
44 return StatusCode::SUCCESS;
51 ATH_CHECK(writeHandle.
record(std::make_unique<xAOD::MuonSimHitContainer>(),
52 std::make_unique<xAOD::MuonSimHitAuxContainer>()));
54 for (
auto& [mergeId, hits] : overlayed) {
57 return a->globalTime() < b->globalTime();
60 for (
auto itr = hits.begin(); itr != hits.end(); ++itr){
66 xAOD::MuonSimHit* merged = writeHandle->push_back(std::make_unique<xAOD::MuonSimHit>());
67 (*merged) = (*primHit);
68 auto mergeItr = itr +1;
69 for ( ; mergeItr !=hits.end(); ++mergeItr) {
78 (*merged) = (*mergeMe);
90 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
ATLAS-specific HepMC functions.
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Gaudi::Property< double > m_deadTime
Define a detector dead time.
SG::WriteHandleKey< xAOD::MuonSimHitContainer > m_writeKey
Gaudi::Property< bool > m_includePileUpTruth
SG::ReadHandleKey< xAOD::MuonSimHitContainer > m_sigKey
StatusCode execute(const EventContext &ctx) const override final
Gaudi::Property< int > m_vetoPileUpTruthLinks
SG::ReadHandleKey< xAOD::MuonSimHitContainer > m_bkgKey
StatusCode initialize() override final
Gaudi::Property< double > m_mergeTime
Define a detector merge time.
Property holding a SG store/key/clid from which a ReadHandle is made.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
bool next() noexcept
Loads the hits from the next chamber.
void setEnergyDeposit(const float deposit)
Sets the energy deposited by the traversing particle inside the gas volume.
float energyDeposit() const
Returns the energy deposited by the traversing particle inside the gas volume.
const HepMcParticleLink & genParticleLink() const
Returns the link to the HepMC particle producing this hit.
float globalTime() const
Returns the time ellapsed since the collision of the traversing particle.
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
This header ties the generic definitions in this package.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
MuonSimHitContainer_v1 MuonSimHitContainer
Define the version of the pixel cluster container.