ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CaloSurfaceBuilder Class Reference

This class creates the Surfaces needed to perform track extrapolation. More...

#include <CaloSurfaceBuilder.h>

Inheritance diagram for CaloSurfaceBuilder:
Collaboration diagram for CaloSurfaceBuilder:

Public Member Functions

 CaloSurfaceBuilder (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~CaloSurfaceBuilder ()
 
virtual StatusCode initialize () override final
 
virtual StatusCode finalize () override final
 
virtual CaloDepthToolgetCaloDepth () override final
 
virtual Trk::SurfaceCreateUserSurface (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 More...
 
virtual Trk::SurfaceCreateLastSurface (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 More...
 
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, clients should not need to use them. More...
 
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
 
virtual bool get_cylinder_surface (CaloSubdetNames::ALIGNVOL alvol, Amg::Transform3D &htrans, double &hphi, std::vector< double > &radius, std::vector< double > &depth, std::vector< double > &hlength) const override final
 
virtual bool get_disk_surface (CaloSubdetNames::ALIGNVOL alvol, Amg::Transform3D &htrans, double &hphi, std::vector< double > &z, std::vector< double > &depth, std::vector< double > &rmin, std::vector< double > &rmax) const override final
 
virtual std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > entrySurfaces (const CaloDetDescrManager *calo_dd) const override final
 
virtual std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > exitSurfaces (const CaloDetDescrManager *calo_dd) const override final
 

Private Member Functions

void fill_tg_surfaces (const CaloDetDescrManager *calo_dd) const
 

Private Attributes

const TileDetDescrManagerm_tile_dd
 
std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > m_layerEntries ATLAS_THREAD_SAFE
 
std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > m_layerExits ATLAS_THREAD_SAFE
 
std::once_flag m_fillOnce ATLAS_THREAD_SAFE
 
ToolHandle< ICaloRecoMaterialToolm_lar_mat
 
ToolHandle< ICaloRecoSimpleGeomToolm_lar_simplegeom
 
ToolHandle< CaloDepthToolm_calodepth
 

Detailed Description

This class creates the Surfaces needed to perform track extrapolation.

All numbers are provided by the CaloDetDescr tools

Definition at line 56 of file CaloSurfaceBuilder.h.

Constructor & Destructor Documentation

◆ CaloSurfaceBuilder()

CaloSurfaceBuilder::CaloSurfaceBuilder ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 56 of file CaloSurfaceBuilder.cxx.

59  : base_class(type, name, parent)
60  , m_tile_dd(nullptr)
61  , m_lar_mat("LArRecoMaterialTool")
62  , m_lar_simplegeom("LArRecoSimpleGeomTool")
63 {
64  declareProperty("LArRecoMaterialTool", m_lar_mat);
65  declareProperty("LarRecoSimpleGeometryTool", m_lar_simplegeom);
66 }

◆ ~CaloSurfaceBuilder()

CaloSurfaceBuilder::~CaloSurfaceBuilder ( )
virtualdefault

Member Function Documentation

◆ CreateLastSurface()

Trk::Surface * CaloSurfaceBuilder::CreateLastSurface ( const CaloCell_ID::CaloSample  sample,
const double  offset,
const double  etaCaloLocal,
const CaloDetDescrManager calo_dd 
) const
finaloverridevirtual

end of the sample for the last layers of the Calo

Definition at line 248 of file CaloSurfaceBuilder.cxx.

252 {
253 
254  Trk::Surface* surf = nullptr;
255 
256  bool tile = false;
262  tile = true;
263 
264  auto pos = Amg::Transform3D(Trk::s_idTransform);
265 
266  bool result = false;
267  double rmin = 0.;
268  double z = 0.;
269  double rmax = 0.;
270  double radius = 0.;
271  double hphi = 0.;
272  double hlen = 0.;
273  double depth = 0.;
274  int side = 1;
275 
276  if (etaCaloLocal < 0)
277  side = -1;
278 
281 
282  /*To avoid the funny numbers given by the CaloDescriptors to TileBar2, (due
283  to the cell D type)
284  we'll take only the radius from them, the rest we copy from TileBar1 */
285  if (sample == CaloCell_ID::TileBar2) {
286  double radius2 = 0;
287  auto pos2 = Amg::Transform3D(Trk::s_idTransform);
289  sample, side, pos2, radius, hphi, hlen, depth, calo_dd);
291  side,
292  pos,
293  radius2,
294  hphi,
295  hlen,
296  depth,
297  calo_dd);
298  } else {
299 
301  sample, side, pos, radius, hphi, hlen, depth, calo_dd);
302  }
303  if (!result) {
304  return nullptr;
305  }
306 
307  // for Atlas configuration, avoid to create a hole at phi ~ pi by hphi
308  // rounding effects (the phi range was introduced for the testbeam)
309  else {
310  std::vector<TileDetDescriptor*>::const_iterator Tile_first =
312  TileDetDescriptor* TileBar_descr = *(Tile_first + 1);
313  TileDetDescriptor* TileExt_descr = *(Tile_first + 3);
314  TileDetDescriptor* TileGap_descr = *(Tile_first + 5);
315  if (sample == CaloCell_ID::TileBar2) {
316  radius = TileBar_descr->rcenter(2) + .5 * TileBar_descr->dr(2);
317  } else if (sample == CaloCell_ID::TileExt2) {
318  radius = TileExt_descr->rcenter(2) + .5 * TileExt_descr->dr(2);
319  } else if (sample == CaloCell_ID::TileGap2) {
320  radius = TileGap_descr->rcenter(2) + .5 * TileGap_descr->dr(2);
321  } else {
322  ATH_MSG_DEBUG("Not a considered cylinder tile");
323  }
324 
325  if (tile) {
326  hlen = hlen / 2;
327  }
328 
329  if (hphi < 0.9 * M_PI) {
330  return surf = new Trk::CylinderSurface(pos, radius, hphi, hlen);
331  } else {
332  return surf = new Trk::CylinderSurface(pos, radius, hlen);
333  }
334  }
336 
337  bool result = this->get_disk_surface(
338  sample, side, pos, z, rmin, rmax, hphi, depth, calo_dd);
339  if (!result) {
340  return nullptr;
341  }
342  double zend = 0;
343  if (sample == CaloCell_ID::TileGap3) {
344  std::vector<TileDetDescriptor*>::const_iterator Tile_first =
346  TileDetDescriptor* TileGap_descr = *(Tile_first + 5);
347  zend = TileGap_descr->zcenter(2) + .5 * TileGap_descr->dz(2);
348  zend = zend * side;
349  }
350  if (sample == CaloCell_ID::HEC3) {
351  for (const CaloDetDescriptor* descr : calo_dd->calo_descriptors_range()) {
352  if (descr) {
353  if (descr->getSampling(0) == CaloCell_ID::HEC3) {
354  zend = descr->calo_z_max();
355  zend = zend * side;
356  }
357  }
358  }
359  }
360 
361  z = offset + zend - (pos)(2, 3);
362 
363  Amg::Translation3D vec(0., 0., z);
364  pos = (pos) * vec;
365 
366  // for Atlas configuration, avoid to create a hole a phi ~ pi by hphi
367  // rounding effects. the phi range was introduced for the testbeam
368  if (hphi < 0.9 * M_PI) {
369  return new Trk::DiscSurface(pos, rmin, rmax, hphi);
370  } else {
371  return new Trk::DiscSurface(pos, rmin, rmax);
372  }
373  } else {
375  "This sample is not a 'LAST' surface... returning dummy surface");
376  return surf;
377  }
378 
379  return nullptr;
380 }

