ATLAS Offline Software
Loading...
Searching...
No Matches
LArWheelCalculator_Impl::WheelFanCalculator< SaggingType > Class Template Reference

LAr wheel fan calculator, templated for sagging settings. More...

#include <WheelFanCalculator.h>

Inheritance diagram for LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >:
Collaboration diagram for LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >:

Public Member Functions

 WheelFanCalculator (LArWheelCalculator *lwc)
const LArWheelCalculatorlwc () const
Geometry methods
virtual double DistanceToTheNearestFan (CLHEP::Hep3Vector &p, int &out_fan_number) const
virtual int PhiGapNumberForWheel (int i) const
virtual std::pair< int, int > GetPhiGapAndSide (const CLHEP::Hep3Vector &p) const

Private Attributes

LArWheelCalculatorm_lwc

Detailed Description

template<typename SaggingType>
class LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >

LAr wheel fan calculator, templated for sagging settings.

Definition at line 139 of file WheelFanCalculator.h.

Constructor & Destructor Documentation

◆ WheelFanCalculator()

template<typename SaggingType>
LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >::WheelFanCalculator ( LArWheelCalculator * lwc)
inline

Definition at line 142 of file WheelFanCalculator.h.

143 : m_lwc(lwc)
144 {
145 }
const LArWheelCalculator * lwc() const

Member Function Documentation

◆ DistanceToTheNearestFan()

template<typename SaggingType>
virtual double LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >::DistanceToTheNearestFan ( CLHEP::Hep3Vector & p,
int & out_fan_number ) const
inlinevirtual

Implements LArWheelCalculator_Impl::IFanCalculator.

Definition at line 150 of file WheelFanCalculator.h.

151 {
152 static const double halfpi=M_PI/2.0;
155#ifdef HARDDEBUG
156 printf("DistanceToTheNearestFan: initial FN %4d\n", fan_number);
157#endif
158 p.rotateZ(-angle);
159 // determine search direction
161
162 const double d0 = NFDistance::calculate(lwc(), fan_number, p);
163 //lwc()->set_m_fan_number(fan_number);
164 //double d0 = lwc()->DistanceToTheNeutralFibre(p);
165
166 const int delta = (d0 < 0.) ? -1 : 1;
167 //int delta = 1; // delta = signof(d0)
168 //if(d0 < 0.) delta = -1; // search direction has been determined
169
170 const double step_angle = - lwc()->m_FanStepOnPhi * delta;
171
172 if (delta > 0) { // forward search
174 } else { // backward search
176 }
177
178 /*
179 double d1 = d0;
180 do { // search:
181 p.rotateZ(angle);
182 fan_number += delta;
183
184 d1 = NFDistance::calculate(lwc(), fan_number, p);
185 //lwc()->set_m_fan_number(fan_number);
186 //d1 = lwc()->DistanceToTheNeutralFibre(p);
187
188#ifdef HARDDEBUG
189 printf("DistanceToTheNearestFan: step FN %4d %4d\n", fan_number, lwc()->m_fan_number);
190#endif
191 } while(d0 * d1 > 0.);
192 // if signs of d1 and d0 are different, the point is between current pair
193 if(delta > 0) fan_number --;
194 */
195
196 p.rotateZ(-0.5 * step_angle);
197#ifdef HARDDEBUG
198 printf("DistanceToTheNearestFan: final FN %4d\n", fan_number);
199#endif
200
203 }
LAr wheel fan calculator, templated for sagging settings.
int adjust_fan_number(int fan_number) const
double DistanceToTheNeutralFibre(const CLHEP::Hep3Vector &p, int fan_number) const
Calculates aproximate, probably underestimate, distance to the neutral fibre of the vertical fan.
void rotate_to_nearest_fan(const LArWheelCalculator *lwc, int &fan_number, const double angle, CLHEP::Hep3Vector &p)

◆ GetPhiGapAndSide()

template<typename SaggingType>
virtual std::pair< int, int > LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >::GetPhiGapAndSide ( const CLHEP::Hep3Vector & p) const
inlinevirtual

Implements LArWheelCalculator_Impl::IFanCalculator.

Definition at line 210 of file WheelFanCalculator.h.

211 {
212 static const double halfpi=M_PI/2.0;
214
215 int fan_number = int((p.phi() - halfpi - lwc()->m_ZeroFanPhi) / lwc()->m_FanStepOnPhi);
216 const double angle = lwc()->m_FanStepOnPhi * fan_number + lwc()->m_ZeroFanPhi;
217 p1.rotateZ(-angle);
218
220
221 const double d0 = NFDistance::calculate(lwc(), fan_number, p1);
222 //lwc()->set_m_fan_number(fan_number);
223 //double d0 = lwc()->DistanceToTheNeutralFibre(p1);
224
225 double d1 = d0;
226
227 const int delta = (d0 < 0.) ? -1 : 1;
228 //int delta = 1;
229 //if(d0 < 0.) delta = -1;
230 const double step_angle = - lwc()->m_FanStepOnPhi * delta;
231 do {
232 p1.rotateZ(step_angle);
233 fan_number += delta;
235 //lwc()->set_m_fan_number(fan_number);
236 //d1 = lwc()->DistanceToTheNeutralFibre(p1);
237 } while(d0 * d1 > 0.);
238
239 if(delta > 0) fan_number --;
240 if(!lwc()->m_isElectrode) fan_number ++;
241
242 p1.rotateZ(-0.5 * step_angle);
243
246 int side = dd < 0.? -1: 1;
247#ifdef HARDDEBUG
248 printf("GetPhiGapAndSide: MFN %4d\n", a_fan_number);
249#endif
251 }

◆ lwc()

template<typename SaggingType>
const LArWheelCalculator * LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >::lwc ( ) const
inline

Definition at line 255 of file WheelFanCalculator.h.

255{ return m_lwc; };

◆ PhiGapNumberForWheel()

template<typename SaggingType>
virtual int LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >::PhiGapNumberForWheel ( int i) const
inlinevirtual

Implements LArWheelCalculator_Impl::IFanCalculator.

Definition at line 205 of file WheelFanCalculator.h.

206 {
207 return i;
208 }

Member Data Documentation

◆ m_lwc

template<typename SaggingType>
LArWheelCalculator* LArWheelCalculator_Impl::WheelFanCalculator< SaggingType >::m_lwc
private

Definition at line 258 of file WheelFanCalculator.h.


The documentation for this class was generated from the following files: