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 override
std::vector< double > getXYZEtaPhiInCellSampling (const TRACK *track, const CaloCell *cell) const override
std::vector< double > getXYZEtaPhiInCellSampling (const TRACK *track, CaloSampling::CaloSample sampling) const override
std::unique_ptr< const Trk::TrackParametersgetTrackInCellSampling (const TRACK *track, CaloSampling::CaloSample sampling) const override
std::vector< std::vector< double > > getXYZEtaPhiPerLayer (const TRACK *track) const override
std::vector< std::vector< double > > getXYZEtaPhiPerSampling (const TRACK *track) const override
double getPathInsideCell (const TRACK *track, const CaloCell *cell) 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
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 542 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

546 {
547
548 std::vector<float> energyInCone(drCones.size(), 0.F);
549
550 std::unique_ptr<Trk::CaloExtension> extension = m_caloExtensionTool->caloExtension(ctx, *track);
551
552 if (!extension) {
553 return energyInCone;
554 }
555
557 CaloExtensionHelpers::entryExitLayerMap(*extension, entryExitLayerMap);
558
559 for (const xAOD::CaloCluster* cluster : *clusters) {
560
561 // Find the most energetic layer of the cluster
562 xAOD::CaloCluster::CaloSample mostEnergeticLayer = xAOD::CaloCluster::CaloSample::Unknown;
563 double maxLayerClusterEnergy = std::numeric_limits<double>::min();
564 for (unsigned int sampling = 0; sampling < xAOD::CaloCluster::CaloSample::FCAL0; ++sampling) {
565 if(sampling == xAOD::CaloCluster::CaloSample::TileGap3) continue;
566 double clusterLayerEnergy = cluster->eSample(static_cast<xAOD::CaloCluster::CaloSample>(sampling));
567 if(clusterLayerEnergy > maxLayerClusterEnergy) {
568 maxLayerClusterEnergy = clusterLayerEnergy;
569 mostEnergeticLayer = static_cast<xAOD::CaloCluster::CaloSample>(sampling);
570 }
571 }
572
573 if(mostEnergeticLayer == xAOD::CaloCluster::CaloSample::Unknown) continue;
574
575 double clusterEta = cluster->rawEta();
576 double clusterPhi = cluster->rawPhi();
577
578 auto entryExit = entryExitLayerMap.find(mostEnergeticLayer);
579 if (entryExit == entryExitLayerMap.end()) continue;
580 double trackEta = entryExit->second.first.eta();
581 double trackPhi = entryExit->second.first.phi();
582
583 double deltaR = KinematicUtils::deltaR(clusterEta, trackEta, clusterPhi, trackPhi);
584
585 for (unsigned int icone = 0; icone < drCones.size(); ++icone) {
586 if (deltaR < drCones[icone]) {
587 for (xAOD::CaloCluster::CaloSample sampling : samplings) {
588 energyInCone[icone] += cluster->eSample(sampling);
589 }
590 }
591 }
592 }
593
594 return energyInCone;
595}
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 317 of file DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx.

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

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

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

◆ getTrackInCellSampling()

std::unique_ptr< const Trk::TrackParameters > TrackTools::getTrackInCellSampling ( const TRACK * track,
CaloSampling::CaloSample sampling ) 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(Gaudi::Hive::currentContext(), *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
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(Gaudi::Hive::currentContext(), *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

◆ getXYZEtaPhiInCellSampling() [2/2]

std::vector< double > TrackTools::getXYZEtaPhiInCellSampling ( const TRACK * track,
const CaloCell * cell ) 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);
134} // getXYZEtaPhiInCellSampling
std::vector< double > getXYZEtaPhiInCellSampling(const TRACK *track, const CaloCell *cell) const override

◆ getXYZEtaPhiPerLayer()

std::vector< std::vector< double > > TrackTools::getXYZEtaPhiPerLayer ( const TRACK * track) 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 );
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
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 );
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
38
39 //=== TileDetDescrManager
41
42 return StatusCode::SUCCESS;
43} // TrackTools::initialize
#define ATH_CHECK
Evaluate an expression and check for errors.
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ retrieveIndex()

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

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

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

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

◆ m_isCollision

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

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

60{this, "IsCollision", true};

◆ m_tileID

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

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

65{nullptr};

◆ m_tileMgr

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

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

66{nullptr};

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