ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
HGTD_DigitizationTool Class Referenceabstract

#include <HGTD_DigitizationTool.h>

Inheritance diagram for HGTD_DigitizationTool:
Collaboration 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. More...
 
virtual StatusCode prepareEvent (const EventContext &ctx, unsigned int) override final
 called before the bunchXing loop More...
 
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) More...
 
virtual StatusCode mergeEvent (const EventContext &ctx) override final
 called at the end of the bunchXing loop More...
 
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 More...
 
virtual bool filterPassed () const =0
 flags whether the event should be removed or not More...
 
virtual void resetFilter ()=0
 reset the filter More...
 
 DeclareInterfaceID (IPileUpTool, 1, 0)
 Creates the InterfaceID and interfaceID() method. More...
 

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. More...
 
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. More...
 
std::unique_ptr< HGTD_RDO_CollectioncreateRDOCollection (SiChargedDiodeCollection *) const
 
StatusCode storeRDOCollection (std::unique_ptr< HGTD_RDO_Collection >)
 
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. More...
 
SG::WriteHandleKey< HGTD_RDO_Containerm_output_rdo_cont_key {this, "OutputObjectName", "HGTD_RDOs", "Output Object name"}
 
SG::WriteHandle< InDetSimDataCollectionm_sdo_collection_map
 SDO Map handle. More...
 
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. More...
 
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"}
 
const HGTD_IDm_id_helper {nullptr}
 Handle to the ID helper. More...
 
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. More...
 
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 More...
 
virtual StatusCode processAllSubEvents (const EventContext &ctx)=0
 dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface. More...
 
virtual bool filterPassed () const override
 dummy implementation of passing filter More...
 
virtual void resetFilter () override
 dummy implementation of filter reset More...
 
Gaudi::Property< int > m_firstXing
 
Gaudi::Property< int > m_lastXing
 
Gaudi::Property< int > m_vetoPileUpTruthLinks
 
bool m_filterPassed {true}
 

Detailed Description

Definition at line 48 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 22 of file HGTD_DigitizationTool.cxx.

26 }

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 302 of file HGTD_DigitizationTool.cxx.

304  {
305  ATH_MSG_DEBUG("applyProcessorTools()");
306  int processorNumber = 0;
307 
308  // std::list<ISiChargedDiodesProcessorTool *>::iterator provessor_itr =
309  // m_diode_processor_tools.begin();
310  // for (; provessor_itr != m_diode_processor_tools.end(); ++provessor_itr) {
311  // (*provessor_itr)->process(*charged_diodes, rndmEngine);
312 
313  // processorNumber++;
314  // ATH_MSG_DEBUG("Applied processor # " << processorNumber);
315  // }
317  proc->process(*charged_diodes, rndmEngine);
318 
319  processorNumber++;
320  ATH_MSG_DEBUG("Applied processor # " << processorNumber);
321  }
322  return;
323 }

◆ createAndStoreSDO()

void HGTD_DigitizationTool::createAndStoreSDO ( SiChargedDiodeCollection collection)
private

Definition at line 399 of file HGTD_DigitizationTool.cxx.

