ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
LArWheelCalculator_Impl::WheelFanCalculator< SaggingType > Class Template Reference

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

#include <LArWheelCalculator.h>

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 48 of file LArWheelCalculator.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  }

Member Function Documentation

◆ DistanceToTheNearestFan()

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

Definition at line 150 of file WheelFanCalculator.h.

151  {
152  static const double halfpi=M_PI/2.0;
153  int fan_number = int((p.phi() - halfpi - lwc()->m_ZeroFanPhi_ForDetNeaFan) / lwc()->m_FanStepOnPhi);
154  const double angle = lwc()->m_FanStepOnPhi * fan_number + lwc()->m_ZeroFanPhi_ForDetNeaFan;
155 #ifdef HARDDEBUG
156  printf("DistanceToTheNearestFan: initial FN %4d\n", fan_number);
157 #endif
158  p.rotateZ(-angle);
159  // determine search direction
160  typedef DistanceToTheNeutralFibre_OfFan<SaggingType> NFDistance;
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
173  rotate_to_nearest_fan< SaggingType, FORWARD, NFDistance >( lwc(), fan_number, step_angle, p);
174  } else { // backward search
175  rotate_to_nearest_fan< SaggingType, BACKWARD, NFDistance >( lwc(), fan_number, step_angle, p);
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 
201  out_fan_number = lwc()->adjust_fan_number(fan_number);
202  return lwc()->DistanceToTheNeutralFibre(p, out_fan_number);
203  }

◆ GetPhiGapAndSide()

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

Definition at line 210 of file WheelFanCalculator.h.

211  {
212  static const double halfpi=M_PI/2.0;
213  CLHEP::Hep3Vector p1 = p;
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 
219  typedef DistanceToTheNeutralFibre_OfFan<SaggingType> NFDistance;
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;
234  d1 = NFDistance::calculate(lwc(), fan_number, p1);
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 
244  const int a_fan_number = lwc()->adjust_fan_number(fan_number);
245  double dd = lwc()->DistanceToTheNeutralFibre(p1, a_fan_number);
246  int side = dd < 0.? -1: 1;
247 #ifdef HARDDEBUG
248  printf("GetPhiGapAndSide: MFN %4d\n", a_fan_number);
249 #endif
250  return std::pair<int, int>(a_fan_number, side);
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

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:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
M_PI
#define M_PI
Definition: ActiveFraction.h:11
dq_defect_virtual_defect_validation.d1
d1
Definition: dq_defect_virtual_defect_validation.py:79
TRT::Hit::side
@ side
Definition: HitInfo.h:83
LArWheelCalculator::adjust_fan_number
int adjust_fan_number(int fan_number) const
Definition: LArWheelCalculator.h:214
LArWheelCalculator::m_ZeroFanPhi_ForDetNeaFan
double m_ZeroFanPhi_ForDetNeaFan
Definition: LArWheelCalculator.h:172
lumiFormat.i
int i
Definition: lumiFormat.py:92
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
EMFourMomBuilder::calculate
void calculate(xAOD::Electron &electron)
Definition: EMFourMomBuilder.cxx:68
LArWheelCalculator_Impl::WheelFanCalculator::m_lwc
LArWheelCalculator * m_lwc
Definition: WheelFanCalculator.h:255
LArWheelCalculator::m_ZeroFanPhi
double m_ZeroFanPhi
Definition: LArWheelCalculator.h:171
LArWheelCalculator::m_FanStepOnPhi
double m_FanStepOnPhi
Definition: LArWheelCalculator.h:173
library_scraper.dd
list dd
Definition: library_scraper.py:46
LArWheelCalculator_Impl::WheelFanCalculator::lwc
const LArWheelCalculator * lwc() const
Definition: WheelFanCalculator.h:255
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
python.PhysicalConstants.halfpi
float halfpi
Definition: PhysicalConstants.py:51