ATLAS Offline Software
LArWheelCalculator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOSPECIALSHAPES_LARWHEELCALCULATOR_H
6 #define GEOSPECIALSHAPES_LARWHEELCALCULATOR_H
7 
8 #include <array>
9 #include <vector>
10 
11 // FMV and other checks
12 #ifndef PORTABLE_LAR_SHAPE
13 // For athena
14  #include "CxxUtils/features.h"
15 #else
16 // When run outside of Athena
17  #define HAVE_VECTOR_SIZE_ATTRIBUTE 1
18  #ifdef __APPLE__
19  #define CXXUTILS_FEATURES_H 1
20  #endif
21 #endif
22 
23 #include "CLHEP/Vector/ThreeVector.h"
24 #if !defined(XAOD_STANDALONE) && !defined(PORTABLE_LAR_SHAPE)
25  #include "AthenaKernel/CLASS_DEF.h"
26 #endif // XAOD_STANDALONE
27 
28 #if HAVE_VECTOR_SIZE_ATTRIBUTE
29  #include "vec_parametrized_sincos.h"
30 #endif
32 
33 #define LARWC_SINCOS_POLY 5
34 #define LARWC_DTNF_NEW
35 
36 struct EMECData;
37 
38 //#define HARDDEBUG
39 
40 // Forward declarations
42  class IDistanceCalculator;
45 
46  class IFanCalculator;
47  class ModuleFanCalculator;
48  template <typename SaggingType> class WheelFanCalculator;
49  template <typename SaggingType> class DistanceToTheNeutralFibre_OfFan;
50 }
51 
58 {
59 
63  template <typename SaggingType> friend class LArWheelCalculator_Impl::WheelFanCalculator;
64  template <typename SaggingType> friend class LArWheelCalculator_Impl::DistanceToTheNeutralFibre_OfFan;
65 
66  public:
67 
68  LArWheelCalculator(const EMECData & emecData, LArG4::LArWheelCalculator_t a_wheelType, int zside = 1);
69  virtual ~LArWheelCalculator();
70 
73 
76 
77  // "Get constant" methods:
78  double GetWheelThickness() const { return m_WheelThickness; }
79  double GetdWRPtoFrontFace() const { return m_dWRPtoFrontFace; }
81  virtual LArG4::LArWheelCalculator_t type() const { return m_type; }
82  // "zShift" is the z-distance (cm) that the EM endcap is shifted
83  // (due to cabling, etc.)
84  int GetAtlasZside() const { return m_AtlasZside; }
85  double zShift() const { return m_zShift; }
86  double GetFanFoldRadius() const { return m_FanFoldRadius; }
87  double GetZeroFanPhi() const { return m_ZeroFanPhi; }
88  int GetNumberOfWaves() const { return m_NumberOfWaves; }
89  int GetNumberOfHalfWaves() const { return m_NumberOfHalfWaves; }
90  int GetNumberOfFans() const { return m_NumberOfFans; }
91 
92  double GetActiveLength() const { return m_ActiveLength; }
93  double GetFanStepOnPhi() const { return m_FanStepOnPhi; }
94  double GetHalfWaveLength() const { return m_HalfWaveLength; }
95  double GetQuarterWaveLength() const { return m_QuarterWaveLength; }
96  double GetWheelRefPoint() const { return m_zWheelRefPoint; }
97  double GetFanHalfThickness() const { return m_FanHalfThickness; }
98 
99  bool GetisModule() const { return m_isModule; }
100  bool GetisElectrode() const { return m_isElectrode; }
101  bool GetisInner() const { return m_isInner; }
102  bool GetisBarrette() const { return m_isBarrette; }
103  bool GetisBarretteCalib() const { return m_isBarretteCalib; }
104 
105  double GetWheelInnerRadius(double *) const;
106  void GetWheelOuterRadius(double *) const;
107 
108  double GetElecFocaltoWRP() const { return m_dElecFocaltoWRP; }
109  // "set constant" method:
110 
111  int GetFirstFan() const { return m_FirstFan; }
112  int GetLastFan() const { return m_LastFan; }
113 
114  int GetStartGapNumber() const { return m_ZeroGapNumber; }
116 
119 
123  double DistanceToTheNearestFan(CLHEP::Hep3Vector &p, int & out_fan_number) const;
124 
128  double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const;
129 
130  CLHEP::Hep3Vector NearestPointOnNeutralFibre(const CLHEP::Hep3Vector &p,
131  int fan_number) const;
132  std::vector<double> NearestPointOnNeutralFibre_asVector(const CLHEP::Hep3Vector &p,
133  int fan_number) const;
134  int GetPhiGap(const CLHEP::Hep3Vector &p) const { return GetPhiGapAndSide(p).first; }
135  int PhiGapNumberForWheel(int) const;
136  std::pair<int, int> GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const;
137  double AmplitudeOfSurface(const CLHEP::Hep3Vector& P, int side, int fan_number) const;
138 
140 
141  private:
143 
145  bool m_SaggingOn; // !
148  std::array<double,5> m_slant_parametrization; // pol4
149  std::array<double,LARWC_SINCOS_POLY+1> m_sin_parametrization;
150  std::array<double,LARWC_SINCOS_POLY+1> m_cos_parametrization;
151  std::vector<std::vector<double> > m_sagging_parameter; // !
152 
162  double m_zShift;
163 
167 
171  double m_ZeroFanPhi;
177  //int m_HalfNumberOfFans; removed because unused. DM 2015-07-30
182 
185  bool m_isInner;
188 
189 
197 
198 
199  // int m_fan_number; // break thread-safety -> removed DM 2015-07-30
200 
201  void outer_wheel_init(const EMECData &);
202  void inner_wheel_init(const EMECData &);
203  void module_init();
204 
205  public:
206 
207  /*void set_m_fan_number(const int &fan_number)
208  {
209  m_fan_number = fan_number;
210  if(m_fan_number < 0) m_fan_number += m_NumberOfFans;
211  m_fan_number += m_ZeroGapNumber;
212  if(m_fan_number >= m_NumberOfFans) m_fan_number -= m_NumberOfFans;
213  }*/
214  int adjust_fan_number(int fan_number) const {
215  int res_fan_number = fan_number;
216  if(res_fan_number < 0) res_fan_number += m_NumberOfFans;
217  res_fan_number += m_ZeroGapNumber;
218  if(res_fan_number >= m_NumberOfFans) res_fan_number -= m_NumberOfFans;
219  return res_fan_number;
220  }
221 
224  double parameterized_slant_angle(double) const;
225 
226  private:
227 
228  void parameterized_sincos(const double, double &, double &) const;
229  void parameterized_sin(const double, double &, double &) const;
230 
231  private:
232 
236 #if HAVE_VECTOR_SIZE_ATTRIBUTE
237  vsincos_par m_vsincos_par{};
238 #endif
239 
240 };
241 
242 #if !defined(XAOD_STANDALONE) && !defined(PORTABLE_LAR_SHAPE)
243  //using the macro below we can assign an identifier (and a version)
244  //This is required and checked at compile time when you try to record/retrieve
245  CLASS_DEF(LArWheelCalculator , 900345678 , 1)
246 #endif // XAOD_STANDALONE
247 
248 #endif // GEOSPECIALSHAPES_LARWHEELCALCULATOR_H
LArWheelCalculator::m_dMechFocaltoWRP
double m_dMechFocaltoWRP
Definition: LArWheelCalculator.h:158
LArWheelCalculator::m_rOuterCutoff
double m_rOuterCutoff
Definition: LArWheelCalculator.h:160
features.h
Some additional feature test macros.
LArWheelCalculator::GetActiveLength
double GetActiveLength() const
Definition: LArWheelCalculator.h:92
LArWheelCalculator::GetStraightStartSection
double GetStraightStartSection() const
Definition: LArWheelCalculator.h:80
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LArWheelCalculator::m_electrodeTotalThickness
double m_electrodeTotalThickness
Definition: LArWheelCalculator.h:194
LArWheelCalculator::module_init
void module_init()
Definition: LArWheelCalculator.cxx:481
LArWheelCalculator::m_eta_low
double m_eta_low
Definition: LArWheelCalculator.h:161
LArWheelCalculator::m_glueThickness
double m_glueThickness
Definition: LArWheelCalculator.h:193
LArWheelCalculator::m_isModule
bool m_isModule
Definition: LArWheelCalculator.h:183
vec_parametrized_sincos.h
LArWheelCalculator::m_slant_use_default
bool m_slant_use_default
Definition: LArWheelCalculator.h:147
LArWheelCalculator::m_dElecFocaltoWRP
double m_dElecFocaltoWRP
Definition: LArWheelCalculator.h:159
LArWheelCalculator::GetisBarrette
bool GetisBarrette() const
Definition: LArWheelCalculator.h:102
LArWheelCalculator::m_electrodeInvContraction
double m_electrodeInvContraction
Definition: LArWheelCalculator.h:196
LArWheelCalculator::parameterized_slant_angle
double parameterized_slant_angle(double) const
Calculates wave slant angle using parametrization for current wheel for given distance from calorimet...
Definition: LArWheelCalculatorGeometry.cxx:71
LArWheelCalculator::m_eta_mid
double m_eta_mid
Definition: LArWheelCalculator.h:161
LArWheelCalculator_Impl::DistanceCalculatorSaggingOn
Implements details of distance calculation to parts of the LAr endcap with sagging taken into account...
Definition: DistanceCalculatorSaggingOn.h:19
EMECData
Definition: EMECData.h:131
LArWheelCalculator::inner_wheel_init
void inner_wheel_init(const EMECData &)
Definition: LArWheelCalculator.cxx:410
LArWheelCalculator::type
virtual LArG4::LArWheelCalculator_t type() const
Definition: LArWheelCalculator.h:81
LArWheelCalculator::GetNumberOfHalfWaves
int GetNumberOfHalfWaves() const
Definition: LArWheelCalculator.h:89
LArWheelCalculator::LArWheelCalculatorTypeString
static const char * LArWheelCalculatorTypeString(LArG4::LArWheelCalculator_t)
Definition: LArWheelCalculator.cxx:65
LArWheelCalculator::GetZeroFanPhi
double GetZeroFanPhi() const
Definition: LArWheelCalculator.h:87
LArWheelCalculator::PhiGapNumberForWheel
int PhiGapNumberForWheel(int) const
Definition: LArWheelCalculator.cxx:405
LArWheelCalculator::m_FanHalfThickness
double m_FanHalfThickness
Definition: LArWheelCalculator.h:178
LArWheelCalculator::m_fanCalcImpl
LArWheelCalculator_Impl::IFanCalculator * m_fanCalcImpl
Definition: LArWheelCalculator.h:234
LArWheelCalculator::m_leadThicknessOuter
double m_leadThicknessOuter
Definition: LArWheelCalculator.h:191
LArWheelCalculator::m_AtlasZside
int m_AtlasZside
Definition: LArWheelCalculator.h:144
LArWheelCalculator::NearestPointOnNeutralFibre_asVector
std::vector< double > NearestPointOnNeutralFibre_asVector(const CLHEP::Hep3Vector &p, int fan_number) const
Definition: LArWheelCalculatorGeometry.cxx:118
LArWheelCalculator::GetisInner
bool GetisInner() const
Definition: LArWheelCalculator.h:101
LArWheelCalculator::GetPhiGap
int GetPhiGap(const CLHEP::Hep3Vector &p) const
Definition: LArWheelCalculator.h:134
LArWheelCalculator_Impl::DistanceToTheNeutralFibre_OfFan
Definition: LArWheelCalculator.h:49
LArWheelCalculator::m_zWheelFrontFace
double m_zWheelFrontFace
Definition: LArWheelCalculator.h:166
LArWheelCalculator::parameterized_sincos
void parameterized_sincos(const double, double &, double &) const
Definition: LArWheelCalculatorGeometry.cxx:41
LArWheelCalculator::GetQuarterWaveLength
double GetQuarterWaveLength() const
Definition: LArWheelCalculator.h:95
LArWheelCalculator::m_coldContraction
double m_coldContraction
Definition: LArWheelCalculator.h:195
LArWheelCalculator::m_HalfGapBetweenWheels
double m_HalfGapBetweenWheels
Definition: LArWheelCalculator.h:156
LArWheelCalculator::GetNumberOfWaves
int GetNumberOfWaves() const
Definition: LArWheelCalculator.h:88
TRT::Hit::side
@ side
Definition: HitInfo.h:83
LArWheelCalculator::m_isBarretteCalib
bool m_isBarretteCalib
Definition: LArWheelCalculator.h:187
LArWheelCalculator::m_steelThickness
double m_steelThickness
Definition: LArWheelCalculator.h:192
LArWheelCalculator::m_sagging_parameter
std::vector< std::vector< double > > m_sagging_parameter
Definition: LArWheelCalculator.h:151
LArWheelCalculator::adjust_fan_number
int adjust_fan_number(int fan_number) const
Definition: LArWheelCalculator.h:214
LArWheelCalculator::GetisBarretteCalib
bool GetisBarretteCalib() const
Definition: LArWheelCalculator.h:103
LArWheelCalculator::m_isElectrode
bool m_isElectrode
Definition: LArWheelCalculator.h:184
LArWheelCalculator::m_ZeroFanPhi_ForDetNeaFan
double m_ZeroFanPhi_ForDetNeaFan
Definition: LArWheelCalculator.h:172
LArWheelCalculator::parameterized_sin
void parameterized_sin(const double, double &, double &) const
Definition: LArWheelCalculatorGeometry.cxx:21
LArWheelCalculator::operator=
LArWheelCalculator & operator=(const LArWheelCalculator &)=delete
LArWheelCalculator::m_NumberOfWaves
int m_NumberOfWaves
Definition: LArWheelCalculator.h:174
LArWheelCalculator::GetNumberOfFans
int GetNumberOfFans() const
Definition: LArWheelCalculator.h:90
beamspotman.n
n
Definition: beamspotman.py:731
LArWheelCalculator::GetFanFoldRadius
double GetFanFoldRadius() const
Definition: LArWheelCalculator.h:86
LArWheelCalculator::m_WheelThickness
double m_WheelThickness
Definition: LArWheelCalculator.h:164
LArWheelCalculator::GetWheelThickness
double GetWheelThickness() const
Definition: LArWheelCalculator.h:78
LArWheelCalculator::~LArWheelCalculator
virtual ~LArWheelCalculator()
Definition: LArWheelCalculator.cxx:92
LArWheelCalculator
Definition: LArWheelCalculator.h:58
LArWheelCalculator_Impl::DistanceCalculatorSaggingOff
Implements details of distance calculation to parts of the LAr endcap without sagging corrections.
Definition: DistanceCalculatorSaggingOff.h:21
vsincos_par
vectorized version of parametrized sincos see ATLASSIM-4753 for details
Definition: vec_parametrized_sincos.h:16
LArWheelCalculator::fill_sincos_parameterization
void fill_sincos_parameterization()
Definition: sincos_poly.cxx:247
LArWheelCalculator::GetWheelOuterRadius
void GetWheelOuterRadius(double *) const
Definition: LArWheelCalculator.cxx:520
LArWheelCalculator::m_isBarrette
bool m_isBarrette
Definition: LArWheelCalculator.h:186
LArWheelCalculator_Impl
Definition: LArWheelCalculator.h:41
LArWheelCalculator::m_phiRotation
bool m_phiRotation
Definition: LArWheelCalculator.h:146
LArWheelCalculator::GetdWRPtoFrontFace
double GetdWRPtoFrontFace() const
Definition: LArWheelCalculator.h:79
LArWheelCalculator::GetElecFocaltoWRP
double GetElecFocaltoWRP() const
Definition: LArWheelCalculator.h:108
LArWheelCalculator::GetisElectrode
bool GetisElectrode() const
Definition: LArWheelCalculator.h:100
LArWheelCalculator::GetWheelInnerRadius
double GetWheelInnerRadius(double *) const
Definition: LArWheelCalculator.cxx:495
LArWheelCalculator_Impl::IDistanceCalculator
Definition: IDistanceCalculator.h:19
LArWheelCalculator::m_StraightStartSection
double m_StraightStartSection
Definition: LArWheelCalculator.h:154
LArWheelCalculator::GetPhiGapAndSide
std::pair< int, int > GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const
Definition: LArWheelCalculatorGeometry.cxx:98
LArWheelCalculator::m_slant_parametrization
std::array< double, 5 > m_slant_parametrization
Definition: LArWheelCalculator.h:148
LArWheelCalculator::m_eta_hi
double m_eta_hi
Definition: LArWheelCalculator.h:161
LArWheelCalculator::m_NumberOfFans
int m_NumberOfFans
Definition: LArWheelCalculator.h:176
LArWheelCalculator::m_leadThicknessInner
double m_leadThicknessInner
Definition: LArWheelCalculator.h:190
LArWheelCalculator::GetLastFan
int GetLastFan() const
Definition: LArWheelCalculator.h:112
LArWheelCalculator::m_distanceCalcImpl
LArWheelCalculator_Impl::IDistanceCalculator * m_distanceCalcImpl
Definition: LArWheelCalculator.h:233
LArWheelCalculator::m_HalfWheelThickness
double m_HalfWheelThickness
Definition: LArWheelCalculator.h:165
LArWheelCalculator_Impl::IFanCalculator
Definition: IFanCalculator.h:19
LArWheelCalculator::m_zWheelRefPoint
double m_zWheelRefPoint
Definition: LArWheelCalculator.h:157
LArWheelCalculator::m_ZeroFanPhi
double m_ZeroFanPhi
Definition: LArWheelCalculator.h:171
LArWheelCalculator::GetHalfWaveLength
double GetHalfWaveLength() const
Definition: LArWheelCalculator.h:94
LArWheelCalculator::m_FirstFan
int m_FirstFan
Definition: LArWheelCalculator.h:180
LArWheelCalculator::m_FanStepOnPhi
double m_FanStepOnPhi
Definition: LArWheelCalculator.h:173
LArWheelCalculator::m_QuarterWaveLength
double m_QuarterWaveLength
Definition: LArWheelCalculator.h:168
LArWheelCalculator::AmplitudeOfSurface
double AmplitudeOfSurface(const CLHEP::Hep3Vector &P, int side, int fan_number) const
Definition: LArWheelCalculatorGeometry.cxx:130
LArWheelCalculator::m_ZeroGapNumber
int m_ZeroGapNumber
Definition: LArWheelCalculator.h:179
LArWheelCalculator::DistanceToTheNearestFan
double DistanceToTheNearestFan(CLHEP::Hep3Vector &p, int &out_fan_number) const
Determines the nearest to the input point fan.
Definition: LArWheelCalculatorGeometry.cxx:90
LArWheelCalculator::m_FanFoldRadius
double m_FanFoldRadius
Definition: LArWheelCalculator.h:170
LArWheelCalculator::GetFirstFan
int GetFirstFan() const
Definition: LArWheelCalculator.h:111
LArWheelCalculator::m_dWRPtoFrontFace
double m_dWRPtoFrontFace
Definition: LArWheelCalculator.h:155
LArWheelCalculator::m_NumberOfHalfWaves
int m_NumberOfHalfWaves
Definition: LArWheelCalculator.h:175
LArWheelCalculator::outer_wheel_init
void outer_wheel_init(const EMECData &)
Definition: LArWheelCalculator.cxx:426
LArWheelCalculator::NearestPointOnNeutralFibre
CLHEP::Hep3Vector NearestPointOnNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
Definition: LArWheelCalculatorGeometry.cxx:113
LArWheelCalculator_Impl::WheelFanCalculator
LAr wheel fan calculator, templated for sagging settings.
Definition: LArWheelCalculator.h:48
LArWheelCalculator::m_HalfWaveLength
double m_HalfWaveLength
Definition: LArWheelCalculator.h:169
LArWheelCalculator::m_ActiveLength
double m_ActiveLength
Definition: LArWheelCalculator.h:153
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
LArWheelCalculator::SetStartGapNumber
void SetStartGapNumber(int n)
Definition: LArWheelCalculator.h:115
LArWheelCalculator::GetAtlasZside
int GetAtlasZside() const
Definition: LArWheelCalculator.h:84
LArWheelCalculator::m_cos_parametrization
std::array< double, LARWC_SINCOS_POLY+1 > m_cos_parametrization
Definition: LArWheelCalculator.h:150
LArWheelCalculator::LArWheelCalculator
LArWheelCalculator(const EMECData &emecData, LArG4::LArWheelCalculator_t a_wheelType, int zside=1)
Definition: LArWheelCalculator.cxx:99
LArWheelCalculator::GetStartGapNumber
int GetStartGapNumber() const
Definition: LArWheelCalculator.h:114
LArWheelCalculator::GetFanStepOnPhi
double GetFanStepOnPhi() const
Definition: LArWheelCalculator.h:93
LArWheelCalculator::GetWheelRefPoint
double GetWheelRefPoint() const
Definition: LArWheelCalculator.h:96
LArWheelCalculator::DistanceToTheNeutralFibre
double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
Calculates aproximate, probably underestimate, distance to the neutral fibre of the vertical fan.
Definition: LArWheelCalculatorGeometry.cxx:108
LArWheelCalculator::m_SaggingOn
bool m_SaggingOn
Definition: LArWheelCalculator.h:145
LArWheelCalculator::m_LastFan
int m_LastFan
Definition: LArWheelCalculator.h:181
LArWheelCalculator::m_type
LArG4::LArWheelCalculator_t m_type
Definition: LArWheelCalculator.h:142
LArWheelCalculator::m_isInner
bool m_isInner
Definition: LArWheelCalculator.h:185
LArWheelCalculator::LArWheelCalculator
LArWheelCalculator(const LArWheelCalculator &)=delete
LArWheelCalculator::m_zWheelBackFace
double m_zWheelBackFace
Definition: LArWheelCalculator.h:166
LArWheelCalculator::m_sin_parametrization
std::array< double, LARWC_SINCOS_POLY+1 > m_sin_parametrization
Definition: LArWheelCalculator.h:149
LArWheelCalculator::GetisModule
bool GetisModule() const
Definition: LArWheelCalculator.h:99
LArWheelCalculator::m_zShift
double m_zShift
Definition: LArWheelCalculator.h:162
CLASS_DEF.h
macros to associate a CLID to a type
LArWheelCalculatorEnums.h
LArG4::LArWheelCalculator_t
LArWheelCalculator_t
Definition: LArWheelCalculatorEnums.h:10
LArWheelCalculator::zShift
double zShift() const
Definition: LArWheelCalculator.h:85
LArWheelCalculator_Impl::ModuleFanCalculator
This is an interface of distance calculation to parts of the LAr endcap.
Definition: ModuleFanCalculator.h:17
LArWheelCalculator::GetFanHalfThickness
double GetFanHalfThickness() const
Definition: LArWheelCalculator.h:97