ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_DigitizationTool Class Referenceabstract

#include <HGTD_DigitizationTool.h>

Inheritance diagram for HGTD_DigitizationTool:

Public Member Functions

 HGTD_DigitizationTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override final
virtual StatusCode processAllSubEvents (const EventContext &ctx) override final
 alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
virtual StatusCode prepareEvent (const EventContext &ctx, unsigned int) override final
 called before the bunchXing loop
virtual StatusCode processBunchXing (int bunch_xing, SubEventIterator sub_event_itr, SubEventIterator sub_event_itr_end) override final
 called for each active bunch-crossing (time in ns)
virtual StatusCode mergeEvent (const EventContext &ctx) override final
 called at the end of the bunchXing loop
virtual bool toProcess (int bunchXing) const =0
 flags whether this tool is "live" for bunchXing (time in ns) implemented by default in PileUpToolBase as FirstXing<=bunchXing<=LastXing
virtual bool filterPassed () const =0
 flags whether the event should be removed or not
virtual void resetFilter ()=0
 reset the filter
 DeclareInterfaceID (IPileUpTool, 1, 0)
 Creates the InterfaceID and interfaceID() method.

Static Public Member Functions

static const InterfaceID & interfaceID ()

Private Member Functions

StatusCode retrieveHitCollection (const EventContext &ctx)
 Retrieve the SiHit collection and place it in a TimedHitCollection.
StatusCode digitizeHitsPerDetectorElement (const EventContext &ctx, CLHEP::HepRandomEngine *rndmEngine)
void applyProcessorTools (SiChargedDiodeCollection *, CLHEP::HepRandomEngine *rndmEngine) const
 FIXME: will be implemented once we know how much noise we expect.
StatusCode createAndStoreRDO (SiChargedDiodeCollection *, const InDetDD::SolidStateDetectorElementBase *)
void createAndStoreSDO (SiChargedDiodeCollection *collection)

Private Attributes

FloatProperty m_charge_threshold {this, "ChargeThreshold", 625., "Minimum charge threshold in ASIC"}
BooleanProperty m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."}
SG::ReadHandleKey< SiHitCollection > m_hitsContainerKey {this, "InputObjectName", "HGTD_Hits", "Input HITS collection name"}
std::string m_inputObjectName {""}
SG::WriteHandle< HGTD_RDO_Container > m_hgtd_rdo_container
 RDO container handle.
SG::WriteHandleKey< HGTD_RDO_Container > m_output_rdo_cont_key {this, "OutputObjectName", "HGTD_RDOs", "Output Object name"}
SG::WriteHandle< HGTD_ALTIROC_RDO_Container > m_hgtd_altiroc_rdo_container
 ALTIROC RDO container handle.
SG::WriteHandleKey< HGTD_ALTIROC_RDO_Container > m_output_altiroc_rdo_cont_key {this, "AltirocOutputObject", "", "Key of HGTD_ALTIROC_RDO container"}
SG::WriteHandle< InDetSimDataCollection > m_sdo_collection_map
 SDO Map handle.
SG::WriteHandleKey< InDetSimDataCollection > m_output_sdo_coll_key {this, "OutputSDOName", "HGTD_SDO_Map", "Output SDO container name"}
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTDDetEleCollKey {this, "HGTDDetEleCollKey", "HGTD_DetectorElementCollection", "Key of HGTD_DetectorElementCollection for HGTD"}
ServiceHandle< PileUpMergeSvc > m_merge_svc {this, "MergeSvc", "PileUpMergeSvc", "Merge service used in Pixel & HGTD digitization"}
ServiceHandle< IAthRNGSvc > m_rndm_svc {this, "RndmSvc", "AthRNGSvc", "Random Number Service used in HGTD & Pixel digitization"}
 Random number service.
std::list< ISiChargedDiodesProcessorTool * > m_diode_processor_tools
ToolHandle< IFrontEnd > m_hgtd_front_end_tool {this, "FrontEnd", "HGTD_FrontEndTool", "Tool for pulse shape simulation"}
ToolHandle< IHGTD_SurfaceChargesGenerator > m_hgtd_surf_charge_gen {this, "SurfaceChargesGenerator", "HGTD_SurfaceChargesGenerator", "Choice of using a more detailed charge drift model"}
ToolHandle< HGTD_TdcCalibrationTool > m_hgtd_tdc_calib_tool {this, "HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool", "Tool that handles the Time to Digital Converter (TDC)"}
const HGTD_ID * m_id_helper {nullptr}
 Handle to the ID helper.
std::unique_ptr< TimedHitCollection< SiHit > > m_timed_hit_coll {nullptr}
std::vector< bool > m_processed_elements
 In order to process all element rather than just those with hits we create a vector to keep track of which elements have been processed.
std::vector< std::unique_ptr< SiHitCollection > > m_hit_coll_ptrs {}

structors and AlgTool implementation

virtual bool toProcess (int bunchXing) const override
 the method this base class helps implementing
virtual bool filterPassed () const override
 dummy implementation of passing filter
virtual void resetFilter () override
 dummy implementation of filter reset
Gaudi::Property< int > m_firstXing
Gaudi::Property< int > m_lastXing
Gaudi::Property< int > m_vetoPileUpTruthLinks
bool m_filterPassed {true}

