ATLAS Offline Software
Loading...
Searching...
No Matches
LArWheelCalculator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef GEOSPECIALSHAPES_LARWHEELCALCULATOR_H
6#define GEOSPECIALSHAPES_LARWHEELCALCULATOR_H
7
8
9
10// FMV and other checks
11#ifndef PORTABLE_LAR_SHAPE
12// For athena
13 #include "CxxUtils/features.h"
14#else
15// When run outside of Athena
16 #define HAVE_VECTOR_SIZE_ATTRIBUTE 1
17 #ifdef __APPLE__
18 #define CXXUTILS_FEATURES_H 1
19 #endif
20#endif
21
22#include "CLHEP/Vector/ThreeVector.h"
23#if !defined(XAOD_STANDALONE) && !defined(PORTABLE_LAR_SHAPE)
25#endif // XAOD_STANDALONE
26
27#if HAVE_VECTOR_SIZE_ATTRIBUTE
29#endif
31
32#include <array>
33#include <vector>
34
35#define LARWC_SINCOS_POLY 5
36
37struct EMECData;
38
39//#define HARDDEBUG
40
41// Forward declarations
46
47 class IFanCalculator;
49 template <typename SaggingType> class WheelFanCalculator;
50 template <typename SaggingType> class DistanceToTheNeutralFibre_OfFan;
51}
52
59{
60
64 template <typename SaggingType> friend class LArWheelCalculator_Impl::WheelFanCalculator;
65 template <typename SaggingType> friend class LArWheelCalculator_Impl::DistanceToTheNeutralFibre_OfFan;
66
67 public:
68
69 LArWheelCalculator(const EMECData & emecData, LArG4::LArWheelCalculator_t a_wheelType, int zside = 1);
70 virtual ~LArWheelCalculator();
71
74
77
78 // "Get constant" methods:
79 double GetWheelThickness() const { return m_WheelThickness; }
80 double GetdWRPtoFrontFace() const { return m_dWRPtoFrontFace; }
82 virtual LArG4::LArWheelCalculator_t type() const { return m_type; }
83 // "zShift" is the z-distance (cm) that the EM endcap is shifted
84 // (due to cabling, etc.)
85 int GetAtlasZside() const { return m_AtlasZside; }
86 double zShift() const { return m_zShift; }
87 double GetFanFoldRadius() const { return m_FanFoldRadius; }
88 double GetZeroFanPhi() const { return m_ZeroFanPhi; }
89 int GetNumberOfWaves() const { return m_NumberOfWaves; }
91 int GetNumberOfFans() const { return m_NumberOfFans; }
92
93 double GetActiveLength() const { return m_ActiveLength; }
94 double GetFanStepOnPhi() const { return m_FanStepOnPhi; }
95 double GetHalfWaveLength() const { return m_HalfWaveLength; }
96 double GetQuarterWaveLength() const { return m_QuarterWaveLength; }
97 double GetWheelRefPoint() const { return m_zWheelRefPoint; }
98 double GetFanHalfThickness() const { return m_FanHalfThickness; }
99
100 bool GetisModule() const { return m_isModule; }
101 bool GetisElectrode() const { return m_isElectrode; }
102 bool GetisInner() const { return m_isInner; }
103 bool GetisBarrette() const { return m_isBarrette; }
104 bool GetisBarretteCalib() const { return m_isBarretteCalib; }
105
106 double GetWheelInnerRadius(std::array<double,2> & rInner) const;
107 double GetWheelInnerRadius(std::array<double,3> & rInner) const;
108 void GetWheelOuterRadius(std::array<double,2> & rOuter) const;
109 void GetWheelOuterRadius(std::array<double,3> & rOuter) const;
110
111 double GetElecFocaltoWRP() const { return m_dElecFocaltoWRP; }
112 // "set constant" method:
113
114 int GetFirstFan() const { return m_FirstFan; }
115 int GetLastFan() const { return m_LastFan; }
116
117 int GetStartGapNumber() const { return m_ZeroGapNumber; }
119
122
126 double DistanceToTheNearestFan(CLHEP::Hep3Vector &p, int & out_fan_number) const;
127
131 double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const;
132
133 CLHEP::Hep3Vector NearestPointOnNeutralFibre(const CLHEP::Hep3Vector &p,
134 int fan_number) const;
135 std::vector<double> NearestPointOnNeutralFibre_asVector(const CLHEP::Hep3Vector &p,
136 int fan_number) const;
137 int GetPhiGap(const CLHEP::Hep3Vector &p) const { return GetPhiGapAndSide(p).first; }
138 int PhiGapNumberForWheel(int) const;
139 std::pair<int, int> GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const;
140 double AmplitudeOfSurface(const CLHEP::Hep3Vector& P, int side, int fan_number) const;
141
143
144 private:
146
148 bool m_SaggingOn; // !
151 std::array<double,5> m_slant_parametrization; // pol4
152 std::array<double,LARWC_SINCOS_POLY+1> m_sin_parametrization;
153 std::array<double,LARWC_SINCOS_POLY+1> m_cos_parametrization;
154 std::vector<std::vector<double> > m_sagging_parameter; // !
155
165 double m_zShift;
166
170
180 //int m_HalfNumberOfFans; removed because unused. DM 2015-07-30
185
191
192
200
201
202 // int m_fan_number; // break thread-safety -> removed DM 2015-07-30
203
204 void outer_wheel_init(const EMECData &);
205 void inner_wheel_init(const EMECData &);
206 void module_init();
207
208 public:
209
210 /*void set_m_fan_number(const int &fan_number)
211 {
212 m_fan_number = fan_number;
213 if(m_fan_number < 0) m_fan_number += m_NumberOfFans;
214 m_fan_number += m_ZeroGapNumber;
215 if(m_fan_number >= m_NumberOfFans) m_fan_number -= m_NumberOfFans;
216 }*/
217 int adjust_fan_number(int fan_number) const {
218 int res_fan_number = fan_number;
219 if(res_fan_number < 0) res_fan_number += m_NumberOfFans;
220 res_fan_number += m_ZeroGapNumber;
221 if(res_fan_number >= m_NumberOfFans) res_fan_number -= m_NumberOfFans;
222 return res_fan_number;
223 }
224
227 double parameterized_slant_angle(double) const;
228
229 private:
230
231 void parameterized_sincos(const double, double &, double &) const;
232 void parameterized_sin(const double, double &, double &) const;
233
234 private:
235
239#if HAVE_VECTOR_SIZE_ATTRIBUTE
240 vsincos_par m_vsincos_par{};
241#endif
242
243};
244
245#if !defined(XAOD_STANDALONE) && !defined(PORTABLE_LAR_SHAPE)
246 //using the macro below we can assign an identifier (and a version)
247 //This is required and checked at compile time when you try to record/retrieve
248 CLASS_DEF(LArWheelCalculator , 900345678 , 1)
249#endif // XAOD_STANDALONE
250
251#endif // GEOSPECIALSHAPES_LARWHEELCALCULATOR_H
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static Double_t P(Double_t *tt, Double_t *par)
Implements details of distance calculation to parts of the LAr endcap without sagging corrections.
Implements details of distance calculation to parts of the LAr endcap with sagging taken into account...
Abstract interface for calculator classes that handle distance calculation to parts of the LAr endcap...
Abstract interface for fan calculator classes that handle distance calculation to parts of the LAr en...
This is an interface of distance calculation to parts of the LAr endcap.
LAr wheel fan calculator, templated for sagging settings.
This class separates some of the geometry details of the LAr endcap.
LArWheelCalculator(const LArWheelCalculator &)=delete
bool GetisBarretteCalib() const
CLHEP::Hep3Vector NearestPointOnNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
double GetWheelRefPoint() const
double GetFanStepOnPhi() const
std::array< double, LARWC_SINCOS_POLY+1 > m_cos_parametrization
std::pair< int, int > GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const
double GetdWRPtoFrontFace() const
double GetFanHalfThickness() const
void outer_wheel_init(const EMECData &)
double GetElecFocaltoWRP() const
int adjust_fan_number(int fan_number) const
int GetPhiGap(const CLHEP::Hep3Vector &p) const
double AmplitudeOfSurface(const CLHEP::Hep3Vector &P, int side, int fan_number) const
int GetNumberOfHalfWaves() const
double GetZeroFanPhi() const
double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
Calculates aproximate, probably underestimate, distance to the neutral fibre of the vertical fan.
double GetHalfWaveLength() const
double GetFanFoldRadius() const
double GetQuarterWaveLength() const
std::array< double, 5 > m_slant_parametrization
double GetStraightStartSection() const
double DistanceToTheNearestFan(CLHEP::Hep3Vector &p, int &out_fan_number) const
Determines the nearest to the input point fan.
void parameterized_sin(const double, double &, double &) const
double GetWheelThickness() const
LArWheelCalculator & operator=(const LArWheelCalculator &)=delete
LArWheelCalculator_Impl::IFanCalculator * m_fanCalcImpl
std::vector< std::vector< double > > m_sagging_parameter
int PhiGapNumberForWheel(int) const
void inner_wheel_init(const EMECData &)
LArG4::LArWheelCalculator_t m_type
void parameterized_sincos(const double, double &, double &) const
double GetActiveLength() const
double parameterized_slant_angle(double) const
Calculates wave slant angle using parametrization for current wheel for given distance from calorimet...
std::array< double, LARWC_SINCOS_POLY+1 > m_sin_parametrization
LArWheelCalculator(const EMECData &emecData, LArG4::LArWheelCalculator_t a_wheelType, int zside=1)
double GetWheelInnerRadius(std::array< double, 2 > &rInner) const
LArWheelCalculator_Impl::IDistanceCalculator * m_distanceCalcImpl
virtual LArG4::LArWheelCalculator_t type() const
static const char * LArWheelCalculatorTypeString(LArG4::LArWheelCalculator_t)
std::vector< double > NearestPointOnNeutralFibre_asVector(const CLHEP::Hep3Vector &p, int fan_number) const
void fill_sincos_parameterization()
void GetWheelOuterRadius(std::array< double, 2 > &rOuter) const
Some additional feature test macros.
vectorized version of parametrized sincos see ATLASSIM-4753 for details