ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
FPTracker::DipoleBender Class Reference

#include <DipoleBender.h>

Inheritance diagram for FPTracker::DipoleBender:
Collaboration diagram for FPTracker::DipoleBender:

Public Types

typedef std::shared_ptr< IBenderConstPtr_t
 

Public Member Functions

 DipoleBender (Bendplane, double length, double strength, double pbeam0, int side)
 
void bend (IParticle &) const
 
std::string label () const
 
std::shared_ptr< IBenderclone () const
 

Private Attributes

Bendplane m_bendplane
 
double m_length
 
double m_strength
 
double m_pbeam0
 
double m_dside
 

Static Private Attributes

static const std::string s_label = "DiplBender"
 

Detailed Description

Definition at line 14 of file DipoleBender.h.

Member Typedef Documentation

◆ ConstPtr_t

typedef std::shared_ptr< IBender > FPTracker::IBender::ConstPtr_t
inherited

Definition at line 18 of file FPTracker/FPTracker/IBender.h.

Constructor & Destructor Documentation

◆ DipoleBender()

FPTracker::DipoleBender::DipoleBender ( Bendplane  bendplane,
double  length,
double  strength,
double  pbeam0,
int  side 
)

Definition at line 14 of file DipoleBender.cxx.

20  :
21  m_bendplane(bendplane),
22  m_length(magnetLength),
24  m_pbeam0(pbeam0),
25  m_dside(side==0 ? -1.:1.){
26  }

Member Function Documentation

◆ bend()

void FPTracker::DipoleBender::bend ( IParticle particle) const
virtual

Implements FPTracker::IBender.

Definition at line 33 of file DipoleBender.cxx.

33  {
34 
35  // -- DIPOLE MAGNET
36  // tandir is in x,y,z bearing in mind the sign of z/
37  // But the magnet strength is stored as its effect on dx/ds or dy/ds.
38  // bend = magnet strength, corrected for momentum, = bend for this proton.
39  // dzc = length of magnet, signed
40  // position[i] = New displ. = old + effect of gradient + effect of bend.
41  // position[i-1] = old displacement + effect of gradient in non-bending plane.
42 
43  // calculates new x, y coordinates and direction after deflection
44 
45  Point& position = particle.position();
46  Point& direction = particle.direction();
47 
48  double tandir = direction[m_bendplane]/direction[2] ;
49  double bend = m_strength*m_pbeam0/particle.momentum();
50  double dzc = m_length*m_dside;
51 
52  //std::cout<<"dir [2] from DipoleBender "<<direction[2]<<'\n';
53 
54  position[m_bendplane] += dzc*tandir +(dzc/m_dside)*std::tan(0.5*bend) ;
55  position[1-m_bendplane] += dzc*direction[1-m_bendplane]/direction[2];
56  direction[m_bendplane] = (tandir*m_dside +std::tan(bend))/(1.-m_dside*tandir*std::tan(bend)); //update part. angles
57  direction[m_bendplane] = direction[m_bendplane]/std::sqrt(1. + direction[m_bendplane]*direction[m_bendplane]) ;
58 
59  // tan(new angle) = tan(sum of orig. angle + angle of bend)
60  // Then we turn it into the sine, e.g. dx/ds (perhaps unncessarily)
61 
62  // If main bending magnet, the local coord system must be redefined.
63  // Rotate wrt the local lab coords if necessary, and return to lab frame.
64  // The main bends are curved, so we must do this before evaluating the aperture.
65  if(m_length > 10.){ // Identifies MB magnet.
66  direction[0] -= m_strength; // Rotates the coords.
67  position[0] -= 0.5*m_strength*m_length;
68  // Shifts coord system laterally.
69  }
70 
71  }

◆ clone()

IBender::ConstPtr_t FPTracker::DipoleBender::clone ( ) const

Definition at line 28 of file DipoleBender.cxx.

28  {
30  return ib;
31  }

◆ label()

std::string FPTracker::DipoleBender::label ( ) const
virtual

Implements FPTracker::IBender.

Definition at line 74 of file DipoleBender.cxx.

74 {return s_label;}

Member Data Documentation

◆ m_bendplane

Bendplane FPTracker::DipoleBender::m_bendplane
private

Definition at line 31 of file DipoleBender.h.

◆ m_dside

double FPTracker::DipoleBender::m_dside
private

Definition at line 35 of file DipoleBender.h.

◆ m_length

double FPTracker::DipoleBender::m_length
private

Definition at line 32 of file DipoleBender.h.

◆ m_pbeam0

double FPTracker::DipoleBender::m_pbeam0
private

Definition at line 34 of file DipoleBender.h.

◆ m_strength

double FPTracker::DipoleBender::m_strength
private

Definition at line 33 of file DipoleBender.h.

◆ s_label

const std::string FPTracker::DipoleBender::s_label = "DiplBender"
staticprivate

Definition at line 30 of file DipoleBender.h.


The documentation for this class was generated from the following files:
FPTracker::DipoleBender::DipoleBender
DipoleBender(Bendplane, double length, double strength, double pbeam0, int side)
Definition: DipoleBender.cxx:14
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
FPTracker::IBender::ConstPtr_t
std::shared_ptr< IBender > ConstPtr_t
Definition: FPTracker/FPTracker/IBender.h:18
PlotCalibFromCool.ib
ib
Definition: PlotCalibFromCool.py:419
FPTracker::DipoleBender::m_dside
double m_dside
Definition: DipoleBender.h:35
TRT::Hit::side
@ side
Definition: HitInfo.h:83
FPTracker::DipoleBender::m_pbeam0
double m_pbeam0
Definition: DipoleBender.h:34
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
FPTracker::DipoleBender::s_label
static const std::string s_label
Definition: DipoleBender.h:30
ChargedTracksWeightFilter::Spline::Point
Linear spline representation of a function used to calculate weights.
Definition: ChargedTracksWeightFilter.h:28
FPTracker::DipoleBender::m_length
double m_length
Definition: DipoleBender.h:32
FPTracker::DipoleBender::m_strength
double m_strength
Definition: DipoleBender.h:33
FPTracker::magnetStrength
double magnetStrength(int type, double length, double strength, double Brho)
Definition: magnetStrength.cxx:8
FPTracker::DipoleBender::bend
void bend(IParticle &) const
Definition: DipoleBender.cxx:33
FPTracker::DipoleBender::m_bendplane
Bendplane m_bendplane
Definition: DipoleBender.h:31