ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
HGTD_SmearedDigitizationTool Class Reference

#include <HGTD_SmearedDigitizationTool.h>

Inheritance diagram for HGTD_SmearedDigitizationTool:
Collaboration diagram for HGTD_SmearedDigitizationTool:

Public Types

using Cluster_t = HGTD_Cluster
 
using ClusterCollection_t = HGTD_ClusterCollection
 
using ClusterContainer_t = HGTD_ClusterContainer
 
using HGTD_DetElement_RIO_Map_t = std::multimap< IdentifierHash, const Cluster_t * >
 

Public Member Functions

 HGTD_SmearedDigitizationTool (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~HGTD_SmearedDigitizationTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode processAllSubEvents (const EventContext &ctx) override
 

Private Member Functions

StatusCode retrieveTruth (PRD_MultiTruthCollection *&prd_truth_coll)
 
TimedHitCollection< SiHitsetupTimedHitCollection ()
 
StatusCode digitize (const EventContext &ctx, TimedHitCollection< SiHit > &timed_hit_collection, HGTD_DetElement_RIO_Map_t &det_element_rio_map)
 
StatusCode fillMultiTruthCollection (PRD_MultiTruthCollection *, Cluster_t *, const TimedHitPtr< SiHit > &, const EventContext &)
 
StatusCode fillClusterContainer (HGTD_DetElement_RIO_Map_t &det_element_rio_map, ClusterContainer_t &cluster_container)
 
float smearPosition (float pos, float sig, float boundary, CLHEP::HepRandomEngine *rndmEngine)
 
float smearMeanTime (float time, float time_res, CLHEP::HepRandomEngine *rndmEngine)
 

Private Attributes

const HGTD_DetectorManagerm_hgtd_det_manager {nullptr}
 
const HGTD_IDm_hgtd_idhelper {nullptr}
 
std::string m_prd_truth_coll_name {"PRD_MultiTruthPixel"}
 
ServiceHandle< PileUpMergeSvcm_merge_svc {this, "MergeSvc", "PileUpMergeSvc", "Merge service used in HGTD fast digitization"}
 
ServiceHandle< IAthRNGSvcm_rndm_svc {this, "RndmSvc", "AthRNGSvc", "Random number service used in HGTD fast digitization"}
 Random number service. More...
 
StringProperty m_cluster_name {this, "HGTD_ClustersContainerName", "HGTD_Cluster", "Name of the HGTD cluster container"}
 
StringProperty m_si_hit_collection_name {this, "SiHitCollectionName", "HGTD_Hits", "Name of the Si Hit collection"}
 
BooleanProperty m_smear_intersection_position {this, "SmearIntersectionPosition", true, ""}
 
BooleanProperty m_smear_mean_time {this, "SmearMeanTime", true, ""}
 
BooleanProperty m_write_tree {this, "WriteTree", false, ""}
 
FloatProperty m_pitch_x {this, "pitch_X", 1.3, ""}
 
FloatProperty m_pitch_y {this, "pitch_Y", 1.3, ""}
 
float m_time_res {0.035}
 
ServiceHandle< ITHistSvc > m_hist_svc {this, "THistSvc", "THistSvc"}
 
std::unique_ptr< TFile > m_output_file
 
std::unique_ptr< TTree > m_tree
 
float m_x_hit {}
 
float m_y_hit {}
 
float m_x_hit_smeared {}
 
float m_y_hit_smeared {}
 
float m_x_entry_hit {}
 
float m_y_entry_hit {}
 
float m_z_entry_hit {}
 
float m_x_exit_hit {}
 
float m_y_exit_hit {}
 
float m_z_exit_hit {}
 
float m_hit_time {}
 
float m_hit_time_smeared {}
 
float m_x_cluster_global {}
 
float m_y_cluster_global {}
 
float m_z_cluster_global {}
 
float m_err_x_hit {}
 
float m_err_y_hit {}
 

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 StatusCode processBunchXing (int, SubEventIterator, SubEventIterator) override
 
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 44 of file HGTD_SmearedDigitizationTool.h.

Member Typedef Documentation

◆ Cluster_t

Definition at line 46 of file HGTD_SmearedDigitizationTool.h.

◆ ClusterCollection_t

Definition at line 47 of file HGTD_SmearedDigitizationTool.h.

◆ ClusterContainer_t

Definition at line 48 of file HGTD_SmearedDigitizationTool.h.

◆ HGTD_DetElement_RIO_Map_t

Definition at line 50 of file HGTD_SmearedDigitizationTool.h.

Constructor & Destructor Documentation

◆ HGTD_SmearedDigitizationTool()

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

Definition at line 26 of file HGTD_SmearedDigitizationTool.cxx.

27  :
29 }

◆ ~HGTD_SmearedDigitizationTool()

HGTD_SmearedDigitizationTool::~HGTD_SmearedDigitizationTool ( )
default

Member Function Documentation

◆ digitize()

StatusCode HGTD_SmearedDigitizationTool::digitize ( const EventContext &  ctx,
TimedHitCollection< SiHit > &  timed_hit_collection,
HGTD_DetElement_RIO_Map_t det_element_rio_map 
)
private

Definition at line 161 of file HGTD_SmearedDigitizationTool.cxx.