400  {
401  using list_t = SiTotalCharge::list_t;
402  std::vector<InDetSimData::Deposit> deposits;
403  deposits.reserve(5); // no idea what a reasonable number for this would be
404  // with pileup
405 
406  // loop over the charged diodes
407  SiChargedDiodeIterator i_chargedDiode = charged_diodes->begin();
408  SiChargedDiodeIterator i_chargedDiode_end = charged_diodes->end();
409 
410  for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
411  deposits.clear();
412  const list_t &charges =
413  (*i_chargedDiode).second.totalCharge().chargeComposition();
414 
415  bool real_particle_hit = false;
416 
417  // loop over the list of elements inside the charged diode
418  list_t::const_iterator charge_list_itr_end = charges.end();
419  list_t::const_iterator charge_list_itr = charges.begin();
420 
421  for (; charge_list_itr != charge_list_itr_end; ++charge_list_itr) {
422 
423  const HepMcParticleLink &trkLink = charge_list_itr->particleLink();
425  continue;
426  }
427  if (!real_particle_hit) {
428  // Types of SiCharges expected from HGTD
429  // Noise: barcode==0 &&
430  // processType()==SiCharge::noise
431  // Delta Rays: barcode==0 &&
432  // processType()==SiCharge::track
433  // Pile Up Tracks With No Truth: barcode!=0 &&
434  // processType()==SiCharge::cut_track
435  // Tracks With Truth: barcode!=0 &&
436  // processType()==SiCharge::track
437  if (!HepMC::no_truth_link(trkLink) && charge_list_itr->processType() == SiCharge::track) {
438  real_particle_hit = true;
439  }
440  // real_particle_hit = trkLink.isValid();
441  }
442 
443  // check if this track number has been already used.
444  std::vector<InDetSimData::Deposit>::reverse_iterator theDeposit =
445  deposits.rend(); // dummy value
446  std::vector<InDetSimData::Deposit>::reverse_iterator depositsR_end =
447  deposits.rend();
448  std::vector<InDetSimData::Deposit>::reverse_iterator i_Deposit =
449  deposits.rbegin();
450  for (; i_Deposit != depositsR_end; ++i_Deposit) {
451  if ((*i_Deposit).first == trkLink) {
452  theDeposit = i_Deposit;
453  break;
454  }
455  }
456 
457  // Diode has already a hit, check which one that arrived first.
458  if (theDeposit != depositsR_end) {
459  if((*theDeposit).second > charge_list_itr->time()){
460  (*theDeposit).first = trkLink;
461  (*theDeposit).second = charge_list_itr->time();
462  }
463  } else { // create a new deposit with the track lick and the ToA
464  deposits.emplace_back(trkLink, charge_list_itr->time());
465  }
466  } // END LOOP charges within diode
467 
468  // add the simdata object to the map if the deposit originated from a
469  // particle to which the truth information was kept. Can be HS and PU.
470  if (real_particle_hit) {
471 
472  InDetDD::SiReadoutCellId readout_cell =
473  (*i_chargedDiode).second.getReadoutCell();
474  int eta_index = readout_cell.etaIndex();
475  int phi_index = readout_cell.phiIndex();
476  const Identifier id_readout = m_id_helper->pixel_id(
477  charged_diodes->identify(), phi_index, eta_index);
478 
479  m_sdo_collection_map->try_emplace(id_readout, std::move(deposits), (*i_chargedDiode).second.flag());
480  }
481  } // END LOOP charged diodes
482 }

◆ createRDOCollection()

std::unique_ptr< HGTD_RDO_Collection > HGTD_DigitizationTool::createRDOCollection ( SiChargedDiodeCollection charged_diodes) const
private

Definition at line 337 of file HGTD_DigitizationTool.cxx.

338  {
339 
340  IdentifierHash idHash_de = charged_diodes->identifyHash();
341 
342  std::unique_ptr<HGTD_RDO_Collection> rdo_collection =
343  std::make_unique<HGTD_RDO_Collection>(idHash_de);
344 
345  // need the DE identifier
346  const Identifier id_de = charged_diodes->identify();
347  rdo_collection->setIdentifier(id_de);
348 
349  SiChargedDiodeIterator i_chargedDiode = charged_diodes->begin();
350  SiChargedDiodeIterator i_chargedDiode_end = charged_diodes->end();
351 
352  for (; i_chargedDiode != i_chargedDiode_end; ++i_chargedDiode) {
353 
354  // skip deposits below the charge threshold of ~2fC after amplif.
355  // the charge here is the purely deposited charge, so factor ~20 less
356  // FIXME: gain radiation dependent, compensated with higher bias voltage
357  // more precise modelling in the future
358  SiChargedDiode& diode = (*i_chargedDiode).second;
359  if (diode.totalCharge().charge() < m_charge_threshold) {
360  ATH_MSG_DEBUG("charge of " << diode.totalCharge().charge()
361  << " does not pass threshold of "
362  << m_charge_threshold);
363  continue;
364  }
365 
366  InDetDD::SiReadoutCellId readout_cell =
367  (*i_chargedDiode).second.getReadoutCell();
368  int eta_index = readout_cell.etaIndex();
369  int phi_index = readout_cell.phiIndex();
370 
371  ATH_MSG_DEBUG("readout_cell ID: " << readout_cell << " eta:" << eta_index
372  << " phi:" << phi_index);
373 
374  // FIXME the method takes ID, phi, eta
375  // FIXME switching order here to fix upstream issue with orientations
376  const Identifier id_readout =
377  m_id_helper->pixel_id(charged_diodes->identify(), phi_index, eta_index);
378 
379  const SiTotalCharge& charge = diode.totalCharge();
380 
381  // this is the time of the main charge. For now this might be OK as long as
382  // the toal deposit just gets transformed into "one charge", but will need a
383  // change in the future!!
384  float toa = charge.time();
385 
386  unsigned int dummy_tot = 256;
387  unsigned short dummy_bcid = 0;
388  unsigned short dummy_l1a = 0;
389  unsigned short dummy_l1id = 0;
390 
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);
393 
394  rdo_collection->push_back(p_rdo.release());
395  }
396  return rdo_collection;
397 }

