ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | List of all members
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

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

Member Enumeration Documentation

◆ TILE_RAW

Enumerator
TILE_RAW_FIRST 
TILE_RAW_SECOND 
TILE_RAW_THIRD 
TILE_RAW_FOURTH 
TILE_RAW_FIFTH 
TILE_RAW_SIXTH 

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

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

◆ getCellsWithinConeAroundTrack()

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

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

197  {
198 //======================================================================
199  // CELLS WITHIN CONE AROUND TRACK
202  for(;icell!=end;++icell){
203  const CaloCell* cell = (*icell);
204  const CaloDetDescrElement* dde = cell->caloDDE();
205 
206  // REASONS TO SKIP THIS CELL OR BREAK THE LOOP
207  if(!dde) continue;
208  if(!includelar && dde->getSubCalo() == CaloCell_ID::LAREM) continue;
209  if(dde->getSubCalo() != CaloCell_ID::LAREM && dde->getSubCalo() != CaloCell_ID::TILE) continue;
210 
211  std::vector<double> coordinates = getXYZEtaPhiInCellSampling(track,dde->getSampling());
212  if(coordinates.size()!=5) continue;
213 
214  double deltaR = KinematicUtils::deltaR( cell->eta(),coordinates[3], cell->phi(),coordinates[4]);
215 
216  if(deltaR<=cone)
217  {
218  unsigned int i=0;
219  while(i!=output->size()){if(output->at(i)==cell){break;}i++;}
220  if(i==output->size())
221  {
222  output->push_back(cell);
223  }
224  }
225  } // FOR
226 } // TrackTools::getCellsWithinConeAroundTrack

◆ 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);
553 
554  for (const xAOD::CaloCluster* cluster : *clusters) {
555 
556  // Find the most energetic layer of the cluster
558  double maxLayerClusterEnergy = std::numeric_limits<double>::min();
559  for (unsigned int sampling = 0; sampling < xAOD::CaloCluster::CaloSample::FCAL0; ++sampling) {
560  if(sampling == xAOD::CaloCluster::CaloSample::TileGap3) continue;
561  double clusterLayerEnergy = cluster->eSample(static_cast<xAOD::CaloCluster::CaloSample>(sampling));
562  if(clusterLayerEnergy > maxLayerClusterEnergy) {
563  maxLayerClusterEnergy = clusterLayerEnergy;
564  mostEnergeticLayer = static_cast<xAOD::CaloCluster::CaloSample>(sampling);
565  }
566  }
567 
568  if(mostEnergeticLayer == xAOD::CaloCluster::CaloSample::Unknown) continue;
569 
570  double clusterEta = cluster->rawEta();
571  double clusterPhi = cluster->rawPhi();
572 
573  auto entryExit = entryExitLayerMap.find(mostEnergeticLayer);
574  if (entryExit == entryExitLayerMap.end()) continue;
575  double trackEta = entryExit->second.first.eta();
576  double trackPhi = entryExit->second.first.phi();
577 
578  double deltaR = KinematicUtils::deltaR(clusterEta, trackEta, clusterPhi, trackPhi);
579 
580  for (unsigned int icone = 0; icone < drCones.size(); ++icone) {
581  if (deltaR < drCones[icone]) {
582  for (xAOD::CaloCluster::CaloSample sampling : samplings) {
583  energyInCone[icone] += cluster->eSample(sampling);
584  }
585  }
586  }
587  }
588 
589  return energyInCone;
590 }

◆ 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

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

◆ 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();
73  CaloSampling::CaloSample sample = parsIdHelper.caloSample(id);
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 }

◆ 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

◆ 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

◆ 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 
35  ATH_CHECK(m_caloExtensionTool.retrieve());
36 
38 
39  //=== TileDetDescrManager
41 
42  return StatusCode::SUCCESS;
43 } // TrackTools::initialize

◆ retrieveIndex()

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

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

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

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.

◆ m_isCollision

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

◆ m_tileID

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

◆ m_tileMgr

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

