ATLAS Offline Software
Loading...
Searching...
No Matches
TileCal::TrackTools Class Reference

#include <TrackTools.h>

Inheritance diagram for TileCal::TrackTools:
Collaboration diagram for TileCal::TrackTools:

Public Member Functions

StatusCode initialize () override final
StatusCode finalize () override final
void getCellsWithinConeAroundTrack (const xAOD::TrackParticle *track, const CaloCellContainer *input, ConstDataVector< CaloCellContainer > *output, double cone, bool includelar, const EventContext &ctx) const override
std::vector< double > getXYZEtaPhiInCellSampling (const TRACK *track, const CaloCell *cell, const EventContext &ctx) const override
std::vector< double > getXYZEtaPhiInCellSampling (const TRACK *track, CaloSampling::CaloSample sampling, const EventContext &ctx) const override
std::unique_ptr< const Trk::TrackParametersgetTrackInCellSampling (const TRACK *track, CaloSampling::CaloSample sampling, const EventContext &ctx) const override
std::vector< std::vector< double > > getXYZEtaPhiPerLayer (const TRACK *track, const EventContext &ctx) const override
std::vector< std::vector< double > > getXYZEtaPhiPerSampling (const TRACK *track, const EventContext &ctx) const override
double getPathInsideCell (const TRACK *track, const CaloCell *cell, const EventContext &ctx) const override
double getPath (const CaloCell *cell, const Trk::TrackParameters *entrance, const Trk::TrackParameters *exit) const override
int retrieveIndex (int sampling, float eta) const override
std::vector< float > getEnergyInCones (const xAOD::TrackParticle *track, const xAOD::CaloClusterContainer *clusters, const std::set< xAOD::CaloCluster::CaloSample > &samplings, const std::vector< double > &drCones, const EventContext &ctx) const override

Private Types

enum  TILE_RAW {
  TILE_RAW_FIRST , TILE_RAW_SECOND , TILE_RAW_THIRD , TILE_RAW_FOURTH ,
  TILE_RAW_FIFTH , TILE_RAW_SIXTH
}

Private Attributes

Gaudi::Property< bool > m_isCollision {this, "IsCollision", true}
ToolHandle< Trk::IParticleCaloExtensionToolm_caloExtensionTool
const TileIDm_tileID {nullptr}
const TileDetDescrManagerm_tileMgr {nullptr}

Detailed Description

Member Enumeration Documentation

◆ TILE_RAW

Member Function Documentation

◆ finalize()

StatusCode TrackTools::finalize ( )
finaloverride

Definition at line 46 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

46 {
47//===============================
48 ATH_MSG_INFO( "Finalizing TrackTools" );
49 return StatusCode::SUCCESS;
50} // TRACKTOOLS::FINALIZE
#define ATH_MSG_INFO(x)

◆ getCellsWithinConeAroundTrack()

void TileCal::TrackTools::getCellsWithinConeAroundTrack ( const xAOD::TrackParticle * track,
const CaloCellContainer * input,
ConstDataVector< CaloCellContainer > * output,
double cone,
bool includelar,
const EventContext & ctx ) const
override

◆ getEnergyInCones()

std::vector< float > TrackTools::getEnergyInCones ( const xAOD::TrackParticle * track,
const xAOD::CaloClusterContainer * clusters,
const std::set< xAOD::CaloCluster::CaloSample > & samplings,
const std::vector< double > & drCones,
const EventContext & ctx ) const
override

Definition at line 543 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