◆ DeclareInterfaceID()

IPileUpTool::DeclareInterfaceID ( IPileUpTool  ,
,
 
)
inherited

Creates the InterfaceID and interfaceID() method.

◆ digitizeHitsPerDetectorElement()

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

Definition at line 231 of file HGTD_DigitizationTool.cxx.

231  {
232  ATH_MSG_DEBUG("HGTD_DigitizationTool::digitizeHitsPerDetectorElement");
233 
234  // Get HGTD_DetectorElementCollection
236  const InDetDD::HGTD_DetectorElementCollection* elements(hgtdDetEleColl.retrieve());
237  if (elements==nullptr) {
238  ATH_MSG_FATAL(m_HGTDDetEleCollKey.fullKey() << " could not be retrieved");
239  return StatusCode::FAILURE;
240  }
241 
242  // the iterators mark the start and end of si hits that belong to one
243  // collection which means that they were found on the same detector element
244  // (module)
247 
248  // the nextDetectorElement method sets the iterators to a range belonging to
249  // one module, so we iterate over modules (detector elements) in the while
250  // loop
251  while (m_timed_hit_coll->nextDetectorElement(coll_itr, coll_itr_end)) {
252 
253  const TimedHitPtr<SiHit> &fist_hit = *coll_itr;
254 
256  fist_hit->getBarrelEndcap(), fist_hit->getLayerDisk(),
257  fist_hit->getPhiModule(), fist_hit->getEtaModule());
258  IdentifierHash waferHash{m_id_helper->wafer_hash(id)};
259 
260  // get the det element from the manager
261  const InDetDD::HGTD_DetectorElement *det_elem = elements->getDetectorElement(waferHash);
262  // FIXME check for null??
263  // create a diode collection holding the digitized hits
264  // FIXME (init once outside the while loop and use clear and set det elem??)
265  std::unique_ptr<SiChargedDiodeCollection> charged_diode_coll =
266  std::make_unique<SiChargedDiodeCollection>(det_elem);
267 
269  // Loop over the hits on the selected detector element and created charged
270  // diodes
271  for (; coll_itr != coll_itr_end; ++coll_itr) {
272 
273  const TimedHitPtr<SiHit> &current_hit = *coll_itr;
274 
275  // use the surface charge generator to produce the charged diode
276  // and add it to the charged diode collection
277  //
278  // hits that are too far away in time to be captured by the ASICs
279  // are handled internally by the surface charge generator
280  //
281  m_hgtd_surf_charge_gen->createSurfaceChargesFromHit(
282  current_hit, charged_diode_coll.get(), det_elem, rndmEngine, ctx);
283 
284  } // END LOOP over hits
286  // now that the charges have been built, apply all digitization tools
287  applyProcessorTools(charged_diode_coll.get(), rndmEngine);
288  // at this point, the RDOs and SDOs need to be created!!!
289  std::unique_ptr<HGTD_RDO_Collection> rdo_collection =
290  createRDOCollection(charged_diode_coll.get());
291 
292  ATH_CHECK(storeRDOCollection(std::move(rdo_collection)));
293 
294  createAndStoreSDO(charged_diode_coll.get());
295 
296  ATH_MSG_DEBUG("charges filled for module " << id);
297  } // END LOOP over detector elements
298 
299  return StatusCode::SUCCESS;
300 }

◆ 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 28 of file HGTD_DigitizationTool.cxx.