164 {
165  ATH_MSG_DEBUG("--- HGTD_SmearedDigitizationTool: in digitize() ---");
166 
167  // Set the RNG to use for this event.
168  ATHRNG::RNGWrapper* rngWrapper = m_rndm_svc->getEngine(this);
169  rngWrapper->setSeed(name(), ctx);
170  CLHEP::HepRandomEngine* rndmEngine = rngWrapper->getEngine(ctx);
171 
172  PRD_MultiTruthCollection* prd_truth_coll = nullptr;
173  ATH_CHECK(retrieveTruth(prd_truth_coll));
174 
175  // i, e are iterator and end of one detector element
177 
178  while (timed_hit_collection.nextDetectorElement(i, e) and i != e) {
179  const TimedHitPtr<SiHit>& hit(*i++);
180 
181  // FIXME should I cut on the deposited energy??
182  // n electrons = hit->energyLoss() / electron ionisation energy
183  // n * e * gain > 4fCs
184 
185  int endcap = hit->getBarrelEndcap();
186  int layer = hit->getLayerDisk();
187  int phi_module = hit->getPhiModule();
188  int eta_module = hit->getEtaModule();
189 
190  ATH_MSG_DEBUG("HGTD DetectorElement --> endcap "
191  << endcap << ", layer_disk " << layer << ", phi_module "
192  << phi_module << ", eta_module " << eta_module);
193 
194  const InDetDD::SolidStateDetectorElementBase* curr_det_element =
195  m_hgtd_det_manager->getDetectorElement(endcap, layer, phi_module,
196  eta_module);
197 
198  if (!curr_det_element) {
199  ATH_MSG_ERROR("could not get detector element for SolidStateDetector");
200  continue;
201  }
202 
203  IdentifierHash wafer_id =
204  m_hgtd_idhelper->wafer_hash(curr_det_element->identify());
205 
206  HepGeom::Point3D<double> hit_loc_start_pos = hit->localStartPosition();
207  HepGeom::Point3D<double> hit_loc_end_pos = hit->localEndPosition();
208 
209  HepGeom::Point3D<double> hit_glob_start_pos =
210  curr_det_element->hitLocalToLocal3D(hit_loc_start_pos);
211  HepGeom::Point3D<double> hit_glob_end_pos =
212  curr_det_element->hitLocalToLocal3D(hit_loc_end_pos);
213 
214  double globa_entry_x = hit_glob_start_pos.x();
215  double globa_entry_y = hit_glob_start_pos.y();
216  m_x_entry_hit = globa_entry_x;
217  m_y_entry_hit = globa_entry_y;
218  m_z_entry_hit = hit_glob_start_pos.z();
219 
220  double globa_exit_x = hit_glob_end_pos.x();
221  double globa_exit_y = hit_glob_end_pos.y();
222  m_x_exit_hit = globa_exit_x;
223  m_y_exit_hit = globa_exit_y;
224  m_z_exit_hit = hit_glob_end_pos.z();
225 
226  double dist_x = std::abs(std::abs(globa_exit_x) - std::abs(globa_entry_x));
227  double dist_y = std::abs(std::abs(globa_exit_y) - std::abs(globa_entry_y));
228 
229  Amg::Vector2D local_entry(globa_entry_x, globa_entry_y);
230  Amg::Vector2D local_exit(globa_exit_x, globa_exit_y);
231 
232  // get the identifier of the entry and the exit
233  Identifier entry_id = curr_det_element->identifierOfPosition(local_entry);
234  Identifier exit_id = curr_det_element->identifierOfPosition(local_exit);
235 
236  // now get the cellIds and check whether they're valid
237  InDetDD::SiCellId entry_cell_id =
238  curr_det_element->cellIdFromIdentifier(entry_id);
239  InDetDD::SiCellId exit_cell_id =
240  curr_det_element->cellIdFromIdentifier(exit_id);
241 
242  ATH_MSG_DEBUG("--- HGTD_SmearedDigitizationTool: entryId "
243  << entry_id << " --- exitId " << exit_id);
244  ATH_MSG_DEBUG("--- HGTD_SmearedDigitizationTool: entryCellId "
245  << entry_cell_id << " --- exitCellId " << exit_cell_id);
246 
247  if (not entry_cell_id.isValid() or not exit_cell_id.isValid()) {
248  continue;
249  }
250 
251  // the intersecetion id and cellId of it. yes, this is correct
252  double intersection_x = 0.5 * (globa_entry_x + globa_exit_x);
253  double intersection_y = 0.5 * (globa_entry_y + globa_exit_y);
254  m_x_hit = intersection_x;
255  m_y_hit = intersection_y;
256 
257  // calculate how many pixels the particle crosses in x and y direction
258  double times_x = floor(dist_x / m_pitch_x);
259  double times_y = floor(dist_y / m_pitch_y);
260 
261  double sigma_x = m_pitch_x / std::sqrt(12);
262  double sigma_y = m_pitch_y / std::sqrt(12);
263 
264  int element_x = times_x + 1;
265  int element_y = times_y + 1;
266 
267  // Smear pixel in x and y direction
268  // FIXME make sure the length width dimensions are correct!!!
270  intersection_x = smearPosition(intersection_x, sigma_x,
271  curr_det_element->width() / 2.,
272  rndmEngine);
273  intersection_y = smearPosition(intersection_y, sigma_y,
274  curr_det_element->length() / 2.,
275  rndmEngine);
276  }
277  m_x_hit_smeared = intersection_x;
278  m_y_hit_smeared = intersection_y;
279 
280  Amg::Vector2D intersection(intersection_x, intersection_y);
281 
282  Identifier intersection_id =
283  curr_det_element->identifierOfPosition(intersection);
284 
285  // the pixel positions and other elements for the geometrical clustering
286  std::vector<Identifier> rdo_list = {intersection_id};
287 
288  InDetDD::SiCellId current_cell_id =
289  curr_det_element->cellIdFromIdentifier(intersection_id);
290 
291  if (!current_cell_id.isValid()) {
292  continue;
293  }
294 
295  double length_x = element_x * m_pitch_x;
296  double length_y = element_y * m_pitch_y;
297 
298  InDet::SiWidth si_width(Amg::Vector2D(element_x, element_y),
299  Amg::Vector2D(length_x, length_y));
300 
301  AmgSymMatrix(2) covariance;
302  covariance.setIdentity();
303  covariance(Trk::locX, Trk::locX) = sigma_x * sigma_x;
304  covariance(Trk::locY, Trk::locY) = sigma_y * sigma_y;
305  Amg::MatrixX cluster_err = Amg::MatrixX(covariance);
306 
307  float hit_time = hit->meanTime();
308  m_hit_time = hit_time;
310  hit_time = smearMeanTime(hit_time, m_time_res, rndmEngine);
311  }
312  m_hit_time_smeared = hit_time;
313 
314  std::vector<int> tot_vec = {0}; // dummy, not used in reco currently
315 
316  Cluster_t* cluster = new Cluster_t(intersection_id, intersection, std::move(rdo_list),
317  si_width, curr_det_element, std::move(cluster_err),
318  hit_time, m_time_res, std::move(tot_vec));
319 
320  m_x_cluster_global = (cluster->globalPosition()).x();
321  m_y_cluster_global = (cluster->globalPosition()).y();
322  m_z_cluster_global = (cluster->globalPosition()).z();
323  m_err_x_hit = Amg::error(cluster->localCovariance(), Trk::locX);
324  m_err_y_hit = Amg::error(cluster->localCovariance(), Trk::locY);
325 
326  if (m_write_tree) {
327  m_tree->Fill();
328  }
329 
330  det_element_rio_map.insert(
331  std::pair<IdentifierHash, const Cluster_t*>(wafer_id, cluster));
332 
333  ATH_CHECK(fillMultiTruthCollection(prd_truth_coll, cluster, hit, ctx));
334 
335  } // END while
336  return StatusCode::SUCCESS;
337 }

