25 const std::string& name,
26 const IInterface* parent)
50 return StatusCode::FAILURE;
72 return StatusCode::SUCCESS;
80 return StatusCode::FAILURE;
84 rngWrapper->
setSeed(name(), ctx);
85 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
99 return StatusCode::SUCCESS;
107 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::processBunchXing " << bunch_xing);
114 TimedHitCollList_t timed_hit_coll_list;
117 sub_event_itr, sub_event_itr_end).isSuccess())) and
118 timed_hit_coll_list.size() == 0) {
120 return StatusCode::FAILURE;
122 ATH_MSG_VERBOSE(timed_hit_coll_list.size() <<
" SiHitCollections with key " <<
126 TimedHitCollList_t::iterator endColl{timed_hit_coll_list.end()};
127 for (TimedHitCollList_t::iterator iColl{timed_hit_coll_list.begin()}; iColl != endColl; ++iColl) {
128 std::unique_ptr<SiHitCollection> hitCollPtr{std::make_unique<SiHitCollection>(*iColl->second)};
130 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollPtr->size() <<
133 <<
" index: " << timeIndex.
index()
134 <<
" type: " << timeIndex.
type());
139 return StatusCode::SUCCESS;
147 rngWrapper->
setSeed(name(), ctx);
148 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
160 return StatusCode::SUCCESS;
190 return StatusCode::SUCCESS;
194 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::retrieveHitCollection()");
202 if (!hitCollection.
isValid()) {
203 ATH_MSG_ERROR(
"Could not get HGTD SiHitCollection container " << hitCollection.
name() <<
" from store " << hitCollection.
store());
204 return StatusCode::FAILURE;
210 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollection->size() <<
" hits");
212 return StatusCode::SUCCESS;
215 TimedHitCollList_t timed_hit_coll_list;
216 unsigned int n_si_hits(0);
222 timed_hit_coll_list.size() == 0) {
224 return StatusCode::FAILURE;
233 TimedHitCollList_t::iterator coll_itr(timed_hit_coll_list.begin());
234 TimedHitCollList_t::iterator coll_itr_end(timed_hit_coll_list.end());
236 while (coll_itr != coll_itr_end) {
249 return StatusCode::SUCCESS;
253 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::digitizeHitsPerDetectorElement");
258 if (elements==
nullptr) {
260 return StatusCode::FAILURE;
277 fist_hit->getBarrelEndcap(), fist_hit->getLayerDisk(),
278 fist_hit->getPhiModule(), fist_hit->getEtaModule());
286 std::unique_ptr<SiChargedDiodeCollection> charged_diode_coll =
287 std::make_unique<SiChargedDiodeCollection>(det_elem);
292 for (; coll_itr != coll_itr_end; ++coll_itr) {
303 current_hit, charged_diode_coll.get(), det_elem, rndmEngine, ctx);
318 return StatusCode::SUCCESS;
323 CLHEP::HepRandomEngine* rndmEngine)
const {
325 int processorNumber = 0;
336 proc->process(*charged_diodes, rndmEngine);
349 std::unique_ptr<HGTD_RDO_Collection> rdo_collection =
350 std::make_unique<HGTD_RDO_Collection>(idHash_de);
352 std::unique_ptr<HGTD_ALTIROC_RDO_Collection> altiroc_rdo_collection =
353 std::make_unique<HGTD_ALTIROC_RDO_Collection>(idHash_de);
357 rdo_collection->setIdentifier(id_de);
358 altiroc_rdo_collection->setIdentifier(id_de);
363 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
372 <<
" does not pass threshold of "
378 (*i_chargedDiode).second.getReadoutCell();
379 int eta_index = readout_cell.
etaIndex();
380 int phi_index = readout_cell.
phiIndex();
382 ATH_MSG_DEBUG(
"readout_cell ID: " << readout_cell <<
" eta:" << eta_index
383 <<
" phi:" << phi_index);
395 float charge_time =
charge.time();
397 unsigned int dummy_tot = 256;
398 unsigned short dummy_bcid = 0;
399 unsigned short dummy_l1a = 0;
400 unsigned short dummy_l1id = 0;
404 std::unique_ptr<HGTD_RDO> p_rdo = std::make_unique<HGTD_RDO>(
405 id_readout, charge_time, dummy_tot, dummy_bcid, dummy_l1a, dummy_l1id);
407 rdo_collection->push_back(p_rdo.release());
417 uint8_t dummy_crc = 0;
419 std::unique_ptr<HGTD_ALTIROC_RDO> p_altiroc_rdo =
420 std::make_unique<HGTD_ALTIROC_RDO>(id_readout,
427 altiroc_rdo_collection->push_back(p_altiroc_rdo.release());
435 const IdentifierHash identifyHash{rdo_collection->identifierHash()};
437 ->addCollection(rdo_collection.release(), identifyHash).isFailure()) {
438 ATH_MSG_FATAL(
"HGTD RDO collection could not be added to container!");
439 return StatusCode::FAILURE;
445 const IdentifierHash identifyHash{altiroc_rdo_collection->identifierHash()};
447 ->addCollection(altiroc_rdo_collection.release(), identifyHash).isFailure()) {
448 ATH_MSG_FATAL(
"HGTD ALTIROC RDO collection could not be added to container!");
449 return StatusCode::FAILURE;
453 return StatusCode::SUCCESS;
459 std::vector<InDetSimData::Deposit> deposits;
464 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
466 const list_t &charges = i_chargedDiode->second.totalCharge().chargeComposition();
467 bool real_particle_hit =
false;
468 for (
const auto&
charge : charges) {
474 real_particle_hit =
true;
476 auto reverseDeposits = deposits | std::views::reverse;
477 const auto deposit = std::ranges::find(reverseDeposits, trkLink, &InDetSimData::Deposit::first);
478 if (deposit != reverseDeposits.end()) {
480 deposit->second = std::min(deposit->second,
static_cast<float>(
charge.time()));
482 deposits.emplace_back(trkLink,
charge.time());
487 if (real_particle_hit) {
490 int eta_index = readout_cell.
etaIndex();
491 int phi_index = readout_cell.
phiIndex();
493 m_sdo_collection_map->try_emplace(id_readout, std::move(deposits), (*i_chargedDiode).second.flag());
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_FATAL(x,...)
double charge(const T &p)
SiChargedDiodeMap::iterator SiChargedDiodeIterator
AtlasHitsVector< SiHit > SiHitCollection
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.
a link optimized in size for a GenParticle in a McEventCollection
This is a "hash" representation of an Identifier.
Class to hold geometrical description of an HGTD detector element.
int phiIndex() const
Get phi index. Equivalent to strip().
int etaIndex() const
Get eta index.
Identifier for the strip or pixel readout cell.
Class to hold geometrical description of a solid state detector element.
const_pointer_type retrieve()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
std::string store() const
Return the name of the store holding the object we are proxying.
const std::string & name() const
Return the StoreGate ID for the referenced object.
virtual Identifier identify() const override final
SiChargedDiodeIterator begin()
virtual IdentifierHash identifyHash() const override final
SiChargedDiodeIterator end()
const SiTotalCharge & totalCharge() const
std::vector< SiCharge > list_t
TimedVector::const_iterator const_iterator
a smart pointer to a hit that also provides access to the extended timing info of the host event.
bool no_truth_link(const T &p)
Method to establish if a if the object is linked to something which was never saved to the HepMC Trut...
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
const HGTD_DetectorElement * getDetectorElement(const IdentifierHash &hash, const HGTD_DetectorElementCollection &coll)
DataVector< HGTD_DetectorElement > HGTD_DetectorElementCollection
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::list< value_t > type
type of the collection of timed data object
a struct encapsulating the identifier of a pile-up event
index_type index() const
the index of the component event in PileUpEventInfo
PileUpType type() const
the pileup type - minbias, cavern, beam halo, signal?
time_type time() const
bunch xing time in ns