28  {
29 
30  ATH_CHECK(detStore()->retrieve(m_id_helper, "HGTD_ID"));
31 
33  ATH_CHECK(m_merge_svc.retrieve());
34  }
35 
36  ATH_CHECK(m_rndm_svc.retrieve());
37 
39 
40  ATH_CHECK(m_hgtd_front_end_tool.retrieve());
41 
42  // add the front end to the set of tools used for diode processing
44 
45  // check the input object name
46  if (m_hitsContainerKey.key().empty()) {
47  ATH_MSG_FATAL("Property InputObjectName not set !");
48  return StatusCode::FAILURE;
49  }
51  ATH_MSG_DEBUG("Input objects in container : '" << m_inputObjectName << "'");
52 
53  // Initialize ReadHandleKey
54  ATH_CHECK(m_hitsContainerKey.initialize(true));
58 
59  return StatusCode::SUCCESS;
60 }

◆ interfaceID()

const InterfaceID & HGTD_DigitizationTool::interfaceID ( )
inlinestatic

Definition at line 137 of file HGTD_DigitizationTool.h.

137  {
138  return IID_IHGTD_DigitizationTool;
139 }

◆ mergeEvent()

StatusCode HGTD_DigitizationTool::mergeEvent ( const EventContext &  )
finaloverridevirtual

called at the end of the bunchXing loop

Reimplemented from IPileUpTool.

Definition at line 129 of file HGTD_DigitizationTool.cxx.

129  {
130  ATH_MSG_VERBOSE("HGTD_DigitizationTool::mergeEvent()");
131 
132  // Set the RNG to use for this event.
133  ATHRNG::RNGWrapper* rngWrapper = m_rndm_svc->getEngine(this);
134  rngWrapper->setSeed(name(), ctx);
135  CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
136 
137  ATH_CHECK(digitizeHitsPerDetectorElement(ctx, rndmEngine));
138 
139  // FIXME: needs to be added once noise/selftriggering has to go in
140  // ATH_CHECK(simulateNoisePerDetectorElement());
141 
142  m_hit_coll_ptrs.clear();
143 
144  m_timed_hit_coll.reset(nullptr);
145 
146  ATH_MSG_DEBUG("Digitize success!");
147  return StatusCode::SUCCESS;
148 }

◆ prepareEvent()

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

called before the bunchXing loop

Reimplemented from IPileUpTool.

Definition at line 153 of file HGTD_DigitizationTool.cxx.

153  {
154  ATH_MSG_DEBUG("HGTD_DigitizationTool::prepareEvent()");
155  // Create the IdentifiableContainer to contain the digit collections Create
156  // a new RDO container
158  ATH_CHECK(m_hgtd_rdo_container.record(std::make_unique<HGTD_RDO_Container>(m_id_helper->wafer_hash_max())));
159 
160  // Create a map for the SDO and register it into StoreGate
162  ATH_CHECK(m_sdo_collection_map.record(std::make_unique<InDetSimDataCollection>()));
163 
164  m_processed_elements.clear(); // FIXME not sure I need this vector??
166 
167  m_timed_hit_coll = std::make_unique<TimedHitCollection<SiHit>>();
168 
169  return StatusCode::SUCCESS;
170 }

◆ processAllSubEvents() [1/2]

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 62 of file HGTD_DigitizationTool.cxx.

62  {
63 
64  ATH_MSG_DEBUG("processAllSubEvents");
65 
66  if (prepareEvent(ctx, 0).isFailure()) {
67  return StatusCode::FAILURE;
68  }
69  // Set the RNG to use for this event.
70  ATHRNG::RNGWrapper* rngWrapper = m_rndm_svc->getEngine(this);
71  rngWrapper->setSeed(name(), ctx);
72  CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
73 
74  ATH_MSG_DEBUG("Begin digitizeAllHits");
75 
76  if (retrieveHitCollection(ctx).isSuccess()) {
77  ATH_CHECK(digitizeHitsPerDetectorElement(ctx, rndmEngine));
78  } else {
79  ATH_MSG_DEBUG("retrieveHitCollection found no hits");
80  }
81 
82  // FIXME: needs to be added once noise/selftriggering has to go in
83  // ATH_CHECK(simulateNoisePerDetectorElement());
84 
85  ATH_MSG_DEBUG("processAllSubEvents successful!");
86  return StatusCode::SUCCESS;
87 }