The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileDetDescrManager::get_cell_dim
TileCellDim * get_cell_dim(const Identifier &cell_id) const
Definition: TileDetDescrManager.cxx:952
beamspotman.r
def r
Definition: beamspotman.py:674
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:215
test_pyathena.eta
eta
Definition: test_pyathena.py:10
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
TileCal::TrackTools::TILE_RAW_SECOND
@ TILE_RAW_SECOND
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:67
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
WriteCellNoiseToCool.icell
icell
Definition: WriteCellNoiseToCool.py:339
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
beamspotman.cur
def cur
Definition: beamspotman.py:669
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
index
Definition: index.py:1
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:161
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:217
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
TileCal::TrackTools::TILE_RAW_THIRD
@ TILE_RAW_THIRD
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:67
TileCal::TrackTools::m_tileID
const TileID * m_tileID
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:65
CaloExtensionHelpers::entryExitLayerMap
void entryExitLayerMap(const Trk::CaloExtension &extension, EntryExitLayerMap &result, const LayersToSelect *selection=nullptr)
Definition: CaloExtensionHelpers.h:192
TileCal::TrackTools::m_caloExtensionTool
ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:62
TileCal::TrackTools::TILE_RAW_FIRST
@ TILE_RAW_FIRST
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:67
Trk::TrackParametersIdHelper::caloSample
CaloSampling::CaloSample caloSample(TrackParametersIdentifier id) const
CaloSample encoded in id, returns CaloSampling::Unknown if id is not valid
Definition: TrackParametersIdHelper.h:91
Tile_Base_ID::tower
int tower(const Identifier &id) const
Definition: Tile_Base_ID.cxx:165
PlotPulseshapeFromCool.np
np
Definition: PlotPulseshapeFromCool.py:64
TileCal::TrackTools::m_tileMgr
const TileDetDescrManager * m_tileMgr
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:66
x
#define x
Trk::TrackParametersIdHelper::isEntryToVolume
bool isEntryToVolume(TrackParametersIdentifier id) const
returns true if the id belongs to the volume entrance
Definition: TrackParametersIdHelper.h:81
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
TileCal::TrackTools::TILE_RAW_FIFTH
@ TILE_RAW_FIFTH
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:67
CaloDetDescrElement::getSubCalo
CaloCell_ID::SUBCALO getSubCalo() const
cell subcalo
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:433
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
TileCellDim
Definition: TileCellDim.h:19
Trk::TrackParametersIdHelper
helper class to encode and decode a TrackParametersIdentifier
Definition: TrackParametersIdHelper.h:18
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:62
TileCellDim::getRMax
double getRMax(unsigned int index) const
Definition: TileCellDim.cxx:39
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
z
#define z
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileCal::TrackTools::getXYZEtaPhiInCellSampling
std::vector< double > getXYZEtaPhiInCellSampling(const TRACK *track, const CaloCell *cell) const override
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx:123
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:43
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
CaloExtensionHelpers::EntryExitLayerMap
std::map< CaloSampling::CaloSample, std::pair< Amg::Vector3D, Amg::Vector3D > > EntryExitLayerMap
Definition: CaloExtensionHelpers.h:21
TileCellDim::getRMin
double getRMin(unsigned int index) const
Definition: TileCellDim.cxx:31
calibdata.exit
exit
Definition: calibdata.py:235
TrackParametersIdentifier
unsigned int TrackParametersIdentifier
Definition: TrackParametersIdHelper.h:13
merge.output
output
Definition: merge.py:16
python.TriggerEDMRun2.Samplings
Samplings
Definition: TriggerEDMRun2.py:76
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
TileCal::TrackTools::getTrackInCellSampling
std::unique_ptr< const Trk::TrackParameters > getTrackInCellSampling(const TRACK *track, CaloSampling::CaloSample sampling) const override
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx:53
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
TileCellDim::getZMax
double getZMax(unsigned int index) const
Definition: TileCellDim.cxx:55
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
DeMoScan.index
string index
Definition: DeMoScan.py:362
TileCal::TrackTools::TILE_RAW_SIXTH
@ TILE_RAW_SIXTH
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:67
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
TileCal::TrackTools::getPath
double getPath(const CaloCell *cell, const Trk::TrackParameters *entrance, const Trk::TrackParameters *exit) const override
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.cxx:317
TileCal::TrackTools::m_isCollision
Gaudi::Property< bool > m_isCollision
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:60
TauGNNUtils::Variables::Track::trackPhi
bool trackPhi(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:493
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
KinematicUtils::deltaR
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: D3PDMaker/TileD3PDMaker/src/ITrackTools.h:114
TileCal::TrackTools::TILE_RAW_FOURTH
@ TILE_RAW_FOURTH
Definition: DerivationFramework/DerivationFrameworkTileCal/src/TrackTools.h:67
Trk::CaloExtension::caloLayerIntersections
const std::vector< CurvilinearParameters > & caloLayerIntersections() const
access to the intersections with the calorimeter layers.
Definition: CaloExtension.h:59
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:43
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
python.compressB64.c
def c
Definition: compressB64.py:93
TileCellDim::getZMin
double getZMin(unsigned int index) const
Definition: TileCellDim.cxx:47
TauGNNUtils::Variables::Track::trackEta
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:488