◆ CreateUserSurface()

Trk::Surface * CaloSurfaceBuilder::CreateUserSurface ( const CaloCell_ID::CaloSample  sample,
const double  offset,
const double  etaCaloLocal,
const CaloDetDescrManager calo_dd 
) const
finaloverridevirtual

overwrite DD radius/z by CaloDepth radius, and an offset can be added

Definition at line 123 of file CaloSurfaceBuilder.cxx.

127 {
128 
129  if (sample == CaloCell_ID::Unknown) {
130  return nullptr;
131  }
132 
133  auto pos = Amg::Transform3D(Trk::s_idTransform);
134  Trk::Surface* surf = nullptr;
135 
136  bool result = false;
137  double rmin = 0.;
138  double z = 0.;
139  double rmax = 0.;
140  double radius = 0.;
141  double hphi = 0.;
142  double hlen = 0.;
143  double depth = 0.;
144  int side = 1;
145 
146  bool tile = false;
152  tile = true;
153 
154  bool HEC3 = false;
155  if (sample == CaloCell_ID::HEC3)
156  HEC3 = true;
157 
158  if (etaCaloLocal < 0)
159  side = -1;
160 
161  // Specific hack for the testbeam : even if tracks have eta<0, ask for the
162  // positive side
163  if (calo_dd->lar_geometry() == "H8")
164  side = 1;
165 
166  // too bad, I need this ugly if to decide which type of surface should be
167  // built cylinder of disk ?
168  // Note: TileGap3 is in the barrel but is a disk!!
169  bool barrel = true;
176  barrel = false;
177  }
178 
179  if (barrel) {
180 
181  /*To avoid the funny numbers given by the CaloDescriptors to TileBar2, (due
182  to the cell D type)
183  we'll take only the radius from them, the rest we copy from TileBar1 */
184  if (sample == CaloCell_ID::TileBar2) {
185  double radius2 = 0;
186  auto pos2 = Amg::Transform3D(Trk::s_idTransform);
188  sample, side, pos2, radius, hphi, hlen, depth, calo_dd);
190  side,
191  pos,
192  radius2,
193  hphi,
194  hlen,
195  depth,
196  calo_dd);
197  } else {
199  sample, side, pos, radius, hphi, hlen, depth, calo_dd);
200  }
201  if (!result) {
202  return nullptr;
203  }
204 
205  // this correction will only work for LAr
206  double betterrad = 0;
207  if (!tile) {
208  betterrad = m_calodepth->radius(sample, etaCaloLocal, 0., calo_dd);
209  radius = offset + betterrad;
210  }
211  if (tile)
212  hlen = hlen / 2;
213  // for Atlas configuration, avoid to create a hole at phi ~ pi by hphi
214  // rounding effects (the phi range was introduced for the testbeam)
215  if (hphi < 0.9 * M_PI) {
216  surf = new Trk::CylinderSurface(pos, radius, hphi, hlen);
217  } else {
218  surf = new Trk::CylinderSurface(pos, radius, hlen);
219  }
220  } else {
221  bool result = this->get_disk_surface(
222  sample, side, pos, z, rmin, rmax, hphi, depth, calo_dd);
223  if (!result) {
224  return nullptr;
225  }
226 
227  double betterz = 0;
228 
229  if (!tile && !HEC3) {
230  betterz = m_calodepth->radius(sample, etaCaloLocal, 0., calo_dd);
231  z = offset + betterz - (pos)(2, 3);
232  Amg::Translation3D vec(0., 0., z);
233  pos = (pos) * vec;
234  }
235  // for Atlas configuration, avoid to create a hole a phi ~ pi by hphi
236  // rounding effects. the phi range was introduced for the testbeam
237  if (hphi < 0.9 * M_PI) {
238  surf = new Trk::DiscSurface(pos, rmin, rmax, hphi);
239  } else {
240  surf = new Trk::DiscSurface(pos, rmin, rmax);
241  }
242  }
243 
244  return surf;
245 }

