ATLAS Offline Software
CaloSurfaceBuilder.h
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 // -----------------------------------------
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 
57  : public AthAlgTool
58  , virtual public ICaloSurfaceBuilder
59 
60 {
61 
62 public:
63  // Constructor:
64 
65  CaloSurfaceBuilder(const std::string& type,
66  const std::string& name,
67  const IInterface* parent);
68 
70 
71  virtual StatusCode initialize() override final;
72  virtual StatusCode finalize() override final;
73 
74  virtual CaloDepthTool* getCaloDepth() override final;
75 
77  virtual Trk::Surface* CreateUserSurface(
79  const double offset,
80  const double etaCaloLocal,
81  const CaloDetDescrManager* calo_dd) const override final;
82 
84  virtual Trk::Surface* CreateLastSurface(
86  const double offset,
87  const double etaCaloLocal,
88  const CaloDetDescrManager* calo_dd) const override final;
89 
94  virtual bool get_cylinder_surface(
96  int side,
97  Amg::Transform3D& htrans,
98  double& radius,
99  double& hphi,
100  double& hlength,
101  double& depth,
102  const CaloDetDescrManager* calo_dd) const override final;
103 
104  virtual bool get_disk_surface(
106  int side,
107  Amg::Transform3D& htrans,
108  double& z,
109  double& rmin,
110  double& rmax,
111  double& hphisec,
112  double& depth,
113  const CaloDetDescrManager* calo_dd) const override final;
114 
115  virtual bool get_cylinder_surface(
116  CaloSubdetNames::ALIGNVOL alvol,
117  Amg::Transform3D& htrans,
118  double& hphi,
119  std::vector<double>& radius,
120  std::vector<double>& depth,
121  std::vector<double>& hlength) const override final;
122 
123  virtual bool get_disk_surface(
124  CaloSubdetNames::ALIGNVOL alvol,
125  Amg::Transform3D& htrans, double& hphi,
126  std::vector<double>& z,
127  std::vector<double>& depth,
128  std::vector<double>& rmin,
129  std::vector<double>& rmax) const override final;
130 
131  virtual std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
132  entrySurfaces(const CaloDetDescrManager* calo_dd) const override final;
133  virtual std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
134  exitSurfaces(const CaloDetDescrManager* calo_dd) const override final;
135 
136 private:
137  // fill cashed surfaces
139 
141 
142  // cache the surfaces for TG builder
143  // These are protected by calls to fill once
144  // The assumption is calo does not change during
145  // a ~ Run
146  mutable std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
147  m_layerEntries ATLAS_THREAD_SAFE;
148  mutable std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
149  m_layerExits ATLAS_THREAD_SAFE;
150  mutable std::once_flag m_fillOnce ATLAS_THREAD_SAFE;
151 
152  // Simplified geometry :
155 
156  // Defines the depths for DD and User surfaces :
157  ToolHandle<CaloDepthTool> m_calodepth{ this,
158  "CaloDepthTool",
159  "CaloDepthTool/CaloDepthTool",
160  "CaloDepthTool to be used" };
161 };
162 
163 inline std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
165 {
166  std::call_once(m_fillOnce, [this, calo_dd]() { fill_tg_surfaces(calo_dd); });
167  return m_layerEntries;
168 }
169 
170 inline std::vector<std::pair<const Trk::Surface*, const Trk::Surface*>>
172 {
173  std::call_once(m_fillOnce, [this, calo_dd]() { fill_tg_surfaces(calo_dd); });
174  return m_layerExits;
175 }
176 
177 #endif // CALOTRACKINGGEOMETRY_CALOSURFACEBUILDER_H
178 
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
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:60
CaloSurfaceBuilder::m_lar_simplegeom
ToolHandle< ICaloRecoSimpleGeomTool > m_lar_simplegeom
Definition: CaloSurfaceBuilder.h:154
CaloSurfaceBuilder::m_calodepth
ToolHandle< CaloDepthTool > m_calodepth
Definition: CaloSurfaceBuilder.h:157
CaloDepthTool.h
Declaration of CaloDepthTool. Created by Claire Bourdarios, 25.10.2004.
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:7
CaloSurfaceBuilder::~CaloSurfaceBuilder
virtual ~CaloSurfaceBuilder()
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
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
ICaloRecoMaterialTool
This (clean) interface is driven by 2 constraints :
Definition: ICaloRecoMaterialTool.h:36
ICaloSurfaceBuilder
Definition: ICaloSurfaceBuilder.h:44
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:249
GeoPrimitives.h
CaloSurfaceBuilder::ATLAS_THREAD_SAFE
std::vector< std::pair< const Trk::Surface *, const Trk::Surface * > > m_layerEntries ATLAS_THREAD_SAFE
Definition: CaloSurfaceBuilder.h:147
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
z
#define z
CaloSurfaceBuilder::getCaloDepth
virtual CaloDepthTool * getCaloDepth() override final
Definition: CaloSurfaceBuilder.cxx:384
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:72
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:164
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:171
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:195
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
CaloSurfaceBuilder::finalize
virtual StatusCode finalize() override final
Definition: CaloSurfaceBuilder.cxx:98
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:392
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:140
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:465
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CaloSurfaceBuilder::fill_tg_surfaces
void fill_tg_surfaces(const CaloDetDescrManager *calo_dd) const
Definition: CaloSurfaceBuilder.cxx:589
AthAlgTool
Definition: AthAlgTool.h:26
CaloSubdetNames.h
CaloSubdetNames declaration.
checker_macros.h
Define macros for attributes used to control the static checker.