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< SiHitCollectionm_hitsContainerKey {this, "InputObjectName", "HGTD_Hits", "Input HITS collection name"}
std::string m_inputObjectName {""}
SG::WriteHandle< HGTD_RDO_Containerm_hgtd_rdo_container
 RDO container handle.
SG::WriteHandleKey< HGTD_RDO_Containerm_output_rdo_cont_key {this, "OutputObjectName", "HGTD_RDOs", "Output Object name"}
SG::WriteHandle< HGTD_ALTIROC_RDO_Containerm_hgtd_altiroc_rdo_container
 ALTIROC RDO container handle.
SG::WriteHandleKey< HGTD_ALTIROC_RDO_Containerm_output_altiroc_rdo_cont_key {this, "AltirocOutputObject", "", "Key of HGTD_ALTIROC_RDO container"}
SG::WriteHandle< InDetSimDataCollectionm_sdo_collection_map
 SDO Map handle.
SG::WriteHandleKey< InDetSimDataCollectionm_output_sdo_coll_key {this, "OutputSDOName", "HGTD_SDO_Map", "Output SDO container name"}
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollectionm_HGTDDetEleCollKey {this, "HGTDDetEleCollKey", "HGTD_DetectorElementCollection", "Key of HGTD_DetectorElementCollection for HGTD"}
ServiceHandle< PileUpMergeSvcm_merge_svc {this, "MergeSvc", "PileUpMergeSvc", "Merge service used in Pixel & HGTD digitization"}
ServiceHandle< IAthRNGSvcm_rndm_svc {this, "RndmSvc", "AthRNGSvc", "Random Number Service used in HGTD & Pixel digitization"}
 Random number service.
std::list< ISiChargedDiodesProcessorTool * > m_diode_processor_tools
ToolHandle< IFrontEndm_hgtd_front_end_tool {this, "FrontEnd", "HGTD_FrontEndTool", "Tool for pulse shape simulation"}
ToolHandle< IHGTD_SurfaceChargesGeneratorm_hgtd_surf_charge_gen {this, "SurfaceChargesGenerator", "HGTD_SurfaceChargesGenerator", "Choice of using a more detailed charge drift model"}
ToolHandle< HGTD_TdcCalibrationToolm_hgtd_tdc_calib_tool {this, "HGTD_TdcCalibrationTool","HGTD_TdcCalibrationTool", "Tool that handles the Time to Digital Converter (TDC)"}
const HGTD_IDm_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 23 of file HGTD_DigitizationTool.cxx.

26 : PileUpToolBase(type, name, parent) {
27}
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 320 of file HGTD_DigitizationTool.cxx.

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

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

456 {
457 using list_t = SiTotalCharge::list_t;
458 std::vector<InDetSimData::Deposit> deposits;
459 deposits.reserve(5); // no idea what a reasonable number for this would be
460 // with pileup
461
462 // loop over the charged diodes
463 SiChargedDiodeIterator i_chargedDiode = charged_diodes->begin();
464 SiChargedDiodeIterator i_chargedDiode_end = charged_diodes->end();
465
466 for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
467 deposits.clear();
468 const list_t &charges =
469 (*i_chargedDiode).second.totalCharge().chargeComposition();
470
471 bool real_particle_hit = false;
472
473 // loop over the list of elements inside the charged diode
474 list_t::const_iterator charge_list_itr_end = charges.end();
475 list_t::const_iterator charge_list_itr = charges.begin();
476
477 for (; charge_list_itr != charge_list_itr_end; ++charge_list_itr) {
478
479 const HepMcParticleLink &trkLink = charge_list_itr->particleLink();
481 continue;
482 }
483 if (!real_particle_hit) {
484 // Types of SiCharges expected from HGTD
485 // Noise: barcode==0 &&
486 // processType()==SiCharge::noise
487 // Delta Rays: barcode==0 &&
488 // processType()==SiCharge::track
489 // Pile Up Tracks With No Truth: barcode!=0 &&
490 // processType()==SiCharge::cut_track
491 // Tracks With Truth: barcode!=0 &&
492 // processType()==SiCharge::track
493 if (!HepMC::no_truth_link(trkLink) && charge_list_itr->processType() == SiCharge::track) {
494 real_particle_hit = true;
495 }
496 // real_particle_hit = trkLink.isValid();
497 }
498
499 // check if this track number has been already used.
500 std::vector<InDetSimData::Deposit>::reverse_iterator theDeposit =
501 deposits.rend(); // dummy value
502 std::vector<InDetSimData::Deposit>::reverse_iterator depositsR_end =
503 deposits.rend();
504 std::vector<InDetSimData::Deposit>::reverse_iterator i_Deposit =
505 deposits.rbegin();
506 for (; i_Deposit != depositsR_end; ++i_Deposit) {
507 if ((*i_Deposit).first == trkLink) {
508 theDeposit = i_Deposit;
509 break;
510 }
511 }
512
513 // Diode has already a hit, check which one that arrived first.
514 if (theDeposit != depositsR_end) {
515 if((*theDeposit).second > charge_list_itr->time()){
516 (*theDeposit).first = trkLink;
517 (*theDeposit).second = charge_list_itr->time();
518 }
519 } else { // create a new deposit with the track lick and the ToA
520 deposits.emplace_back(trkLink, charge_list_itr->time());
521 }
522 } // END LOOP charges within diode
523
524 // add the simdata object to the map if the deposit originated from a
525 // particle to which the truth information was kept. Can be HS and PU.
526 if (real_particle_hit) {
527
528 InDetDD::SiReadoutCellId readout_cell =
529 (*i_chargedDiode).second.getReadoutCell();
530 int eta_index = readout_cell.etaIndex();
531 int phi_index = readout_cell.phiIndex();
532 const Identifier id_readout = m_id_helper->pixel_id(
533 charged_diodes->identify(), phi_index, eta_index);
534
535 m_sdo_collection_map->try_emplace(id_readout, std::move(deposits), (*i_chargedDiode).second.flag());
536 }
537 } // END LOOP charged diodes
538}
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 251 of file HGTD_DigitizationTool.cxx.

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