547 {
548
549 std::vector<float> energyInCone(drCones.size(), 0.F);
550
551 std::unique_ptr<Trk::CaloExtension> extension = m_caloExtensionTool->caloExtension(ctx, *track);
552
553 if (!extension) {
554 return energyInCone;
555 }
556
558 CaloExtensionHelpers::entryExitLayerMap(*extension, entryExitLayerMap);
559
560 for (const xAOD::CaloCluster* cluster : *clusters) {
561
562 // Find the most energetic layer of the cluster
563 xAOD::CaloCluster::CaloSample mostEnergeticLayer = xAOD::CaloCluster::CaloSample::Unknown;
564 double maxLayerClusterEnergy = std::numeric_limits<double>::min();
565 for (unsigned int sampling = 0; sampling < xAOD::CaloCluster::CaloSample::FCAL0; ++sampling) {
566 if(sampling == xAOD::CaloCluster::CaloSample::TileGap3) continue;
567 double clusterLayerEnergy = cluster->eSample(static_cast<xAOD::CaloCluster::CaloSample>(sampling));
568 if(clusterLayerEnergy > maxLayerClusterEnergy) {
569 maxLayerClusterEnergy = clusterLayerEnergy;
570 mostEnergeticLayer = static_cast<xAOD::CaloCluster::CaloSample>(sampling);
571 }
572 }
573
574 if(mostEnergeticLayer == xAOD::CaloCluster::CaloSample::Unknown) continue;
575
576 double clusterEta = cluster->rawEta();
577 double clusterPhi = cluster->rawPhi();
578
579 auto entryExit = entryExitLayerMap.find(mostEnergeticLayer);
580 if (entryExit == entryExitLayerMap.end()) continue;
581 double trackEta = entryExit->second.first.eta();
582 double trackPhi = entryExit->second.first.phi();
583
584 double deltaR = KinematicUtils::deltaR(clusterEta, trackEta, clusterPhi, trackPhi);
585
586 for (unsigned int icone = 0; icone < drCones.size(); ++icone) {
587 if (deltaR < drCones[icone]) {
588 for (xAOD::CaloCluster::CaloSample sampling : samplings) {
589 energyInCone[icone] += cluster->eSample(sampling);
590 }
591 }
592 }
593 }
594
595 return energyInCone;
596}
Scalar deltaR(const MatrixBase< Derived > &vec) const
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
CaloSampling::CaloSample CaloSample
void entryExitLayerMap(const Trk::CaloExtension &extension, EntryExitLayerMap &result, const LayersToSelect *selection=nullptr)
std::map< CaloSampling::CaloSample, std::pair< Amg::Vector3D, Amg::Vector3D > > EntryExitLayerMap
double deltaR(double eta1, double eta2, double phi1, double phi2)
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, float &out)
bool trackPhi(const xAOD::TauJet &, const xAOD::TauTrack &track, float &out)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ getPath()

double TrackTools::getPath ( const CaloCell * cell,
const Trk::TrackParameters * entrance,
const Trk::TrackParameters * exit ) const
override

Definition at line 318 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