◆ entrySurfaces()

std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > CaloSurfaceBuilder::entrySurfaces ( const CaloDetDescrManager calo_dd) const
inlinefinaloverridevirtual

Definition at line 162 of file CaloSurfaceBuilder.h.

163 {
164  std::call_once(m_fillOnce, [this, calo_dd]() { fill_tg_surfaces(calo_dd); });
165  return m_layerEntries;
166 }

◆ exitSurfaces()

std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > CaloSurfaceBuilder::exitSurfaces ( const CaloDetDescrManager calo_dd) const
inlinefinaloverridevirtual

Definition at line 169 of file CaloSurfaceBuilder.h.

170 {
171  std::call_once(m_fillOnce, [this, calo_dd]() { fill_tg_surfaces(calo_dd); });
172  return m_layerExits;
173 }

◆ fill_tg_surfaces()

void CaloSurfaceBuilder::fill_tg_surfaces ( const CaloDetDescrManager calo_dd) const
private

Definition at line 588 of file CaloSurfaceBuilder.cxx.

589 {
590 
591  // entry surfaces ( id<24 to avoid error messages )
594  float etaRef = (sample < 4 || std::abs(sample - 13) < 2) ? 1. : 2.;
595  Trk::Surface* spos = CreateUserSurface(sample, 0., etaRef, calo_dd);
596  Trk::Surface* sneg = CreateUserSurface(sample, 0., -etaRef, calo_dd);
597  if (spos)
598  spos->setOwner(Trk::TGOwn);
599  if (sneg)
600  sneg->setOwner(Trk::TGOwn);
601  m_layerEntries.emplace_back(spos, sneg);
602  }
603  // turn into SlidingSurfaces
604  // EMB2 neg
605  float etaMin = -1.5;
606  float etaMax = 0.;
607  float deta = 0.05;
608  unsigned int neta = (etaMax - etaMin) / deta;
609  std::vector<float> offset(neta);
610  float rbase = m_layerEntries[CaloCell_ID::EMB2].second->bounds().r();
611  for (unsigned int ie = 0; ie < neta; ie++) {
612  float eta = etaMin + (ie + 0.5) * deta;
613  const Trk::Surface* surf =
614  CreateUserSurface(CaloCell_ID::EMB2, 0., eta, calo_dd);
615  offset[ie] = surf->bounds().r() - rbase;
616  delete surf;
617  }
618  const Trk::CylinderSurface* cyl = dynamic_cast<const Trk::CylinderSurface*>(
619  m_layerEntries[CaloCell_ID::EMB2].second);
620  if (!cyl) {
621  std::abort();
622  }
624  *cyl,
626  offset);
627  tmpSlidCyl->setOwner(Trk::TGOwn);
628  m_layerEntries[CaloCell_ID::EMB2].second = tmpSlidCyl;
629  delete cyl;
630  // EMB2 pos
631  etaMin = 0.;
632  etaMax = 1.5;
633  deta = 0.05;
634  neta = (etaMax - etaMin) / deta;
635  offset.resize(neta);
636  rbase = m_layerEntries[CaloCell_ID::EMB2].first->bounds().r();
637  for (unsigned int ie = 0; ie < neta; ie++) {
638  float eta = etaMin + (ie + 0.5) * deta;
639  Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EMB2, 0., eta, calo_dd);
640  offset[ie] = surf->bounds().r() - rbase;
641  delete surf;
642  }
643  cyl = dynamic_cast<const Trk::CylinderSurface*>(
644  m_layerEntries[CaloCell_ID::EMB2].first);
645  if (!cyl) {
646  std::abort();
647  }
648  tmpSlidCyl = new Trk::SlidingCylinderSurface(
649  *cyl,
651  offset);
652  tmpSlidCyl->setOwner(Trk::TGOwn);
653  m_layerEntries[CaloCell_ID::EMB2].first = tmpSlidCyl;
654  delete cyl;
655  // EMB3 neg
656  etaMin = -1.5;
657  etaMax = 0.;
658  deta = 0.05;
659  neta = (etaMax - etaMin) / deta;
660  offset.resize(neta);
661  rbase = m_layerEntries[CaloCell_ID::EMB3].second->bounds().r();
662  for (unsigned int ie = 0; ie < neta; ie++) {
663  float eta = etaMin + (ie + 0.5) * deta;
664  Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EMB3, 0., eta, calo_dd);
665  offset[ie] = surf->bounds().r() - rbase;
666  delete surf;
667  }
668  cyl = dynamic_cast<const Trk::CylinderSurface*>(
669  m_layerEntries[CaloCell_ID::EMB3].second);
670  if (!cyl) {
671  std::abort();
672  }
673  tmpSlidCyl = new Trk::SlidingCylinderSurface(
674  *cyl,
676  offset);
677  tmpSlidCyl->setOwner(Trk::TGOwn);
678  m_layerEntries[CaloCell_ID::EMB3].second = tmpSlidCyl;
679  delete cyl;
680 
681  // EMB3 pos
682  etaMin = 0.;
683  etaMax = 1.5;
684  deta = 0.05;
685  neta = (etaMax - etaMin) / deta;
686  offset.resize(neta);
687  rbase = m_layerEntries[CaloCell_ID::EMB3].first->bounds().r();
688  for (unsigned int ie = 0; ie < neta; ie++) {
689  float eta = etaMin + (ie + 0.5) * deta;
690  const Trk::Surface* surf =
691  CreateUserSurface(CaloCell_ID::EMB3, 0., eta, calo_dd);
692  offset[ie] = surf->bounds().r() - rbase;
693  delete surf;
694  }
695  cyl = dynamic_cast<const Trk::CylinderSurface*>(
696  m_layerEntries[CaloCell_ID::EMB3].first);
697  if (!cyl) {
698  std::abort();
699  }
700  tmpSlidCyl = new Trk::SlidingCylinderSurface(
701  *cyl,
703  offset);
704  tmpSlidCyl->setOwner(Trk::TGOwn);
705  m_layerEntries[CaloCell_ID::EMB3].first = tmpSlidCyl;
706  delete cyl;
707 
708  // EME2 neg
709  etaMin = -3.2;
710  etaMax = -1.35;
711  deta = 0.05;
712  neta = (etaMax - etaMin) / deta;
713  offset.resize(neta);
714  float zbase = m_layerEntries[CaloCell_ID::EME2].second->center().z();
715  for (unsigned int ie = 0; ie < neta; ie++) {
716  float eta = etaMin + (ie + 0.5) * deta;
717  const Trk::Surface* surf =
718  CreateUserSurface(CaloCell_ID::EME2, 0., eta, calo_dd);
719  offset[ie] = surf->center().z() - zbase;
720  delete surf;
721  }
722  const Trk::DiscSurface* disc = dynamic_cast<const Trk::DiscSurface*>(
723  m_layerEntries[CaloCell_ID::EME2].second);
724  if (!disc) {
725  std::abort();
726  }
728  *disc,
730  offset);
731  tmpSlidDisc->setOwner(Trk::TGOwn);
732  m_layerEntries[CaloCell_ID::EME2].second = tmpSlidDisc;
733  delete disc;
734 
735  // EME2 pos
736  etaMin = 1.35;
737  etaMax = 3.2;
738  deta = 0.05;
739  neta = (etaMax - etaMin) / deta;
740  offset.resize(neta);
741  zbase = m_layerEntries[CaloCell_ID::EME2].first->center().z();
742  for (unsigned int ie = 0; ie < neta; ie++) {
743  float eta = etaMin + (ie + 0.5) * deta;
744  Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EME2, 0., eta, calo_dd);
745  offset[ie] = surf->center().z() - zbase;
746  delete surf;
747  }
748  disc = dynamic_cast<const Trk::DiscSurface*>(
749  m_layerEntries[CaloCell_ID::EME2].first);
750  if (!disc) {
751  std::abort();
752  }
753  tmpSlidDisc = new Trk::SlidingDiscSurface(
754  *disc,
756  offset);
757  tmpSlidDisc->setOwner(Trk::TGOwn);
758  m_layerEntries[CaloCell_ID::EME2].first = tmpSlidDisc;
759  delete disc;
760 
761  // EME3 neg
762  etaMin = -3.2;
763  etaMax = -1.35;
764  deta = 0.05;
765  neta = (etaMax - etaMin) / deta;
766  offset.resize(neta);
767  zbase = m_layerEntries[CaloCell_ID::EME3].second->center().z();
768  for (unsigned int ie = 0; ie < neta; ie++) {
769  float eta = etaMin + (ie + 0.5) * deta;
770  const Trk::Surface* surf =
771  CreateUserSurface(CaloCell_ID::EME3, 0., eta, calo_dd);
772  offset[ie] = surf->center().z() - zbase;
773  delete surf;
774  }
775  disc = dynamic_cast<const Trk::DiscSurface*>(
776  m_layerEntries[CaloCell_ID::EME3].second);
777  if (!disc) {
778  std::abort();
779  }
780  tmpSlidDisc = new Trk::SlidingDiscSurface(
781  *disc,
783  offset);
784  tmpSlidDisc->setOwner(Trk::TGOwn);
785  m_layerEntries[CaloCell_ID::EME3].second = tmpSlidDisc;
786  delete disc;
787 
788  // EME3 pos
789  etaMin = 1.35;
790  etaMax = 3.2;
791  deta = 0.05;
792  neta = (etaMax - etaMin) / deta;
793  offset.resize(neta);
794  zbase = m_layerEntries[CaloCell_ID::EME3].first->center().z();
795  for (unsigned int ie = 0; ie < neta; ie++) {
796  float eta = etaMin + (ie + 0.5) * deta;
797  Trk::Surface* surf = CreateUserSurface(CaloCell_ID::EME3, 0., eta, calo_dd);
798  offset[ie] = surf->center().z() - zbase;
799  delete surf;
800  }
801  disc = dynamic_cast<const Trk::DiscSurface*>(
802  m_layerEntries[CaloCell_ID::EME3].first);
803  if (!disc) {
804  std::abort();
805  }
806  tmpSlidDisc = new Trk::SlidingDiscSurface(
807  *disc,
809  offset);
810  tmpSlidDisc->setOwner(Trk::TGOwn);
811  m_layerEntries[CaloCell_ID::EME3].first = tmpSlidDisc;
812  delete disc;
813 
814  // exit surfaces
816  sample + 1 < static_cast<int>(m_layerEntries.size());
818  m_layerExits.push_back(m_layerEntries[sample + 1]);
819  }
820 
821  // fix exit for outer layers
822  Trk::Surface* lpos =
823  CreateLastSurface(CaloCell_ID::TileBar2, 0., 1., calo_dd);
824  Trk::Surface* lneg =
825  CreateLastSurface(CaloCell_ID::TileBar2, 0., -1., calo_dd);
826  if (lpos) {
827  lpos->setOwner(Trk::TGOwn);
828  }
829  if (lneg) {
830  lneg->setOwner(Trk::TGOwn);
831  }
832  m_layerExits[CaloCell_ID::TileBar2] =
833  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
834 
835  lpos = CreateLastSurface(CaloCell_ID::TileExt2, 0., 1., calo_dd);
836  lneg = CreateLastSurface(CaloCell_ID::TileExt2, 0., -1., calo_dd);
837  if (lpos) {
838  lpos->setOwner(Trk::TGOwn);
839  }
840  if (lneg) {
841  lneg->setOwner(Trk::TGOwn);
842  }
843  m_layerExits[CaloCell_ID::TileExt2] =
844  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
845 
846  lpos = CreateLastSurface(CaloCell_ID::TileGap2, 0., 1., calo_dd);
847  lneg = CreateLastSurface(CaloCell_ID::TileGap2, 0., -1., calo_dd);
848  if (lpos) {
849  lpos->setOwner(Trk::TGOwn);
850  }
851  if (lneg) {
852  lneg->setOwner(Trk::TGOwn);
853  }
854  m_layerExits[CaloCell_ID::TileGap2] =
855  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
856 
857  lpos = CreateLastSurface(CaloCell_ID::TileGap3, 0., 1., calo_dd);
858  lneg = CreateLastSurface(CaloCell_ID::TileGap3, 0., -1., calo_dd);
859  if (lpos) {
860  lpos->setOwner(Trk::TGOwn);
861  }
862  if (lneg) {
863  lneg->setOwner(Trk::TGOwn);
864  }
865  m_layerExits[CaloCell_ID::TileGap3] =
866  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
867 
868  lpos = CreateLastSurface(CaloCell_ID::HEC3, 0., 1., calo_dd);
869  lneg = CreateLastSurface(CaloCell_ID::HEC3, 0., -1., calo_dd);
870  if (lpos) {
871  lpos->setOwner(Trk::TGOwn);
872  }
873  if (lneg) {
874  lneg->setOwner(Trk::TGOwn);
875  }
876  m_layerExits[CaloCell_ID::HEC3] =
877  std::pair<const Trk::Surface*, const Trk::Surface*>(lpos, lneg);
878 }