◆ fillClusterContainer()

StatusCode HGTD_SmearedDigitizationTool::fillClusterContainer ( HGTD_DetElement_RIO_Map_t det_element_rio_map,
ClusterContainer_t cluster_container 
)
private

Definition at line 375 of file HGTD_SmearedDigitizationTool.cxx.

376  {
378  "--- HGTD_SmearedDigitizationTool: in fillClusterContainer() ---");
379  using RIO_map_t = HGTD_DetElement_RIO_Map_t;
380 
381  RIO_map_t::iterator i = det_element_rio_map.begin();
382  RIO_map_t::iterator e = det_element_rio_map.end();
383 
384  for (; i != e; i = det_element_rio_map.upper_bound(i->first)) {
385 
386  std::pair<RIO_map_t::iterator, RIO_map_t::iterator> range;
387  range = det_element_rio_map.equal_range(i->first);
388 
389  RIO_map_t::iterator first_det_elem = range.first;
390 
391  IdentifierHash wafer_id = first_det_elem->first;
392 
393  const InDetDD::SolidStateDetectorElementBase* det_element =
395 
396  ClusterCollection_t* cluster_coll = new ClusterCollection_t(wafer_id);
397  cluster_coll->setIdentifier(det_element->identify());
398 
399  for (RIO_map_t::iterator iter = range.first; iter != range.second; ++iter) {
400 
401  Cluster_t* cluster = const_cast<Cluster_t*>((*iter).second);
402  cluster->setHashAndIndex(cluster_coll->identifyHash(),
403  cluster_coll->size());
404  cluster_coll->push_back(cluster);
405  }
406 
407  if (cluster_container.addCollection(cluster_coll, wafer_id)
408  .isFailure()) {
409  ATH_MSG_WARNING("Could not add collection to Identifiable container!");
410  }
411  } // end for
412 
413  return StatusCode::SUCCESS;
414 }

◆ fillMultiTruthCollection()

StatusCode HGTD_SmearedDigitizationTool::fillMultiTruthCollection ( PRD_MultiTruthCollection map,
Cluster_t cluster,
const TimedHitPtr< SiHit > &  hit,
const EventContext &  ctx 
)
private

Definition at line 359 of file HGTD_SmearedDigitizationTool.cxx.

359  {
360 
361  const HepMcParticleLink trk_link = HepMcParticleLink::getRedirectedLink(hit->particleLink(), hit.eventId(), ctx); // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc.
362 
363  ATH_MSG_DEBUG("Truth map filling with cluster "
364  << *cluster << " and link = " << trk_link);
365 
366  if (trk_link.isValid()) {
368  map->insert(std::make_pair(cluster->identify(), trk_link));
369  }
370  }
371 
372  return StatusCode::SUCCESS;
373 }

◆ filterPassed()

