ATLAS Offline Software
Loading...
Searching...
No Matches
MaterialMapper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6// MaterialMapper.cxx, (c) ATLAS Detector software
8
9// Trk include
16
17
18// constructor
19Trk::MaterialMapper::MaterialMapper(const std::string& t, const std::string& n, const IInterface* p)
20: AthAlgTool(t,n,p),
21 m_incidentSvc("IncidentSvc", n),
22 m_histSvc("THistSvc", n)
23{
24 declareInterface<IMaterialMapper>(this);
25}
26
27// destructor
29{
30 // memory cleanup
32 auto volTreeIter = m_volumeTrees.begin();
33 auto endVolTreeIter = m_volumeTrees.end();
34 for ( ; volTreeIter != endVolTreeIter; delete (volTreeIter->second), ++volTreeIter) {}
35 }
36
38 // delete the layer hit TTree
39 auto layTreeIter = m_layerTrees.begin();
40 auto endLayTreeIter = m_layerTrees.end();
41 for ( ; layTreeIter != endLayTreeIter; delete (layTreeIter->second), ++layTreeIter) {}
42 // delete the layer per event TTree
43 layTreeIter = m_layerFullTrees.begin();
44 endLayTreeIter = m_layerFullTrees.end();
45 for ( ; layTreeIter != endLayTreeIter; delete (layTreeIter->second), ++layTreeIter) {}
46 }
47
49 // finalize the Hit Tree
50 auto surfTreeIter = m_surfaceTrees.begin();
51 auto endSurfTreeIter = m_surfaceTrees.end();
52 for ( ; surfTreeIter != endSurfTreeIter; delete (surfTreeIter->second), ++surfTreeIter) {}
53 }
54}
55
56// Athena standard methods
57// initialize
59{
60
61 // Athena/Gaudi framework
62 ATH_CHECK( m_incidentSvc.retrieve() );
63 ATH_CHECK( m_histSvc.retrieve() );
64
65 // register to the incident service: EndEvent for histogram filling and reset
66 m_incidentSvc->addListener( this, IncidentType::EndEvent);
67
68 // book the Tree
70 return StatusCode::SUCCESS;
71}
72
73// finalize
75{
76 ATH_MSG_INFO( "finalize() successful" );
77 return StatusCode::SUCCESS;
78}
79
80void Trk::MaterialMapper::recordMaterialHit(const AssociatedMaterial& amhit, const Amg::Vector3D& projectedPosition) const
81{
82
84
85 // ----------------------------------- Recording Hits section --------------------------------
87
88 // get the tracking volume
90 const Trk::Layer* lay = amhit.associatedLayer();
91
92 if (!tvol) {
93 ATH_MSG_WARNING("Could not associate TrackingVolume to material step!");
94 return;
95 }
96
97 // ----------------------------------- The Material Validation code --------------------------
98 const Trk::TrackingVolume* itvol = tvol;
99 while (itvol) {
100 // get the volume tree object
101 ATH_MSG_VERBOSE( "getting volTreeObj for: " << itvol->volumeName() << " at: " << itvol );
102 Trk::VolumeTreeObject* volTreeObj = volumeTreeObject(lay,itvol);
103 if (volTreeObj) {
104 // add the quantities
105 (*volTreeObj).path += amhit.steplength();
106 (*volTreeObj).pathInX0 += amhit.steplengthInX0();
107 (*volTreeObj).pathInL0 += amhit.steplengthInL0();
108 if(amhit.A() != 0.0) {
109 (*volTreeObj).pathZARho += (amhit.Z()/amhit.A())*amhit.rho()*amhit.steplength();
110 }
111 } else
112 ATH_MSG_WARNING( "Cannot find/create VolumeTreeObject for volume '" << itvol->volumeName() << "'." );
113 itvol = itvol->getMotherVolume();
114 if (itvol) ATH_MSG_VERBOSE( "motherVolume found: " << itvol->volumeName() );
115 }
116
117 // -------------------------------- main tree section -----------------------------------------
118 // eta / phi
119 m_averageEta += position.eta();
120 m_averagePhi += position.phi();
121 // effectively crossed Z/A*rho
122 double steplength = amhit.steplength();
123 // fill the variables for spatial information & event characteristics
124 if (lay) {
125 m_mappedPath += steplength;
128 m_mappedPathRho += amhit.rho()*steplength;
129 if(amhit.A() != 0.0) {
130 m_mappedPathZARho += (amhit.Z()/amhit.A())*amhit.rho()*steplength;
131 }
132 ATH_MSG_VERBOSE("[ MaterialMapper ] Accumulated Path in Rho (*Z/A) = " << m_mappedPathRho << " ( " << m_mappedPathZARho << " )");
133 } else
135
136 // mapping information
137 m_mapped[m_materialSteps] = lay ? lay->layerIndex().value() : 0;
138 // the position & step information
151 // record the projected position as well
152 m_materialProjPositionX[m_materialSteps] = projectedPosition.x();
153 m_materialProjPositionY[m_materialSteps] = projectedPosition.y();
154 m_materialProjPositionZ[m_materialSteps] = projectedPosition.z();
155 m_materialProjPositionR[m_materialSteps] = projectedPosition.perp();
156 m_materialProjDistance[m_materialSteps] = (position-projectedPosition).mag();
157 // and increase the number of steps
159
160
161 // record the layer hit
163}
164
165
167{
168 ATH_MSG_VERBOSE( "finalizeEvent() on Volume hits " );
169
170 auto volTreeIter = mapped ? m_volumeTrees.begin() : m_volumeTreesUnmapped.begin();
171 auto endVolTreeIter = mapped ? m_volumeTrees.end() : m_volumeTreesUnmapped.end();
172
173 // do the loop
174 for ( ; volTreeIter != endVolTreeIter; ++volTreeIter ) {
175
176 Trk::VolumeTreeObject* volTreeObj = volTreeIter->second;
177
178 if (!volTreeObj) continue;
179
180 if ((*volTreeObj).path > 0.) {
181 // spatial mapping
182 (*volTreeObj).eta = m_averageEta;
183 (*volTreeObj).phi = m_averagePhi;
184 // fill the volume Tree Object
185 (*volTreeObj).tree->Fill();
186 }
187 // reset
188 (*volTreeObj).eta = 0.;
189 (*volTreeObj).phi = 0.;
190 (*volTreeObj).path = 0.;
191 (*volTreeObj).pathInX0 = 0.;
192 (*volTreeObj).pathInL0 = 0.;
193 (*volTreeObj).pathZARho = 0.;
194
195 }
196}
197
198
200{
201
203
204 const Trk::Layer* lay = amhit.associatedLayer();
205 if (m_layerValidation && lay) {
206 // try to find the histogram
207 Trk::LayerTreeObject* layTreeObj = layerTreeObject(*lay,full);
208 if (layTreeObj
210 && amhit.steplengthInX0() > 0.)
211 {
212
213 const Amg::Vector3D& pos = amhit.materialPosition();
214
215 // hit positions
216 double posX = pos.x();
217 double posY = pos.y();
218 double posZ = pos.z();
219 double posR = pos.perp();
220 double posEta = pos.eta();
221
222 // fill the hit position --------------------
223 (*layTreeObj).hitPositionX[(*layTreeObj).layerHits] = posX;
224 (*layTreeObj).hitPositionY[(*layTreeObj).layerHits] = posY;
225 (*layTreeObj).hitPositionZ[(*layTreeObj).layerHits] = posZ;
226 (*layTreeObj).hitPositionR[(*layTreeObj).layerHits] = posR;
227 (*layTreeObj).hitPositionEta[(*layTreeObj).layerHits] = posEta;
228
229 // increase the layer Hits
230 ++(*layTreeObj).layerHits;
231 ++(*layTreeObj).densedHits;
232
233 // fill the densed Hit position ---------------
234 (*layTreeObj).densedHitX += posX;
235 (*layTreeObj).densedHitY += posY;
236 (*layTreeObj).densedHitZ += posZ;
237 (*layTreeObj).densedHitR += posR;
238 (*layTreeObj).densedHitPhi += pos.phi();
239 (*layTreeObj).densedHitTheta += pos.theta();
240
241 // fill the correction factor ------------------
242 (*layTreeObj).correctionFactor += amhit.correctionFactor();
243 (*layTreeObj).path += amhit.steplength();
244 (*layTreeObj).pathInX0 += amhit.steplengthInX0();
245 (*layTreeObj).pathInL0 += amhit.steplengthInL0();
246 (*layTreeObj).A += amhit.A() * amhit.rho() * amhit.steplength();
247 (*layTreeObj).Z += amhit.Z() * amhit.rho() * amhit.steplength();
248 (*layTreeObj).rho += amhit.rho() * amhit.steplength();
249
250 }
251 }
252}
253
255{
256
257 ATH_MSG_VERBOSE( "finalizeEvent() on Layer hits " );
258
259 for (size_t iltm = 0; iltm < 2; ++iltm) {
260 // loop over all layer Tree objects and fill them
261 auto layObjIter = iltm ? m_layerFullTrees.begin() : m_layerTrees.begin();
262 auto endIter = iltm ? m_layerFullTrees.end() : m_layerTrees.end();
263 // do the loop
264 for ( ; layObjIter != endIter; ++layObjIter ) {
265
266 Trk::LayerTreeObject* layTreeObj = layObjIter->second;
267
268 if (!layTreeObj) continue;
269
270 // get the number of single hits
271 int hits = (*layTreeObj).densedHits;
272
273 if ((*layTreeObj).pathInX0 > 0.) {
274 if (hits>1) {
275 (*layTreeObj).densedHitX /= hits;
276 (*layTreeObj).densedHitY /= hits;
277 (*layTreeObj).densedHitZ /= hits;
278 (*layTreeObj).densedHitR /= hits;
279 (*layTreeObj).densedHitPhi /= hits;
280 (*layTreeObj).densedHitTheta /= hits;
281 (*layTreeObj).correctionFactor /= hits;
282 (*layTreeObj).A /= (*layTreeObj).rho;
283 (*layTreeObj).Z /= (*layTreeObj).rho;
284 (*layTreeObj).rho /= (*layTreeObj).path;
285 }
286 // fill the layer Tree Object
287 (*layTreeObj).tree->Fill();
288 }
289 // reset
290 (*layTreeObj).layerHits = 0;
291 (*layTreeObj).path = 0.;
292 (*layTreeObj).pathInX0 = 0.;
293 (*layTreeObj).pathInL0 = 0.;
294 (*layTreeObj).densedHits = 0;
295 (*layTreeObj).densedHitX = 0.;
296 (*layTreeObj).densedHitY = 0.;
297 (*layTreeObj).densedHitZ = 0.;
298 (*layTreeObj).densedHitR = 0.;
299 (*layTreeObj).densedHitPhi = 0.;
300 (*layTreeObj).densedHitTheta = 0.;
301 (*layTreeObj).correctionFactor = 0.;
302 (*layTreeObj).A = 0.;
303 (*layTreeObj).Z = 0.;
304 (*layTreeObj).rho = 0.;
305 }
306 }
307}
308
309
311 const AssociatedMaterial& amhit) const
312{
313
315
316 const Trk::Layer* lay = amhit.associatedLayer();
317 if (m_surfaceValidation && lay) {
318 // try to find the histogram
319 Trk::SurfaceTreeObject* surfTreeObj = surfaceTreeObject(*lay);
320 // now fill
321 if (surfTreeObj) {
322 // fill it
323 (*surfTreeObj).loc1 += locpos[0];
324 (*surfTreeObj).loc2 += locpos[1];
325 (*surfTreeObj).eta += amhit.materialPosition().eta();
326 (*surfTreeObj).correctionFactor += amhit.correctionFactor();
327 (*surfTreeObj).path += amhit.steplength();
328 (*surfTreeObj).pathInX0 += amhit.steplengthInX0();
329 (*surfTreeObj).pathInL0 += amhit.steplengthInL0();
330 (*surfTreeObj).A += amhit.A()*amhit.steplength()*amhit.rho();
331 (*surfTreeObj).Z += amhit.Z()*amhit.steplength()*amhit.rho();
332 (*surfTreeObj).rho += amhit.rho()*amhit.steplength();
333 // increase the surface hits
334 ++(*surfTreeObj).surfaceHits;
335
336 }
337 }
338}
339
340
342{
343
344 ATH_MSG_VERBOSE( "finalizeEvent() on Surface hits " );
345
346 // loop over all layer Tree objects and fill them
347 auto surfObjIter = m_surfaceTrees.begin();
348 auto endIter = m_surfaceTrees.end();
349 // do the loop
350 for ( ; surfObjIter != endIter; ++surfObjIter ) {
351 Trk::SurfaceTreeObject* surfTreeObj = surfObjIter->second;
352 // get the number of single hits
353 int hits = (*surfTreeObj).surfaceHits;
354 // fill only if hits have been there
355 if ((*surfTreeObj).pathInX0 > 0.) {
356 if (hits>1) {
357 (*surfTreeObj).loc1 /= hits;
358 (*surfTreeObj).loc2 /= hits;
359 (*surfTreeObj).eta /= hits;
360 (*surfTreeObj).correctionFactor /= hits;
361 (*surfTreeObj).A /= hits;
362 (*surfTreeObj).Z /= hits;
363 (*surfTreeObj).rho /= hits;
364 }
365 // fill the tree
366 (*surfTreeObj).tree->Fill();
367 }
368 // reset
369 (*surfTreeObj).loc1 = 0.;
370 (*surfTreeObj).loc2 = 0.;
371 (*surfTreeObj).eta = 0.;
372
373 (*surfTreeObj).correctionFactor = 0.;
374 (*surfTreeObj).path = 0.;
375 (*surfTreeObj).pathInX0 = 0.;
376 (*surfTreeObj).pathInL0 = 0.;
377 (*surfTreeObj).rho = 0.;
378
379 (*surfTreeObj).surfaceHits = 0;
380
381 }
382}
383
384
386{
387 // try to find the histogram
388 auto endIter = lay ? m_volumeTrees.end() : m_volumeTreesUnmapped.end();
389 auto findIter = lay ? m_volumeTrees.end() : m_volumeTreesUnmapped.end();
390
391 Trk::VolumeTreeObject* tvolTreeObj = nullptr;
392
393 findIter = lay ? m_volumeTrees.find(tvol) : m_volumeTreesUnmapped.find(tvol);
394
395 if (findIter == endIter) {
396
397 TString tvolName = tvol->volumeName();
398 tvolName.ReplaceAll("::","_");
399
400 TString treeName = tvolName;
401 treeName += "_";
402 treeName += m_volumeTreePrefix.value();
403 if (!lay) treeName += "_UNMAPPED";
404
405 TString treeTitle = "TrackingVolume : ";
406 treeTitle += tvolName;
407 if (!lay) treeTitle += " - UNMAPPED";
408
409 TString treeRegName = "/val/";
410 treeRegName += treeName;
411
412 ATH_MSG_INFO( "No Tree found for " << treeTitle );
413 ATH_MSG_INFO( " -> Booking it now with register name : " << treeRegName.Data() );
414
415 tvolTreeObj = new Trk::VolumeTreeObject(treeName, treeTitle);
416 if (lay)
417 m_volumeTrees.insert(std::make_pair(tvol,tvolTreeObj));
418 else
419 m_volumeTreesUnmapped.insert(std::make_pair(tvol,tvolTreeObj));
420
421 // now register the Tree
422 if (m_histSvc->regTree(treeRegName.Data(), (*tvolTreeObj).tree).isFailure()) {
423 ATH_MSG_ERROR( "initialize() Could not register the validation Tree -> Switching Tree output for this volume off !" );
424 delete tvolTreeObj; tvolTreeObj = nullptr;
425 }
426
427 } else // a tree is found
428 tvolTreeObj = findIter->second;
429
430 return tvolTreeObj;
431}
432
433
435{
436 if (!lay.layerIndex().value()) return nullptr;
437
438 // try to find the histogram
439
440 Trk::LayerTreeObject* layTreeObj = nullptr;
441
442 if (full) {
443 auto it = m_layerFullTrees.find(&lay);
444 if (it != m_layerFullTrees.end()) {
445 return it->second;
446 }
447 }
448 else {
449 auto it = m_layerTrees.find(&lay);
450 if (it != m_layerTrees.end()) {
451 return it->second;
452 }
453 }
454
455 {
456 // check if it is a boundary MaterialLayer
457 const Trk::MaterialLayer* mLayer = dynamic_cast<const Trk::MaterialLayer*>(&lay);
458 if (mLayer)
459 ATH_MSG_INFO("MaterialLayer from BoundarySurface detected.");
460 // get the TrackingVolume
461 const Trk::TrackingVolume* enclosingVolume = lay.enclosingTrackingVolume();
462 TString tvolName = (enclosingVolume) ? enclosingVolume->volumeName() : "BoundaryLayers";
463 tvolName.ReplaceAll("::","_");
464
465 TString treeName = tvolName;
466 treeName += "_";
467 treeName += m_layerTreePrefix.value();
468
469 TString layerType = (lay.surfaceRepresentation().type() == Trk::SurfaceType::Cylinder) ?
470 "CylinderLayer_" : "DiscLayer_";
471 if (full) treeName += "full_";
472 treeName += layerType;
473 if (mLayer) treeName += "boundary_";
474 treeName += lay.layerIndex().value();
475
476 TString treeTitle = "TrackingVolume :";
477 treeTitle += tvolName;
478
479 TString treeRegName = "/val/";
480 treeRegName += treeName;
481
482 ATH_MSG_INFO( "No Tree found for Layer " << lay.layerIndex().value() << " in Volume '" << tvolName << "'.");
483 ATH_MSG_INFO( " -> Booking it now with register name : " << treeRegName.Data() );
484
485 layTreeObj = new Trk::LayerTreeObject(treeName, treeTitle);
486 if (full) m_layerFullTrees.insert(std::make_pair(&lay,layTreeObj));
487 else m_layerTrees.insert(std::make_pair(&lay,layTreeObj));
488
489 // now register the Tree
490 if (m_histSvc->regTree(treeRegName.Data(), (*layTreeObj).tree).isFailure()) {
491 ATH_MSG_ERROR( "initialize() Could not register the validation Tree -> Switching Tree output for this layer off !" );
492 delete layTreeObj; layTreeObj = nullptr;
493 }
494
495 }
496
497 return layTreeObj;
498}
499
500
502{
503 // try to find the histogram
504 auto endIter = m_surfaceTrees.end();
505 auto findIter = m_surfaceTrees.end();
506
507 Trk::SurfaceTreeObject* surfTreeObj = nullptr;
508
509 findIter = m_surfaceTrees.find(&lay);
510 if (findIter == endIter) {
511 // get the TrackingVolume
512 const Trk::TrackingVolume* enclosingVolume = lay.enclosingTrackingVolume();
513 TString volumeName = (enclosingVolume) ? enclosingVolume->volumeName() : "Unknown";
514
515 TString treeName = m_surfaceTreePrefix.value();
516 treeName += lay.layerIndex().value();
517
518 TString treeTitle = "TrackingVolume :";
519 treeTitle += volumeName;
520
521 TString treeRegName = "/val/";
522 treeRegName += treeName;
523
524 ATH_MSG_INFO( "No Tree found for Layer " << lay.layerIndex().value()
525 << " in Volume '" << volumeName << "'." );
526 ATH_MSG_INFO( " -> Booking it now with register name : " << treeRegName.Data() );
527
528 surfTreeObj = new Trk::SurfaceTreeObject(treeName, treeTitle);
529 m_surfaceTrees.insert(std::make_pair(&lay,surfTreeObj));
530
531 // now register the Tree
532 if (m_histSvc->regTree(treeRegName.Data(), (*surfTreeObj).tree).isFailure()) {
533 ATH_MSG_INFO( "initialize() Could not register the validation Tree -> Switching Tree output for this surface off !" );
534 delete surfTreeObj; surfTreeObj = nullptr;
535 }
536
537 } else // a tree is found
538 surfTreeObj = findIter->second;
539 return surfTreeObj;
540}
541
542
543void Trk::MaterialMapper::handle( const Incident& inc ) {
544 // check the incident type
545 if ( inc.type() == IncidentType::EndEvent && m_materialSteps){
546 // check if the hit collection already contains:
547 ATH_MSG_VERBOSE("EndEvent incident caught, finalize histogramns");
548 // average Eta / Phi
551 // (a) the volume validation
552 finalizeVolumeHits(true); // trees with mapped hits
553 finalizeVolumeHits(false); // trees with unmapped hits
554 // (b) the layer validation
556 // (c) the surface validation (reference material)
558 // fill the main TTree & reset
559 m_validationTree->Fill();
560 // initialize the eta/phi
561 m_averageEta = 0.;
562 m_averagePhi = 0.;
563 // initialize the rest
564 m_materialSteps = 0;
565 m_mappedPath = 0.;
566 m_mappedPathInX0 = 0.;
567 m_mappedPathInL0 = 0.;
568 m_mappedPathRho = 0.;
569 m_mappedPathZARho = 0.;
570 // increate counter
572 }
573 }
574
575
577{
578
579 ATH_MSG_INFO( "Booking the Validation Tree ... " );
580
581 // (1) Main MaterialMapper TTree
582 // ------------- validation section ------------------------------------------
583 m_validationTree = new TTree(m_validationTreeName.value().c_str(), m_validationTreeDescription.value().c_str());
584
585 // position coordinates of the update
586 m_validationTree->Branch("Eta", &m_averageEta, "averageEta/F");
587 m_validationTree->Branch("Phi", &m_averagePhi, "averagePhiF");
588 m_validationTree->Branch("Path", &m_mappedPath, "path/F");
589 m_validationTree->Branch("PathInX0", &m_mappedPathInX0, "pathInX0/F");
590 m_validationTree->Branch("PathInL0", &m_mappedPathInL0, "pathInL0/F");
591 m_validationTree->Branch("PathRho", &m_mappedPathRho, "pathRho/F");
592 m_validationTree->Branch("PathZARho", &m_mappedPathZARho, "pathZARho/F");
593 m_validationTree->Branch("UnmappedPathInX0", &m_unmappedPathInX0, "unmappedPathInX0/F");
594 m_validationTree->Branch("MaterialSteps", &m_materialSteps, "steps/I");
595 m_validationTree->Branch("Mapped", m_mapped, "mapped[steps]/I");
596 m_validationTree->Branch("MaterialAccumPathInX0", m_materialAccumPathInX0, "materialAccumPinX0[steps]/F");
597 m_validationTree->Branch("MaterialAccumPathZARho", m_materialAccumPathZARho, "materialAccumPZARho[steps]/F");
598 m_validationTree->Branch("MaterialStepPath", m_materialStepPath, "materialStepPath[steps]/F");
599 m_validationTree->Branch("MaterialStepX0", m_materialStepX0, "materialStepX0[steps]/F");
600 m_validationTree->Branch("MaterialStepL0", m_materialStepL0, "materialStepL0[steps]/F");
601 m_validationTree->Branch("MaterialStepZ", m_materialStepZ, "materialStepZ[steps]/F");
602 m_validationTree->Branch("MaterialStepA", m_materialStepA, "materialStepA[steps]/F");
603 m_validationTree->Branch("MaterialStepRho", m_materialStepRho, "materialStepRho[steps]/F");
604 m_validationTree->Branch("MaterialStepPositionX", m_materialStepPositionX , "materialStepX[steps]/F");
605 m_validationTree->Branch("MaterialStepPositionY", m_materialStepPositionY , "materialStepY[steps]/F");
606 m_validationTree->Branch("MaterialStepPositionZ", m_materialStepPositionZ , "materialStepZ[steps]/F");
607 m_validationTree->Branch("MaterialStepPositionR", m_materialStepPositionR , "materialStepR[steps]/F");
608 m_validationTree->Branch("MaterialProjPositionX", m_materialProjPositionX , "materialProjX[steps]/F");
609 m_validationTree->Branch("MaterialProjPositionY", m_materialProjPositionY , "materialProjY[steps]/F");
610 m_validationTree->Branch("MaterialProjPositionZ", m_materialProjPositionZ , "materialProjZ[steps]/F");
611 m_validationTree->Branch("MaterialProjPositionR", m_materialProjPositionR , "materialProjR[steps]/F");
612 m_validationTree->Branch("MaterialProjDistance", m_materialProjDistance , "materialProjD[steps]/F");
613
614 // now register the Tree
615 if (m_histSvc->regTree(m_validationTreeFolder.value().c_str(), m_validationTree).isFailure()) {
616 ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
617 delete m_validationTree; m_validationTree = nullptr;
618 return;
619 }
620
621 ATH_MSG_INFO( " ... successful." );
622
623}
624
625
Scalar mag() const
mag method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define TRKDETDESCRTOOLS_MAXLAYERHITS
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
It is used in the Mapping process ( using MaterialSteps ), the validation and recostruction ( using M...
double x0() const
Access method : material X0/A/Z/rho.
const Trk::Layer * associatedLayer() const
Trivial Access methods.
double steplengthInX0() const
Access method : steplength.
double steplength() const
Access method : steplength.
double steplengthInL0() const
Access method : steplength.
const Trk::TrackingVolume * associatedTrackingVolume() const
Trivial Access methods.
const Amg::Vector3D & materialPosition() const
Trivial Access methods.
double correctionFactor() const
Trivial Access methods.
int value() const
layerIndex expressed in an integer
Definition LayerIndex.h:71
Base Class for a Detector Layer in the Tracking realm.
Definition Layer.h:72
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
const LayerIndex & layerIndex() const
get the layerIndex
const TrackingVolume * enclosingTrackingVolume() const
get the confining TrackingVolume
A material layer is a simple helper class to attach material information to a boundary surface.
Gaudi::Property< bool > m_layerValidation
float m_materialProjPositionY[TRKDETDESCRTOOLS_MAXSTEPS]
y position of the material recording when assigned to layer
float m_unmappedPathInX0
total path in x0 in these events lost
float m_materialStepPositionY[TRKDETDESCRTOOLS_MAXSTEPS]
y position of the material recording
void recordSurfaceHit(const Amg::Vector2D &locpos, const AssociatedMaterial &amhit) const
Record material hit on a surface.
void bookValidationTree()
Validation : book the Tree.
StatusCode finalize()
AlgTool finalize method.
Gaudi::Property< std::string > m_volumeTreePrefix
float m_averageEta
average eta
float m_mappedPath
total mapped path
std::map< const Trk::Layer *, LayerTreeObject * > m_layerFullTrees
Gaudi::Property< std::string > m_surfaceTreePrefix
std::map< const Trk::TrackingVolume *, VolumeTreeObject * > m_volumeTrees
float m_averagePhi
average ogu
void finalizeLayerHits() const
Finalize the SingleLayer Steps.
Gaudi::Property< std::string > m_validationTreeName
void recordLayerHit(const AssociatedMaterial &amhit, bool full=false) const
Record material hit - if various hits per uniform layer are recorded, or if you want to record one fu...
float m_mappedPathRho
total mapped path times rho
float m_mappedPathInL0
total mapped path in L0
ServiceHandle< ITHistSvc > m_histSvc
TTree * m_validationTree
The validation tree.
virtual ~MaterialMapper()
Virtual destructor.
float m_materialAccumPathInX0[TRKDETDESCRTOOLS_MAXSTEPS]
accumulated path length in x0
StatusCode initialize()
AlgTool initialize method.
LayerTreeObject * layerTreeObject(const Layer &lay, bool full=false) const
find (&&,||) create the LayerTreeObject
unsigned int m_processedEvents
float m_materialStepX0[TRKDETDESCRTOOLS_MAXSTEPS]
step x0
ServiceHandle< IIncidentSvc > m_incidentSvc
float m_materialProjPositionX[TRKDETDESCRTOOLS_MAXSTEPS]
x position of the material recording when assigned to layer
MaterialMapper(const std::string &, const std::string &, const IInterface *)
AlgTool like constructor.
void finalizeVolumeHits(bool mapped=true) const
Finalize the Volume Steps.
float m_materialStepZ[TRKDETDESCRTOOLS_MAXSTEPS]
step Z
float m_materialStepPositionX[TRKDETDESCRTOOLS_MAXSTEPS]
x position of the material recording
SurfaceTreeObject * surfaceTreeObject(const Layer &lay) const
find (&&,||) create the LayerTreeObject
float m_materialProjDistance[TRKDETDESCRTOOLS_MAXSTEPS]
the distance to the projected hit
float m_mappedPathZARho
total mapped path times (Z/A)*rho
void finalizeSurfaceHits() const
Finalize the SingleLayer Steps.
void handle(const Incident &inc)
Handle the incident from the incident service.
int m_mapped[TRKDETDESCRTOOLS_MAXSTEPS]
mapped or not mapped
Gaudi::Property< std::string > m_validationTreeFolder
float m_materialStepRho[TRKDETDESCRTOOLS_MAXSTEPS]
step rho
std::map< const Trk::TrackingVolume *, VolumeTreeObject * > m_volumeTreesUnmapped
Gaudi::Property< bool > m_volumeValidation
float m_materialAccumPathZARho[TRKDETDESCRTOOLS_MAXSTEPS]
accumulated path length times (Z/A)*rho
int m_materialSteps
number of update positions
Gaudi::Property< unsigned int > m_maxMappingEvents
Gaudi::Property< bool > m_surfaceValidation
float m_materialProjPositionR[TRKDETDESCRTOOLS_MAXSTEPS]
r value of the material recording when assigned to layer
float m_materialStepPositionR[TRKDETDESCRTOOLS_MAXSTEPS]
r value of the material recording
Gaudi::Property< std::string > m_validationTreeDescription
float m_materialStepA[TRKDETDESCRTOOLS_MAXSTEPS]
step A
VolumeTreeObject * volumeTreeObject(const Layer *lay=0, const TrackingVolume *tvol=0) const
find (&&,||) create a VolumeTreObject
float m_materialStepPath[TRKDETDESCRTOOLS_MAXSTEPS]
step path
Gaudi::Property< std::string > m_layerTreePrefix
float m_mappedPathInX0
total mapped path in X0
float m_materialStepL0[TRKDETDESCRTOOLS_MAXSTEPS]
step l0
void recordMaterialHit(const AssociatedMaterial &amhit, const Amg::Vector3D &projectedPosition) const
Record material hit along the recording.
float m_materialProjPositionZ[TRKDETDESCRTOOLS_MAXSTEPS]
z position of the material recording when assigned to layer
float m_materialStepPositionZ[TRKDETDESCRTOOLS_MAXSTEPS]
z position of the material recording
std::map< const Trk::Layer *, LayerTreeObject * > m_layerTrees
std::map< const Trk::Layer *, SurfaceTreeObject * > m_surfaceTrees
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
const TrackingVolume * getMotherVolume() const
Return the MotherVolume - if it exists.
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
std::vector< std::string > mapped
Definition hcg.cxx:56
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
-> simple helper struct for filling the Volume objects