◆ finalize()

StatusCode CaloSurfaceBuilder::finalize ( )
finaloverridevirtual

Definition at line 97 of file CaloSurfaceBuilder.cxx.

98 {
99  // clear surface cash
100  for (auto & layerEntry : m_layerEntries) {
101  delete layerEntry.first;
102  delete layerEntry.second;
103  }
104 
105  if (!m_layerExits.empty()) {
106  delete m_layerExits[CaloCell_ID::TileBar2].first;
107  delete m_layerExits[CaloCell_ID::TileBar2].second;
108  delete m_layerExits[CaloCell_ID::TileExt2].first;
109  delete m_layerExits[CaloCell_ID::TileExt2].second;
110  delete m_layerExits[CaloCell_ID::TileGap2].first;
111  delete m_layerExits[CaloCell_ID::TileGap2].second;
112  delete m_layerExits[CaloCell_ID::TileGap3].first;
113  delete m_layerExits[CaloCell_ID::TileGap3].second;
114  delete m_layerExits[CaloCell_ID::HEC3].first;
115  delete m_layerExits[CaloCell_ID::HEC3].second;
116  }
117 
118  StatusCode sc = StatusCode::SUCCESS;
119  return sc;
120 }

◆ get_cylinder_surface() [1/2]

bool CaloSurfaceBuilder::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
finaloverridevirtual