◆ processAllSubEvents() [2/2]

virtual StatusCode IPileUpTool::processAllSubEvents
inherited

dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface.

◆ 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 90 of file HGTD_DigitizationTool.cxx.

92  {
93 
94  ATH_MSG_DEBUG("HGTD_DigitizationTool::processBunchXing " << bunch_xing);
95 
96  // FIXME removed m_HardScatterSplittingMode and
97  // m_HardScatterSplittingSkipper until we have confirmed we need this
98 
99  using TimedHitCollList_t = PileUpMergeSvc::TimedList<SiHitCollection>::type;
100  // this is a list<pair<time_t, DataLink<SiHitCollection> >
101  TimedHitCollList_t timed_hit_coll_list;
102 
103  if ((not (m_merge_svc->retrieveSubSetEvtData(m_inputObjectName, timed_hit_coll_list, bunch_xing,
104  sub_event_itr, sub_event_itr_end).isSuccess())) and
105  timed_hit_coll_list.size() == 0) {
106  ATH_MSG_ERROR("Could not fill TimedHitCollList");
107  return StatusCode::FAILURE;
108  } else {
109  ATH_MSG_VERBOSE(timed_hit_coll_list.size() << " SiHitCollections with key " <<
110  m_inputObjectName << " found");
111  }
112 
113  TimedHitCollList_t::iterator endColl{timed_hit_coll_list.end()};
114  for (TimedHitCollList_t::iterator iColl{timed_hit_coll_list.begin()}; iColl != endColl; ++iColl) {
115  std::unique_ptr<SiHitCollection> hitCollPtr{std::make_unique<SiHitCollection>(*iColl->second)};
116  PileUpTimeEventIndex timeIndex{iColl->first};
117  ATH_MSG_DEBUG("SiHitCollection found with " << hitCollPtr->size() <<
118  " hits");
119  ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time()
120  << " index: " << timeIndex.index()
121  << " type: " << timeIndex.type());
122  m_timed_hit_coll->insert(timeIndex, hitCollPtr.get());
123  m_hit_coll_ptrs.push_back(std::move(hitCollPtr));
124  }
125 
126  return StatusCode::SUCCESS;
127 }

◆ resetFilter() [1/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; }

◆ resetFilter() [2/2]

virtual void IPileUpTool::resetFilter ( )
pure virtualinherited

reset the filter

◆ retrieveHitCollection()

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

Retrieve the SiHit collection and place it in a TimedHitCollection.

Definition at line 172 of file HGTD_DigitizationTool.cxx.

172  {
173  ATH_MSG_DEBUG("HGTD_DigitizationTool::retrieveHitCollection()");
174 
175  using TimedHitCollList_t = PileUpMergeSvc::TimedList<SiHitCollection>::type;
176  // this is a list<pair<time_t, DataLink<SiHitCollection> >
177 
178  // In case of single hits container just load the collection using read handles
179  if (!m_onlyUseContainerName) {
181  if (!hitCollection.isValid()) {
182  ATH_MSG_ERROR("Could not get HGTD SiHitCollection container " << hitCollection.name() << " from store " << hitCollection.store());
183  return StatusCode::FAILURE;
184  }
185 
186  // create a new hits collection
187  m_timed_hit_coll = std::make_unique<TimedHitCollection<SiHit>>(1);
188  m_timed_hit_coll->insert(0, hitCollection.cptr());
189  ATH_MSG_DEBUG("SiHitCollection found with " << hitCollection->size() << " hits");
190 
191  return StatusCode::SUCCESS;
192  }
193 
194  TimedHitCollList_t timed_hit_coll_list;
195  unsigned int n_si_hits(0);
196 
197  if (m_merge_svc
198  ->retrieveSubEvtsData(m_inputObjectName, timed_hit_coll_list,
199  n_si_hits)
200  .isFailure() and
201  timed_hit_coll_list.size() == 0) { // FIXME is the size check relevant??
202  ATH_MSG_ERROR("Could not fill TimedHitCollList_t");
203  return StatusCode::FAILURE;
204  } else {
205  ATH_MSG_DEBUG(timed_hit_coll_list.size() << " SiHitCollections with key " << m_inputObjectName << " found");
206  }
207 
208  // create a new hits collection
209  m_timed_hit_coll = std::make_unique<TimedHitCollection<SiHit>>(n_si_hits);
210 
211  // now merge all collections into one
212  TimedHitCollList_t::iterator coll_itr(timed_hit_coll_list.begin());
213  TimedHitCollList_t::iterator coll_itr_end(timed_hit_coll_list.end());
214 
215  while (coll_itr != coll_itr_end) {
216 
217  // FIXME removed m_HardScatterSplittingMode and
218  // m_HardScatterSplittingSkipper until we have confirmed we need this
219 
220  const SiHitCollection *collection(coll_itr->second);
221 
222  m_timed_hit_coll->insert(coll_itr->first, collection);
223 
224  ATH_MSG_DEBUG("SiTrackerHitCollection found with" << collection->size()
225  << " hits");
226  ++coll_itr;
227  }
228  return StatusCode::SUCCESS;
229 }