virtual bool PileUpToolBase::filterPassed ( ) const
inlineoverridevirtualinherited

dummy implementation of passing filter

Definition at line 49 of file PileUpToolBase.h.

49 { return m_filterPassed; }

◆ finalize()

StatusCode HGTD_SmearedDigitizationTool::finalize ( )
overridevirtual

Definition at line 75 of file HGTD_SmearedDigitizationTool.cxx.

75  {
76 
77  ATH_MSG_DEBUG("HGTD_SmearedDigitizationTool::finalize()");
78 
79  if (m_write_tree) {
80  m_output_file->cd();
81  m_tree->Write();
82  m_output_file->Close();
83  }
84 
85  return StatusCode::SUCCESS;
86 }

◆ initialize()

StatusCode HGTD_SmearedDigitizationTool::initialize ( )
overridevirtual

Reimplemented from PileUpToolBase.

Definition at line 33 of file HGTD_SmearedDigitizationTool.cxx.

33  {
34 
35  ATH_MSG_DEBUG("HGTD_SmearedDigitizationTool::initialize()");
36 
37  // Get the HGTD Detector Manager
39 
40  // Get the HGTD ID helper
42 
43  // locate the PileUpMergeSvc
44  ATH_CHECK(m_merge_svc.retrieve());
45 
46  if (m_write_tree) {
47  ATH_CHECK(m_hist_svc.retrieve());
48  m_output_file = std::make_unique<TFile>("HGTD_SmearedDigiOutput.root", "RECREATE");
49  m_tree = std::make_unique<TTree>("SmearedDigiTree", "SmearedDigiTree");
50  m_tree->Branch("m_x_hit", &m_x_hit);
51  m_tree->Branch("m_y_hit", &m_y_hit);
52  m_tree->Branch("m_x_entry_hit", &m_x_entry_hit);
53  m_tree->Branch("m_y_entry_hit", &m_y_entry_hit);
54  m_tree->Branch("m_z_entry_hit", &m_z_entry_hit);
55  m_tree->Branch("m_x_exit_hit", &m_x_exit_hit);
56  m_tree->Branch("m_y_exit_hit", &m_y_exit_hit);
57  m_tree->Branch("m_z_exit_hit", &m_z_exit_hit);
58  m_tree->Branch("m_x_cluster_global", &m_x_cluster_global);
59  m_tree->Branch("m_y_cluster_global", &m_y_cluster_global);
60  m_tree->Branch("m_z_cluster_global", &m_z_cluster_global);
61  m_tree->Branch("m_x_hit_smeared", &m_x_hit_smeared);
62  m_tree->Branch("m_y_hit_smeared", &m_y_hit_smeared);
63  m_tree->Branch("m_hit_time", &m_hit_time);
64  m_tree->Branch("m_hit_time_smeared", &m_hit_time_smeared);
65  m_tree->Branch("m_err_x_hit", &m_err_x_hit);
66  m_tree->Branch("m_err_y_hit", &m_err_y_hit);
67 
68  ATH_CHECK(m_hist_svc->regTree("HGTD_ClusterSmearedDigi", m_tree.get()));
69  }
70 
71  return StatusCode::SUCCESS;
72 }

◆ processAllSubEvents() [1/2]

StatusCode HGTD_SmearedDigitizationTool::processAllSubEvents ( const EventContext &  ctx)
overridevirtual

Reimplemented from PileUpToolBase.

Definition at line 88 of file HGTD_SmearedDigitizationTool.cxx.

88  {
89 
90  ATH_MSG_DEBUG("[HGTD_SmearedDigitizationTool::processAllSubEvents]");
91 
92  auto cluster_container =
94 
95  cluster_container->cleanup();
96 
97  ATH_CHECK(evtStore()->record(cluster_container, m_cluster_name));
98 
99  auto timed_hit_collection = setupTimedHitCollection();
100  HGTD_DetElement_RIO_Map_t det_element_rio_map;
101  ATH_CHECK(digitize(ctx,
102  timed_hit_collection,
103  det_element_rio_map));
104 
105  // TODO: also needs an EventContext (is it the equivalent of createAndStoreRIOs in SiSmearedDigitizationTool)?
106  ATH_CHECK(fillClusterContainer (det_element_rio_map,
107  *cluster_container));
108 
109  return StatusCode::SUCCESS;
110 }

◆ 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()

virtual StatusCode PileUpToolBase::processBunchXing ( int  ,
SubEventIterator  ,
SubEventIterator   
)
inlineoverridevirtualinherited

◆ resetFilter()

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

◆ retrieveTruth()

StatusCode HGTD_SmearedDigitizationTool::retrieveTruth ( PRD_MultiTruthCollection *&  prd_truth_coll)
private

Definition at line 113 of file HGTD_SmearedDigitizationTool.cxx.

113  {
114 
115  if ((evtStore()->contains<PRD_MultiTruthCollection>(m_prd_truth_coll_name))) {
116  ATH_CHECK((evtStore()->retrieve(prd_truth_coll, m_prd_truth_coll_name)));
117  } else {
118  prd_truth_coll = new PRD_MultiTruthCollection;
119  ATH_CHECK(evtStore()->record(prd_truth_coll, m_prd_truth_coll_name));
120  }
121 
122  return StatusCode::SUCCESS;
123 }

◆ setupTimedHitCollection()

