24 const std::string& name,
25 const IInterface* parent)
49 return StatusCode::FAILURE;
71 return StatusCode::SUCCESS;
79 return StatusCode::FAILURE;
83 rngWrapper->
setSeed(name(), ctx);
84 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
98 return StatusCode::SUCCESS;
106 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::processBunchXing " << bunch_xing);
113 TimedHitCollList_t timed_hit_coll_list;
116 sub_event_itr, sub_event_itr_end).isSuccess())) and
117 timed_hit_coll_list.size() == 0) {
119 return StatusCode::FAILURE;
121 ATH_MSG_VERBOSE(timed_hit_coll_list.size() <<
" SiHitCollections with key " <<
125 TimedHitCollList_t::iterator endColl{timed_hit_coll_list.end()};
126 for (TimedHitCollList_t::iterator iColl{timed_hit_coll_list.begin()}; iColl != endColl; ++iColl) {
127 std::unique_ptr<SiHitCollection> hitCollPtr{std::make_unique<SiHitCollection>(*iColl->second)};
129 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollPtr->size() <<
132 <<
" index: " << timeIndex.
index()
133 <<
" type: " << timeIndex.
type());
138 return StatusCode::SUCCESS;
146 rngWrapper->
setSeed(name(), ctx);
147 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
159 return StatusCode::SUCCESS;
189 return StatusCode::SUCCESS;
193 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::retrieveHitCollection()");
201 if (!hitCollection.
isValid()) {
202 ATH_MSG_ERROR(
"Could not get HGTD SiHitCollection container " << hitCollection.
name() <<
" from store " << hitCollection.
store());
203 return StatusCode::FAILURE;
209 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollection->size() <<
" hits");
211 return StatusCode::SUCCESS;
214 TimedHitCollList_t timed_hit_coll_list;
215 unsigned int n_si_hits(0);
221 timed_hit_coll_list.size() == 0) {
223 return StatusCode::FAILURE;
232 TimedHitCollList_t::iterator coll_itr(timed_hit_coll_list.begin());
233 TimedHitCollList_t::iterator coll_itr_end(timed_hit_coll_list.end());
235 while (coll_itr != coll_itr_end) {
248 return StatusCode::SUCCESS;
252 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::digitizeHitsPerDetectorElement");
257 if (elements==
nullptr) {
259 return StatusCode::FAILURE;
276 fist_hit->getBarrelEndcap(), fist_hit->getLayerDisk(),
277 fist_hit->getPhiModule(), fist_hit->getEtaModule());
285 std::unique_ptr<SiChargedDiodeCollection> charged_diode_coll =
286 std::make_unique<SiChargedDiodeCollection>(det_elem);
291 for (; coll_itr != coll_itr_end; ++coll_itr) {
302 current_hit, charged_diode_coll.get(), det_elem, rndmEngine, ctx);
317 return StatusCode::SUCCESS;
322 CLHEP::HepRandomEngine* rndmEngine)
const {
324 int processorNumber = 0;
335 proc->process(*charged_diodes, rndmEngine);
348 std::unique_ptr<HGTD_RDO_Collection> rdo_collection =
349 std::make_unique<HGTD_RDO_Collection>(idHash_de);
351 std::unique_ptr<HGTD_ALTIROC_RDO_Collection> altiroc_rdo_collection =
352 std::make_unique<HGTD_ALTIROC_RDO_Collection>(idHash_de);
356 rdo_collection->setIdentifier(id_de);
357 altiroc_rdo_collection->setIdentifier(id_de);
362 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
371 <<
" does not pass threshold of "
377 (*i_chargedDiode).second.getReadoutCell();
378 int eta_index = readout_cell.
etaIndex();
379 int phi_index = readout_cell.
phiIndex();
381 ATH_MSG_DEBUG(
"readout_cell ID: " << readout_cell <<
" eta:" << eta_index
382 <<
" phi:" << phi_index);
394 float charge_time =
charge.time();
396 unsigned int dummy_tot = 256;
397 unsigned short dummy_bcid = 0;
398 unsigned short dummy_l1a = 0;
399 unsigned short dummy_l1id = 0;
403 std::unique_ptr<HGTD_RDO> p_rdo = std::make_unique<HGTD_RDO>(
404 id_readout, charge_time, dummy_tot, dummy_bcid, dummy_l1a, dummy_l1id);
406 rdo_collection->push_back(p_rdo.release());
416 uint8_t dummy_crc = 0;
418 std::unique_ptr<HGTD_ALTIROC_RDO> p_altiroc_rdo =
419 std::make_unique<HGTD_ALTIROC_RDO>(id_readout,
426 altiroc_rdo_collection->push_back(p_altiroc_rdo.release());
434 const IdentifierHash identifyHash{rdo_collection->identifierHash()};
436 ->addCollection(rdo_collection.release(), identifyHash).isFailure()) {
437 ATH_MSG_FATAL(
"HGTD RDO collection could not be added to container!");
438 return StatusCode::FAILURE;
444 const IdentifierHash identifyHash{altiroc_rdo_collection->identifierHash()};
446 ->addCollection(altiroc_rdo_collection.release(), identifyHash).isFailure()) {
447 ATH_MSG_FATAL(
"HGTD ALTIROC RDO collection could not be added to container!");
448 return StatusCode::FAILURE;
452 return StatusCode::SUCCESS;
458 std::vector<InDetSimData::Deposit> deposits;
466 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
468 const list_t &charges =
469 (*i_chargedDiode).second.totalCharge().chargeComposition();
471 bool real_particle_hit =
false;
474 list_t::const_iterator charge_list_itr_end = charges.end();
475 list_t::const_iterator charge_list_itr = charges.begin();
477 for (; charge_list_itr != charge_list_itr_end; ++charge_list_itr) {
483 if (!real_particle_hit) {
494 real_particle_hit =
true;
500 std::vector<InDetSimData::Deposit>::reverse_iterator theDeposit =
502 std::vector<InDetSimData::Deposit>::reverse_iterator depositsR_end =
504 std::vector<InDetSimData::Deposit>::reverse_iterator i_Deposit =
506 for (; i_Deposit != depositsR_end; ++i_Deposit) {
507 if ((*i_Deposit).first == trkLink) {
508 theDeposit = i_Deposit;
514 if (theDeposit != depositsR_end) {
515 if((*theDeposit).second > charge_list_itr->time()){
516 (*theDeposit).first = trkLink;
517 (*theDeposit).second = charge_list_itr->time();
520 deposits.emplace_back(trkLink, charge_list_itr->time());
526 if (real_particle_hit) {
529 (*i_chargedDiode).second.getReadoutCell();
530 int eta_index = readout_cell.
etaIndex();
531 int phi_index = readout_cell.
phiIndex();
533 charged_diodes->
identify(), phi_index, eta_index);
535 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_VERBOSE(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