◆ storeRDOCollection()

StatusCode HGTD_DigitizationTool::storeRDOCollection ( std::unique_ptr< HGTD_RDO_Collection coll)
private

Definition at line 325 of file HGTD_DigitizationTool.cxx.

326  {
327  const IdentifierHash identifyHash{coll->identifierHash()};
328  // Create the RDO collection
330  ->addCollection(coll.release(), identifyHash).isFailure()) {
331  ATH_MSG_FATAL("HGTD RDO collection could not be added to container!");
332  return StatusCode::FAILURE;
333  }
334  return StatusCode::SUCCESS;
335 }

◆ 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  }

Member Data Documentation

◆ m_charge_threshold

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

Definition at line 104 of file HGTD_DigitizationTool.h.

◆ m_diode_processor_tools

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

Definition at line 118 of file HGTD_DigitizationTool.h.

◆ m_filterPassed

bool PileUpToolBase::m_filterPassed {true}
protectedinherited

Definition at line 60 of file PileUpToolBase.h.

◆ 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.

◆ 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 119 of file HGTD_DigitizationTool.h.

◆ m_hgtd_rdo_container

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

RDO container handle.

Definition at line 110 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 120 of file HGTD_DigitizationTool.h.

◆ 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 114 of file HGTD_DigitizationTool.h.

◆ m_hit_coll_ptrs

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

Definition at line 133 of file HGTD_DigitizationTool.h.

◆ m_hitsContainerKey

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

Definition at line 107 of file HGTD_DigitizationTool.h.

◆ m_id_helper

const HGTD_ID* HGTD_DigitizationTool::m_id_helper {nullptr}
private

Handle to the ID helper.

Definition at line 122 of file HGTD_DigitizationTool.h.

◆ m_inputObjectName

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

Definition at line 108 of file HGTD_DigitizationTool.h.

◆ 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.

◆ m_merge_svc

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

Definition at line 116 of file HGTD_DigitizationTool.h.

◆ 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 106 of file HGTD_DigitizationTool.h.

◆ 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 111 of file HGTD_DigitizationTool.h.

◆ 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 113 of file HGTD_DigitizationTool.h.

◆ 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 131 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 117 of file HGTD_DigitizationTool.h.

◆ m_sdo_collection_map

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

SDO Map handle.

Definition at line 112 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 126 of file HGTD_DigitizationTool.h.