These methods provide the default parameters used by the CaloTrackingGeometry and Surface Builders, clients should not need to use them.

Definition at line 391 of file CaloSurfaceBuilder.cxx.

400 {
401  bool result = false;
402 
403  // strips are spread on several descriptor, which all have the same
404  // htrans, radius, hphi, but not the same hlength
405  double hl{};
406  hlength = 0;
407 
408  // these ones are definitely not cylinders :
416  return false;
417  }
420 
421  for (const CaloDetDescriptor* reg : calo_dd->calo_descriptors_range()) {
422  if (reg) {
423  if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
424  result = reg->get_cylinder_surface(htrans, radius, hphi, hl, depth);
425  hlength = std::max(hl, hlength);
426  }
427  }
428  }
429  }
430 
431  else {
432  // these are not cylinders
433  switch (sample) {
442  break;
443  default:
444  ATH_MSG_ERROR(" get_cylinder_surface Not Cylindrical Tile found!!! ");
445  return 0;
446  }
447 
448  for (const CaloDetDescriptor* reg : calo_dd->tile_descriptors_range()) {
449  if (reg) {
450  if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
451  result = reg->get_cylinder_surface(htrans, radius, hphi, hl, depth);
452  if (hl > hlength)
453  hlength = hl;
454  hphi = .5 * reg->dphi() * reg->n_phi();
455  }
456  }
457  }
458  result = true;
459  }
460  return result;
461 }

