ATLAS Offline Software
Loading...
Searching...
No Matches
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

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

Member Typedef Documentation

◆ Cluster_t

◆ ClusterCollection_t

◆ ClusterContainer_t

◆ HGTD_DetElement_RIO_Map_t

Initial value:
std::multimap<IdentifierHash, const Cluster_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 :
28 PileUpToolBase(type, name, parent) {
29}
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)

◆ ~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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
#define AmgSymMatrix(dim)
if(febId1==febId2)
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
float smearPosition(float pos, float sig, float boundary, CLHEP::HepRandomEngine *rndmEngine)
StatusCode fillMultiTruthCollection(PRD_MultiTruthCollection *, Cluster_t *, const TimedHitPtr< SiHit > &, const EventContext &)
const HGTD_DetectorManager * m_hgtd_det_manager
float smearMeanTime(float time, float time_res, CLHEP::HepRandomEngine *rndmEngine)
ServiceHandle< IAthRNGSvc > m_rndm_svc
Random number service.
StatusCode retrieveTruth(PRD_MultiTruthCollection *&prd_truth_coll)
bool isValid() const
Test if its in a valid state.
Definition SiCellId.h:136
double length() const
Length in eta direction (z - barrel, r - endcap)
HepGeom::Point3D< double > hitLocalToLocal3D(const HepGeom::Point3D< double > &hitPosition) const
Same as previuos method but 3D.
double width() const
Methods from design (inline)
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const =0
SiCellId from Identifier.
virtual Identifier identify() const override final
identifier of this detector element (inline)
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift)
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
TimedVector::const_iterator const_iterator
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
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 ...
Eigen::Matrix< double, 2, 1 > Vector2D
@ layer
Definition HitInfo.h:79
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37

◆ 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 =
394 m_hgtd_det_manager->getDetectorElement(wafer_id);
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}
#define ATH_MSG_WARNING(x)
std::multimap< IdentifierHash, const Cluster_t * > HGTD_DetElement_RIO_Map_t

◆ 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}
Gaudi::Property< int > m_vetoPileUpTruthLinks
const HepMcParticleLink & particleLink() const
Definition SiHit.h:190
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
Definition TimedHitPtr.h:47
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.

◆ 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}
ServiceHandle< PileUpMergeSvc > m_merge_svc
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ processAllSubEvents()

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 =
93 new ClusterContainer_t(m_hgtd_idhelper->wafer_hash_max());
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;
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}
TimedHitCollection< SiHit > setupTimedHitCollection()
StatusCode fillClusterContainer(HGTD_DetElement_RIO_Map_t &det_element_rio_map, ClusterContainer_t &cluster_container)
StatusCode digitize(const EventContext &ctx, TimedHitCollection< SiHit > &timed_hit_collection, HGTD_DetElement_RIO_Map_t &det_element_rio_map)

◆ processBunchXing()

◆ 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
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}
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114

◆ 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}
AtlasHitsVector< SiHit > SiHitCollection
void reserve(unsigned int numberOfHits)
reserve a timed vector numberOfHits in size.
void insert(const PileUpTimeEventIndex &timeEventIndex, const AtlasHitsVector< HIT > *inputCollection)
std::list< value_t > type
type of the collection of timed data object

◆ 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}
time(flags, cells_name, *args, **kw)

◆ 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 }
Gaudi::Property< int > m_firstXing
Gaudi::Property< int > m_lastXing

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.

93{this, "HGTD_ClustersContainerName", "HGTD_Cluster", "Name of the HGTD cluster container"};

◆ m_err_x_hit

float HGTD_SmearedDigitizationTool::m_err_x_hit {}
private

Definition at line 131 of file HGTD_SmearedDigitizationTool.h.

131{};

◆ m_err_y_hit

float HGTD_SmearedDigitizationTool::m_err_y_hit {}
private

Definition at line 132 of file HGTD_SmearedDigitizationTool.h.

132{};

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

const HGTD_DetectorManager* HGTD_SmearedDigitizationTool::m_hgtd_det_manager {nullptr}
private

Definition at line 85 of file HGTD_SmearedDigitizationTool.h.

85{nullptr};

◆ m_hgtd_idhelper

const HGTD_ID* HGTD_SmearedDigitizationTool::m_hgtd_idhelper {nullptr}
private

Definition at line 86 of file HGTD_SmearedDigitizationTool.h.

86{nullptr};

◆ m_hist_svc

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

Definition at line 108 of file HGTD_SmearedDigitizationTool.h.

108{this, "THistSvc", "THistSvc"};

