ATLAS Offline Software
Loading...
Searching...
No Matches
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)
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#define LARWC_DTNF_NEW
37
38struct EMECData;
39
40//#define HARDDEBUG
41
42// Forward declarations
47
48 class IFanCalculator;
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; }
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
181 //int m_HalfNumberOfFans; removed because unused. DM 2015-07-30
186
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
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