29 {
30
31 ATH_CHECK(detStore()->retrieve(m_id_helper, "HGTD_ID"));
32
34 ATH_CHECK(m_merge_svc.retrieve());
35 }
36
37 ATH_CHECK(m_rndm_svc.retrieve());
38
40
42
43 // add the front end to the set of tools used for diode processing
45
46 // check the input object name
47 if (m_hitsContainerKey.key().empty()) {
48 ATH_MSG_FATAL("Property InputObjectName not set !");
49 return StatusCode::FAILURE;
50 }
52 ATH_MSG_DEBUG("Input objects in container : '" << m_inputObjectName << "'");
53
54 // Initialize ReadHandleKey
55 ATH_CHECK(m_hitsContainerKey.initialize(true));
56 ATH_CHECK(m_HGTDDetEleCollKey.initialize());
57 ATH_CHECK(m_output_sdo_coll_key.initialize());
58
59 // Initialize RDO WriteHandleKey if keys not empty
60 if(!m_output_rdo_cont_key.key().empty()){
61 ATH_CHECK(m_output_rdo_cont_key.initialize());
62 }
63
64 // Initialize ALTIROC_RDO WriteHandleKey if keys not empty
65 // Only retrieve TDC calibration tool if it will be used
66 if(!m_output_altiroc_rdo_cont_key.key().empty()){
69 }
70
71 return StatusCode::SUCCESS;
72}
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
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ 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 & )
finaloverridevirtual

called at the end of the bunchXing loop

Reimplemented from IPileUpTool.

Definition at line 141 of file HGTD_DigitizationTool.cxx.

141 {
142 ATH_MSG_VERBOSE("HGTD_DigitizationTool::mergeEvent()");
143
144 // Set the RNG to use for this event.
145 ATHRNG::RNGWrapper* rngWrapper = m_rndm_svc->getEngine(this);
146 rngWrapper->setSeed(name(), ctx);
147 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
148
150
151 // FIXME: needs to be added once noise/selftriggering has to go in
152 // ATH_CHECK(simulateNoisePerDetectorElement());
153
154 m_hit_coll_ptrs.clear();
155
156 m_timed_hit_coll.reset(nullptr);
157
158 ATH_MSG_DEBUG("Digitize success!");
159 return StatusCode::SUCCESS;
160}
#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:169
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:134
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 & ,
unsigned int  )
finaloverridevirtual

called before the bunchXing loop

Reimplemented from IPileUpTool.

Definition at line 165 of file HGTD_DigitizationTool.cxx.

165 {
166 ATH_MSG_DEBUG("HGTD_DigitizationTool::prepareEvent()");
167 // Create the IdentifiableContainer to contain the digit collections Create
168 // a new RDO container
169
170 if(!m_output_rdo_cont_key.key().empty()){
172 ATH_CHECK(m_hgtd_rdo_container.record(std::make_unique<HGTD_RDO_Container>(m_id_helper->wafer_hash_max())));
173 }
174
175 if(!m_output_altiroc_rdo_cont_key.key().empty()){
177 ATH_CHECK(m_hgtd_altiroc_rdo_container.record(std::make_unique<HGTD_ALTIROC_RDO_Container>(m_id_helper->wafer_hash_max())));
178 }
179
180 // Create a map for the SDO and register it into StoreGate
182 ATH_CHECK(m_sdo_collection_map.record(std::make_unique<InDetSimDataCollection>()));
183
184 m_processed_elements.clear(); // FIXME not sure I need this vector??
185 m_processed_elements.resize(m_id_helper->wafer_hash_max(), false);
186
187 m_timed_hit_coll = std::make_unique<TimedHitCollection<SiHit>>();
188
189 return StatusCode::SUCCESS;
190}
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 74 of file HGTD_DigitizationTool.cxx.

74 {
75
76 ATH_MSG_DEBUG("processAllSubEvents");
77
78 if (prepareEvent(ctx, 0).isFailure()) {
79 return StatusCode::FAILURE;
80 }
81 // Set the RNG to use for this event.
82 ATHRNG::RNGWrapper* rngWrapper = m_rndm_svc->getEngine(this);
83 rngWrapper->setSeed(name(), ctx);
84 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
85
86 ATH_MSG_DEBUG("Begin digitizeAllHits");
87
88 if (retrieveHitCollection(ctx).isSuccess()) {
90 } else {
91 ATH_MSG_DEBUG("retrieveHitCollection found no hits");
92 }
93
94 // FIXME: needs to be added once noise/selftriggering has to go in
95 // ATH_CHECK(simulateNoisePerDetectorElement());
96
97 ATH_MSG_DEBUG("processAllSubEvents successful!");
98 return StatusCode::SUCCESS;
99}
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 102 of file HGTD_DigitizationTool.cxx.

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

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