Detailed Description

Definition at line 51 of file HGTD_DigitizationTool.h.

Constructor & Destructor Documentation

◆ HGTD_DigitizationTool()

HGTD_DigitizationTool::HGTD_DigitizationTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 24 of file HGTD_DigitizationTool.cxx.

27 : PileUpToolBase(type, name, parent) {
28}
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)

Member Function Documentation

◆ applyProcessorTools()

void HGTD_DigitizationTool::applyProcessorTools ( SiChargedDiodeCollection * charged_diodes,
CLHEP::HepRandomEngine * rndmEngine ) const
private

FIXME: will be implemented once we know how much noise we expect.

Step by step processor tools applied on diodes. These should simulate: Preamplifier -> Discriminator -> TDC. Is called within digitizeHitsPerDetectorElement.

Used tools: FrontEndTool, which calls the Amplifier inside

Definition at line 321 of file HGTD_DigitizationTool.cxx.

323 {
324 ATH_MSG_DEBUG("applyProcessorTools()");
325 int processorNumber = 0;
326
327 // std::list<ISiChargedDiodesProcessorTool *>::iterator provessor_itr =
328 // m_diode_processor_tools.begin();
329 // for (; provessor_itr != m_diode_processor_tools.end(); ++provessor_itr) {
330 // (*provessor_itr)->process(*charged_diodes, rndmEngine);
331
332 // processorNumber++;
333 // ATH_MSG_DEBUG("Applied processor # " << processorNumber);
334 // }
335 for (ISiChargedDiodesProcessorTool* proc: m_diode_processor_tools) {
336 proc->process(*charged_diodes, rndmEngine);
337
338 processorNumber++;
339 ATH_MSG_DEBUG("Applied processor # " << processorNumber);
340 }
341 return;
342}
#define ATH_MSG_DEBUG(x,...)
std::list< ISiChargedDiodesProcessorTool * > m_diode_processor_tools

◆ createAndStoreRDO()

StatusCode HGTD_DigitizationTool::createAndStoreRDO ( SiChargedDiodeCollection * charged_diodes,
const InDetDD::SolidStateDetectorElementBase * element )
private

Definition at line 344 of file HGTD_DigitizationTool.cxx.

345 {
346
347 IdentifierHash idHash_de = charged_diodes->identifyHash();
348
349 std::unique_ptr<HGTD_RDO_Collection> rdo_collection =
350 std::make_unique<HGTD_RDO_Collection>(idHash_de);
351
352 std::unique_ptr<HGTD_ALTIROC_RDO_Collection> altiroc_rdo_collection =
353 std::make_unique<HGTD_ALTIROC_RDO_Collection>(idHash_de);
354
355 // need the DE identifier
356 const Identifier id_de = charged_diodes->identify();
357 rdo_collection->setIdentifier(id_de);
358 altiroc_rdo_collection->setIdentifier(id_de);
359
360 SiChargedDiodeIterator i_chargedDiode = charged_diodes->begin();
361 SiChargedDiodeIterator i_chargedDiode_end = charged_diodes->end();
362
363 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
364
365 // skip deposits below the charge threshold of ~2fC after amplif.
366 // the charge here is the purely deposited charge, so factor ~20 less
367 // FIXME: gain radiation dependent, compensated with higher bias voltage
368 // more precise modelling in the future
369 SiChargedDiode& diode = (*i_chargedDiode).second;
370 if (diode.totalCharge().charge() < m_charge_threshold) {
371 ATH_MSG_DEBUG("charge of " << diode.totalCharge().charge()
372 << " does not pass threshold of "
374 continue;
375 }
376
377 InDetDD::SiReadoutCellId readout_cell =
378 (*i_chargedDiode).second.getReadoutCell();
379 int eta_index = readout_cell.etaIndex();
380 int phi_index = readout_cell.phiIndex();
381
382 ATH_MSG_DEBUG("readout_cell ID: " << readout_cell << " eta:" << eta_index
383 << " phi:" << phi_index);
384
385 // FIXME the method takes ID, phi, eta
386 // FIXME switching order here to fix upstream issue with orientations
387 const Identifier id_readout =
388 m_id_helper->pixel_id(charged_diodes->identify(), phi_index, eta_index);
389
390 const SiTotalCharge& charge = diode.totalCharge();
391
392 // this is the time of the main charge. For now this might be OK as long as
393 // the toal deposit just gets transformed into "one charge", but will need a
394 // change in the future!!
395 float charge_time = charge.time();
396
397 unsigned int dummy_tot = 256;
398 unsigned short dummy_bcid = 0;
399 unsigned short dummy_l1a = 0;
400 unsigned short dummy_l1id = 0;
401
402
403 if(!m_output_rdo_cont_key.key().empty()){
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);
406
407 rdo_collection->push_back(p_rdo.release());
408 }
409
410 if(!m_output_altiroc_rdo_cont_key.key().empty()){
411 uint8_t toa = m_hgtd_tdc_calib_tool->Time2TOA(element,charge_time);
412 // Check overflow to not store out of range measurements
413 if (m_hgtd_tdc_calib_tool->checkTOAoverflow(toa)){
414 continue;
415 }
416
417 uint8_t dummy_crc = 0;
418
419 std::unique_ptr<HGTD_ALTIROC_RDO> p_altiroc_rdo =
420 std::make_unique<HGTD_ALTIROC_RDO>(id_readout,
421 dummy_crc,
422 toa,
423 dummy_tot,
424 dummy_l1id,
425 dummy_bcid);
426
427 altiroc_rdo_collection->push_back(p_altiroc_rdo.release());
428 }
429 }
430
431 // Store the RDO collection
432
433 // Only store the HGTD_RDO if its WriteHandleKey is set
434 if(!m_output_rdo_cont_key.key().empty()){
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;
440 }
441 }
442
443 // Only store the HGTD_ALTIROC_RDO if its WriteHandleKey is set
444 if(!m_output_altiroc_rdo_cont_key.key().empty()){
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;
450 }
451 }
452
453 return StatusCode::SUCCESS;
454}
#define ATH_MSG_FATAL(x,...)
double charge(const T &p)
Definition AtlasPID.h:1003
SiChargedDiodeMap::iterator SiChargedDiodeIterator
SG::WriteHandleKey< HGTD_ALTIROC_RDO_Container > m_output_altiroc_rdo_cont_key
SG::WriteHandle< HGTD_RDO_Container > m_hgtd_rdo_container
RDO container handle.
const HGTD_ID * m_id_helper
Handle to the ID helper.
SG::WriteHandle< HGTD_ALTIROC_RDO_Container > m_hgtd_altiroc_rdo_container
ALTIROC RDO container handle.
ToolHandle< HGTD_TdcCalibrationTool > m_hgtd_tdc_calib_tool
SG::WriteHandleKey< HGTD_RDO_Container > m_output_rdo_cont_key
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
int etaIndex() const
Get eta index.
Definition SiCellId.h:114
virtual Identifier identify() const override final
SiChargedDiodeIterator begin()
virtual IdentifierHash identifyHash() const override final
const SiTotalCharge & totalCharge() const
double time() const
double charge() const
IDC::IDENTIFIABLE * addCollection(const Identifier collId, IDC *idc, const IDHELPER &idHelper, MsgStream &log)