318 {
319//====================================================================================================================================
320 ATH_MSG_DEBUG("IN getPath...");
321
322 // OBTAIN LAYER INDICES FOR LINEAR INTERPOLATION
323 unsigned int sampleID = cell->caloDDE()->getSampling();
324
325 // OBTAIN TRACK AND CELL PARAMETERS
326 double pathl = 0.;
327 double layer1X = exit->position().x();
328 double layer1Y = exit->position().y();
329 double layer1Z = exit->position().z();
330 double layer2X = entrance->position().x();
331 double layer2Y = entrance->position().y();
332 double layer2Z = entrance->position().z();
333
334 double cellPhi = cell->caloDDE()->phi();
335 double cellDPhi = cell->caloDDE()->dphi();
336 double cellPhimin = cellPhi - cellDPhi / 2.;
337 double cellPhimax = cellPhi + cellDPhi / 2.;
338 double cellZ = cell->caloDDE()->z();
339 double cellDZ = cell->caloDDE()->dz();
340 double cellZmin = cellZ - cellDZ / 2.;
341 double cellZmax = cellZ + cellDZ / 2.;
342 double cellR = cell->caloDDE()->r();
343 double cellDR = cell->caloDDE()->dr();
344 double cellRmin = cellR - cellDR / 2.;
345 double cellRmax = cellR + cellDR / 2.;
346
347 double cellXimp[2], cellYimp[2], cellZimp[2];
348 double x(0), y(0), z(0), r(0), phi(0);
349 double deltaPhi;
350
351 // COMPUTE PATH
352 bool compute = true;
353 int lBC(0);
354 while(compute){
355 if ((lBC == 1) && (sampleID == 13) && (m_tileID->tower(cell->ID()) == 8)) break; // B9
356 int np = 0;
357 if(std::sqrt((layer1X - layer2X) * (layer1X - layer2X) + (layer1Y - layer2Y) * (layer1Y - layer2Y)) < 3818.5){
358 if(sampleID == 13){
359 TileCellDim* cellDim = m_tileMgr->get_cell_dim(cell->ID());
360 if(lBC == 0){
361 cellRmin = cellDim->getRMin(TILE_RAW_FIRST);
362 cellRmax = cellDim->getRMax(TILE_RAW_THIRD);
363 cellZmin = cellDim->getZMin(TILE_RAW_SECOND);
364 cellZmax = cellDim->getZMax(TILE_RAW_SECOND);
365 } else if(lBC == 1){
366 cellRmin = cellDim->getRMin(TILE_RAW_FOURTH);
367 cellRmax = cellDim->getRMax(TILE_RAW_SIXTH);
368 cellZmin = cellDim->getZMin(TILE_RAW_FIFTH);
369 cellZmax = cellDim->getZMax(TILE_RAW_FIFTH);
370 }
371 }
372 // CALCULATE POINTS OF INTERSECTION
373 // INTERSECTIONS R PLANES
374 double radius(cellRmin);
375
376 double x0int = exit->position().x();
377 double x1int = entrance->position().x();
378 double y0int = exit->position().y();
379 double y1int = entrance->position().y();
380 double z0int = exit->position().z();
381 double z1int = entrance->position().z();
382 double s = (y1int - y0int) / (x1int - x0int);
383 double a = 1 + s * s;
384 double b = 2 * s * y0int - 2 * s * s * x0int;
385 double c = y0int * y0int - radius * radius + s * s * x0int * x0int - 2 * y0int * s * x0int;
386 double x1 = (-b + std::sqrt(b * b - 4 * a * c)) / (2 * a);
387 double x2 = (-b - std::sqrt(b * b - 4 * a * c)) / (2 * a);
388 double y1 = y0int + s * (x1 - x0int);
389 double y2 = y0int + s * (x2 - x0int);
390 double s1 = (z1int - z0int) / (x1int - x0int);
391 double z1 = z0int + s1 * (x1 - x0int);
392 double z2 = z0int + s1 * (x2 - x0int);
393
394 x = x1;
395 y = y1;
396 z = z1;
397
398 if( ((x1 - x0int) * (x1 - x0int) + (y1 - y0int) * (y1 - y0int) + (z1 - z0int) * (z1 - z0int)) >
399 ((x2 - x0int) * (x2 - x0int) + (y2 - y0int) * (y2 - y0int) + (z2 - z0int) * (z2 - z0int)) ){
400 x = x2;
401 y = y2;
402 z = z2;
403 } // IF
404
405 phi = std::acos(x / std::sqrt(x * x + y * y));
406 if(y <= 0) phi = -phi;
407 r = cellRmin;
408
409 if(z >= cellZmin && z <= cellZmax && phi >= cellPhimin && phi <= cellPhimax){
410 cellXimp[np] = x;
411 cellYimp[np] = y;
412 cellZimp[np] = z;
413 np = np + 1;
414
415 } // IF
416
417 radius = cellRmax;
418
419 c = y0int * y0int - radius * radius + s * s * x0int * x0int - 2 * y0int * s * x0int;
420 x1 = ((-b + std::sqrt(b * b - 4 * a * c)) / (2 * a));
421 x2 = ((-b - std::sqrt(b * b - 4 * a * c)) / (2 * a));
422 y1 = (y0int + s * (x1 - x0int));
423 y2 = (y0int + s * (x2 - x0int));
424 z1 = (z0int + s1 * (x1 - x0int));
425 z2 = (z0int + s1 * (x2 - x0int));
426 s1 = ((z1int - z0int) / (x1int - x0int));
427
428 x = x1;
429 y = y1;
430 z = z1;
431
432 if( ((x1 - x0int) * (x1 - x0int) + (y1 - y0int) * (y1 - y0int) + (z1 - z0int) * (z1 - z0int)) >
433 ((x2 - x0int) * (x2 - x0int) + (y2 - y0int) * (y2 - y0int) + (z2 - z0int) * (z2 - z0int)) ){
434 x = x2;
435 y = y2;
436 z = z2;
437 } // IF
438
439 phi = std::acos(x / std::sqrt(x * x + y * y));
440 if (y <= 0) phi = -phi;
441 r = cellRmax;
442
443 if(z >= cellZmin && z <= cellZmax && phi >= cellPhimin && phi <= cellPhimax){
444 cellXimp[np] = x;
445 cellYimp[np] = y;
446 cellZimp[np] = z;
447 np=np + 1;
448
449 } // IF
450
451 // INTERSECTIONS Z PLANES
452 if(np < 2){
453 double sxz = (layer2X - layer1X) / (layer2Z - layer1Z);
454 double syz = (layer2Y - layer1Y) / (layer2Z - layer1Z);
455 z = cellZmin;
456 x = layer1X + sxz * (z - layer1Z);
457 y = layer1Y + syz * (z - layer1Z);
458 r = std::sqrt(x * x + y * y);
459 phi = std::acos(x / r);
460 if(y <= 0) phi=-phi;
461 if(r >= cellRmin && r <= cellRmax && phi >= cellPhimin && phi <= cellPhimax){
462 cellXimp[np] = x;
463 cellYimp[np] = y;
464 cellZimp[np] = z;
465 np=np + 1;
466
467 } // IF
468 } // IF
469
470 if(np < 2){
471 double sxz = (layer2X - layer1X) / (layer2Z - layer1Z);
472 double syz = (layer2Y - layer1Y) / (layer2Z - layer1Z);
473 z = cellZmax;
474 x = layer1X + sxz * (z - layer1Z);
475 y = layer1Y + syz * (z - layer1Z);
476 r = std::sqrt(x * x + y * y);
477 phi = std::acos(x / r);
478 if(y <= 0) phi = -phi;
479 if(r >= cellRmin && r <= cellRmax && phi >= cellPhimin && phi <= cellPhimax){
480 cellXimp[np] = x;
481 cellYimp[np] = y;
482 cellZimp[np] = z;
483 np = np + 1;
484
485 } // IF
486 } // IF
487
488 // INTERSECTIONS PHI PLANES
489 if(np < 2){
490 double sxy = (layer2X - layer1X) / (layer2Y - layer1Y);
491 double sxz = (layer2X - layer1X) / (layer2Z - layer1Z);
492 x = (layer1X - sxy * layer1Y) / (1 - sxy * tan(cellPhimin));
493 y = x * std::tan(cellPhimin);
494 z = layer1Z + (1 / sxz) * (x - layer1X);
495 r = std::sqrt(x * x + y * y);
496 phi = std::acos(x / r);
497 if(y <= 0) phi = -phi;
498 deltaPhi = std::abs(phi - cellPhimin);
499 if(deltaPhi > 3.141593) deltaPhi = std::abs(phi + cellPhimin);
500 if(r >= cellRmin && r <= cellRmax && z >= cellZmin && z <= cellZmax && deltaPhi < 0.0001){
501 cellXimp[np] = x;
502 cellYimp[np] = y;
503 cellZimp[np] = z;
504 np = np + 1;
505 } // IF
506 } // IF
507 if(np < 2){
508 double sxy = (layer2X - layer1X) / (layer2Y - layer1Y);
509 double sxz = (layer2X - layer1X) / (layer2Z - layer1Z);
510 x = (layer1X - sxy * layer1Y) / (1 - sxy * tan(cellPhimax));
511 y = x * std::tan(cellPhimax);
512 z = layer1Z + (1 / sxz) * (x - layer1X);
513 r = std::sqrt(x * x + y * y);
514 phi = std::acos(x / r);
515 if(y <= 0) phi = -phi;
516 deltaPhi = std::abs(phi - cellPhimax);
517 if(deltaPhi > 3.141593) deltaPhi = std::abs(phi + cellPhimax);
518 if(r >= cellRmin && r <= cellRmax && z >= cellZmin && z <= cellZmax && deltaPhi < 0.0001){
519 cellXimp[np] = x;
520 cellYimp[np] = y;
521 cellZimp[np] = z;
522 np = np + 1;
523 } // IF
524 } // IF
525
526 // CALCULATE PATH IF TWO INTERSECTIONS WERE FOUND
527 if(np == 2){
528
529 pathl += std::sqrt( (cellXimp[0] - cellXimp[1]) * (cellXimp[0] - cellXimp[1]) +
530 (cellYimp[0] - cellYimp[1]) * (cellYimp[0] - cellYimp[1]) +
531 (cellZimp[0] - cellZimp[1]) * (cellZimp[0] - cellZimp[1]) );
532 } // IF
533 } // IF
534 if(sampleID == 13 && lBC == 0) ++lBC;
535 else compute = false;
536 } // WHILE (FOR LBBC LAYER)
537
538 return pathl;
539} // TrackTools::getPath
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x)
static Double_t a
#define y
#define x
#define z
double getZMax(unsigned int index) const
double getRMax(unsigned int index) const
double getZMin(unsigned int index) const
double getRMin(unsigned int index) const
const Amg::Vector3D & position() const
Access method for the position.
int r
Definition globals.cxx:22

