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 
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)
24  #include "AthenaKernel/CLASS_DEF.h"
25 #endif // XAOD_STANDALONE
26 
27 #if HAVE_VECTOR_SIZE_ATTRIBUTE
28  #include "vec_parametrized_sincos.h"
29 #endif
31 
32 #include <array>
33 #include <vector>
34 
35 #define LARWC_SINCOS_POLY 5
36 #define LARWC_DTNF_NEW
37 
38 struct EMECData;
39 
40 //#define HARDDEBUG
41 
42 // Forward declarations
44  class IDistanceCalculator;
47 
48  class IFanCalculator;
49  class ModuleFanCalculator;
50  template <typename SaggingType> class WheelFanCalculator;
51  template <typename SaggingType> class DistanceToTheNeutralFibre_OfFan;
52 }
53 
60 {
61 
65  template <typename SaggingType> friend class LArWheelCalculator_Impl::WheelFanCalculator;
66  template <typename SaggingType> friend class LArWheelCalculator_Impl::DistanceToTheNeutralFibre_OfFan;
67 
68  public:
69 
70  LArWheelCalculator(const EMECData & emecData, LArG4::LArWheelCalculator_t a_wheelType, int zside = 1);
71  virtual ~LArWheelCalculator();
72 
75 
78 
79  // "Get constant" methods:
80  double GetWheelThickness() const { return m_WheelThickness; }
81  double GetdWRPtoFrontFace() const { return m_dWRPtoFrontFace; }
83  virtual LArG4::LArWheelCalculator_t type() const { return m_type; }
84  // "zShift" is the z-distance (cm) that the EM endcap is shifted
85  // (due to cabling, etc.)
86  int GetAtlasZside() const { return m_AtlasZside; }
87  double zShift() const { return m_zShift; }
88  double GetFanFoldRadius() const { return m_FanFoldRadius; }
89  double GetZeroFanPhi() const { return m_ZeroFanPhi; }
90  int GetNumberOfWaves() const { return m_NumberOfWaves; }
91  int GetNumberOfHalfWaves() const { return m_NumberOfHalfWaves; }
92  int GetNumberOfFans() const { return m_NumberOfFans; }
93 
94  double GetActiveLength() const { return m_ActiveLength; }
95  double GetFanStepOnPhi() const { return m_FanStepOnPhi; }
96  double GetHalfWaveLength() const { return m_HalfWaveLength; }
97  double GetQuarterWaveLength() const { return m_QuarterWaveLength; }
98  double GetWheelRefPoint() const { return m_zWheelRefPoint; }
99  double GetFanHalfThickness() const { return m_FanHalfThickness; }
100 
101  bool GetisModule() const { return m_isModule; }
102  bool GetisElectrode() const { return m_isElectrode; }
103  bool GetisInner() const { return m_isInner; }
104  bool GetisBarrette() const { return m_isBarrette; }
105  bool GetisBarretteCalib() const { return m_isBarretteCalib; }
106 
107  double GetWheelInnerRadius(std::array<double,2> & rInner) const;
108  double GetWheelInnerRadius(std::array<double,3> & rInner) const;
109  void GetWheelOuterRadius(std::array<double,2> & rOuter) const;
110  void GetWheelOuterRadius(std::array<double,3> & rOuter) const;
111 
112  double GetElecFocaltoWRP() const { return m_dElecFocaltoWRP; }
113  // "set constant" method:
114 
115  int GetFirstFan() const { return m_FirstFan; }
116  int GetLastFan() const { return m_LastFan; }
117 
118  int GetStartGapNumber() const { return m_ZeroGapNumber; }
120 
123 
127  double DistanceToTheNearestFan(CLHEP::Hep3Vector &p, int & out_fan_number) const;
128 
132  double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const;
133 
134  CLHEP::Hep3Vector NearestPointOnNeutralFibre(const CLHEP::Hep3Vector &p,
135  int fan_number) const;
136  std::vector<double> NearestPointOnNeutralFibre_asVector(const CLHEP::Hep3Vector &p,
137  int fan_number) const;
138  int GetPhiGap(const CLHEP::Hep3Vector &p) const { return GetPhiGapAndSide(p).first; }
139  int PhiGapNumberForWheel(int) const;
140  std::pair<int, int> GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const;
141  double AmplitudeOfSurface(const CLHEP::Hep3Vector& P, int side, int fan_number) const;
142 
144 
145  private:
147 
149  bool m_SaggingOn; // !
152  std::array<double,5> m_slant_parametrization; // pol4
153  std::array<double,LARWC_SINCOS_POLY+1> m_sin_parametrization;
154  std::array<double,LARWC_SINCOS_POLY+1> m_cos_parametrization;
155  std::vector<std::vector<double> > m_sagging_parameter; // !
156 
166  double m_zShift;
167 
171 
175  double m_ZeroFanPhi;
181  //int m_HalfNumberOfFans; removed because unused. DM 2015-07-30
186 
189  bool m_isInner;
192 
193 
201 
202 
203  // int m_fan_number; // break thread-safety -> removed DM 2015-07-30
204 
205  void outer_wheel_init(const EMECData &);
206  void inner_wheel_init(const EMECData &);
207  void module_init();
208 
209  public:
210 
211  /*void set_m_fan_number(const int &fan_number)
212  {
213  m_fan_number = fan_number;
214  if(m_fan_number < 0) m_fan_number += m_NumberOfFans;
215  m_fan_number += m_ZeroGapNumber;
216  if(m_fan_number >= m_NumberOfFans) m_fan_number -= m_NumberOfFans;
217  }*/
218  int adjust_fan_number(int fan_number) const {
219  int res_fan_number = fan_number;
220  if(res_fan_number < 0) res_fan_number += m_NumberOfFans;
221  res_fan_number += m_ZeroGapNumber;
222  if(res_fan_number >= m_NumberOfFans) res_fan_number -= m_NumberOfFans;
223  return res_fan_number;
224  }
225 
228  double parameterized_slant_angle(double) const;
229 
230  private:
231 
232  void parameterized_sincos(const double, double &, double &) const;
233  void parameterized_sin(const double, double &, double &) const;
234 
235  private:
236 
240 #if HAVE_VECTOR_SIZE_ATTRIBUTE
241  vsincos_par m_vsincos_par{};
242 #endif
243 
244 };
245 
246 #if !defined(XAOD_STANDALONE) && !defined(PORTABLE_LAR_SHAPE)
247  //using the macro below we can assign an identifier (and a version)
248  //This is required and checked at compile time when you try to record/retrieve
249  CLASS_DEF(LArWheelCalculator , 900345678 , 1)
250 #endif // XAOD_STANDALONE
251 
252 #endif // GEOSPECIALSHAPES_LARWHEELCALCULATOR_H
LArWheelCalculator::m_dMechFocaltoWRP
double m_dMechFocaltoWRP
Definition: LArWheelCalculator.h:162
LArWheelCalculator::m_rOuterCutoff
double m_rOuterCutoff
Definition: LArWheelCalculator.h:164
features.h
Some additional feature test macros.
LArWheelCalculator::GetActiveLength
double GetActiveLength() const
Definition: LArWheelCalculator.h:94
LArWheelCalculator::GetStraightStartSection
double GetStraightStartSection() const
Definition: LArWheelCalculator.h:82
LArWheelCalculator::m_electrodeTotalThickness
double m_electrodeTotalThickness
Definition: LArWheelCalculator.h:198
LArWheelCalculator::module_init
void module_init()
Definition: LArWheelCalculator.cxx:479
LArWheelCalculator::m_eta_low
double m_eta_low
Definition: LArWheelCalculator.h:165
LArWheelCalculator::m_glueThickness
double m_glueThickness
Definition: LArWheelCalculator.h:197
LArWheelCalculator::m_isModule
bool m_isModule
Definition: LArWheelCalculator.h:187
vec_parametrized_sincos.h
LArWheelCalculator::m_slant_use_default
bool m_slant_use_default
Definition: LArWheelCalculator.h:151
DMTest::P
P_v1 P
Definition: P.h:23
LArWheelCalculator::m_dElecFocaltoWRP
double m_dElecFocaltoWRP
Definition: LArWheelCalculator.h:163
LArWheelCalculator::GetisBarrette
bool GetisBarrette() const
Definition: LArWheelCalculator.h:104
LArWheelCalculator::m_electrodeInvContraction
double m_electrodeInvContraction
Definition: LArWheelCalculator.h:200
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:165
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:408
LArWheelCalculator::type
virtual LArG4::LArWheelCalculator_t type() const
Definition: LArWheelCalculator.h:83
LArWheelCalculator::GetNumberOfHalfWaves
int GetNumberOfHalfWaves() const
Definition: LArWheelCalculator.h:91
LArWheelCalculator::LArWheelCalculatorTypeString
static const char * LArWheelCalculatorTypeString(LArG4::LArWheelCalculator_t)
Definition: LArWheelCalculator.cxx:65
LArWheelCalculator::GetZeroFanPhi
double GetZeroFanPhi() const
Definition: LArWheelCalculator.h:89
LArWheelCalculator::PhiGapNumberForWheel
int PhiGapNumberForWheel(int) const
Definition: LArWheelCalculator.cxx:403
LArWheelCalculator::m_FanHalfThickness
double m_FanHalfThickness
Definition: LArWheelCalculator.h:182
LArWheelCalculator::m_fanCalcImpl
LArWheelCalculator_Impl::IFanCalculator * m_fanCalcImpl
Definition: LArWheelCalculator.h:238
LArWheelCalculator::m_leadThicknessOuter
double m_leadThicknessOuter
Definition: LArWheelCalculator.h:195
LArWheelCalculator::m_AtlasZside
int m_AtlasZside
Definition: LArWheelCalculator.h:148
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:103
LArWheelCalculator::GetPhiGap
int GetPhiGap(const CLHEP::Hep3Vector &p) const
Definition: LArWheelCalculator.h:138
LArWheelCalculator_Impl::DistanceToTheNeutralFibre_OfFan
Definition: LArWheelCalculator.h:51
LArWheelCalculator::m_zWheelFrontFace
double m_zWheelFrontFace
Definition: LArWheelCalculator.h:170
LArWheelCalculator::parameterized_sincos
void parameterized_sincos(const double, double &, double &) const
Definition: LArWheelCalculatorGeometry.cxx:41
LArWheelCalculator::GetQuarterWaveLength
double GetQuarterWaveLength() const
Definition: LArWheelCalculator.h:97
LArWheelCalculator::m_coldContraction
double m_coldContraction
Definition: LArWheelCalculator.h:199
LArWheelCalculator::m_HalfGapBetweenWheels
double m_HalfGapBetweenWheels
Definition: LArWheelCalculator.h:160
LArWheelCalculator::GetNumberOfWaves
int GetNumberOfWaves() const
Definition: LArWheelCalculator.h:90
TRT::Hit::side
@ side
Definition: HitInfo.h:83
LArWheelCalculator::m_isBarretteCalib
bool m_isBarretteCalib
Definition: LArWheelCalculator.h:191
LArWheelCalculator::m_steelThickness
double m_steelThickness
Definition: LArWheelCalculator.h:196
LArWheelCalculator::m_sagging_parameter
std::vector< std::vector< double > > m_sagging_parameter
Definition: LArWheelCalculator.h:155
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
LArWheelCalculator::adjust_fan_number
int adjust_fan_number(int fan_number) const
Definition: LArWheelCalculator.h:218
LArWheelCalculator::GetisBarretteCalib
bool GetisBarretteCalib() const
Definition: LArWheelCalculator.h:105
LArWheelCalculator::GetWheelInnerRadius
double GetWheelInnerRadius(std::array< double, 2 > &rInner) const
Definition: LArWheelCalculator.cxx:493
LArWheelCalculator::m_isElectrode
bool m_isElectrode
Definition: LArWheelCalculator.h:188
LArWheelCalculator::m_ZeroFanPhi_ForDetNeaFan
double m_ZeroFanPhi_ForDetNeaFan
Definition: LArWheelCalculator.h:176
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:178
LArWheelCalculator::GetNumberOfFans
int GetNumberOfFans() const
Definition: LArWheelCalculator.h:92
beamspotman.n
n
Definition: beamspotman.py:731
LArWheelCalculator::GetFanFoldRadius
double GetFanFoldRadius() const
Definition: LArWheelCalculator.h:88
LArWheelCalculator::m_WheelThickness
double m_WheelThickness
Definition: LArWheelCalculator.h:168
LArWheelCalculator::GetWheelThickness
double GetWheelThickness() const
Definition: LArWheelCalculator.h:80
LArWheelCalculator::~LArWheelCalculator
virtual ~LArWheelCalculator()
Definition: LArWheelCalculator.cxx:92
LArWheelCalculator
Definition: LArWheelCalculator.h:60
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::m_isBarrette
bool m_isBarrette
Definition: LArWheelCalculator.h:190
LArWheelCalculator_Impl
Definition: LArWheelCalculator.h:43
LArWheelCalculator::m_phiRotation
bool m_phiRotation
Definition: LArWheelCalculator.h:150
LArWheelCalculator::GetdWRPtoFrontFace
double GetdWRPtoFrontFace() const
Definition: LArWheelCalculator.h:81
LArWheelCalculator::GetWheelOuterRadius
void GetWheelOuterRadius(std::array< double, 2 > &rOuter) const
Definition: LArWheelCalculator.cxx:525
LArWheelCalculator::GetElecFocaltoWRP
double GetElecFocaltoWRP() const
Definition: LArWheelCalculator.h:112
LArWheelCalculator::GetisElectrode
bool GetisElectrode() const
Definition: LArWheelCalculator.h:102
LArWheelCalculator_Impl::IDistanceCalculator
Definition: IDistanceCalculator.h:19
LArWheelCalculator::m_StraightStartSection
double m_StraightStartSection
Definition: LArWheelCalculator.h:158
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:152
LArWheelCalculator::m_eta_hi
double m_eta_hi
Definition: LArWheelCalculator.h:165
LArWheelCalculator::m_NumberOfFans
int m_NumberOfFans
Definition: LArWheelCalculator.h:180
LArWheelCalculator::m_leadThicknessInner
double m_leadThicknessInner
Definition: LArWheelCalculator.h:194
LArWheelCalculator::GetLastFan
int GetLastFan() const
Definition: LArWheelCalculator.h:116
LArWheelCalculator::m_distanceCalcImpl
LArWheelCalculator_Impl::IDistanceCalculator * m_distanceCalcImpl
Definition: LArWheelCalculator.h:237
LArWheelCalculator::m_HalfWheelThickness
double m_HalfWheelThickness
Definition: LArWheelCalculator.h:169
LArWheelCalculator_Impl::IFanCalculator
Definition: IFanCalculator.h:19
LArWheelCalculator::m_zWheelRefPoint
double m_zWheelRefPoint
Definition: LArWheelCalculator.h:161
LArWheelCalculator::m_ZeroFanPhi
double m_ZeroFanPhi
Definition: LArWheelCalculator.h:175
LArWheelCalculator::GetHalfWaveLength
double GetHalfWaveLength() const
Definition: LArWheelCalculator.h:96
LArWheelCalculator::m_FirstFan
int m_FirstFan
Definition: LArWheelCalculator.h:184
LArWheelCalculator::m_FanStepOnPhi
double m_FanStepOnPhi
Definition: LArWheelCalculator.h:177
LArWheelCalculator::m_QuarterWaveLength
double m_QuarterWaveLength
Definition: LArWheelCalculator.h:172
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:183
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:174
LArWheelCalculator::GetFirstFan
int GetFirstFan() const
Definition: LArWheelCalculator.h:115
LArWheelCalculator::m_dWRPtoFrontFace
double m_dWRPtoFrontFace
Definition: LArWheelCalculator.h:159
LArWheelCalculator::m_NumberOfHalfWaves
int m_NumberOfHalfWaves
Definition: LArWheelCalculator.h:179
LArWheelCalculator::outer_wheel_init
void outer_wheel_init(const EMECData &)
Definition: LArWheelCalculator.cxx:424
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:50
LArWheelCalculator::m_HalfWaveLength
double m_HalfWaveLength
Definition: LArWheelCalculator.h:173
LArWheelCalculator::m_ActiveLength
double m_ActiveLength
Definition: LArWheelCalculator.h:157
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:119
LArWheelCalculator::GetAtlasZside
int GetAtlasZside() const
Definition: LArWheelCalculator.h:86
LArWheelCalculator::m_cos_parametrization
std::array< double, LARWC_SINCOS_POLY+1 > m_cos_parametrization
Definition: LArWheelCalculator.h:154
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:118
LArWheelCalculator::GetFanStepOnPhi
double GetFanStepOnPhi() const
Definition: LArWheelCalculator.h:95
LArWheelCalculator::GetWheelRefPoint
double GetWheelRefPoint() const
Definition: LArWheelCalculator.h:98
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:149
LArWheelCalculator::m_LastFan
int m_LastFan
Definition: LArWheelCalculator.h:185
LArWheelCalculator::m_type
LArG4::LArWheelCalculator_t m_type
Definition: LArWheelCalculator.h:146
LArWheelCalculator::m_isInner
bool m_isInner
Definition: LArWheelCalculator.h:189
LArWheelCalculator::LArWheelCalculator
LArWheelCalculator(const LArWheelCalculator &)=delete
LArWheelCalculator::m_zWheelBackFace
double m_zWheelBackFace
Definition: LArWheelCalculator.h:170
LArWheelCalculator::m_sin_parametrization
std::array< double, LARWC_SINCOS_POLY+1 > m_sin_parametrization
Definition: LArWheelCalculator.h:153
LArWheelCalculator::GetisModule
bool GetisModule() const
Definition: LArWheelCalculator.h:101
LArWheelCalculator::m_zShift
double m_zShift
Definition: LArWheelCalculator.h:166
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:87
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:99