TimedHitCollection< SiHit > HGTD_SmearedDigitizationTool::setupTimedHitCollection ( )
private

Definition at line 126 of file HGTD_SmearedDigitizationTool.cxx.

126  {
127  // Define Hit Collection
128  TimedHitCollection<SiHit> timed_hit_coll;
129 
130  // get the container(s)
131  typedef PileUpMergeSvc::TimedList<SiHitCollection>::type TimedHitCollList_t;
132 
133  // this is a list<pair<time_t, DataLink<SCTUncompressedHitCollection> > >
134  TimedHitCollList_t hit_coll_list;
135  unsigned int num_si_hits(0);
136  if (!(m_merge_svc
137  ->retrieveSubEvtsData(m_si_hit_collection_name.value(), hit_coll_list,
138  num_si_hits)
139  .isSuccess()) and
140  hit_coll_list.empty()) {
141  ATH_MSG_ERROR("Could not fill TimedHitCollList_t");
142  return timed_hit_coll;
143  }
144 
145  ATH_MSG_DEBUG(hit_coll_list.size() << " SiHitCollections with key "
146  << m_si_hit_collection_name << " found");
147 
148  timed_hit_coll.reserve(num_si_hits);
149 
150  // loop on the hit collections
151  for(auto hit_coll : hit_coll_list) {
152  const SiHitCollection* si_collection(hit_coll.second);
153  timed_hit_coll.insert(hit_coll.first, si_collection);
154  ATH_MSG_DEBUG("SiHitCollection found with " << si_collection->size()
155  << " hits");
156  }
157  return timed_hit_coll;
158 }

◆ smearMeanTime()

float HGTD_SmearedDigitizationTool::smearMeanTime ( float  time,
float  time_res,
CLHEP::HepRandomEngine *  rndmEngine 
)
private

Definition at line 355 of file HGTD_SmearedDigitizationTool.cxx.

355  {
356  return time + CLHEP::RandGauss::shoot(rndmEngine, 0., time_res);
357 }

◆ smearPosition()

float HGTD_SmearedDigitizationTool::smearPosition ( float  pos,
float  sig,
float  boundary,
CLHEP::HepRandomEngine *  rndmEngine 
)
private

Definition at line 339 of file HGTD_SmearedDigitizationTool.cxx.

340  {
341  ATH_MSG_DEBUG("[HGTD_SmearedDigitizationTool::smearPosition] pos: "
342  << pos << " sig: " << sig << " boundary: " << boundary);
343  float smeared_pos = pos;
344  float smear_para = 0.;
345  if (sig != 0.) {
346  do {
347  smear_para = CLHEP::RandGauss::shoot(rndmEngine, 0., sig);
348 
349  } while (std::abs(smeared_pos + smear_para) > boundary);
350  smeared_pos += smear_para;
351  }
352  return smeared_pos;
353 }

◆ toProcess()

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_cluster_name

StringProperty HGTD_SmearedDigitizationTool::m_cluster_name {this, "HGTD_ClustersContainerName", "HGTD_Cluster", "Name of the HGTD cluster container"}
private

Definition at line 93 of file HGTD_SmearedDigitizationTool.h.

◆ m_err_x_hit

float HGTD_SmearedDigitizationTool::m_err_x_hit {}
private

Definition at line 131 of file HGTD_SmearedDigitizationTool.h.

◆ m_err_y_hit

float HGTD_SmearedDigitizationTool::m_err_y_hit {}
private

Definition at line 132 of file HGTD_SmearedDigitizationTool.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_det_manager

const HGTD_DetectorManager* HGTD_SmearedDigitizationTool::m_hgtd_det_manager {nullptr}
private

Definition at line 85 of file HGTD_SmearedDigitizationTool.h.

◆ m_hgtd_idhelper

const HGTD_ID* HGTD_SmearedDigitizationTool::m_hgtd_idhelper {nullptr}
private

Definition at line 86 of file HGTD_SmearedDigitizationTool.h.

◆ m_hist_svc

ServiceHandle<ITHistSvc> HGTD_SmearedDigitizationTool::m_hist_svc {this, "THistSvc", "THistSvc"}
private

Definition at line 108 of file HGTD_SmearedDigitizationTool.h.

◆ m_hit_time

float HGTD_SmearedDigitizationTool::m_hit_time {}
private

Definition at line 124 of file HGTD_SmearedDigitizationTool.h.

◆ m_hit_time_smeared

float HGTD_SmearedDigitizationTool::m_hit_time_smeared {}
private

Definition at line 125 of file HGTD_SmearedDigitizationTool.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_SmearedDigitizationTool::m_merge_svc {this, "MergeSvc", "PileUpMergeSvc", "Merge service used in HGTD fast digitization"}
private

Definition at line 90 of file HGTD_SmearedDigitizationTool.h.

◆ m_output_file

std::unique_ptr<TFile> HGTD_SmearedDigitizationTool::m_output_file
private

Definition at line 109 of file HGTD_SmearedDigitizationTool.h.

◆ m_pitch_x

FloatProperty HGTD_SmearedDigitizationTool::m_pitch_x {this, "pitch_X", 1.3, ""}
private

Definition at line 102 of file HGTD_SmearedDigitizationTool.h.

◆ m_pitch_y

FloatProperty HGTD_SmearedDigitizationTool::m_pitch_y {this, "pitch_Y", 1.3, ""}
private