◆ createAndStoreSDO()

void HGTD_DigitizationTool::createAndStoreSDO ( SiChargedDiodeCollection * collection)
private

Definition at line 457 of file HGTD_DigitizationTool.cxx.

457 {
458 using list_t = SiTotalCharge::list_t;
459 std::vector<InDetSimData::Deposit> deposits;
460 deposits.reserve(5); // no idea what a reasonable number for this would be with pileup
461 // loop over the charged diodes
462 SiChargedDiodeIterator i_chargedDiode = charged_diodes->begin();
463 SiChargedDiodeIterator i_chargedDiode_end = charged_diodes->end();
464 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
465 deposits.clear();
466 const list_t &charges = i_chargedDiode->second.totalCharge().chargeComposition();
467 bool real_particle_hit = false;
468 for (const auto& charge : charges) {
469 const HepMcParticleLink& trkLink = charge.particleLink();
471 continue;
472 }
473 if (!real_particle_hit && !HepMC::no_truth_link(trkLink) && charge.processType() == SiCharge::track) {
474 real_particle_hit = true;
475 }
476 auto reverseDeposits = deposits | std::views::reverse; //is a reverse search necessary?
477 const auto deposit = std::ranges::find(reverseDeposits, trkLink, &InDetSimData::Deposit::first);
478 if (deposit != reverseDeposits.end()) {
479 //deposit->second is a float, charge.time() is a double
480 deposit->second = std::min(deposit->second, static_cast<float>(charge.time()));
481 } else {
482 deposits.emplace_back(trkLink, charge.time());
483 }
484 }
485 // add the simdata object to the map if the deposit originated from a
486 // particle to which the truth information was kept. Can be HS and PU.
487 if (real_particle_hit) {
488
489 InDetDD::SiReadoutCellId readout_cell = i_chargedDiode->second.getReadoutCell();
490 int eta_index = readout_cell.etaIndex();
491 int phi_index = readout_cell.phiIndex();
492 const Identifier id_readout = m_id_helper->pixel_id(charged_diodes->identify(), phi_index, eta_index);
493 m_sdo_collection_map->try_emplace(id_readout, std::move(deposits), (*i_chargedDiode).second.flag());
494 }
495 } // END LOOP charged diodes
496}
SG::WriteHandle< InDetSimDataCollection > m_sdo_collection_map
SDO Map handle.
Gaudi::Property< int > m_vetoPileUpTruthLinks
std::vector< SiCharge > list_t
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.

◆ DeclareInterfaceID()

IPileUpTool::DeclareInterfaceID ( IPileUpTool ,
1 ,
0  )
inherited

Creates the InterfaceID and interfaceID() method.

◆ digitizeHitsPerDetectorElement()

StatusCode HGTD_DigitizationTool::digitizeHitsPerDetectorElement ( const EventContext & ctx,
CLHEP::HepRandomEngine * rndmEngine )
private

Definition at line 252 of file HGTD_DigitizationTool.cxx.

