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
29
30#include <array>
31#include <vector>
32
33#define LARWC_SINCOS_POLY 5
34
35struct EMECData;
36
37//#define HARDDEBUG
38
39// Forward declarations
44
45 class IFanCalculator;
47 template <typename SaggingType> class WheelFanCalculator;
48 template <typename SaggingType> class DistanceToTheNeutralFibre_OfFan;
49}
50
57{
58
62 template <typename SaggingType> friend class LArWheelCalculator_Impl::WheelFanCalculator;
63 template <typename SaggingType> friend class LArWheelCalculator_Impl::DistanceToTheNeutralFibre_OfFan;
64
65 public:
66
67 LArWheelCalculator(const EMECData & emecData, LArG4::LArWheelCalculator_t a_wheelType, int zside = 1);
68 virtual ~LArWheelCalculator();
69
72
75
76 // "Get constant" methods:
77 double GetWheelThickness() const { return m_WheelThickness; }
78 double GetdWRPtoFrontFace() const { return m_dWRPtoFrontFace; }
80 virtual LArG4::LArWheelCalculator_t type() const { return m_type; }
81 // "zShift" is the z-distance (cm) that the EM endcap is shifted
82 // (due to cabling, etc.)
83 int GetAtlasZside() const { return m_AtlasZside; }
84 double zShift() const { return m_zShift; }
85 double GetFanFoldRadius() const { return m_FanFoldRadius; }
86 double GetZeroFanPhi() const { return m_ZeroFanPhi; }
87 int GetNumberOfWaves() const { return m_NumberOfWaves; }
89 int GetNumberOfFans() const { return m_NumberOfFans; }
90
91 double GetActiveLength() const { return m_ActiveLength; }
92 double GetFanStepOnPhi() const { return m_FanStepOnPhi; }
93 double GetHalfWaveLength() const { return m_HalfWaveLength; }
94 double GetQuarterWaveLength() const { return m_QuarterWaveLength; }
95 double GetWheelRefPoint() const { return m_zWheelRefPoint; }
96 double GetFanHalfThickness() const { return m_FanHalfThickness; }
97
98 bool GetisModule() const { return m_isModule; }
99 bool GetisElectrode() const { return m_isElectrode; }
100 bool GetisInner() const { return m_isInner; }
101 bool GetisBarrette() const { return m_isBarrette; }
102 bool GetisBarretteCalib() const { return m_isBarretteCalib; }
103
104 double GetWheelInnerRadius(std::array<double,2> & rInner) const;
105 double GetWheelInnerRadius(std::array<double,3> & rInner) const;
106 void GetWheelOuterRadius(std::array<double,2> & rOuter) const;
107 void GetWheelOuterRadius(std::array<double,3> & rOuter) const;
108
109 double GetElecFocaltoWRP() const { return m_dElecFocaltoWRP; }
110 // "set constant" method:
111
112 int GetFirstFan() const { return m_FirstFan; }
113 int GetLastFan() const { return m_LastFan; }
114
115 int GetStartGapNumber() const { return m_ZeroGapNumber; }
117
120
124 double DistanceToTheNearestFan(CLHEP::Hep3Vector &p, int & out_fan_number) const;
125
129 double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const;
130
131 CLHEP::Hep3Vector NearestPointOnNeutralFibre(const CLHEP::Hep3Vector &p,
132 int fan_number) const;
133 std::vector<double> NearestPointOnNeutralFibre_asVector(const CLHEP::Hep3Vector &p,
134 int fan_number) const;
135 int GetPhiGap(const CLHEP::Hep3Vector &p) const { return GetPhiGapAndSide(p).first; }
136 int PhiGapNumberForWheel(int) const;
137 std::pair<int, int> GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const;
138 double AmplitudeOfSurface(const CLHEP::Hep3Vector& P, int side, int fan_number) const;
139
141
142 private:
144
146 bool m_SaggingOn; // !
149 std::array<double,5> m_slant_parametrization; // pol4
150 std::array<double,LARWC_SINCOS_POLY+1> m_sin_parametrization;
151 std::array<double,LARWC_SINCOS_POLY+1> m_cos_parametrization;
152 std::vector<std::vector<double> > m_sagging_parameter; // !
153
163 double m_zShift;
164
168
178 //int m_HalfNumberOfFans; removed because unused. DM 2015-07-30
183
189
190
198
199
200 // int m_fan_number; // break thread-safety -> removed DM 2015-07-30
201
202 void outer_wheel_init(const EMECData &);
203 void inner_wheel_init(const EMECData &);
204 void module_init();
205
206 public:
207
208 /*void set_m_fan_number(const int &fan_number)
209 {
210 m_fan_number = fan_number;
211 if(m_fan_number < 0) m_fan_number += m_NumberOfFans;
212 m_fan_number += m_ZeroGapNumber;
213 if(m_fan_number >= m_NumberOfFans) m_fan_number -= m_NumberOfFans;
214 }*/
215 int adjust_fan_number(int fan_number) const {
216 int res_fan_number = fan_number;
217 if(res_fan_number < 0) res_fan_number += m_NumberOfFans;
218 res_fan_number += m_ZeroGapNumber;
219 if(res_fan_number >= m_NumberOfFans) res_fan_number -= m_NumberOfFans;
220 return res_fan_number;
221 }
222
225 double parameterized_slant_angle(double) const;
226
227 private:
228
229 void parameterized_sincos(const double, double &, double &) const;
230 void parameterized_sin(const double, double &, double &) const;
231
232 private:
233
238};
239
240#if !defined(XAOD_STANDALONE) && !defined(PORTABLE_LAR_SHAPE)
241 //using the macro below we can assign an identifier (and a version)
242 //This is required and checked at compile time when you try to record/retrieve
243 CLASS_DEF(LArWheelCalculator , 900345678 , 1)
244#endif // XAOD_STANDALONE
245
246#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
bool GetisElectrode() 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