◆ get_cylinder_surface() [2/2]

bool CaloSurfaceBuilder::get_cylinder_surface ( CaloSubdetNames::ALIGNVOL  alvol,
Amg::Transform3D htrans,
double &  hphi,
std::vector< double > &  radius,
std::vector< double > &  depth,
std::vector< double > &  hlength 
) const
finaloverridevirtual

Definition at line 534 of file CaloSurfaceBuilder.cxx.

540 {
541  bool result = m_lar_simplegeom->get_cylinder_surface(
542  alvol, htrans, hphi, radius, depth, hlength);
543 
544  // Shift the POS/NEG sides ( htrans convention is different in Calo's and
545  // Tracking )
546  // FIXME : for this, assume that the 1rst hlength is the good one
547 
548  if (alvol == CaloSubdetNames::EMB_POS ||
550  result = m_lar_simplegeom->get_cylinder_surface(
551  alvol, htrans, hphi, radius, depth, hlength);
552  Amg::Translation3D vec(0., 0., hlength[0]);
553  htrans = (htrans) * vec;
554  return result;
555  } else if (alvol == CaloSubdetNames::EMB_NEG ||
557  result = m_lar_simplegeom->get_cylinder_surface(
558  alvol, htrans, hphi, radius, depth, hlength);
559  Amg::Translation3D vec(0., 0., -1. * hlength[0]);
560  htrans = (htrans) * vec;
561  return result;
562  }
563 
564  return result;
565 }