252 {
253 ATH_MSG_DEBUG("HGTD_DigitizationTool::digitizeHitsPerDetectorElement");
254
255 // Get HGTD_DetectorElementCollection
256 SG::ReadCondHandle<InDetDD::HGTD_DetectorElementCollection> hgtdDetEleColl(m_HGTDDetEleCollKey, ctx);
257 const InDetDD::HGTD_DetectorElementCollection* elements(hgtdDetEleColl.retrieve());
258 if (elements==nullptr) {
259 ATH_MSG_FATAL(m_HGTDDetEleCollKey.fullKey() << " could not be retrieved");
260 return StatusCode::FAILURE;
261 }
262
263 // the iterators mark the start and end of si hits that belong to one
264 // collection which means that they were found on the same detector element
265 // (module)
268
269 // the nextDetectorElement method sets the iterators to a range belonging to
270 // one module, so we iterate over modules (detector elements) in the while
271 // loop
272 while (m_timed_hit_coll->nextDetectorElement(coll_itr, coll_itr_end)) {
273
274 const TimedHitPtr<SiHit> &fist_hit = *coll_itr;
275
276 Identifier id = m_id_helper->wafer_id(
277 fist_hit->getBarrelEndcap(), fist_hit->getLayerDisk(),
278 fist_hit->getPhiModule(), fist_hit->getEtaModule());
279 IdentifierHash waferHash{m_id_helper->wafer_hash(id)};
280
281 // get the det element from the manager
282 const InDetDD::HGTD_DetectorElement *det_elem = InDetDD::HGTDDetEl::getDetectorElement(waferHash,*elements);
283 // FIXME check for null??
284 // create a diode collection holding the digitized hits
285 // FIXME (init once outside the while loop and use clear and set det elem??)
286 std::unique_ptr<SiChargedDiodeCollection> charged_diode_coll =
287 std::make_unique<SiChargedDiodeCollection>(det_elem);
288
290 // Loop over the hits on the selected detector element and created charged
291 // diodes
292 for (; coll_itr != coll_itr_end; ++coll_itr) {
293
294 const TimedHitPtr<SiHit> &current_hit = *coll_itr;
295
296 // use the surface charge generator to produce the charged diode
297 // and add it to the charged diode collection
298 //
299 // hits that are too far away in time to be captured by the ASICs
300 // are handled internally by the surface charge generator
301 //
302 m_hgtd_surf_charge_gen->createSurfaceChargesFromHit(
303 current_hit, charged_diode_coll.get(), det_elem, rndmEngine, ctx);
304
305 } // END LOOP over hits
307 // now that the charges have been built, apply all digitization tools
308 applyProcessorTools(charged_diode_coll.get(), rndmEngine);
309 // at this point, the RDOs and SDOs need to be created!!!
310
311 ATH_CHECK(createAndStoreRDO(charged_diode_coll.get(),det_elem));
312
313 createAndStoreSDO(charged_diode_coll.get());
314
315 ATH_MSG_DEBUG("charges filled for module " << id);
316 } // END LOOP over detector elements
317
318 return StatusCode::SUCCESS;
319}
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode createAndStoreRDO(SiChargedDiodeCollection *, const InDetDD::SolidStateDetectorElementBase *)
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTDDetEleCollKey
ToolHandle< IHGTD_SurfaceChargesGenerator > m_hgtd_surf_charge_gen
std::unique_ptr< TimedHitCollection< SiHit > > m_timed_hit_coll
void createAndStoreSDO(SiChargedDiodeCollection *collection)
void applyProcessorTools(SiChargedDiodeCollection *, CLHEP::HepRandomEngine *rndmEngine) const
FIXME: will be implemented once we know how much noise we expect.
TimedVector::const_iterator const_iterator
const HGTD_DetectorElement * getDetectorElement(const IdentifierHash &hash, const HGTD_DetectorElementCollection &coll)
DataVector< HGTD_DetectorElement > HGTD_DetectorElementCollection

◆ filterPassed() [1/2]

virtual bool IPileUpTool::filterPassed ( ) const
pure virtualinherited

flags whether the event should be removed or not

◆ filterPassed() [2/2]

virtual bool PileUpToolBase::filterPassed ( ) const
inlineoverridevirtualinherited

dummy implementation of passing filter

Definition at line 49 of file PileUpToolBase.h.

49{ return m_filterPassed; }

◆ initialize()

StatusCode HGTD_DigitizationTool::initialize ( )
finaloverridevirtual

Reimplemented from PileUpToolBase.

Definition at line 30 of file HGTD_DigitizationTool.cxx.