◆ 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.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
HGTD_DigitizationTool::m_output_sdo_coll_key
SG::WriteHandleKey< InDetSimDataCollection > m_output_sdo_coll_key
Definition: HGTD_DigitizationTool.h:113
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
HGTD_DigitizationTool::m_id_helper
const HGTD_ID * m_id_helper
Handle to the ID helper.
Definition: HGTD_DigitizationTool.h:122
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SiChargedDiode
Definition: SiChargedDiode.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
PileUpToolBase::m_filterPassed
bool m_filterPassed
Definition: PileUpToolBase.h:60
HGTD_ID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: HGTD_ID.h:404
HGTD_DigitizationTool::m_hitsContainerKey
SG::ReadHandleKey< SiHitCollection > m_hitsContainerKey
Definition: HGTD_DigitizationTool.h:107
HGTD_DigitizationTool::m_hgtd_surf_charge_gen
ToolHandle< IHGTD_SurfaceChargesGenerator > m_hgtd_surf_charge_gen
Definition: HGTD_DigitizationTool.h:120
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
SiChargedDiodeCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
Definition: SiChargedDiodeCollection.h:236
SiCharge::track
@ track
Definition: SiCharge.h:28
AtlasHitsVector
Definition: AtlasHitsVector.h:33
InDetDD::HGTD_DetectorElement
Definition: HGTD_DetectorElement.h:40
SiChargedDiodeCollection::end
SiChargedDiodeIterator end()
Definition: SiChargedDiodeCollection.h:253
SiTotalCharge::charge
double charge() const
Definition: SiTotalCharge.h:118
HGTD_DigitizationTool::createRDOCollection
std::unique_ptr< HGTD_RDO_Collection > createRDOCollection(SiChargedDiodeCollection *) const
Definition: HGTD_DigitizationTool.cxx:337
InDetDD::SiCellId::phiIndex
int phiIndex() const
Get phi index. Equivalent to strip().
Definition: SiCellId.h:122
TimedHitPtr< SiHit >
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PileUpToolBase::m_lastXing
Gaudi::Property< int > m_lastXing
Definition: PileUpToolBase.h:56
HGTD_DigitizationTool::m_sdo_collection_map
SG::WriteHandle< InDetSimDataCollection > m_sdo_collection_map
SDO Map handle.
Definition: HGTD_DigitizationTool.h:112
HepMC::ignoreTruthLink
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
Definition: MagicNumbers.h:332
SiTotalCharge::list_t
std::vector< SiCharge > list_t
Definition: SiTotalCharge.h:31
SiChargedDiodeCollection::begin
SiChargedDiodeIterator begin()
Definition: SiChargedDiodeCollection.h:248
ISiChargedDiodesProcessorTool
Definition: ISiChargedDiodesProcessorTool.h:26
PileUpToolBase::m_vetoPileUpTruthLinks
Gaudi::Property< int > m_vetoPileUpTruthLinks
Definition: PileUpToolBase.h:58
SiChargedDiodeIterator
SiChargedDiodeMap::iterator SiChargedDiodeIterator
Definition: SiChargedDiodeCollection.h:70
HGTD_DigitizationTool::m_inputObjectName
std::string m_inputObjectName
Definition: HGTD_DigitizationTool.h:108
HGTD_ID::wafer_id
Identifier wafer_id(int endcap, int layer, int phi_module, int eta_module) const
For a single crystal.
Definition: HGTD_ID.h:287
PileUpMergeSvc::TimedList::type
std::list< value_t > type
type of the collection of timed data object
Definition: PileUpMergeSvc.h:75
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
HGTD_DigitizationTool::m_rndm_svc
ServiceHandle< IAthRNGSvc > m_rndm_svc
Random number service.
Definition: HGTD_DigitizationTool.h:117
SiChargedDiode::totalCharge
const SiTotalCharge & totalCharge() const
Definition: SiChargedDiode.h:107
InDetDD::SiCellId::etaIndex
int etaIndex() const
Get eta index.
Definition: SiCellId.h:114
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HGTD_DigitizationTool::storeRDOCollection
StatusCode storeRDOCollection(std::unique_ptr< HGTD_RDO_Collection >)
Definition: HGTD_DigitizationTool.cxx:325
HGTD_RDO_Collection::setIdentifier
void setIdentifier(Identifier id)
Definition: HGTD_RDO_Collection.h:29
HGTD_DigitizationTool::retrieveHitCollection
StatusCode retrieveHitCollection(const EventContext &ctx)
Retrieve the SiHit collection and place it in a TimedHitCollection.
Definition: HGTD_DigitizationTool.cxx:172
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HGTD_DigitizationTool::m_hgtd_front_end_tool
ToolHandle< IFrontEnd > m_hgtd_front_end_tool
Definition: HGTD_DigitizationTool.h:119
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HGTD_DigitizationTool::m_merge_svc
ServiceHandle< PileUpMergeSvc > m_merge_svc
Definition: HGTD_DigitizationTool.h:116
PileUpToolBase::PileUpToolBase
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PileUpToolBase.cxx:7
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
createCablingJSON.eta_index
int eta_index
Definition: createCablingJSON.py:9
HGTD_DigitizationTool::m_timed_hit_coll
std::unique_ptr< TimedHitCollection< SiHit > > m_timed_hit_coll
Definition: HGTD_DigitizationTool.h:126
HGTD_DigitizationTool::applyProcessorTools
void applyProcessorTools(SiChargedDiodeCollection *, CLHEP::HepRandomEngine *rndmEngine) const
FIXME: will be implemented once we know how much noise we expect.
Definition: HGTD_DigitizationTool.cxx:302
HGTD_ID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: HGTD_ID.cxx:832
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
HGTD_DigitizationTool::digitizeHitsPerDetectorElement
StatusCode digitizeHitsPerDetectorElement(const EventContext &ctx, CLHEP::HepRandomEngine *rndmEngine)
Definition: HGTD_DigitizationTool.cxx:231
HGTD_DigitizationTool::m_HGTDDetEleCollKey
SG::ReadCondHandleKey< InDetDD::HGTD_DetectorElementCollection > m_HGTDDetEleCollKey
Definition: HGTD_DigitizationTool.h:114
mc.proc
proc
Definition: mc.PhPy8EG_A14NNPDF23_gg4l_example.py:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
HGTD_RDO_Collection::identifierHash
const IdentifierHash & identifierHash() const
Definition: HGTD_RDO_Collection.h:31
HGTD_DigitizationTool::m_hit_coll_ptrs
std::vector< std::unique_ptr< SiHitCollection > > m_hit_coll_ptrs
Definition: HGTD_DigitizationTool.h:133
Muon::IDC_Helper::addCollection
IDC::IDENTIFIABLE * addCollection(const Identifier collId, IDC *idc, const IDHELPER &idHelper, MsgStream &log)
charge
double charge(const T &p)
Definition: AtlasPID.h:538
HGTD_DigitizationTool::m_output_rdo_cont_key
SG::WriteHandleKey< HGTD_RDO_Container > m_output_rdo_cont_key
Definition: HGTD_DigitizationTool.h:111
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
HGTD_ID::pixel_id
Identifier pixel_id(int endcap, int layer, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Definition: HGTD_ID.h:331
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
HGTD_DigitizationTool::createAndStoreSDO
void createAndStoreSDO(SiChargedDiodeCollection *collection)
Definition: HGTD_DigitizationTool.cxx:399
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SiTotalCharge
Definition: SiTotalCharge.h:24
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PileUpToolBase::m_firstXing
Gaudi::Property< int > m_firstXing
Definition: PileUpToolBase.h:54
HGTD_DigitizationTool::m_diode_processor_tools
std::list< ISiChargedDiodesProcessorTool * > m_diode_processor_tools
Definition: HGTD_DigitizationTool.h:118
InDetDD::SiReadoutCellId
Definition: SiReadoutCellId.h:42
HGTD_DigitizationTool::prepareEvent
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int) override final
called before the bunchXing loop
Definition: HGTD_DigitizationTool.cxx:153
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
InDetDD::HGTD_DetectorElementCollection
Definition: HGTD_DetectorElementCollection.h:29
PileUpTimeEventIndex
a struct encapsulating the identifier of a pile-up event
Definition: PileUpTimeEventIndex.h:12
HGTD_DigitizationTool::m_charge_threshold
FloatProperty m_charge_threshold
Definition: HGTD_DigitizationTool.h:104
TimedHitCollection
Definition: TimedHitCollection.h:15
HepMC::no_truth_link
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...
Definition: MagicNumbers.h:329
HGTD_DigitizationTool::m_hgtd_rdo_container
SG::WriteHandle< HGTD_RDO_Container > m_hgtd_rdo_container
RDO container handle.
Definition: HGTD_DigitizationTool.h:110
HGTD_DigitizationTool::m_onlyUseContainerName
BooleanProperty m_onlyUseContainerName
Definition: HGTD_DigitizationTool.h:106
HGTD_DigitizationTool::m_processed_elements
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 ...
Definition: HGTD_DigitizationTool.h:131
SiChargedDiodeCollection::identify
virtual Identifier identify() const override final
Definition: SiChargedDiodeCollection.h:230
Identifier
Definition: IdentifierFieldParser.cxx:14