◆ get_disk_surface() [1/2]

bool CaloSurfaceBuilder::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
finaloverridevirtual

Definition at line 464 of file CaloSurfaceBuilder.cxx.

473 {
474 
475  // set defaults :
476  bool result = false;
477  z = 0.;
478  rmin = 999999.;
479  rmax = 0.;
480 
481  // strips are spread on several descriptor, which all have the same
482  // htrans, hphisec, but not the same rmin and rmax
483  // + for EMEC2 and EMEC3, the InnerWeel entrance z is different :-(
484  // ==> as CaloCell_ID::CaloSample does not allow to distinguish,
485  // take OW z and fix the HepTransform accordingly
486 
487  // these ones are definitely not disks :
494  return false;
495  }
496 
497  double ri, ra, zow;
498  for (const CaloDetDescriptor* reg : calo_dd->calo_descriptors_range()) {
499  if (reg) {
500  if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
501  result = reg->get_disk_surface(htrans, zow, ri, ra, hphisec, depth);
502  if (!reg->is_lar_em_endcap_inner())
503  z = zow;
504  rmin = std::min(ri, rmin);
505  rmax = std::max(rmax, ra);
506  }
507  }
508  }
509 
510  if (sample == CaloCell_ID::TileGap3) {
511  for (const CaloDetDescriptor* reg : calo_dd->tile_descriptors_range()) {
512  if (reg) {
513  if (reg->getSampling(0) == sample && reg->calo_sign() * side > 0) {
514  result = reg->get_disk_surface(htrans, zow, ri, ra, hphisec, depth);
515  if (!reg->is_lar_em_endcap_inner())
516  z = zow;
517  rmin = std::min(ri, rmin);
518  rmax = std::max(rmax, ra);
519  }
520  }
521  }
522  }
523 
524  if (rmin > rmax) {
525  rmin = 0.;
526  }
527  // Fix the z ( convention is different in Calo's and Tracking )
528  Amg::Translation3D vec(0., 0., z - (htrans)(2, 3));
529  htrans = (htrans) * vec;
530  return result;
531 }

◆ get_disk_surface() [2/2]

bool CaloSurfaceBuilder::get_disk_surface ( CaloSubdetNames::ALIGNVOL  alvol,
Amg::Transform3D htrans,
double &  hphi,
std::vector< double > &  z,
std::vector< double > &  depth,
std::vector< double > &  rmin,
std::vector< double > &  rmax 
) const
finaloverridevirtual

Definition at line 568 of file CaloSurfaceBuilder.cxx.

575 {
576  bool result = m_lar_simplegeom->get_disk_surface(
577  alvol, htrans, hphi, z, depth, rmin, rmax);
578 
579  // Fix the z ( htrans convention is different in Calo's and Tracking ) ?
580  // = left to the CreateDDEClayer method, because z is a vector => 1 fix per
581  // disk element
582 
583  return result;
584 }

◆ getCaloDepth()

CaloDepthTool * CaloSurfaceBuilder::getCaloDepth ( )
finaloverridevirtual

Definition at line 383 of file CaloSurfaceBuilder.cxx.

384 {
385  return &(*m_calodepth); // from ToolHandle to pointer
386 }

◆ initialize()