Definition at line 103 of file HGTD_SmearedDigitizationTool.h.

◆ m_prd_truth_coll_name

std::string HGTD_SmearedDigitizationTool::m_prd_truth_coll_name {"PRD_MultiTruthPixel"}
private

Definition at line 88 of file HGTD_SmearedDigitizationTool.h.

◆ m_rndm_svc

ServiceHandle<IAthRNGSvc> HGTD_SmearedDigitizationTool::m_rndm_svc {this, "RndmSvc", "AthRNGSvc", "Random number service used in HGTD fast digitization"}
private

Random number service.

Definition at line 91 of file HGTD_SmearedDigitizationTool.h.

◆ m_si_hit_collection_name

StringProperty HGTD_SmearedDigitizationTool::m_si_hit_collection_name {this, "SiHitCollectionName", "HGTD_Hits", "Name of the Si Hit collection"}
private

Definition at line 95 of file HGTD_SmearedDigitizationTool.h.

◆ m_smear_intersection_position

BooleanProperty HGTD_SmearedDigitizationTool::m_smear_intersection_position {this, "SmearIntersectionPosition", true, ""}
private

Definition at line 97 of file HGTD_SmearedDigitizationTool.h.

◆ m_smear_mean_time

BooleanProperty HGTD_SmearedDigitizationTool::m_smear_mean_time {this, "SmearMeanTime", true, ""}
private

Definition at line 98 of file HGTD_SmearedDigitizationTool.h.

◆ m_time_res

float HGTD_SmearedDigitizationTool::m_time_res {0.035}
private

Definition at line 104 of file HGTD_SmearedDigitizationTool.h.

◆ m_tree

std::unique_ptr<TTree> HGTD_SmearedDigitizationTool::m_tree
private

Definition at line 110 of file HGTD_SmearedDigitizationTool.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.

◆ m_write_tree

BooleanProperty HGTD_SmearedDigitizationTool::m_write_tree {this, "WriteTree", false, ""}
private

Definition at line 99 of file HGTD_SmearedDigitizationTool.h.

◆ m_x_cluster_global

float HGTD_SmearedDigitizationTool::m_x_cluster_global {}
private

Definition at line 127 of file HGTD_SmearedDigitizationTool.h.

◆ m_x_entry_hit

float HGTD_SmearedDigitizationTool::m_x_entry_hit {}
private

Definition at line 117 of file HGTD_SmearedDigitizationTool.h.

◆ m_x_exit_hit

float HGTD_SmearedDigitizationTool::m_x_exit_hit {}
private

Definition at line 120 of file HGTD_SmearedDigitizationTool.h.

◆ m_x_hit

float HGTD_SmearedDigitizationTool::m_x_hit {}
private

Definition at line 112 of file HGTD_SmearedDigitizationTool.h.

◆ m_x_hit_smeared

float HGTD_SmearedDigitizationTool::m_x_hit_smeared {}
private

Definition at line 114 of file HGTD_SmearedDigitizationTool.h.

◆ m_y_cluster_global

float HGTD_SmearedDigitizationTool::m_y_cluster_global {}
private

Definition at line 128 of file HGTD_SmearedDigitizationTool.h.

◆ m_y_entry_hit

float HGTD_SmearedDigitizationTool::m_y_entry_hit {}
private

Definition at line 118 of file HGTD_SmearedDigitizationTool.h.

◆ m_y_exit_hit

float HGTD_SmearedDigitizationTool::m_y_exit_hit {}
private

Definition at line 121 of file HGTD_SmearedDigitizationTool.h.

◆ m_y_hit

float HGTD_SmearedDigitizationTool::m_y_hit {}
private

Definition at line 113 of file HGTD_SmearedDigitizationTool.h.

◆ m_y_hit_smeared

float HGTD_SmearedDigitizationTool::m_y_hit_smeared {}
private

Definition at line 115 of file HGTD_SmearedDigitizationTool.h.

◆ m_z_cluster_global

float HGTD_SmearedDigitizationTool::m_z_cluster_global {}
private

Definition at line 129 of file HGTD_SmearedDigitizationTool.h.

◆ m_z_entry_hit

float HGTD_SmearedDigitizationTool::m_z_entry_hit {}
private

Definition at line 119 of file HGTD_SmearedDigitizationTool.h.

◆ m_z_exit_hit

float HGTD_SmearedDigitizationTool::m_z_exit_hit {}
private