30 {
31
32 ATH_CHECK(detStore()->retrieve(m_id_helper, "HGTD_ID"));
33
35 ATH_CHECK(m_merge_svc.retrieve());
36 }
37
38 ATH_CHECK(m_rndm_svc.retrieve());
39
41
43
44 // add the front end to the set of tools used for diode processing
46
47 // check the input object name
48 if (m_hitsContainerKey.key().empty()) {
49 ATH_MSG_FATAL("Property InputObjectName not set !");
50 return StatusCode::FAILURE;
51 }
53 ATH_MSG_DEBUG("Input objects in container : '" << m_inputObjectName << "'");
54
55 // Initialize ReadHandleKey
56 ATH_CHECK(m_hitsContainerKey.initialize(true));
57 ATH_CHECK(m_HGTDDetEleCollKey.initialize());
58 ATH_CHECK(m_output_sdo_coll_key.initialize());
59
60 // Initialize RDO WriteHandleKey if keys not empty
61 if(!m_output_rdo_cont_key.key().empty()){
62 ATH_CHECK(m_output_rdo_cont_key.initialize());
63 }
64
65 // Initialize ALTIROC_RDO WriteHandleKey if keys not empty
66 // Only retrieve TDC calibration tool if it will be used
67 if(!m_output_altiroc_rdo_cont_key.key().empty()){
70 }
71
72 return StatusCode::SUCCESS;
73}
ServiceHandle< PileUpMergeSvc > m_merge_svc
ToolHandle< IFrontEnd > m_hgtd_front_end_tool
SG::WriteHandleKey< InDetSimDataCollection > m_output_sdo_coll_key
SG::ReadHandleKey< SiHitCollection > m_hitsContainerKey
ServiceHandle< IAthRNGSvc > m_rndm_svc
Random number service.
BooleanProperty m_onlyUseContainerName

◆ interfaceID()

const InterfaceID & HGTD_DigitizationTool::interfaceID ( )
inlinestatic

Definition at line 143 of file HGTD_DigitizationTool.h.

143 {
145}
static const InterfaceID IID_IHGTD_DigitizationTool("HGTD_DigitizationTool", 1, 0)

◆ mergeEvent()

StatusCode HGTD_DigitizationTool::mergeEvent ( const EventContext & ctx)
finaloverridevirtual

called at the end of the bunchXing loop

Reimplemented from IPileUpTool.

Definition at line 142 of file HGTD_DigitizationTool.cxx.

142 {
143 ATH_MSG_VERBOSE("HGTD_DigitizationTool::mergeEvent()");
144
145 // Set the RNG to use for this event.
146 ATHRNG::RNGWrapper* rngWrapper = m_rndm_svc->getEngine(this);
147 rngWrapper->setSeed(name(), ctx);
148 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
149
151
152 // FIXME: needs to be added once noise/selftriggering has to go in
153 // ATH_CHECK(simulateNoisePerDetectorElement());
154
155 m_hit_coll_ptrs.clear();
156
157 m_timed_hit_coll.reset(nullptr);
158
159 ATH_MSG_DEBUG("Digitize success!");
160 return StatusCode::SUCCESS;
161}
#define ATH_MSG_VERBOSE(x,...)
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition RNGWrapper.h:154
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:108
std::vector< std::unique_ptr< SiHitCollection > > m_hit_coll_ptrs
StatusCode digitizeHitsPerDetectorElement(const EventContext &ctx, CLHEP::HepRandomEngine *rndmEngine)

◆ prepareEvent()

StatusCode HGTD_DigitizationTool::prepareEvent ( const EventContext & ctx,
unsigned int  )
finaloverridevirtual

called before the bunchXing loop

Reimplemented from IPileUpTool.

Definition at line 166 of file HGTD_DigitizationTool.cxx.

166 {
167 ATH_MSG_DEBUG("HGTD_DigitizationTool::prepareEvent()");
168 // Create the IdentifiableContainer to contain the digit collections Create
169 // a new RDO container
170
171 if(!m_output_rdo_cont_key.key().empty()){
173 ATH_CHECK(m_hgtd_rdo_container.record(std::make_unique<HGTD_RDO_Container>(m_id_helper->wafer_hash_max())));
174 }
175
176 if(!m_output_altiroc_rdo_cont_key.key().empty()){
178 ATH_CHECK(m_hgtd_altiroc_rdo_container.record(std::make_unique<HGTD_ALTIROC_RDO_Container>(m_id_helper->wafer_hash_max())));
179 }
180
181 // Create a map for the SDO and register it into StoreGate
183 ATH_CHECK(m_sdo_collection_map.record(std::make_unique<InDetSimDataCollection>()));
184
185 m_processed_elements.clear(); // FIXME not sure I need this vector??
186 m_processed_elements.resize(m_id_helper->wafer_hash_max(), false);
187
188 m_timed_hit_coll = std::make_unique<TimedHitCollection<SiHit>>();
189
190 return StatusCode::SUCCESS;
191}
std::vector< bool > m_processed_elements
In order to process all element rather than just those with hits we create a vector to keep track of ...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ processAllSubEvents()

StatusCode HGTD_DigitizationTool::processAllSubEvents ( const EventContext & ctx)
finaloverridevirtual

alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.

Implements IPileUpTool.

Definition at line 75 of file HGTD_DigitizationTool.cxx.