StatusCode CaloSurfaceBuilder::initialize ( )
finaloverridevirtual

Definition at line 71 of file CaloSurfaceBuilder.cxx.

72 {
73  if (m_lar_mat.retrieve().isFailure()) {
74  ATH_MSG_FATAL("Failed to retrieve " << m_lar_mat << ". Aborting.");
75  return StatusCode::FAILURE;
76  }
77 
78  if (m_lar_simplegeom.retrieve().isFailure()) {
79  ATH_MSG_FATAL("Failed to retrieve " << m_lar_simplegeom << ". Aborting.");
80  return StatusCode::FAILURE;
81  }
82 
83  if (m_calodepth.retrieve().isFailure()) {
84  ATH_MSG_FATAL("Failed to retrieve " << m_calodepth << ". Aborting.");
85  return StatusCode::FAILURE;
86  }
87 
88  if (detStore()->retrieve(m_tile_dd).isFailure()) {
89  ATH_MSG_FATAL("Could not find TileDetDescrManager in DetStore");
90  return StatusCode::FAILURE;
91  }
92 
93  return StatusCode::SUCCESS;
94 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/3]

std::vector<std::pair<const Trk::Surface*, const Trk::Surface*> > m_layerEntries CaloSurfaceBuilder::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 145 of file CaloSurfaceBuilder.h.

◆ ATLAS_THREAD_SAFE [2/3]

std::vector<std::pair<const Trk::Surface*, const Trk::Surface*> > m_layerExits CaloSurfaceBuilder::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 147 of file CaloSurfaceBuilder.h.

◆ ATLAS_THREAD_SAFE [3/3]

std::once_flag m_fillOnce CaloSurfaceBuilder::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 148 of file CaloSurfaceBuilder.h.

◆ m_calodepth

ToolHandle<CaloDepthTool> CaloSurfaceBuilder::m_calodepth
private
Initial value:
{ this,
"CaloDepthTool",
"CaloDepthTool/CaloDepthTool",
"CaloDepthTool to be used" }

Definition at line 155 of file CaloSurfaceBuilder.h.

◆ m_lar_mat

ToolHandle<ICaloRecoMaterialTool> CaloSurfaceBuilder::m_lar_mat
private

Definition at line 151 of file CaloSurfaceBuilder.h.

◆ m_lar_simplegeom

ToolHandle<ICaloRecoSimpleGeomTool> CaloSurfaceBuilder::m_lar_simplegeom
private

Definition at line 152 of file CaloSurfaceBuilder.h.

◆ m_tile_dd

const TileDetDescrManager* CaloSurfaceBuilder::m_tile_dd
private

Definition at line 138 of file CaloSurfaceBuilder.h.


The documentation for this class was generated from the following files:
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
CaloSurfaceBuilder::m_lar_mat
ToolHandle< ICaloRecoMaterialTool > m_lar_mat
Definition: CaloSurfaceBuilder.h:151
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
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
CaloSurfaceBuilder::m_lar_simplegeom
ToolHandle< ICaloRecoSimpleGeomTool > m_lar_simplegeom
Definition: CaloSurfaceBuilder.h:152
Trk::Surface::setOwner
void setOwner(SurfaceOwner x)
set Ownership
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloSubdetNames::EMB_POS
@ EMB_POS
Definition: CaloSubdetNames.h:38
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloSubdetNames::PRESAMPLER_B_NEG
@ PRESAMPLER_B_NEG
Definition: CaloSubdetNames.h:37
CaloSurfaceBuilder::m_calodepth
ToolHandle< CaloDepthTool > m_calodepth
Definition: CaloSurfaceBuilder.h:155
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
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:123
TileDetDescriptor::dz
float dz(unsigned int samp) const
Definition: TileDetDescriptor.h:212
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
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:248
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
CaloSubdetNames::PRESAMPLER_B_POS
@ PRESAMPLER_B_POS
Definition: CaloSubdetNames.h:37
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
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
CaloCell_ID::CaloSample
CaloSampling::CaloSample CaloSample
Definition: CaloCell_ID.h:53
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
z
#define z
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
python.TransformConfig.descr
descr
print "%s.properties()" % self.__name__
Definition: TransformConfig.py:360
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
Trk::BinUtility
Definition: BinUtility.h:39
Trk::TGOwn
@ TGOwn
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:55
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
Trk::Surface::bounds
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
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
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:391
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
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:138
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:464
DetectorZone::barrel
@ barrel
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:588
Trk::SlidingCylinderSurface
Definition: SlidingCylinderSurface.h:34
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
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
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
Trk::SurfaceBounds::r
virtual double r() const =0
Interface method for the maximal extension or the radius.