Definition at line 122 of file HGTD_SmearedDigitizationTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDetDD::SolidStateDetectorElementBase::hitLocalToLocal3D
HepGeom::Point3D< double > hitLocalToLocal3D(const HepGeom::Point3D< double > &hitPosition) const
Same as previuos method but 3D.
Definition: SolidStateDetectorElementBase.cxx:117
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
InDetDD::SolidStateDetectorElementBase::identifierOfPosition
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift)
Definition: SolidStateDetectorElementBase.cxx:217
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
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_SmearedDigitizationTool::m_cluster_name
StringProperty m_cluster_name
Definition: HGTD_SmearedDigitizationTool.h:93
HGTD_SmearedDigitizationTool::m_tree
std::unique_ptr< TTree > m_tree
Definition: HGTD_SmearedDigitizationTool.h:110
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
HGTD_SmearedDigitizationTool::m_hist_svc
ServiceHandle< ITHistSvc > m_hist_svc
Definition: HGTD_SmearedDigitizationTool.h:108
PileUpToolBase::m_filterPassed
bool m_filterPassed
Definition: PileUpToolBase.h:60
Trk::locX
@ locX
Definition: ParamDefs.h:37
HGTD_ID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: HGTD_ID.h:404
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
InDetDD::SolidStateDetectorElementBase
Definition: SolidStateDetectorElementBase.h:132
HGTD_SmearedDigitizationTool::m_si_hit_collection_name
StringProperty m_si_hit_collection_name
Definition: HGTD_SmearedDigitizationTool.h:95
HGTD_SmearedDigitizationTool::m_output_file
std::unique_ptr< TFile > m_output_file
Definition: HGTD_SmearedDigitizationTool.h:109
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
HGTD_SmearedDigitizationTool::smearPosition
float smearPosition(float pos, float sig, float boundary, CLHEP::HepRandomEngine *rndmEngine)
Definition: HGTD_SmearedDigitizationTool.cxx:339
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
HGTD_SmearedDigitizationTool::m_x_hit
float m_x_hit
Definition: HGTD_SmearedDigitizationTool.h:112
HGTD_SmearedDigitizationTool::m_y_hit_smeared
float m_y_hit_smeared
Definition: HGTD_SmearedDigitizationTool.h:115
AtlasHitsVector
Definition: AtlasHitsVector.h:33
HGTD_SmearedDigitizationTool::fillClusterContainer
StatusCode fillClusterContainer(HGTD_DetElement_RIO_Map_t &det_element_rio_map, ClusterContainer_t &cluster_container)
Definition: HGTD_SmearedDigitizationTool.cxx:375
InDetDD::SiCellId::isValid
bool isValid() const
Test if its in a valid state.
Definition: SiCellId.h:136
HGTD_SmearedDigitizationTool::m_hgtd_idhelper
const HGTD_ID * m_hgtd_idhelper
Definition: HGTD_SmearedDigitizationTool.h:86
HGTD_SmearedDigitizationTool::setupTimedHitCollection
TimedHitCollection< SiHit > setupTimedHitCollection()
Definition: HGTD_SmearedDigitizationTool.cxx:126
HGTD_SmearedDigitizationTool::m_err_y_hit
float m_err_y_hit
Definition: HGTD_SmearedDigitizationTool.h:132
TimedHitPtr< SiHit >
HGTD_SmearedDigitizationTool::HGTD_DetElement_RIO_Map_t
std::multimap< IdentifierHash, const Cluster_t * > HGTD_DetElement_RIO_Map_t
Definition: HGTD_SmearedDigitizationTool.h:51
PileUpToolBase::m_lastXing
Gaudi::Property< int > m_lastXing
Definition: PileUpToolBase.h:56
HGTD_SmearedDigitizationTool::m_y_entry_hit
float m_y_entry_hit
Definition: HGTD_SmearedDigitizationTool.h:118
HepMC::ignoreTruthLink
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
Definition: MagicNumbers.h:345
HGTD_SmearedDigitizationTool::m_smear_intersection_position
BooleanProperty m_smear_intersection_position
Definition: HGTD_SmearedDigitizationTool.h:97
x
#define x
TimedHitCollection::nextDetectorElement
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
intersection
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
Definition: compareFlatTrees.cxx:25
HGTD_SmearedDigitizationTool::m_x_entry_hit
float m_x_entry_hit
Definition: HGTD_SmearedDigitizationTool.h:117
HGTD_SmearedDigitizationTool::smearMeanTime
float smearMeanTime(float time, float time_res, CLHEP::HepRandomEngine *rndmEngine)
Definition: HGTD_SmearedDigitizationTool.cxx:355
HGTD_SmearedDigitizationTool::digitize
StatusCode digitize(const EventContext &ctx, TimedHitCollection< SiHit > &timed_hit_collection, HGTD_DetElement_RIO_Map_t &det_element_rio_map)
Definition: HGTD_SmearedDigitizationTool.cxx:161
HGTD_SmearedDigitizationTool::m_pitch_y
FloatProperty m_pitch_y
Definition: HGTD_SmearedDigitizationTool.h:103
AmgSymMatrix
#define AmgSymMatrix(dim)
Definition: EventPrimitives.h:50
HGTD_SmearedDigitizationTool::m_y_exit_hit
float m_y_exit_hit
Definition: HGTD_SmearedDigitizationTool.h:121
HGTD_SmearedDigitizationTool::m_hit_time_smeared
float m_hit_time_smeared
Definition: HGTD_SmearedDigitizationTool.h:125
HGTD_SmearedDigitizationTool::m_hgtd_det_manager
const HGTD_DetectorManager * m_hgtd_det_manager
Definition: HGTD_SmearedDigitizationTool.h:85
PileUpToolBase::m_vetoPileUpTruthLinks
Gaudi::Property< int > m_vetoPileUpTruthLinks
Definition: PileUpToolBase.h:58
HGTD_SmearedDigitizationTool::ClusterCollection_t
HGTD_ClusterCollection ClusterCollection_t
Definition: HGTD_SmearedDigitizationTool.h:47
PileUpMergeSvc::TimedList::type
std::list< value_t > type
type of the collection of timed data object
Definition: PileUpMergeSvc.h:75
HGTD_SmearedDigitizationTool::m_hit_time
float m_hit_time
Definition: HGTD_SmearedDigitizationTool.h:124
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HGTD_SmearedDigitizationTool::m_z_entry_hit
float m_z_entry_hit
Definition: HGTD_SmearedDigitizationTool.h:119
TimedHitCollection::insert
void insert(const PileUpTimeEventIndex &timeEventIndex, const AtlasHitsVector< HIT > *inputCollection)
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
TimedHitCollection::reserve
void reserve(unsigned int numberOfHits)
reserve a timed vector numberOfHits in size.
Trk::PrepRawData::setHashAndIndex
void setHashAndIndex(unsigned short collHash, unsigned short objIndex)
TEMP for testing: might make some classes friends later ...
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
HGTD_SmearedDigitizationTool::m_x_exit_hit
float m_x_exit_hit
Definition: HGTD_SmearedDigitizationTool.h:120
python.BuildSignatureFlags.sig
sig
Definition: BuildSignatureFlags.py:218
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
InDetDD::SolidStateDetectorElementBase::width
double width() const
Methods from design (inline)
test_pyathena.parent
parent
Definition: test_pyathena.py:15
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
HGTD_SmearedDigitizationTool::m_prd_truth_coll_name
std::string m_prd_truth_coll_name
Definition: HGTD_SmearedDigitizationTool.h:88
HGTD_SmearedDigitizationTool::m_smear_mean_time
BooleanProperty m_smear_mean_time
Definition: HGTD_SmearedDigitizationTool.h:98
HGTD_SmearedDigitizationTool::m_x_cluster_global
float m_x_cluster_global
Definition: HGTD_SmearedDigitizationTool.h:127
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
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
HGTD_SmearedDigitizationTool::ClusterContainer_t
HGTD_ClusterContainer ClusterContainer_t
Definition: HGTD_SmearedDigitizationTool.h:48
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
HGTD_SmearedDigitizationTool::m_x_hit_smeared
float m_x_hit_smeared
Definition: HGTD_SmearedDigitizationTool.h:114
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
HGTD_SmearedDigitizationTool::m_z_exit_hit
float m_z_exit_hit
Definition: HGTD_SmearedDigitizationTool.h:122
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
HGTD_SmearedDigitizationTool::m_merge_svc
ServiceHandle< PileUpMergeSvc > m_merge_svc
Definition: HGTD_SmearedDigitizationTool.h:90
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
HGTD_SmearedDigitizationTool::m_y_hit
float m_y_hit
Definition: HGTD_SmearedDigitizationTool.h:113
InDetDD::SiCellId
Definition: SiCellId.h:29
HGTD_DetectorManager::getDetectorElement
InDetDD::HGTD_DetectorElement * getDetectorElement(const Identifier &id) const
access to individual elements : via Identifier
Definition: HGTD_DetectorManager.cxx:57
HGTD_SmearedDigitizationTool::m_pitch_x
FloatProperty m_pitch_x
Definition: HGTD_SmearedDigitizationTool.h:102
HGTD_SmearedDigitizationTool::retrieveTruth
StatusCode retrieveTruth(PRD_MultiTruthCollection *&prd_truth_coll)
Definition: HGTD_SmearedDigitizationTool.cxx:113
y
#define y
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
TimedHitPtr::eventId
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
Definition: TimedHitPtr.h:45
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HGTD_SmearedDigitizationTool::fillMultiTruthCollection
StatusCode fillMultiTruthCollection(PRD_MultiTruthCollection *, Cluster_t *, const TimedHitPtr< SiHit > &, const EventContext &)
Definition: HGTD_SmearedDigitizationTool.cxx:359
PileUpToolBase::m_firstXing
Gaudi::Property< int > m_firstXing
Definition: PileUpToolBase.h:54
HGTD_SmearedDigitizationTool::m_y_cluster_global
float m_y_cluster_global
Definition: HGTD_SmearedDigitizationTool.h:128
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
InDet::SiWidth
Definition: SiWidth.h:25
HGTD_SmearedDigitizationTool::Cluster_t
HGTD_Cluster Cluster_t
Definition: HGTD_SmearedDigitizationTool.h:46
HGTD_SmearedDigitizationTool::m_write_tree
BooleanProperty m_write_tree
Definition: HGTD_SmearedDigitizationTool.h:99
HGTD_SmearedDigitizationTool::m_z_cluster_global
float m_z_cluster_global
Definition: HGTD_SmearedDigitizationTool.h:129
HGTD_SmearedDigitizationTool::m_err_x_hit
float m_err_x_hit
Definition: HGTD_SmearedDigitizationTool.h:131
HGTD_SmearedDigitizationTool::m_time_res
float m_time_res
Definition: HGTD_SmearedDigitizationTool.h:104
InDetDD::SolidStateDetectorElementBase::length
double length() const
Length in eta direction (z - barrel, r - endcap)
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
TimedHitCollection
Definition: TimedHitCollection.h:15
InDetDD::SolidStateDetectorElementBase::cellIdFromIdentifier
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const =0
SiCellId from Identifier.
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
HGTD_SmearedDigitizationTool::m_rndm_svc
ServiceHandle< IAthRNGSvc > m_rndm_svc
Random number service.
Definition: HGTD_SmearedDigitizationTool.h:91
Identifier
Definition: IdentifierFieldParser.cxx:14