 |
ATLAS Offline Software
|
Go to the documentation of this file.
23 const std::string&
name,
48 return StatusCode::FAILURE;
59 return StatusCode::SUCCESS;
67 return StatusCode::FAILURE;
72 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
86 return StatusCode::SUCCESS;
94 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::processBunchXing " << bunch_xing);
101 TimedHitCollList_t timed_hit_coll_list;
104 sub_event_itr, sub_event_itr_end).isSuccess())) and
105 timed_hit_coll_list.size() == 0) {
107 return StatusCode::FAILURE;
109 ATH_MSG_VERBOSE(timed_hit_coll_list.size() <<
" SiHitCollections with key " <<
115 std::unique_ptr<SiHitCollection> hitCollPtr{std::make_unique<SiHitCollection>(*iColl->second)};
117 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollPtr->size() <<
120 <<
" index: " << timeIndex.index()
121 <<
" type: " << timeIndex.type());
126 return StatusCode::SUCCESS;
135 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
147 return StatusCode::SUCCESS;
169 return StatusCode::SUCCESS;
173 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::retrieveHitCollection()");
181 if (!hitCollection.
isValid()) {
182 ATH_MSG_ERROR(
"Could not get HGTD SiHitCollection container " << hitCollection.
name() <<
" from store " << hitCollection.
store());
183 return StatusCode::FAILURE;
189 ATH_MSG_DEBUG(
"SiHitCollection found with " << hitCollection->
size() <<
" hits");
191 return StatusCode::SUCCESS;
194 TimedHitCollList_t timed_hit_coll_list;
195 unsigned int n_si_hits(0);
201 timed_hit_coll_list.size() == 0) {
203 return StatusCode::FAILURE;
215 while (coll_itr != coll_itr_end) {
228 return StatusCode::SUCCESS;
232 ATH_MSG_DEBUG(
"HGTD_DigitizationTool::digitizeHitsPerDetectorElement");
237 if (elements==
nullptr) {
239 return StatusCode::FAILURE;
256 fist_hit->getBarrelEndcap(), fist_hit->getLayerDisk(),
257 fist_hit->getPhiModule(), fist_hit->getEtaModule());
265 std::unique_ptr<SiChargedDiodeCollection> charged_diode_coll =
266 std::make_unique<SiChargedDiodeCollection>(det_elem);
271 for (; coll_itr != coll_itr_end; ++coll_itr) {
282 current_hit, charged_diode_coll.get(), det_elem, rndmEngine, ctx);
289 std::unique_ptr<HGTD_RDO_Collection> rdo_collection =
299 return StatusCode::SUCCESS;
304 CLHEP::HepRandomEngine* rndmEngine)
const {
306 int processorNumber = 0;
317 proc->process(*charged_diodes, rndmEngine);
326 std::unique_ptr<HGTD_RDO_Collection> coll) {
331 ATH_MSG_FATAL(
"HGTD RDO collection could not be added to container!");
332 return StatusCode::FAILURE;
334 return StatusCode::SUCCESS;
342 std::unique_ptr<HGTD_RDO_Collection> rdo_collection =
343 std::make_unique<HGTD_RDO_Collection>(idHash_de);
352 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
361 <<
" does not pass threshold of "
367 (*i_chargedDiode).second.getReadoutCell();
384 float toa =
charge.time();
386 unsigned int dummy_tot = 256;
387 unsigned short dummy_bcid = 0;
388 unsigned short dummy_l1a = 0;
389 unsigned short dummy_l1id = 0;
391 std::unique_ptr<HGTD_RDO> p_rdo = std::make_unique<HGTD_RDO>(
392 id_readout, toa, dummy_tot, dummy_bcid, dummy_l1a, dummy_l1id);
394 rdo_collection->
push_back(p_rdo.release());
396 return rdo_collection;
402 std::vector<InDetSimData::Deposit> deposits;
410 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
412 const list_t &charges =
413 (*i_chargedDiode).second.totalCharge().chargeComposition();
415 bool real_particle_hit =
false;
418 list_t::const_iterator charge_list_itr_end = charges.end();
419 list_t::const_iterator charge_list_itr = charges.begin();
421 for (; charge_list_itr != charge_list_itr_end; ++charge_list_itr) {
427 if (!real_particle_hit) {
438 real_particle_hit =
true;
444 std::vector<InDetSimData::Deposit>::reverse_iterator theDeposit =
446 std::vector<InDetSimData::Deposit>::reverse_iterator depositsR_end =
448 std::vector<InDetSimData::Deposit>::reverse_iterator i_Deposit =
450 for (; i_Deposit != depositsR_end; ++i_Deposit) {
451 if ((*i_Deposit).first == trkLink) {
452 theDeposit = i_Deposit;
458 if (theDeposit != depositsR_end) {
459 if((*theDeposit).second > charge_list_itr->time()){
460 (*theDeposit).first = trkLink;
461 (*theDeposit).second = charge_list_itr->time();
464 deposits.emplace_back(trkLink, charge_list_itr->time());
470 if (real_particle_hit) {
473 (*i_chargedDiode).second.getReadoutCell();
479 m_sdo_collection_map->try_emplace(id_readout, std::move(deposits), (*i_chargedDiode).second.flag());
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
const_pointer_type cptr()
Dereference the pointer.
size_type wafer_hash_max() const
virtual IdentifierHash identifyHash() const override final
const std::string & name() const
Return the StoreGate ID for the referenced object.
SiChargedDiodeIterator end()
int phiIndex() const
Get phi index. Equivalent to strip().
#define ATH_MSG_VERBOSE(x)
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
std::vector< SiCharge > list_t
SiChargedDiodeIterator begin()
SiChargedDiodeMap::iterator SiChargedDiodeIterator
Identifier wafer_id(int endcap, int layer, int phi_module, int eta_module) const
For a single crystal.
std::list< value_t > type
type of the collection of timed data object
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
a link optimized in size for a GenParticle in a McEventCollection
const SiTotalCharge & totalCharge() const
int etaIndex() const
Get eta index.
const_pointer_type retrieve()
void setIdentifier(Identifier id)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string store() const
Return the name of the store holding the object we are proxying.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
A wrapper class for event-slot-local random engines.
const IdentifierHash & identifierHash() const
IDC::IDENTIFIABLE * addCollection(const Identifier collId, IDC *idc, const IDHELPER &idHelper, MsgStream &log)
double charge(const T &p)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
Identifier pixel_id(int endcap, int layer, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
const HGTD_DetectorElement * getDetectorElement(const IdentifierHash &hash, const HGTD_DetectorElementCollection &coll)
a struct encapsulating the identifier of a pile-up 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...
virtual Identifier identify() const override final