◆ getPathInsideCell()

double TrackTools::getPathInsideCell ( const TRACK * track,
const CaloCell * cell,
const EventContext & ctx ) const
override

Definition at line 230 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

230 {
231//======================================================================================
232
233 ATH_MSG_DEBUG("in TrackInCaloTools::getPathInsideCell" );
234
235
236
237 // GET CELL DESCRIPTOR AND SAMPLING
238 const CaloDetDescrElement* dde = cell->caloDDE();
239 if(!dde) return 0.;
240 int sampling = dde->getSampling();
241 int sampling_entrance = 0;
242 int sampling_exit = 0;
243 int cell_tower = m_tileID->tower(cell->ID());
244
245 // The type of physics (collision or cosmic) determines the entrance and exit cell for the muons, therefore these different switches are defined accordingly.
246 if (m_isCollision) {
247 switch(sampling){
248 case 12:
249 sampling_entrance = 12;
250 if (cell_tower>=0 && cell_tower<=6) sampling_exit = 14;
251 else if (cell_tower==7) sampling_exit = 13; // for A8, the exit is BC8
252 else if (cell_tower>=8 && cell_tower<=9) sampling_exit = 20; // for A9 and A10, the exit is D5
253 break;
254 case 13:
255 sampling_entrance = 12;
256 if (cell_tower>=0 && cell_tower<=6) sampling_exit = 14;
257 else if (cell_tower==7) sampling_exit = 13; // for BC8, the exit is BC8
258 else if (cell_tower==8) sampling_exit = 20; // for B9, the exit is D5
259 break;
260 case 14: sampling_entrance = 12; sampling_exit = 14; break;
261 case 15: sampling_entrance = 12; sampling_exit = 20; break; // for C10, the entrance is A10, the exit is D5
262 case 16: sampling_entrance = 12; sampling_exit = 13; break;
263 case 17:
264 sampling_entrance = 17;
265 if (cell_tower == 10) { // E1
266 sampling_exit = 19; // the exit is B11
267 } else if (cell_tower == 11) { // E2
268 if (getTrackInCellSampling(track, CaloSampling::CaloSample::TileExt0, ctx)) sampling_exit = 18; // the exit is A12
269 else sampling_exit = 19; // the exit is B11
270 } else if ((cell_tower == 13) || (cell_tower == 15)) { // E3 or E4
271 if (getTrackInCellSampling(track, CaloSampling::CaloSample::PreSamplerE, ctx)) sampling_exit = 4; // the exit is PreSamplerE
272 else sampling_exit = 18; // the exit is TileExt0
273 }
274 break;
275 case 18:
276 sampling_entrance = 18;
277 if (cell_tower>=11 && cell_tower<=13) sampling_exit = 20;
278 else if (cell_tower>=14 && cell_tower<=15) sampling_exit = 19; // for A15 and A16, the exit is B15
279 break;
280 case 19:
281 if (cell_tower==10) {sampling_entrance = 19; sampling_exit = 20;} // for B11, the entrance is B11, the exit is D5
282 else if (cell_tower>=11 && cell_tower<=13) {sampling_entrance = 18; sampling_exit = 20;} // for B12-B14, the entrance is EBA cells, the exit is EBD cells
283 else if (cell_tower==14) {sampling_entrance = 18; sampling_exit = 19;} // for B15, the entrance is A15, the exit is B15
284 break;
285 case 20:
286 if (cell_tower==10) {sampling_entrance = 19; sampling_exit = 20;} // for D5, the entrance is B11, the exit is D5
287 else if (cell_tower==12) {sampling_entrance = 18; sampling_exit = 20;} // for D6, the entrance is A13 cells, the exit is D6
288 break;
289 default: return 0.;
290 } // SWITCH
291 }
292 else {
293 switch(sampling){
294 case 12: sampling_entrance = 12; sampling_exit = 14; break;
295 case 13: sampling_entrance = 12; sampling_exit = 14; break;
296 case 14: sampling_entrance = 12; sampling_exit = 14; break;
297 case 15: sampling_entrance = 13; sampling_exit = 14; break;
298 case 16: sampling_entrance = 12; sampling_exit = 13; break;
299 case 17: sampling_entrance = 17; sampling_exit = 19; break;
300 case 18: sampling_entrance = 18; sampling_exit = 20; break;
301 case 19: sampling_entrance = 18; sampling_exit = 20; break;
302 case 20: sampling_entrance = 18; sampling_exit = 20; break;
303 default: return 0.;
304 } // SWITCH
305 }
306
307 std::unique_ptr<const Trk::TrackParameters> pars_entrance =
308 getTrackInCellSampling(track, (CaloSampling::CaloSample)sampling_entrance, ctx);
309 std::unique_ptr<const Trk::TrackParameters> pars_exit =
310 getTrackInCellSampling(track, (CaloSampling::CaloSample)sampling_exit, ctx);
311
312 if( !pars_entrance || !pars_exit ) return 0.;
313
314 return getPath(cell, pars_entrance.get(), pars_exit.get());
315} // TrackTools::getPathInsideCell
CaloCell_ID::CaloSample getSampling() const
cell sampling
double getPath(const CaloCell *cell, const Trk::TrackParameters *entrance, const Trk::TrackParameters *exit) const override
std::unique_ptr< const Trk::TrackParameters > getTrackInCellSampling(const TRACK *track, CaloSampling::CaloSample sampling, const EventContext &ctx) const override

