8#include <GeoModelKernel/throwExcept.h>
15 return StatusCode::FAILURE;
19 return StatusCode::FAILURE;
32 return StatusCode::SUCCESS;
36 unsigned int nInputEvents) {
38 ATH_MSG_DEBUG(
"prepareEvent() called for " << nInputEvents <<
" input events");
41 return StatusCode::SUCCESS;
45 for (
const auto& [timeIndex, simHitColl] : hitColl) {
46 timedHits.reserve(timedHits.capacity() + simHitColl->size());
48 timedHits.emplace_back(timeIndex.time(), timeIndex.index(), simHit, timeIndex.type());
53 if (a->identify() != b->identify()){
54 return a->identify() < b->identify();
56 if (
a.eventId() != b.eventId()) {
57 return a.eventId() < b.eventId();
59 return a.eventTime() < b.eventTime();
61 return StatusCode::SUCCESS;
86 ATH_CHECK(sdoContainer.
record(std::make_unique<xAOD::MuonSimHitContainer>(),
87 std::make_unique<xAOD::MuonSimHitAuxContainer>()));
90 return StatusCode::SUCCESS;
98 ATH_CHECK(sdoContainer.
record(std::make_unique<xAOD::MuonSimHitContainer>(),
99 std::make_unique<xAOD::MuonSimHitAuxContainer>()));
104 return StatusCode::SUCCESS;
115 for (
auto& [hitPtr, hitContainer] : hitList) {
116 auto copyContainer = std::make_unique<xAOD::MuonSimHitContainer>();
117 auto copyAuxContainer = std::make_unique<xAOD::MuonSimHitAuxContainer>();
118 copyContainer->setStore(copyAuxContainer.get());
120 (*copyContainer->push_back(std::make_unique<xAOD::MuonSimHit>())) = (*copyMe);
122 hitListPermanent.emplace_back(hitPtr, copyContainer.get());
123 m_simHits.emplace_back(std::move(copyContainer), std::move(copyAuxContainer));
126 return StatusCode::SUCCESS;
132 rngWrapper->
setSeed(rngName, ctx);
159 acc_eventTime(*sdoHit) = hit.
eventTime();
160 acc_eventID(*sdoHit) = hit.
eventId();
166 const double deadTimeWindow,
168 auto insertItr = deadTimeMap.insert(std::make_pair(channelId,
hitTime));
170 if (insertItr.second) {
173 if (
hitTime - insertItr.first->second < deadTimeWindow) {
177 insertItr.first->second =
hitTime;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
A wrapper class for event-slot-local random engines.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Helper class to provide type-safe access to aux data.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
int pileupType() const
the type of event which the hit came from (signal, low pt minbias, high pt minbias,...
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
float eventTime() const
t0 offset of the bunch xing containing the hit in ns.
int pdgId() const
Returns the pdgID of the traversing particle.
Identifier identify() const
Returns the global ATLAS identifier of the SimHit.
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.
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
MuonSimHitContainer_v1 MuonSimHitContainer
Define the version of the pixel cluster container.
a struct encapsulating the identifier of a pile-up event
#define THROW_EXCEPTION(MESSAGE)