ATLAS Offline Software
CaloSurfaceBuilder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ***************************************************************************
6 // -----------------------------------------
7 //
8 // 25.10.2004 Creation of the class by claire.bourdarios@cern.ch
9 //
10 // 13.6.2006 Extention to include the tiles will work from 12.0.2 and 12.1.0
11 // by Gustavo.Ordonez.Sanz@cern.ch
12 //
13 // 20.3.2014 entry/exit surfaces cashed for use by tracking geometry
14 // sarka.todorova@cern.ch
15 // ***************************************************************************
16 
17 #ifndef CALOTRACKINGGEOMETRY_CALOSURFACEBUILDER_H
18 #define CALOTRACKINGGEOMETRY_CALOSURFACEBUILDER_H
19 
21 
24 #include "GaudiKernel/ToolHandle.h"
25 
30 
32 #include <vector>
33 
36 class IMessageSvc;
39 class ICaloSurfaceHelper;
41 class TileDetDescriptor;
42 
43 namespace Trk {
44 class Surface;
45 class CylinderLayer;
46 class DiscLayer;
47 class MaterialProperties;
48 class LayerMaterialProperties;
49 class ITrackingVolumeBuilder;
50 }
51 
56 class CaloSurfaceBuilder : public extends<AthAlgTool, ICaloSurfaceBuilder>
57 
58 {
59 
60 public:
61  // Constructor:
62 
63  CaloSurfaceBuilder(const std::string& type,
64  const std::string& name,
65  const IInterface* parent);
66 
68 
69  virtual StatusCode initialize() override final;
70  virtual StatusCode finalize() override final;
71 
72  virtual CaloDepthTool* getCaloDepth() override final;
73 
75  virtual Trk::Surface* CreateUserSurface(
77  const double offset,
78  const double etaCaloLocal,
79  const CaloDetDescrManager* calo_dd) const override final;
80 
82  virtual Trk::Surface* CreateLastSurface(
84  const double offset,
85  const double etaCaloLocal,
86  const CaloDetDescrManager* calo_dd) const override final;
87 
92  virtual bool get_cylinder_surface(
94  int side,
95  Amg::Transform3D& htrans,
96  double& radius,
97  double& hphi,
98  double& hlength,
99  double& depth,
100  const CaloDetDescrManager* calo_dd) const override final;
101 
102  virtual bool get_disk_surface(
104  int side,
105  Amg::Transform3D& htrans,
106  double& z,
107  double& rmin,
108  double& rmax,
109  double& hphisec,
110  double& depth,
111  const CaloDetDescrManager* calo_dd) const override final;
112 
113  virtual bool get_cylinder_surface(
114  CaloSubdetNames::ALIGNVOL alvol,
115  Amg::Transform3D& htrans,
116  double& hphi,
117  std::vector<double>& radius,
118  std::vector<double>& depth,
119  std::vector<double>& hlength) const override final;
120 
121  virtual bool get_disk_surface(
122  CaloSubdetNames::ALIGNVOL alvol,
123  Amg::Transform3D& htrans, double& hphi,
124  std::vector<double>& z,
125  std::vector<double>& depth,
126  std::vector<double>& rmin,
127  std::vector<double>& rmax) const override final;
128 
129  virtual std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
130  entrySurfaces(const CaloDetDescrManager* calo_dd) const override final;
131  virtual std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
132  exitSurfaces(const CaloDetDescrManager* calo_dd) const override final;
133 
134 private:
135  // fill cashed surfaces
137 
139 
140  // cache the surfaces for TG builder
141  // These are protected by calls to fill once
142  // The assumption is calo does not change during
143  // a ~ Run
144  mutable std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
145  m_layerEntries ATLAS_THREAD_SAFE;
146  mutable std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
147  m_layerExits ATLAS_THREAD_SAFE;
148  mutable std::once_flag m_fillOnce ATLAS_THREAD_SAFE;
149 
150  // Simplified geometry :
153 
154  // Defines the depths for DD and User surfaces :
155  ToolHandle<CaloDepthTool> m_calodepth{ this,
156  "CaloDepthTool",
157  "CaloDepthTool/CaloDepthTool",
158  "CaloDepthTool to be used" };
159 };
160 
161 inline std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
163 {
164  std::call_once(m_fillOnce, [this, calo_dd]() { fill_tg_surfaces(calo_dd); });
165  return m_layerEntries;
166 }
167 
168 inline std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
170 {
171  std::call_once(m_fillOnce, [this, calo_dd]() { fill_tg_surfaces(calo_dd); });
172  return m_layerExits;
173 }
174 
175 #endif // CALOTRACKINGGEOMETRY_CALOSURFACEBUILDER_H
176 
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:151
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
CaloSurfaceBuilder
This class creates the Surfaces needed to perform track extrapolation.
Definition: CaloSurfaceBuilder.h:58
CaloSurfaceBuilder::m_lar_simplegeom
ToolHandle< ICaloRecoSimpleGeomTool > m_lar_simplegeom
Definition: CaloSurfaceBuilder.h:152
CaloSurfaceBuilder::m_calodepth
ToolHandle< CaloDepthTool > m_calodepth
Definition: CaloSurfaceBuilder.h:155
CaloDepthTool.h
Declaration of CaloDepthTool. Created by Claire Bourdarios, 25.10.2004.
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
CaloSurfaceBuilder::~CaloSurfaceBuilder
virtual ~CaloSurfaceBuilder()
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
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
ICaloRecoMaterialTool
This (clean) interface is driven by 2 constraints :
Definition: ICaloRecoMaterialTool.h:36
CaloCell_ID.h
TRT::Hit::side
@ side
Definition: HitInfo.h:83
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
GeoPrimitives.h
CaloSurfaceBuilder::ATLAS_THREAD_SAFE
std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > m_layerEntries ATLAS_THREAD_SAFE
Definition: CaloSurfaceBuilder.h:145
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
z
#define z
CaloSurfaceBuilder::getCaloDepth
virtual CaloDepthTool * getCaloDepth() override final
Definition: CaloSurfaceBuilder.cxx:383
TileDetDescrManager
Definition: TileDetDescrManager.h:33
ICaloRecoSimpleGeomTool
Definition: ICaloRecoSimpleGeomTool.h:37
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
TileDetDescriptor
Definition: TileDetDescriptor.h:46
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloSurfaceBuilder::initialize
virtual StatusCode initialize() override final
Definition: CaloSurfaceBuilder.cxx:71
CaloPhiRange.h
CaloPhiRange class declaration.
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
ICaloCoordinateTool
This (clean) interface is implemented in the (rather dirty) ICaloCoordinateTool class,...
Definition: ICaloCoordinateTool.h:65
CaloSurfaceBuilder::entrySurfaces
virtual std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > entrySurfaces(const CaloDetDescrManager *calo_dd) const override final
Definition: CaloSurfaceBuilder.h:162
CaloSurfaceBuilder::CaloSurfaceBuilder
CaloSurfaceBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloSurfaceBuilder.cxx:56
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
ICaloSurfaceBuilder.h
CaloSurfaceBuilder::exitSurfaces
virtual std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > exitSurfaces(const CaloDetDescrManager *calo_dd) const override final
Definition: CaloSurfaceBuilder.h:169
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
CaloSurfaceBuilder::finalize
virtual StatusCode finalize() override final
Definition: CaloSurfaceBuilder.cxx:97
CaloSubdetNames
This class contains the ENUM needed to label the calorimeter pieces which be mooved independently,...
Definition: CaloSubdetNames.h:32
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
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloSurfaceBuilder::m_tile_dd
const TileDetDescrManager * m_tile_dd
Definition: CaloSurfaceBuilder.h:138
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CaloSurfaceBuilder::fill_tg_surfaces
void fill_tg_surfaces(const CaloDetDescrManager *calo_dd) const
Definition: CaloSurfaceBuilder.cxx:588
CaloSubdetNames.h
CaloSubdetNames declaration.
checker_macros.h
Define macros for attributes used to control the static checker.