◆ getTrackInCellSampling()

std::unique_ptr< const Trk::TrackParameters > TrackTools::getTrackInCellSampling ( const TRACK * track,
CaloSampling::CaloSample sampling,
const EventContext & ctx ) const
override

Definition at line 53 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

53 {
54//==================================================================================================
55 if( !m_caloExtensionTool.empty() ){
56 std::unique_ptr<Trk::CaloExtension> extension =
57 m_caloExtensionTool->caloExtension(ctx, *track);
58 if (!extension)
59 return nullptr;
60
61 Trk::TrackParametersIdHelper parsIdHelper;
62
63 std::map<CaloSampling::CaloSample,const Trk::CurvilinearParameters*> Samplings;
64
65 // loop over calo layers, keep track of previous layer
66 auto cur = extension->caloLayerIntersections().begin();
67 auto prev = cur;
68 for( ; cur != extension->caloLayerIntersections().end() ; ++cur ){
69 // check that prev and cur are not the same, if not fill if the previous was an entry layer
70 if( prev != cur && parsIdHelper.isEntryToVolume((*prev).cIdentifier()) )
71 {
72 TrackParametersIdentifier id = (*prev).cIdentifier();
74 Samplings[sample] = &(*prev);
75 }
76 prev=cur;
77 }
78 if(!Samplings[sampling]) {return nullptr ;}
79 else {return std::make_unique<const Trk::CurvilinearParameters> (*(Samplings[sampling]));}
80 }
81 return nullptr;
82}
unsigned int TrackParametersIdentifier
bool isEntryToVolume(TrackParametersIdentifier id) const
returns true if the id belongs to the volume entrance
CaloSampling::CaloSample caloSample(TrackParametersIdentifier id) const
CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid.