◆ m_hit_time

float HGTD_SmearedDigitizationTool::m_hit_time {}
private

Definition at line 124 of file HGTD_SmearedDigitizationTool.h.

124{};

◆ m_hit_time_smeared

float HGTD_SmearedDigitizationTool::m_hit_time_smeared {}
private

Definition at line 125 of file HGTD_SmearedDigitizationTool.h.

125{};

◆ 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_SmearedDigitizationTool::m_merge_svc {this, "MergeSvc", "PileUpMergeSvc", "Merge service used in HGTD fast digitization"}
private

Definition at line 90 of file HGTD_SmearedDigitizationTool.h.

90{this, "MergeSvc", "PileUpMergeSvc", "Merge service used in HGTD fast digitization"};

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

102{this, "pitch_X", 1.3, ""};

◆ m_pitch_y

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

Definition at line 103 of file HGTD_SmearedDigitizationTool.h.

103{this, "pitch_Y", 1.3, ""};

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

88{"PRD_MultiTruthPixel"};

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

91{this, "RndmSvc", "AthRNGSvc", "Random number service used in HGTD fast digitization"};

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

95{this, "SiHitCollectionName", "HGTD_Hits", "Name of the Si Hit collection"};

◆ m_smear_intersection_position

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

Definition at line 97 of file HGTD_SmearedDigitizationTool.h.

97{this, "SmearIntersectionPosition", true, ""};

◆ m_smear_mean_time

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

Definition at line 98 of file HGTD_SmearedDigitizationTool.h.

98{this, "SmearMeanTime", true, ""};

◆ m_time_res

float HGTD_SmearedDigitizationTool::m_time_res {0.035}
private

Definition at line 104 of file HGTD_SmearedDigitizationTool.h.

104{0.035}; // time resolution in ns

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

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

◆ m_write_tree

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

Definition at line 99 of file HGTD_SmearedDigitizationTool.h.

99{this, "WriteTree", false, ""};

◆ m_x_cluster_global

float HGTD_SmearedDigitizationTool::m_x_cluster_global {}
private

Definition at line 127 of file HGTD_SmearedDigitizationTool.h.

127{};

◆ m_x_entry_hit

float HGTD_SmearedDigitizationTool::m_x_entry_hit {}
private

Definition at line 117 of file HGTD_SmearedDigitizationTool.h.

117{};

◆ m_x_exit_hit

float HGTD_SmearedDigitizationTool::m_x_exit_hit {}
private

Definition at line 120 of file HGTD_SmearedDigitizationTool.h.

120{};

◆ m_x_hit

float HGTD_SmearedDigitizationTool::m_x_hit {}
private

Definition at line 112 of file HGTD_SmearedDigitizationTool.h.

112{};

◆ m_x_hit_smeared

float HGTD_SmearedDigitizationTool::m_x_hit_smeared {}
private

Definition at line 114 of file HGTD_SmearedDigitizationTool.h.

114{};

◆ m_y_cluster_global

float HGTD_SmearedDigitizationTool::m_y_cluster_global {}
private

Definition at line 128 of file HGTD_SmearedDigitizationTool.h.

128{};

◆ m_y_entry_hit

float HGTD_SmearedDigitizationTool::m_y_entry_hit {}
private

Definition at line 118 of file HGTD_SmearedDigitizationTool.h.

118{};

◆ m_y_exit_hit

float HGTD_SmearedDigitizationTool::m_y_exit_hit {}
private

Definition at line 121 of file HGTD_SmearedDigitizationTool.h.

121{};

◆ m_y_hit

float HGTD_SmearedDigitizationTool::m_y_hit {}
private

Definition at line 113 of file HGTD_SmearedDigitizationTool.h.

113{};

◆ m_y_hit_smeared

float HGTD_SmearedDigitizationTool::m_y_hit_smeared {}
private

Definition at line 115 of file HGTD_SmearedDigitizationTool.h.

115{};

◆ m_z_cluster_global

float HGTD_SmearedDigitizationTool::m_z_cluster_global {}
private

Definition at line 129 of file HGTD_SmearedDigitizationTool.h.

129{};

◆ m_z_entry_hit

float HGTD_SmearedDigitizationTool::m_z_entry_hit {}
private

Definition at line 119 of file HGTD_SmearedDigitizationTool.h.

119{};

◆ m_z_exit_hit

float HGTD_SmearedDigitizationTool::m_z_exit_hit {}
private

Definition at line 122 of file HGTD_SmearedDigitizationTool.h.

122{};

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