ATLAS Offline Software
CaloSurfaceBuilder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //****************************************************************************
6 // CaloSurfacaBuilder.cxx, (c) ATLAS detector software
7 //****************************************************************************
8 
10 
11 #include "Gaudi/Property.h"
12 #include "GaudiKernel/Bootstrap.h"
13 #include "GaudiKernel/IMessageSvc.h"
14 #include "GaudiKernel/IService.h"
15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/IToolSvc.h"
17 #include "GaudiKernel/MsgStream.h"
18 #include "GaudiKernel/SystemOfUnits.h"
19 
23 
24 #include "TrkGeometry/DiscLayer.h"
25 #include "TrkSurfaces/DiscBounds.h"
27 
30 
31 // Amg
33 
34 // Calo specific stuff :
35 #include "CaloDetDescr/CaloDetDescrElement.h"
41 
42 // Tile specific stuff :
43 #include "CaloIdentifier/TileID.h"
46 
52 
53 #include <algorithm> //for std::min, std::max
54 #include <cmath>
55 
57  const std::string& name,
58  const IInterface* parent)
60  , m_tile_dd(nullptr)
61  , m_lar_mat("LArRecoMaterialTool")
62  , m_lar_simplegeom("LArRecoSimpleGeomTool")
63 {
64  declareInterface<ICaloSurfaceBuilder>(this);
65  declareProperty("LArRecoMaterialTool", m_lar_mat);
66  declareProperty("LarRecoSimpleGeometryTool", m_lar_simplegeom);
67 }
68 
70 
73 {
74  if (m_lar_mat.retrieve().isFailure()) {
75  ATH_MSG_FATAL("Failed to retrieve " << m_lar_mat << ". Aborting.");
76  return StatusCode::FAILURE;
77  }
78 
79  if (m_lar_simplegeom.retrieve().isFailure()) {
80  ATH_MSG_FATAL("Failed to retrieve " << m_lar_simplegeom << ". Aborting.");
81  return StatusCode::FAILURE;
82  }
83 
84  if (m_calodepth.retrieve().isFailure()) {
85  ATH_MSG_FATAL("Failed to retrieve " << m_calodepth << ". Aborting.");
86  return StatusCode::FAILURE;
87  }
88 
89  if (detStore()->retrieve(m_tile_dd).isFailure()) {
90  ATH_MSG_FATAL("Could not find TileDetDescrManager in DetStore");
91  return StatusCode::FAILURE;
92  }
93 
94  return StatusCode::SUCCESS;
95 }
96 
99 {
100  // clear surface cash
101  for (auto & layerEntry : m_layerEntries) {
102  delete layerEntry.first;
103  delete layerEntry.second;
104  }
105 
106  if (!m_layerExits.empty()) {
107  delete m_layerExits[CaloCell_ID::TileBar2].first;
108  delete m_layerExits[CaloCell_ID::TileBar2].second;
109  delete m_layerExits[CaloCell_ID::TileExt2].first;
110  delete m_layerExits[CaloCell_ID::TileExt2].second;
111  delete m_layerExits[CaloCell_ID::TileGap2].first;
112  delete m_layerExits[CaloCell_ID::TileGap2].second;
113  delete m_layerExits[CaloCell_ID::TileGap3].first;
114  delete m_layerExits[CaloCell_ID::TileGap3].second;
115  delete m_layerExits[CaloCell_ID::HEC3].first;
116  delete m_layerExits[CaloCell_ID::HEC3].second;
117  }
118 
119  StatusCode sc = StatusCode::SUCCESS;
120  return sc;
121 }
122 
125  const double offset,
126  const double etaCaloLocal,
127  const CaloDetDescrManager* calo_dd) const
128 {
129 
130  if (sample == CaloCell_ID::Unknown) {
131  return nullptr;
132  }
133 
134  auto pos = Amg::Transform3D(Trk::s_idTransform);
135  Trk::Surface* surf = nullptr;
136 
137  bool result = false;
138  double rmin = 0.;
139  double z = 0.;
140  double rmax = 0.;
141  double radius = 0.;
142  double hphi = 0.;
143  double hlen = 0.;
144  double depth = 0.;
145  int side = 1;
146 
147  bool tile = false;
153  tile = true;
154 
155  bool HEC3 = false;
156  if (sample == CaloCell_ID::HEC3)
157  HEC3 = true;
158 
159  if (etaCaloLocal < 0)
160  side = -1;
161 
162  // Specific hack for the testbeam : even if tracks have eta<0, ask for the
163  // positive side
164  if (calo_dd->lar_geometry() == "H8")
165  side = 1;
166 
167  // too bad, I need this ugly if to decide which type of surface should be
168  // built cylinder of disk ?
169  // Note: TileGap3 is in the barrel but is a disk!!
170  bool barrel = true;
177  barrel = false;
178  }
179 
180  if (barrel) {
181 
182  /*To avoid the funny numbers given by the CaloDescriptors to TileBar2, (due
183  to the cell D type)
184  we'll take only the radius from them, the rest we copy from TileBar1 */
185  if (sample == CaloCell_ID::TileBar2) {
186  double radius2 = 0;
187  auto pos2 = Amg::Transform3D(Trk::s_idTransform);
189  sample, side, pos2, radius, hphi, hlen, depth, calo_dd);
191  side,
192  pos,
193  radius2,
194  hphi,
195  hlen,
196  depth,
197  calo_dd);
198  } else {
200  sample, side, pos, radius, hphi, hlen, depth, calo_dd);
201  }
202  if (!result) {
203  return nullptr;
204  }
205 
206  // this correction will only work for LAr
207  double betterrad = 0;
208  if (!tile) {
209  betterrad = m_calodepth->radius(sample, etaCaloLocal, 0., calo_dd);
210  radius = offset + betterrad;
211  }
212  if (tile)
213  hlen = hlen / 2;
214  // for Atlas configuration, avoid to create a hole at phi ~ pi by hphi
215  // rounding effects (the phi range was introduced for the testbeam)
216  if (hphi < 0.9 * M_PI) {
217  surf = new Trk::CylinderSurface(pos, radius, hphi, hlen);
218  } else {
219  surf = new Trk::CylinderSurface(pos, radius, hlen);
220  }
221  } else {
222  bool result = this->get_disk_surface(
223  sample, side, pos, z, rmin, rmax, hphi, depth, calo_dd);
224  if (!result) {
225  return nullptr;
226  }
227 
228  double betterz = 0;
229 
230  if (!tile && !HEC3) {
231  betterz = m_calodepth->radius(sample, etaCaloLocal, 0., calo_dd);
232  z = offset + betterz - (pos)(2, 3);
233  Amg::Translation3D vec(0., 0., z);
234  pos = (pos) * vec;
235  }
236  // for Atlas configuration, avoid to create a hole a phi ~ pi by hphi
237  // rounding effects. the phi range was introduced for the testbeam
238  if (hphi < 0.9 * M_PI) {
239  surf = new Trk::DiscSurface(pos, rmin, rmax, hphi);
240  } else {
241  surf = new Trk::DiscSurface(pos, rmin, rmax);
242  }
243  }
244 
245  return surf;
246 }
247 
250  const double offset,
251  const double etaCaloLocal,
252  const CaloDetDescrManager* calo_dd) const
253 {
254 
255  Trk::Surface* surf = nullptr;
256 
257  bool tile = false;
263  tile = true;
264 
265  auto pos = Amg::Transform3D(Trk::s_idTransform);
266 
267  bool result = false;
268  double rmin = 0.;
269  double z = 0.;
270  double rmax = 0.;
271  double radius = 0.;
272  double hphi = 0.;
273  double hlen = 0.;
274  double depth = 0.;
275  int side = 1;
276 
277  if (etaCaloLocal < 0)
278  side = -1;
279 
282 
283  /*To avoid the funny numbers given by the CaloDescriptors to TileBar2, (due
284  to the cell D type)
285  we'll take only the radius from them, the rest we copy from TileBar1 */
286  if (sample == CaloCell_ID::TileBar2) {
287  double radius2 = 0;
288  auto pos2 = Amg::Transform3D(Trk::s_idTransform);
290  sample, side, pos2, radius, hphi, hlen, depth, calo_dd);
292  side,
293  pos,
294  radius2,
295  hphi,
296  hlen,
297  depth,
298  calo_dd);
299  } else {
300 
302  sample, side, pos, radius, hphi, hlen, depth, calo_dd);
303  }
304  if (!result) {
305  return nullptr;
306  }
307 
308  // for Atlas configuration, avoid to create a hole at phi ~ pi by hphi
309  // rounding effects (the phi range was introduced for the testbeam)
310  else {
311  std::vector<TileDetDescriptor*>::const_iterator Tile_first =
313  TileDetDescriptor* TileBar_descr = *(Tile_first + 1);
314  TileDetDescriptor* TileExt_descr = *(Tile_first + 3);
315  TileDetDescriptor* TileGap_descr = *(Tile_first + 5);
316  if (sample == CaloCell_ID::TileBar2) {
317  radius = TileBar_descr->rcenter(2) + .5 * TileBar_descr->dr(2);
318  } else if (sample == CaloCell_ID::TileExt2) {
319  radius = TileExt_descr->rcenter(2) + .5 * TileExt_descr->dr(2);
320  } else if (sample == CaloCell_ID::TileGap2) {
321  radius = TileGap_descr->rcenter(2) + .5 * TileGap_descr->dr(2);
322  } else {
323  ATH_MSG_DEBUG("Not a considered cylinder tile");
324  }
325 
326  if (tile) {
327  hlen = hlen / 2;
328  }
329 
330  if (hphi < 0.9 * M_PI) {
331  return surf = new Trk::CylinderSurface(pos, radius, hphi, hlen);
332  } else {
333  return surf = new Trk::CylinderSurface(pos, radius, hlen);
334  }
335  }
337 
338  bool result = this->get_disk_surface(
339  sample, side, pos, z, rmin, rmax, hphi, depth, calo_dd);
340  if (!result) {
341  return nullptr;
342  }
343  double zend = 0;
344  if (sample == CaloCell_ID::TileGap3) {
345  std::vector<TileDetDescriptor*>::const_iterator Tile_first =
347  TileDetDescriptor* TileGap_descr = *(Tile_first + 5);
348  zend = TileGap_descr->zcenter(2) + .5 * TileGap_descr->dz(2);
349  zend = zend * side;
350  }
351  if (sample == CaloCell_ID::HEC3) {
352  for (const CaloDetDescriptor* descr : calo_dd->calo_descriptors_range()) {
353  if (descr) {
354  if (descr->getSampling(0) == CaloCell_ID::HEC3) {
355  zend = descr->calo_z_max();
356  zend = zend * side;
357  }
358  }
359  }
360  }
361 
362  z = offset + zend - (pos)(2, 3);
363 
364  Amg::Translation3D vec(0., 0., z);
365  pos = (pos) * vec;
366 
367  // for Atlas configuration, avoid to create a hole a phi ~ pi by hphi
368  // rounding effects. the phi range was introduced for the testbeam
369  if (hphi < 0.9 * M_PI) {
370  return new Trk::DiscSurface(pos, rmin, rmax, hphi);
371  } else {
372  return new Trk::DiscSurface(pos, rmin, rmax);
373  }
374  } else {
376  "This sample is not a 'LAST' surface... returning dummy surface");
377  return surf;
378  }
379 
380  return nullptr;
381 }
382 
385 {
386  return &(*m_calodepth); // from ToolHandle to pointer
387 }
388 
389 // End of the general user methods :
390 
391 bool
394  int side,
395  Amg::Transform3D& htrans,
396  double& radius,
397  double& hphi,
398  double& hlength,
399  double& depth,
400  const CaloDetDescrManager* calo_dd) const
401 {
402  bool result = false;
403 
404  // strips are spread on several descriptor, which all have the same
405  // htrans, radius, hphi, but not the same hlength
406  double hl{};
407  hlength = 0;
408 
409  // these ones are definitely not cylinders :
417  return false;
418  }
421 
422  for (const CaloDetDescriptor* reg : calo_dd->calo_descriptors_range()) {
423  if (reg) {
424  if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
425  result = reg->get_cylinder_surface(htrans, radius, hphi, hl, depth);
426  hlength = std::max(hl, hlength);
427  }
428  }
429  }
430  }
431 
432  else {
433  // these are not cylinders
434  switch (sample) {
443  break;
444  default:
445  ATH_MSG_ERROR(" get_cylinder_surface Not Cylindrical Tile found!!! ");
446  return 0;
447  }
448 
449  for (const CaloDetDescriptor* reg : calo_dd->tile_descriptors_range()) {
450  if (reg) {
451  if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
452  result = reg->get_cylinder_surface(htrans, radius, hphi, hl, depth);
453  if (hl > hlength)
454  hlength = hl;
455  hphi = .5 * reg->dphi() * reg->n_phi();
456  }
457  }
458  }
459  result = true;
460  }
461  return result;
462 }
463 
464 bool
466  int side,
467  Amg::Transform3D& htrans,
468  double& z,
469  double& rmin,
470  double& rmax,
471  double& hphisec,
472  double& depth,
473  const CaloDetDescrManager* calo_dd) const
474 {
475 
476  // set defaults :
477  bool result = false;
478  z = 0.;
479  rmin = 999999.;
480  rmax = 0.;
481 
482  // strips are spread on several descriptor, which all have the same
483  // htrans, hphisec, but not the same rmin and rmax
484  // + for EMEC2 and EMEC3, the InnerWeel entrance z is different :-(
485  // ==> as CaloCell_ID::CaloSample does not allow to distinguish,
486  // take OW z and fix the HepTransform accordingly
487 
488  // these ones are definitely not disks :
495  return false;
496  }
497 
498  double ri, ra, zow;
499  for (const CaloDetDescriptor* reg : calo_dd->calo_descriptors_range()) {
500  if (reg) {
501  if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
502  result = reg->get_disk_surface(htrans, zow, ri, ra, hphisec, depth);
503  if (!reg->is_lar_em_endcap_inner())
504  z = zow;
505  rmin = std::min(ri, rmin);
506  rmax = std::max(rmax, ra);
507  }
508  }
509  }
510 
511  if (sample == CaloCell_ID::TileGap3) {
512  for (const CaloDetDescriptor* reg : calo_dd->tile_descriptors_range()) {
513  if (reg) {
514  if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
515  result = reg->get_disk_surface(htrans, zow, ri, ra, hphisec, depth);
516  if (!reg->is_lar_em_endcap_inner())
517  z = zow;
518  rmin = std::min(ri, rmin);
519  rmax = std::max(rmax, ra);
520  }
521  }
522  }
523  }
524 
525  if (rmin > rmax) {
526  rmin = 0.;
527  }
528  // Fix the z ( convention is different in Calo's and Tracking )
529  Amg::Translation3D vec(0., 0., z - (htrans)(2, 3));
530  htrans = (htrans) * vec;
531  return result;
532 }
533 
534 bool
536  Amg::Transform3D& htrans,
537  double& hphi,
538  std::vector<double>& radius,
539  std::vector<double>& depth,
540  std::vector<double>& hlength) const
541 {
542  bool result = m_lar_simplegeom->get_cylinder_surface(
543  alvol, htrans, hphi, radius, depth, hlength);
544 
545  // Shift the POS/NEG sides ( htrans convention is different in Calo's and
546  // Tracking )
547  // FIXME : for this, assume that the 1rst hlength is the good one
548 
549  if (alvol == CaloSubdetNames::EMB_POS ||
551  result = m_lar_simplegeom->get_cylinder_surface(
552  alvol, htrans, hphi, radius, depth, hlength);
553  Amg::Translation3D vec(0., 0., hlength[0]);
554  htrans = (htrans) * vec;
555  return result;
556  } else if (alvol == CaloSubdetNames::EMB_NEG ||
558  result = m_lar_simplegeom->get_cylinder_surface(
559  alvol, htrans, hphi, radius, depth, hlength);
560  Amg::Translation3D vec(0., 0., -1. * hlength[0]);
561  htrans = (htrans) * vec;
562  return result;
563  }
564 
565  return result;
566 }
567 
568 bool
570  Amg::Transform3D& htrans,
571  double& hphi,
572  std::vector<double>& z,
573  std::vector<double>& depth,
574  std::vector<double>& rmin,
575  std::vector<double>& rmax) const
576 {
577  bool result = m_lar_simplegeom->get_disk_surface(
578  alvol, htrans, hphi, z, depth, rmin, rmax);
579 
580  // Fix the z ( htrans convention is different in Calo's and Tracking ) ?
581  // = left to the CreateDDEClayer method, because z is a vector => 1 fix per
582  // disk element
583 
584  return result;
585 }
586 
587 // store all the surfaces into a vector
588 void
590 {
591 
592  // entry surfaces ( id<24 to avoid error messages )
595  float etaRef = (sample < 4 || std::abs(sample - 13) < 2) ? 1. : 2.;
596  Trk::Surface* spos = CreateUserSurface(sample, 0., etaRef, calo_dd);
597  Trk::Surface* sneg = CreateUserSurface(sample, 0., -etaRef, calo_dd);
598  if (spos)
599  spos->setOwner(Trk::TGOwn);
600  if (sneg)
601  sneg->setOwner(Trk::TGOwn);
602  m_layerEntries.emplace_back(spos, sneg);
603  }
604  // turn into SlidingSurfaces
605  // EMB2 neg
606  float etaMin = -1.5;
607  float etaMax = 0.;
608  float deta = 0.05;
609  unsigned int neta = (etaMax - etaMin) / deta;
610  std::vector<float> offset(neta);
611  float rbase = m_layerEntries[CaloCell_ID::EMB2].second->bounds().r();
612  for (unsigned int ie = 0; ie < neta; ie++) {
613  float eta = etaMin + (ie + 0.5) * deta;
614  const Trk::Surface* surf =
615  CreateUserSurface(CaloCell_ID::EMB2, 0., eta, calo_dd);
616  offset[ie] = surf->bounds().r() - rbase;
617  delete surf;
618  }
619  const Trk::CylinderSurface* cyl = dynamic_cast<const Trk::CylinderSurface*>(
620  m_layerEntries[CaloCell_ID::EMB2].second);
621  if (!cyl) {
622  std::abort();
623  }
625  *cyl,
627  offset);
628  tmpSlidCyl->setOwner(Trk::TGOwn);
629  m_layerEntries[CaloCell_ID::EMB2].second = tmpSlidCyl;
630  delete cyl;
631  // EMB2 pos
632  etaMin = 0.;
633  etaMax = 1.5;
634  deta = 0.05;
635  neta = (etaMax - etaMin) / deta;
636  offset.resize(neta);
637  rbase = m_layerEntries[CaloCell_ID::EMB2].first->bounds().r();
638  for (unsigned int ie = 0; ie < neta; ie++) {
639  float eta = etaMin + (ie + 0.5) * deta;
640  Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EMB2, 0., eta, calo_dd);
641  offset[ie] = surf->bounds().r() - rbase;
642  delete surf;
643  }
644  cyl = dynamic_cast<const Trk::CylinderSurface*>(
645  m_layerEntries[CaloCell_ID::EMB2].first);
646  if (!cyl) {
647  std::abort();
648  }
649  tmpSlidCyl = new Trk::SlidingCylinderSurface(
650  *cyl,
652  offset);
653  tmpSlidCyl->setOwner(Trk::TGOwn);
654  m_layerEntries[CaloCell_ID::EMB2].first = tmpSlidCyl;
655  delete cyl;
656  // EMB3 neg
657  etaMin = -1.5;
658  etaMax = 0.;
659  deta = 0.05;
660  neta = (etaMax - etaMin) / deta;
661  offset.resize(neta);
662  rbase = m_layerEntries[CaloCell_ID::EMB3].second->bounds().r();
663  for (unsigned int ie = 0; ie < neta; ie++) {
664  float eta = etaMin + (ie + 0.5) * deta;
665  Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EMB3, 0., eta, calo_dd);
666  offset[ie] = surf->bounds().r() - rbase;
667  delete surf;
668  }
669  cyl = dynamic_cast<const Trk::CylinderSurface*>(
670  m_layerEntries[CaloCell_ID::EMB3].second);
671  if (!cyl) {
672  std::abort();
673  }
674  tmpSlidCyl = new Trk::SlidingCylinderSurface(
675  *cyl,
677  offset);
678  tmpSlidCyl->setOwner(Trk::TGOwn);
679  m_layerEntries[CaloCell_ID::EMB3].second = tmpSlidCyl;
680  delete cyl;
681 
682  // EMB3 pos
683  etaMin = 0.;
684  etaMax = 1.5;
685  deta = 0.05;
686  neta = (etaMax - etaMin) / deta;
687  offset.resize(neta);
688  rbase = m_layerEntries[CaloCell_ID::EMB3].first->bounds().r();
689  for (unsigned int ie = 0; ie < neta; ie++) {
690  float eta = etaMin + (ie + 0.5) * deta;
691  const Trk::Surface* surf =
692  CreateUserSurface(CaloCell_ID::EMB3, 0., eta, calo_dd);
693  offset[ie] = surf->bounds().r() - rbase;
694  delete surf;
695  }
696  cyl = dynamic_cast<const Trk::CylinderSurface*>(
697  m_layerEntries[CaloCell_ID::EMB3].first);
698  if (!cyl) {
699  std::abort();
700  }
701  tmpSlidCyl = new Trk::SlidingCylinderSurface(
702  *cyl,
704  offset);
705  tmpSlidCyl->setOwner(Trk::TGOwn);
706  m_layerEntries[CaloCell_ID::EMB3].first = tmpSlidCyl;
707  delete cyl;
708 
709  // EME2 neg
710  etaMin = -3.2;
711  etaMax = -1.35;
712  deta = 0.05;
713  neta = (etaMax - etaMin) / deta;
714  offset.resize(neta);
715  float zbase = m_layerEntries[CaloCell_ID::EME2].second->center().z();
716  for (unsigned int ie = 0; ie < neta; ie++) {
717  float eta = etaMin + (ie + 0.5) * deta;
718  const Trk::Surface* surf =
719  CreateUserSurface(CaloCell_ID::EME2, 0., eta, calo_dd);
720  offset[ie] = surf->center().z() - zbase;
721  delete surf;
722  }
723  const Trk::DiscSurface* disc = dynamic_cast<const Trk::DiscSurface*>(
724  m_layerEntries[CaloCell_ID::EME2].second);
725  if (!disc) {
726  std::abort();
727  }
729  *disc,
731  offset);
732  tmpSlidDisc->setOwner(Trk::TGOwn);
733  m_layerEntries[CaloCell_ID::EME2].second = tmpSlidDisc;
734  delete disc;
735 
736  // EME2 pos
737  etaMin = 1.35;
738  etaMax = 3.2;
739  deta = 0.05;
740  neta = (etaMax - etaMin) / deta;
741  offset.resize(neta);
742  zbase = m_layerEntries[CaloCell_ID::EME2].first->center().z();
743  for (unsigned int ie = 0; ie < neta; ie++) {
744  float eta = etaMin + (ie + 0.5) * deta;
745  Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EME2, 0., eta, calo_dd);
746  offset[ie] = surf->center().z() - zbase;
747  delete surf;
748  }
749  disc = dynamic_cast<const Trk::DiscSurface*>(
750  m_layerEntries[CaloCell_ID::EME2].first);
751  if (!disc) {
752  std::abort();
753  }
754  tmpSlidDisc = new Trk::SlidingDiscSurface(
755  *disc,
757  offset);
758  tmpSlidDisc->setOwner(Trk::TGOwn);
759  m_layerEntries[CaloCell_ID::EME2].first = tmpSlidDisc;
760  delete disc;
761 
762  // EME3 neg
763  etaMin = -3.2;
764  etaMax = -1.35;
765  deta = 0.05;
766  neta = (etaMax - etaMin) / deta;
767  offset.resize(neta);
768  zbase = m_layerEntries[CaloCell_ID::EME3].second->center().z();
769  for (unsigned int ie = 0; ie < neta; ie++) {
770  float eta = etaMin + (ie + 0.5) * deta;
771  const Trk::Surface* surf =
772  CreateUserSurface(CaloCell_ID::EME3, 0., eta, calo_dd);
773  offset[ie] = surf->center().z() - zbase;
774  delete surf;
775  }
776  disc = dynamic_cast<const Trk::DiscSurface*>(
777  m_layerEntries[CaloCell_ID::EME3].second);
778  if (!disc) {
779  std::abort();
780  }
781  tmpSlidDisc = new Trk::SlidingDiscSurface(
782  *disc,
784  offset);
785  tmpSlidDisc->setOwner(Trk::TGOwn);
786  m_layerEntries[CaloCell_ID::EME3].second = tmpSlidDisc;
787  delete disc;
788 
789  // EME3 pos
790  etaMin = 1.35;
791  etaMax = 3.2;
792  deta = 0.05;
793  neta = (etaMax - etaMin) / deta;
794  offset.resize(neta);
795  zbase = m_layerEntries[CaloCell_ID::EME3].first->center().z();
796  for (unsigned int ie = 0; ie < neta; ie++) {
797  float eta = etaMin + (ie + 0.5) * deta;
798  Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EME3, 0., eta, calo_dd);
799  offset[ie] = surf->center().z() - zbase;
800  delete surf;
801  }
802  disc = dynamic_cast<const Trk::DiscSurface*>(
803  m_layerEntries[CaloCell_ID::EME3].first);
804  if (!disc) {
805  std::abort();
806  }
807  tmpSlidDisc = new Trk::SlidingDiscSurface(
808  *disc,
810  offset);
811  tmpSlidDisc->setOwner(Trk::TGOwn);
812  m_layerEntries[CaloCell_ID::EME3].first = tmpSlidDisc;
813  delete disc;
814 
815  // exit surfaces
819  m_layerExits.push_back(m_layerEntries[sample + 1]);
820  }
821 
822  // fix exit for outer layers
823  Trk::Surface* lpos =
824  CreateLastSurface(CaloCell_ID::TileBar2, 0., 1., calo_dd);
825  Trk::Surface* lneg =
826  CreateLastSurface(CaloCell_ID::TileBar2, 0., -1., calo_dd);
827  if (lpos) {
828  lpos->setOwner(Trk::TGOwn);
829  }
830  if (lneg) {
831  lneg->setOwner(Trk::TGOwn);
832  }
833  m_layerExits[CaloCell_ID::TileBar2] =
834  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
835 
836  lpos = CreateLastSurface(CaloCell_ID::TileExt2, 0., 1., calo_dd);
837  lneg = CreateLastSurface(CaloCell_ID::TileExt2, 0., -1., calo_dd);
838  if (lpos) {
839  lpos->setOwner(Trk::TGOwn);
840  }
841  if (lneg) {
842  lneg->setOwner(Trk::TGOwn);
843  }
844  m_layerExits[CaloCell_ID::TileExt2] =
845  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
846 
847  lpos = CreateLastSurface(CaloCell_ID::TileGap2, 0., 1., calo_dd);
848  lneg = CreateLastSurface(CaloCell_ID::TileGap2, 0., -1., calo_dd);
849  if (lpos) {
850  lpos->setOwner(Trk::TGOwn);
851  }
852  if (lneg) {
853  lneg->setOwner(Trk::TGOwn);
854  }
855  m_layerExits[CaloCell_ID::TileGap2] =
856  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
857 
858  lpos = CreateLastSurface(CaloCell_ID::TileGap3, 0., 1., calo_dd);
859  lneg = CreateLastSurface(CaloCell_ID::TileGap3, 0., -1., calo_dd);
860  if (lpos) {
861  lpos->setOwner(Trk::TGOwn);
862  }
863  if (lneg) {
864  lneg->setOwner(Trk::TGOwn);
865  }
866  m_layerExits[CaloCell_ID::TileGap3] =
867  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
868 
869  lpos = CreateLastSurface(CaloCell_ID::HEC3, 0., 1., calo_dd);
870  lneg = CreateLastSurface(CaloCell_ID::HEC3, 0., -1., calo_dd);
871  if (lpos) {
872  lpos->setOwner(Trk::TGOwn);
873  }
874  if (lneg) {
875  lneg->setOwner(Trk::TGOwn);
876  }
877  m_layerExits[CaloCell_ID::HEC3] =
878  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
879 }
880 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileDetDescrManager::tile_descriptors_begin
tile_descr_const_iterator tile_descriptors_begin() const
Definition: TileDetDescrManager.h:101
CaloDepthTool
Implementation of the ICaloDepthTool interface.Given a Track direction, checks if it is in the Calori...
Definition: CaloDepthTool.h:47
CaloSurfaceBuilder::m_lar_mat
ToolHandle< ICaloRecoMaterialTool > m_lar_mat
Definition: CaloSurfaceBuilder.h:153
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
SlidingCylinderSurface.h
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
Trk::SlidingDiscSurface
Definition: SlidingDiscSurface.h:45
get_generator_info.result
result
Definition: get_generator_info.py:21
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
max
#define max(a, b)
Definition: cfImp.cxx:41
DiscBounds.h
CaloSurfaceBuilder::m_lar_simplegeom
ToolHandle< ICaloRecoSimpleGeomTool > m_lar_simplegeom
Definition: CaloSurfaceBuilder.h:154
ITrackingVolumeBuilder.h
Trk::Surface::setOwner
void setOwner(SurfaceOwner x)
set Ownership
MaterialProperties.h
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloSubdetNames::EMB_POS
@ EMB_POS
Definition: CaloSubdetNames.h:38
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloSubdetNames::PRESAMPLER_B_NEG
@ PRESAMPLER_B_NEG
Definition: CaloSubdetNames.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
CaloSurfaceBuilder::m_calodepth
ToolHandle< CaloDepthTool > m_calodepth
Definition: CaloSurfaceBuilder.h:157
CaloSurfaceBuilder.h
DiscLayer.h
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
CaloSurfaceBuilder::~CaloSurfaceBuilder
virtual ~CaloSurfaceBuilder()
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
HomogeneousLayerMaterial.h
Trk::binEta
@ binEta
Definition: BinningType.h:54
Trk::DiscSurface
Definition: DiscSurface.h:54
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
CaloSurfaceBuilder::CreateUserSurface
virtual Trk::Surface * CreateUserSurface(const CaloCell_ID::CaloSample sample, const double offset, const double etaCaloLocal, const CaloDetDescrManager *calo_dd) const override final
overwrite DD radius/z by CaloDepth radius, and an offset can be added
Definition: CaloSurfaceBuilder.cxx:124
python.DomainsRegistry.reg
reg
globals -----------------------------------------------------------------—
Definition: DomainsRegistry.py:343
TileDetDescriptor::dz
float dz(unsigned int samp) const
Definition: TileDetDescriptor.h:212
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
TileID.h
TileDetDescrManager.h
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
ReadCellNoiseFromCool.tile
tile
Definition: ReadCellNoiseFromCool.py:92
PlotCalibFromCool.ie
ie
Definition: PlotCalibFromCool.py:420
CaloDetDescrManager_Base::lar_geometry
const std::string & lar_geometry() const
get lar geometry label, distinguish between full atlas and TB
Definition: CaloDetDescrManager.h:168
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TileDetDescriptor::dr
float dr(unsigned int samp) const
Definition: TileDetDescriptor.h:198
CaloSurfaceBuilder::CreateLastSurface
virtual Trk::Surface * CreateLastSurface(const CaloCell_ID::CaloSample sample, const double offset, const double etaCaloLocal, const CaloDetDescrManager *calo_dd) const override final
end of the sample for the last layers of the Calo
Definition: CaloSurfaceBuilder.cxx:249
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
CaloDetDescriptor.h
Definition of CaloDetDescriptor.
GeoPrimitives.h
CaloSubdetNames::PRESAMPLER_B_POS
@ PRESAMPLER_B_POS
Definition: CaloSubdetNames.h:37
CylinderVolumeBounds.h
TileDetDescriptor::rcenter
float rcenter(unsigned int samp) const
Definition: TileDetDescriptor.h:191
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
SlidingDiscSurface.h
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
CaloCell_ID::CaloSample
CaloSampling::CaloSample CaloSample
Definition: CaloCell_ID.h:53
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
z
#define z
CaloSurfaceBuilder::getCaloDepth
virtual CaloDepthTool * getCaloDepth() override final
Definition: CaloSurfaceBuilder.cxx:384
TileDetDescriptor::zcenter
float zcenter(unsigned int samp) const
Definition: TileDetDescriptor.h:205
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
Trk::CylinderSurface
Definition: CylinderSurface.h:55
TileDetDescriptor
Definition: TileDetDescriptor.h:46
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CylinderSurface.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloSurfaceBuilder::initialize
virtual StatusCode initialize() override final
Definition: CaloSurfaceBuilder.cxx:72
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
CylinderLayer.h
python.TransformConfig.descr
descr
print "%s.properties()" % self.__name__
Definition: TransformConfig.py:360
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
ICaloRecoSimpleGeomTool.h
ICaloSimpleGeomTool interface declaration 19.9.2005 Creation of the interface CaloDetDescr/ICaloSimpl...
min
#define min(a, b)
Definition: cfImp.cxx:40
Trk::BinUtility
Definition: BinUtility.h:39
CaloSurfaceBuilder::CaloSurfaceBuilder
CaloSurfaceBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloSurfaceBuilder.cxx:56
Trk::TGOwn
@ TGOwn
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:55
ICaloCoordinateTool.h
ICaloCoordinateTool interface declaration 30.9.2004 Creation of the class TBCalocoordinate by claire....
Trk::Surface::bounds
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloSubdetNames::EMB_NEG
@ EMB_NEG
Definition: CaloSubdetNames.h:38
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
CaloSurfaceBuilder::finalize
virtual StatusCode finalize() override final
Definition: CaloSurfaceBuilder.cxx:98
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
CaloDetDescrManager_Base::calo_descriptors_range
calo_descr_range calo_descriptors_range() const
Range over descriptors.
Definition: CaloDetDescrManager.cxx:535
Trk::open
@ open
Definition: BinningType.h:40
CaloSurfaceBuilder::get_cylinder_surface
virtual bool get_cylinder_surface(CaloCell_ID::CaloSample sample, int side, Amg::Transform3D &htrans, double &radius, double &hphi, double &hlength, double &depth, const CaloDetDescrManager *calo_dd) const override final
These methods provide the default parameters used by the CaloTrackingGeometry and Surface Builders,...
Definition: CaloSurfaceBuilder.cxx:392
CylinderBounds.h
TrackingVolume.h
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloDetDescriptor
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
Definition: CaloDetDescriptor.h:58
CaloSurfaceBuilder::m_tile_dd
const TileDetDescrManager * m_tile_dd
Definition: CaloSurfaceBuilder.h:140
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
CaloSurfaceBuilder::get_disk_surface
virtual bool get_disk_surface(CaloCell_ID::CaloSample sample, int side, Amg::Transform3D &htrans, double &z, double &rmin, double &rmax, double &hphisec, double &depth, const CaloDetDescrManager *calo_dd) const override final
Definition: CaloSurfaceBuilder.cxx:465
DetectorZone::barrel
@ barrel
TileDetDescriptor.h
CaloDetDescrManager_Base::tile_descriptors_range
calo_descr_range tile_descriptors_range() const
Range over tile descriptors.
Definition: CaloDetDescrManager.cxx:565
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CaloSurfaceBuilder::fill_tg_surfaces
void fill_tg_surfaces(const CaloDetDescrManager *calo_dd) const
Definition: CaloSurfaceBuilder.cxx:589
DiscSurface.h
Trk::SlidingCylinderSurface
Definition: SlidingCylinderSurface.h:34
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
AthAlgTool
Definition: AthAlgTool.h:26
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
ICaloRecoMaterialTool.h
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
CaloSubdetNames::ALIGNVOL
ALIGNVOL
LAr Alignable volumes.
Definition: CaloSubdetNames.h:36
Trk::SurfaceBounds::r
virtual double r() const =0
Interface method for the maximal extension or the radius.