◆ getXYZEtaPhiInCellSampling() [1/2]

std::vector< double > TrackTools::getXYZEtaPhiInCellSampling ( const TRACK * track,
CaloSampling::CaloSample sampling,
const EventContext & ctx ) const
override

Definition at line 85 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

85 {
86//==================================================================================================
87 std::vector<double> coordinates;
88 if( !m_caloExtensionTool.empty() ){
89 std::unique_ptr<Trk::CaloExtension> extension =
90 m_caloExtensionTool->caloExtension(ctx, *track);
91 if (!extension)
92 return coordinates;
93
94 Trk::TrackParametersIdHelper parsIdHelper;
95
96 std::map<CaloSampling::CaloSample,const Trk::TrackParameters*> Samplings;
97
98 // loop over calo layers, keep track of previous layer
99 auto cur = extension->caloLayerIntersections().begin();
100 auto prev = cur;
101 for( ; cur != extension->caloLayerIntersections().end() ; ++cur ){
102 // check that prev and cur are not the same, if not fill if the previous was an entry layer
103 if( prev != cur && parsIdHelper.isEntryToVolume((*prev).cIdentifier()) )
104 {
105 TrackParametersIdentifier id = (*prev).cIdentifier();
106 CaloSampling::CaloSample sample = parsIdHelper.caloSample(id);
107 Samplings[sample] = &(*prev);
108 }
109 prev=cur;
110 }
111 if(!(Samplings[sampling])) return coordinates;
112 coordinates.push_back(Samplings[sampling]->position().x());
113 coordinates.push_back(Samplings[sampling]->position().y());
114 coordinates.push_back(Samplings[sampling]->position().z());
115 coordinates.push_back(Samplings[sampling]->position().eta());
116 coordinates.push_back(Samplings[sampling]->position().phi());
117 }
118 return coordinates;
119} // getXYZEtaPhiInCellSampling
Scalar eta() const
pseudorapidity method
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.