75 {
76
77 ATH_MSG_DEBUG("processAllSubEvents");
78
79 if (prepareEvent(ctx, 0).isFailure()) {
80 return StatusCode::FAILURE;
81 }
82 // Set the RNG to use for this event.
83 ATHRNG::RNGWrapper* rngWrapper = m_rndm_svc->getEngine(this);
84 rngWrapper->setSeed(name(), ctx);
85 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
86
87 ATH_MSG_DEBUG("Begin digitizeAllHits");
88
89 if (retrieveHitCollection(ctx).isSuccess()) {
91 } else {
92 ATH_MSG_DEBUG("retrieveHitCollection found no hits");
93 }
94
95 // FIXME: needs to be added once noise/selftriggering has to go in
96 // ATH_CHECK(simulateNoisePerDetectorElement());
97
98 ATH_MSG_DEBUG("processAllSubEvents successful!");
99 return StatusCode::SUCCESS;
100}
StatusCode retrieveHitCollection(const EventContext &ctx)
Retrieve the SiHit collection and place it in a TimedHitCollection.
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int) override final
called before the bunchXing loop

◆ processBunchXing()

StatusCode HGTD_DigitizationTool::processBunchXing ( int bunchXing,
SubEventIterator bSubEvents,
SubEventIterator eSubEvents )
finaloverridevirtual

called for each active bunch-crossing (time in ns)

Implements IPileUpTool.

Definition at line 103 of file HGTD_DigitizationTool.cxx.

105 {
106
107 ATH_MSG_DEBUG("HGTD_DigitizationTool::processBunchXing " << bunch_xing);
108
109 // FIXME removed m_HardScatterSplittingMode and
110 // m_HardScatterSplittingSkipper until we have confirmed we need this
111
112 using TimedHitCollList_t = PileUpMergeSvc::TimedList<SiHitCollection>::type;
113 // this is a list<pair<time_t, DataLink<SiHitCollection> >
114 TimedHitCollList_t timed_hit_coll_list;
115
116 if ((not (m_merge_svc->retrieveSubSetEvtData(m_inputObjectName, timed_hit_coll_list, bunch_xing,
117 sub_event_itr, sub_event_itr_end).isSuccess())) and
118 timed_hit_coll_list.size() == 0) {
119 ATH_MSG_ERROR("Could not fill TimedHitCollList");
120 return StatusCode::FAILURE;
121 } else {
122 ATH_MSG_VERBOSE(timed_hit_coll_list.size() << " SiHitCollections with key " <<
123 m_inputObjectName << " found");
124 }
125
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)};
129 PileUpTimeEventIndex timeIndex{iColl->first};
130 ATH_MSG_DEBUG("SiHitCollection found with " << hitCollPtr->size() <<
131 " hits");
132 ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time()
133 << " index: " << timeIndex.index()
134 << " type: " << timeIndex.type());
135 m_timed_hit_coll->insert(timeIndex, hitCollPtr.get());
136 m_hit_coll_ptrs.push_back(std::move(hitCollPtr));
137 }
138
139 return StatusCode::SUCCESS;
140}
#define ATH_MSG_ERROR(x,...)
std::list< value_t > type
type of the collection of timed data object
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

◆ resetFilter() [1/2]

virtual void IPileUpTool::resetFilter ( )
pure virtualinherited

reset the filter

◆ resetFilter() [2/2]

virtual void PileUpToolBase::resetFilter ( )
inlineoverridevirtualinherited

dummy implementation of filter reset

Reimplemented in MergeTruthJetsTool.

Definition at line 51 of file PileUpToolBase.h.

51{ m_filterPassed=true; }

◆ retrieveHitCollection()

StatusCode HGTD_DigitizationTool::retrieveHitCollection ( const EventContext & ctx)
private

Retrieve the SiHit collection and place it in a TimedHitCollection.

Definition at line 193 of file HGTD_DigitizationTool.cxx.

193 {
194 ATH_MSG_DEBUG("HGTD_DigitizationTool::retrieveHitCollection()");
195
196 using TimedHitCollList_t = PileUpMergeSvc::TimedList<SiHitCollection>::type;
197 // this is a list<pair<time_t, DataLink<SiHitCollection> >
198
199 // In case of single hits container just load the collection using read handles
201 SG::ReadHandle<SiHitCollection> hitCollection(m_hitsContainerKey, ctx);
202 if (!hitCollection.isValid()) {
203 ATH_MSG_ERROR("Could not get HGTD SiHitCollection container " << hitCollection.name() << " from store " << hitCollection.store());
204 return StatusCode::FAILURE;
205 }
206
207 // create a new hits collection
208 m_timed_hit_coll = std::make_unique<TimedHitCollection<SiHit>>(1);
209 m_timed_hit_coll->insert(0, hitCollection.cptr());
210 ATH_MSG_DEBUG("SiHitCollection found with " << hitCollection->size() << " hits");
211
212 return StatusCode::SUCCESS;
213 }
214
215 TimedHitCollList_t timed_hit_coll_list;
216 unsigned int n_si_hits(0);
217
218 if (m_merge_svc
219 ->retrieveSubEvtsData(m_inputObjectName, timed_hit_coll_list,
220 n_si_hits)
221 .isFailure() and
222 timed_hit_coll_list.size() == 0) { // FIXME is the size check relevant??
223 ATH_MSG_ERROR("Could not fill TimedHitCollList_t");
224 return StatusCode::FAILURE;
225 } else {
226 ATH_MSG_DEBUG(timed_hit_coll_list.size() << " SiHitCollections with key " << m_inputObjectName << " found");
227 }
228
229 // create a new hits collection
230 m_timed_hit_coll = std::make_unique<TimedHitCollection<SiHit>>(n_si_hits);
231
232 // now merge all collections into one
233 TimedHitCollList_t::iterator coll_itr(timed_hit_coll_list.begin());
234 TimedHitCollList_t::iterator coll_itr_end(timed_hit_coll_list.end());
235
236 while (coll_itr != coll_itr_end) {
237
238 // FIXME removed m_HardScatterSplittingMode and
239 // m_HardScatterSplittingSkipper until we have confirmed we need this
240
241 const SiHitCollection *collection(coll_itr->second);
242
243 m_timed_hit_coll->insert(coll_itr->first, collection);
244
245 ATH_MSG_DEBUG("SiTrackerHitCollection found with" << collection->size()
246 << " hits");
247 ++coll_itr;
248 }
249 return StatusCode::SUCCESS;
250}
AtlasHitsVector< SiHit > SiHitCollection