◆ getXYZEtaPhiInCellSampling() [2/2]

std::vector< double > TrackTools::getXYZEtaPhiInCellSampling ( const TRACK * track,
const CaloCell * cell,
const EventContext & ctx ) const
override

Definition at line 123 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

123 {
124//==========================================================================================================
125 std::vector<double> coordinates;
126
127 if(!cell || !track) return coordinates;
128 // GET CELL DESCRIPTOR AND SAMPLING
129 const CaloDetDescrElement* dde = cell->caloDDE();
130 if(!dde) return coordinates;
131 CaloSampling::CaloSample sampling = dde->getSampling();
132
133 return getXYZEtaPhiInCellSampling(track,sampling,ctx);
134} // getXYZEtaPhiInCellSampling
std::vector< double > getXYZEtaPhiInCellSampling(const TRACK *track, const CaloCell *cell, const EventContext &ctx) const override

◆ getXYZEtaPhiPerLayer()

std::vector< std::vector< double > > TrackTools::getXYZEtaPhiPerLayer ( const TRACK * track,
const EventContext & ctx ) const
override

Definition at line 138 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

138 {
139//====================================================================================================
140 std::vector< std::vector<double> > coordinates(11);
141
142 for(unsigned int sample=0 ; sample<21; ++sample) //Samplings:http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.def
143 {
144 std::vector<double> TrkPars(5);
145 std::vector<double> XYZEtaPhi = getXYZEtaPhiInCellSampling( track, (CaloSampling::CaloSample)sample, ctx );
146 TrkPars[0] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[0] ;
147 TrkPars[1] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[1] ;
148 TrkPars[2] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[2] ;
149 TrkPars[3] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[3] ;
150 TrkPars[4] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[4] ;
151 int lay=-1;
152 if (sample==0 || sample==4 ){lay=0;}
153 else if(sample==1 || sample==5 ){lay=1;}
154 else if(sample==2 || sample==6 ){lay=2;}
155 else if(sample==3 || sample==7 ){lay=3;}
156 else if(sample==12 || sample==18){lay=4;}
157 else if(sample==13 || sample==19){lay=5;}
158 else if(sample==15 || sample==17){lay=5;}
159 else if(sample==14 || sample==20){lay=6;}
160 else if(sample==16) {lay=6;}
161 else if(sample==8 ){lay=7;}
162 else if(sample==9 ){lay=8;}
163 else if(sample==10 ){lay=9;}
164 else if(sample==11 ){lay=10;}
165 if(lay!=-1) coordinates[lay] = TrkPars;
166 } // FOR
167
168 return coordinates;
169} // TrackTools::getXYZEtaPhiPerLayer

◆ getXYZEtaPhiPerSampling()

std::vector< std::vector< double > > TrackTools::getXYZEtaPhiPerSampling ( const TRACK * track,
const EventContext & ctx ) const
override

Definition at line 172 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

172 {
173//====================================================================================================
174 std::vector< std::vector<double> > coordinates;
175
176 for(unsigned int s=0 ; s<21; ++s) //Samplings: http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.def
177 {
178 std::vector<double> TrkPars(5);
179 std::vector<double> XYZEtaPhi = getXYZEtaPhiInCellSampling( track, (CaloSampling::CaloSample)s, ctx );
180 TrkPars[0] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[0] ;
181 TrkPars[1] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[1] ;
182 TrkPars[2] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[2] ;
183 TrkPars[3] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[3] ;
184 TrkPars[4] = ( XYZEtaPhi.size()!=5 ) ? -9999. : XYZEtaPhi[4] ;
185 coordinates.push_back(TrkPars);
186 } // FOR
187
188 return coordinates;
189} // TrackTools::getXYZEtaPhiPerSampling

◆ initialize()

StatusCode TrackTools::initialize ( )
finaloverride

Definition at line 24 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

24 {
25//=================================
26
27 ATH_MSG_INFO( "Initializing TrackTools" );
28
29 if (m_isCollision) {
30 ATH_MSG_INFO( "Beam type = Collision" );
31 } else {
32 ATH_MSG_INFO( "Beam type = Cosmic" );
33 }
34
36
37 ATH_CHECK( detStore()->retrieve(m_tileID) );
38
39 //=== TileDetDescrManager
40 ATH_CHECK( detStore()->retrieve(m_tileMgr) );
41
42 return StatusCode::SUCCESS;
43} // TrackTools::initialize
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ retrieveIndex()

int TrackTools::retrieveIndex ( int sampling,
float eta ) const
override

Definition at line 602 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

602 {
603//====================================================
604 // STORE ETA MAP
605 float etamap[81] = { -0.95,-0.85,-0.75,-0.65,-0.55,-0.45,-0.35,-0.25,-0.15,-0.05, // CELLS A-10 TO A-1 (SAMPLING 12) INDICES 0:9
606 0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, 0.95, // CELLS A1 TO A10 (SAMPLING 12) INDICES 10:19
607 -0.85,-0.75,-0.65,-0.55,-0.45,-0.35,-0.25,-0.15,-0.05, // CELLS BC-9 TO BC-1 (SAMPLING 13) INDICES 20:28
608 0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75, 0.85, // CELLS BC1 TO BC9 (SAMPLING 13) INDICES 29:37
609 -0.60,-0.40,-0.20, // CELLS D-3 TO D-1 (SAMPLING 14) INDICES 38:40
610 0.00, 0.20, 0.40, 0.60, // CELLS D0 TO D3 (SAMPLING 14) INDICES 41:44
611 -0.956279,0.9583722, // CELLS C-10 TO C10 (SAMPLING 15) INDICES 45:46
612 -0.855940,0.8579205, // CELLS D-4 TO D4 (SAMPLING 16) INDICES 47:48
613 -1.507772,-1.307385,-1.156978,-1.056676, // CELLS E-4 TO E-1 (SAMPLING 17) INDICES 49:52
614 1.0589020,1.1593041,1.3098471,1.5103633, // CELLS E1 TO E4 (SAMPLING 17) INDICES 53:56
615 -1.554988,-1.455460,-1.355965,-1.256501,-1.157065, // CELLS A-16 TO A-12 (SAMPLING 18) INDICES 57:61
616 1.1594202,1.258668,1.3579534,1.4572804,1.5566510, // CELLS A12 TO A16 (SAMPLING 18) INDICES 62:66
617 -1.454651,-1.355081,-1.255538,-1.156018,-1.056519, // CELLS B-15 TO B-11 (SAMPLING 19) INDICES 67:71
618 1.0586925,1.1580252,1.2573844,1.3567756,1.4562022, // CELLS B11 TO B15 (SAMPLING 19) INDICES 72:76
619 -1.204743,-1.005559, // CELLS D-6 TO D-5 (SAMPLING 20) INDICES 77:78
620 1.0074122,1.2063241}; // CELLS D5 TO D6 (SAMPLING 20) INDICES 79:80
621 // CALCULATE INDEX
622 int index(999),i_start(999),i_end(999);
623 switch(sampling){
624 case 12: i_start = 0; i_end = 19; break;
625 case 13: i_start = 20; i_end = 37; break;
626 case 14: i_start = 38; i_end = 44; break;
627 case 15: i_start = 45; i_end = 46; break;
628 case 16: i_start = 47; i_end = 48; break;
629 case 17: i_start = 49; i_end = 56; break;
630 case 18: i_start = 57; i_end = 66; break;
631 case 19: i_start = 67; i_end = 76; break;
632 case 20: i_start = 77; i_end = 80; break;
633 default: break;
634 } // SWITCH
635
636 if(i_start==999 || i_end==999) return -1;
637
638 index = i_start;
639
640 for(int i=i_start;i <= i_end;++i) index = std::abs(eta-etamap[i]) <= std::abs(eta-etamap[index]) ? i : index;
641 return index;
642} // TRACKTOOLS::RETRIEVEINDEX
str index
Definition DeMoScan.py:362

Member Data Documentation

◆ m_caloExtensionTool

ToolHandle<Trk::IParticleCaloExtensionTool> TileCal::TrackTools::m_caloExtensionTool
private
Initial value:
{this,
"ParticleCaloExtensionTool", "Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"}

Definition at line 63 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h.

63 {this,
64 "ParticleCaloExtensionTool", "Trk::ParticleCaloExtensionTool/ParticleCaloExtensionTool"};

◆ m_isCollision

Gaudi::Property<bool> TileCal::TrackTools::m_isCollision {this, "IsCollision", true}
private

Definition at line 61 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h.

61{this, "IsCollision", true};

◆ m_tileID

const TileID* TileCal::TrackTools::m_tileID {nullptr}
private

Definition at line 66 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h.

66{nullptr};

◆ m_tileMgr

const TileDetDescrManager* TileCal::TrackTools::m_tileMgr {nullptr}
private

Definition at line 67 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h.

67{nullptr};

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