◆ toProcess() [1/2]

virtual bool IPileUpTool::toProcess ( int bunchXing) const
pure virtualinherited

flags whether this tool is "live" for bunchXing (time in ns) implemented by default in PileUpToolBase as FirstXing<=bunchXing<=LastXing

◆ toProcess() [2/2]

virtual bool PileUpToolBase::toProcess ( int bunchXing) const
inlineoverridevirtualinherited

the method this base class helps implementing

Reimplemented in MergeHijingParsTool, and MergeTrackRecordCollTool.

Definition at line 32 of file PileUpToolBase.h.

32 {
33 //closed interval [m_firstXing,m_lastXing]
34 return !((m_firstXing > bunchXing) || (bunchXing > m_lastXing));
35 }
Gaudi::Property< int > m_firstXing
Gaudi::Property< int > m_lastXing

Member Data Documentation

◆ m_charge_threshold

FloatProperty HGTD_DigitizationTool::m_charge_threshold {this, "ChargeThreshold", 625., "Minimum charge threshold in ASIC"}
private

Definition at line 105 of file HGTD_DigitizationTool.h.

105{this, "ChargeThreshold", 625., "Minimum charge threshold in ASIC"};

◆ m_diode_processor_tools

std::list<ISiChargedDiodesProcessorTool*> HGTD_DigitizationTool::m_diode_processor_tools
private

Definition at line 123 of file HGTD_DigitizationTool.h.

◆ m_filterPassed

bool PileUpToolBase::m_filterPassed {true}
protectedinherited

Definition at line 60 of file PileUpToolBase.h.

60{true};

◆ m_firstXing

Gaudi::Property<int> PileUpToolBase::m_firstXing
protectedinherited
Initial value:
{this, "FirstXing", -999,
"First bunch-crossing in which det is live"}

Definition at line 54 of file PileUpToolBase.h.

54 {this, "FirstXing", -999,
55 "First bunch-crossing in which det is live"};

◆ m_hgtd_altiroc_rdo_container

SG::WriteHandle<HGTD_ALTIROC_RDO_Container> HGTD_DigitizationTool::m_hgtd_altiroc_rdo_container
private

ALTIROC RDO container handle.

Definition at line 114 of file HGTD_DigitizationTool.h.

◆ m_hgtd_front_end_tool

ToolHandle<IFrontEnd> HGTD_DigitizationTool::m_hgtd_front_end_tool {this, "FrontEnd", "HGTD_FrontEndTool", "Tool for pulse shape simulation"}
private

Definition at line 124 of file HGTD_DigitizationTool.h.

124{this, "FrontEnd", "HGTD_FrontEndTool", "Tool for pulse shape simulation"};

◆ m_hgtd_rdo_container

SG::WriteHandle<HGTD_RDO_Container> HGTD_DigitizationTool::m_hgtd_rdo_container
private

RDO container handle.

Definition at line 111 of file HGTD_DigitizationTool.h.

◆ m_hgtd_surf_charge_gen

ToolHandle<IHGTD_SurfaceChargesGenerator> HGTD_DigitizationTool::m_hgtd_surf_charge_gen {this, "SurfaceChargesGenerator", "HGTD_SurfaceChargesGenerator", "Choice of using a more detailed charge drift model"}
private

Definition at line 125 of file HGTD_DigitizationTool.h.

125{this, "SurfaceChargesGenerator", "HGTD_SurfaceChargesGenerator", "Choice of using a more detailed charge drift model"};

◆ m_hgtd_tdc_calib_tool

ToolHandle<HGTD_TdcCalibrationTool> HGTD_DigitizationTool::m_hgtd_tdc_calib_tool {this, "HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool", "Tool that handles the Time to Digital Converter (TDC)"}
private

Definition at line 126 of file HGTD_DigitizationTool.h.

126{this, "HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool", "Tool that handles the Time to Digital Converter (TDC)"};

◆ m_HGTDDetEleCollKey

SG::ReadCondHandleKey<InDetDD::HGTD_DetectorElementCollection> HGTD_DigitizationTool::m_HGTDDetEleCollKey {this, "HGTDDetEleCollKey", "HGTD_DetectorElementCollection", "Key of HGTD_DetectorElementCollection for HGTD"}
private

Definition at line 119 of file HGTD_DigitizationTool.h.

119{this, "HGTDDetEleCollKey", "HGTD_DetectorElementCollection", "Key of HGTD_DetectorElementCollection for HGTD"};

◆ m_hit_coll_ptrs

std::vector<std::unique_ptr<SiHitCollection> > HGTD_DigitizationTool::m_hit_coll_ptrs {}
private

Definition at line 139 of file HGTD_DigitizationTool.h.

139{};

◆ m_hitsContainerKey

SG::ReadHandleKey<SiHitCollection> HGTD_DigitizationTool::m_hitsContainerKey {this, "InputObjectName", "HGTD_Hits", "Input HITS collection name"}
private

Definition at line 108 of file HGTD_DigitizationTool.h.

108{this, "InputObjectName", "HGTD_Hits", "Input HITS collection name"};

◆ m_id_helper

const HGTD_ID* HGTD_DigitizationTool::m_id_helper {nullptr}
private

Handle to the ID helper.

Definition at line 128 of file HGTD_DigitizationTool.h.

128{nullptr};

◆ m_inputObjectName

std::string HGTD_DigitizationTool::m_inputObjectName {""}
private

Definition at line 109 of file HGTD_DigitizationTool.h.

109{""};

◆ m_lastXing

Gaudi::Property<int> PileUpToolBase::m_lastXing
protectedinherited
Initial value:
{this, "LastXing", 999,
"Last bunch-crossing in which det is live"}

Definition at line 56 of file PileUpToolBase.h.

56 {this, "LastXing", 999,
57 "Last bunch-crossing in which det is live"};

◆ m_merge_svc

ServiceHandle<PileUpMergeSvc> HGTD_DigitizationTool::m_merge_svc {this, "MergeSvc", "PileUpMergeSvc", "Merge service used in Pixel & HGTD digitization"}
private

Definition at line 121 of file HGTD_DigitizationTool.h.

121{this, "MergeSvc", "PileUpMergeSvc", "Merge service used in Pixel & HGTD digitization"};

◆ m_onlyUseContainerName

BooleanProperty HGTD_DigitizationTool::m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."}
private

Definition at line 107 of file HGTD_DigitizationTool.h.

107{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};

◆ m_output_altiroc_rdo_cont_key

SG::WriteHandleKey<HGTD_ALTIROC_RDO_Container> HGTD_DigitizationTool::m_output_altiroc_rdo_cont_key {this, "AltirocOutputObject", "", "Key of HGTD_ALTIROC_RDO container"}
private

Definition at line 115 of file HGTD_DigitizationTool.h.

115{this, "AltirocOutputObject", "", "Key of HGTD_ALTIROC_RDO container"};

◆ m_output_rdo_cont_key

SG::WriteHandleKey<HGTD_RDO_Container> HGTD_DigitizationTool::m_output_rdo_cont_key {this, "OutputObjectName", "HGTD_RDOs", "Output Object name"}
private

Definition at line 112 of file HGTD_DigitizationTool.h.

112{this, "OutputObjectName", "HGTD_RDOs", "Output Object name"};

◆ m_output_sdo_coll_key

SG::WriteHandleKey<InDetSimDataCollection> HGTD_DigitizationTool::m_output_sdo_coll_key {this, "OutputSDOName", "HGTD_SDO_Map", "Output SDO container name"}
private

Definition at line 118 of file HGTD_DigitizationTool.h.

118{this, "OutputSDOName", "HGTD_SDO_Map", "Output SDO container name"};

◆ m_processed_elements

std::vector<bool> HGTD_DigitizationTool::m_processed_elements
private

In order to process all element rather than just those with hits we create a vector to keep track of which elements have been processed.

This is useful for adding random noise (?!) NB. an element is an hgtd module

Definition at line 137 of file HGTD_DigitizationTool.h.

◆ m_rndm_svc

ServiceHandle<IAthRNGSvc> HGTD_DigitizationTool::m_rndm_svc {this, "RndmSvc", "AthRNGSvc", "Random Number Service used in HGTD & Pixel digitization"}
private

Random number service.

Definition at line 122 of file HGTD_DigitizationTool.h.

122{this, "RndmSvc", "AthRNGSvc", "Random Number Service used in HGTD & Pixel digitization"};

◆ m_sdo_collection_map

SG::WriteHandle<InDetSimDataCollection> HGTD_DigitizationTool::m_sdo_collection_map
private

SDO Map handle.

Definition at line 117 of file HGTD_DigitizationTool.h.

◆ m_timed_hit_coll

std::unique_ptr<TimedHitCollection<SiHit> > HGTD_DigitizationTool::m_timed_hit_coll {nullptr}
private

Definition at line 132 of file HGTD_DigitizationTool.h.

132{nullptr};

◆ m_vetoPileUpTruthLinks

Gaudi::Property<int> PileUpToolBase::m_vetoPileUpTruthLinks
protectedinherited
Initial value:
{this, "VetoPileUpTruthLinks", true,
"Ignore links to suppressed pile-up truth"}

Definition at line 58 of file PileUpToolBase.h.

58 {this, "VetoPileUpTruthLinks", true,
59 "Ignore links to suppressed pile-up truth"};

The documentation for this class was generated from the following files: