ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
HyperbolaStep Class Reference

#include <HyperbolaStep.h>

Collaboration diagram for HyperbolaStep:

Public Member Functions

 HyperbolaStep (const HyperbolaStepper *stepper, InfracolorForce &string, const G4Track &track)
 
 ~HyperbolaStep ()
 
void PrepareNextStep ()
 
void Step (G4double length)
 
void Dump (G4double y[])
 
HyperbolaStepGetPrev () const
 
std::deque< StringVector >::const_iterator GetStringPtr () const
 
G4double GetFracLeft () const
 
G4bool IsBoostLimited () const
 
G4double GetMaxLength () const
 
G4double GetLength () const
 
const StringVectorGetStringOut () const
 
const G4LorentzVector & GetMomentum () const
 

Private Attributes

const HyperbolaStepperm_stepper
 
std::deque< StringVector >::const_iterator m_stringPtr
 
std::deque< StringVector >::const_iterator m_stringEnd
 
G4double m_fracLeft
 
G4ThreeVector m_position
 
G4double m_time
 
G4LorentzVector m_momentum
 
StringVector m_stringIn
 
G4double m_maxFracTaken
 
StringVector m_stringOut
 
G4double m_maxLength
 
G4double m_length
 

Detailed Description

Definition at line 17 of file HyperbolaStep.h.

Constructor & Destructor Documentation

◆ HyperbolaStep()

HyperbolaStep::HyperbolaStep ( const HyperbolaStepper stepper,
InfracolorForce string,
const G4Track &  track 
)

Definition at line 14 of file HyperbolaStep.cxx.

14  :
15  m_stepper(stepper),
16  m_stringPtr(string.GetStringVectors().begin()),
17  m_stringEnd(string.GetStringVectors().end()),
18  m_fracLeft(1.0),
19  m_position(track.GetPosition()),
20  m_time(track.GetGlobalTime()),
21  m_momentum(track.GetDynamicParticle()->Get4Momentum()),
22  m_stringIn(0,0,0,0),
23  m_maxFracTaken(1.0),
24  m_stringOut(0,0,0,0),
25  m_maxLength(0.0),
26  m_length(0.0)
27 {}

◆ ~HyperbolaStep()

HyperbolaStep::~HyperbolaStep ( )

Definition at line 29 of file HyperbolaStep.cxx.

29 {}

Member Function Documentation

◆ Dump()

void HyperbolaStep::Dump ( G4double  y[])

Definition at line 121 of file HyperbolaStep.cxx.

121  {
122  y[0] = m_position.x();
123  y[1] = m_position.y();
124  y[2] = m_position.z();
125  y[3] = m_momentum.x();
126  y[4] = m_momentum.y();
127  y[5] = m_momentum.z();
128  y[6] = m_momentum.t() - m_stepper->GetMass();
129  y[7] = m_time;
130  y[8] = m_length;
131 }

◆ GetFracLeft()

G4double HyperbolaStep::GetFracLeft ( ) const
inline

Definition at line 53 of file HyperbolaStep.h.

53 {return m_fracLeft;}

◆ GetLength()

G4double HyperbolaStep::GetLength ( ) const
inline

Definition at line 56 of file HyperbolaStep.h.

56 {return m_length;}

◆ GetMaxLength()

G4double HyperbolaStep::GetMaxLength ( ) const
inline

Definition at line 55 of file HyperbolaStep.h.

55 {return m_maxLength;}

◆ GetMomentum()

const G4LorentzVector & HyperbolaStep::GetMomentum ( ) const
inline

Definition at line 58 of file HyperbolaStep.h.

58 {return m_momentum;}

◆ GetPrev()

HyperbolaStep* HyperbolaStep::GetPrev ( ) const

◆ GetStringOut()

const StringVector & HyperbolaStep::GetStringOut ( ) const
inline

Definition at line 57 of file HyperbolaStep.h.

57 {return m_stringOut;}

◆ GetStringPtr()

std::deque< StringVector >::const_iterator HyperbolaStep::GetStringPtr ( ) const
inline

Definition at line 52 of file HyperbolaStep.h.

52 {return m_stringPtr;}

◆ IsBoostLimited()

G4bool HyperbolaStep::IsBoostLimited ( ) const
inline

Definition at line 54 of file HyperbolaStep.h.

54 {return m_maxFracTaken != 1.0;}

◆ PrepareNextStep()

void HyperbolaStep::PrepareNextStep ( )

Definition at line 31 of file HyperbolaStep.cxx.

31  {
32  if (m_stringPtr == m_stringEnd) {
33  // End of string vectors
34  m_stringIn.set(0,0,0,0);
35  m_stringOut.set(0,0,0,0);
37  } else {
38  G4double force = m_stepper->GetForce();
39  G4double mass = m_stepper->GetMass();
40 
41  // Get incoming string vector
42  m_stringIn = (*m_stringPtr) * m_fracLeft;
43  m_maxFracTaken = 1.0;
44 
45  // Find maximum remaining boost allowed for this step
46  G4double gamma0 = std::max(m_momentum * m_stepper->GetStartMomentum() / sqr(mass), 1.0);
47  G4double expRapidity0 = gamma0 + std::sqrt(sqr(gamma0) - 1);
48  G4double maxExpRapidity = std::max(m_stepper->GetMaxExpRapidity() / expRapidity0, 1.0);
49 
50  // Reduce string vector if boost too large
51  G4double tmp = 2 * force * m_stringIn.lv() * m_momentum / sqr(mass);
52  if (tmp > maxExpRapidity - 1) {
53  m_maxFracTaken = (maxExpRapidity - 1) / tmp;
55  }
56 
57  // Reflect string vector and compute maximum step length
60  }
61 }

◆ Step()

void HyperbolaStep::Step ( G4double  length)

Definition at line 63 of file HyperbolaStep.cxx.

63  {
64  //G4cout << "steplength/maxlength: " << length << " / " << m_maxLength << G4endl;
65  G4double force = m_stepper->GetForce();
66  G4double mass = m_stepper->GetMass();
67 
68  // Cut step to proper length
69  G4double fracTaken = m_maxFracTaken;
70  if (length < m_maxLength) {
71  if (length > m_length) {
72  // Calculate fraction of string vector to next-to-leading order in step length
73  G4double currMaxLength = m_maxLength - m_length;
74  for (G4int i = 0; i < 2 && currMaxLength > 0; i++) {
75  G4double r = (length - m_length) / currMaxLength;
76  m_stringIn *= r;
78  fracTaken *= r;
79  currMaxLength = (m_stringIn.lv() + m_stringOut.lv()).rho();
80  }
81  } else {
82  m_stringIn.set(0,0,0,0);
83  m_stringOut.set(0,0,0,0);
84  fracTaken = 0.0;
85  }
86  }
87  m_length = length;
88 
89  // Advance string pointer
90  m_fracLeft *= (1 - fracTaken);
91  if (m_fracLeft <= 0.0) {
93  m_fracLeft = 1.0;
94  }
95 
96  // Update position, momentum
97  G4LorentzVector dPosition = m_stringIn.lv() + m_stringOut.lv();
98  m_position += dPosition.vect();
99  G4double dTime = dPosition.t() / CLHEP::c_light;
100  m_time += dTime;
102 
103  // Field
104  if (m_stepper->GetField() != 0) {
105  G4ThreeVector p = m_position - dPosition.vect()/2;
106  G4double point[4] = {p.x(), p.y(), p.z(), m_time - dTime/2};
107  G4double field[6] = {0};
108  m_stepper->GetField()->GetFieldValue(point, field);
109  G4ThreeVector B(field[0], field[1], field[2]);
110  G4ThreeVector E(field[3], field[4], field[5]);
111  G4double charge = m_stepper->GetCharge();
112  G4ThreeVector dMomField = E * dTime + dPosition.vect().cross(B);
113  m_momentum += charge * G4LorentzVector(CLHEP::c_light * dMomField, E * dPosition.vect());
114  }
115 
116  // Renormalize 4-momentum (TODO: address possible instability)
117  m_momentum *= mass / m_momentum.m();
118 }

Member Data Documentation

◆ m_fracLeft

G4double HyperbolaStep::m_fracLeft
private

Definition at line 40 of file HyperbolaStep.h.

◆ m_length

G4double HyperbolaStep::m_length
private

Definition at line 49 of file HyperbolaStep.h.

◆ m_maxFracTaken

G4double HyperbolaStep::m_maxFracTaken
private

Definition at line 46 of file HyperbolaStep.h.

◆ m_maxLength

G4double HyperbolaStep::m_maxLength
private

Definition at line 48 of file HyperbolaStep.h.

◆ m_momentum

G4LorentzVector HyperbolaStep::m_momentum
private

Definition at line 43 of file HyperbolaStep.h.

◆ m_position

G4ThreeVector HyperbolaStep::m_position
private

Definition at line 41 of file HyperbolaStep.h.

◆ m_stepper

const HyperbolaStepper* HyperbolaStep::m_stepper
private

Definition at line 36 of file HyperbolaStep.h.

◆ m_stringEnd

std::deque<StringVector>::const_iterator HyperbolaStep::m_stringEnd
private

Definition at line 39 of file HyperbolaStep.h.

◆ m_stringIn

StringVector HyperbolaStep::m_stringIn
private

Definition at line 45 of file HyperbolaStep.h.

◆ m_stringOut

StringVector HyperbolaStep::m_stringOut
private

Definition at line 47 of file HyperbolaStep.h.

◆ m_stringPtr

std::deque<StringVector>::const_iterator HyperbolaStep::m_stringPtr
private

Definition at line 38 of file HyperbolaStep.h.

◆ m_time

G4double HyperbolaStep::m_time
private

Definition at line 42 of file HyperbolaStep.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
HyperbolaStepper::GetStartMomentum
const G4LorentzVector & GetStartMomentum() const
Definition: HyperbolaStepper.h:74
calibdata.force
bool force
Definition: calibdata.py:19
StringVector::set
void set(const G4ThreeVector &p, G4double m)
Definition: StringVector.h:74
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
HyperbolaStep::m_stringEnd
std::deque< StringVector >::const_iterator m_stringEnd
Definition: HyperbolaStep.h:39
HyperbolaStepper::GetMass
G4double GetMass() const
Definition: HyperbolaStepper.h:72
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
HyperbolaStep::m_momentum
G4LorentzVector m_momentum
Definition: HyperbolaStep.h:43
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
HyperbolaStep::m_stringPtr
std::deque< StringVector >::const_iterator m_stringPtr
Definition: HyperbolaStep.h:38
HyperbolaStep::m_maxFracTaken
G4double m_maxFracTaken
Definition: HyperbolaStep.h:46
HyperbolaStep::m_length
G4double m_length
Definition: HyperbolaStep.h:49
HyperbolaStep::m_maxLength
G4double m_maxLength
Definition: HyperbolaStep.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:92
sqr
#define sqr(t)
Definition: PolygonTriangulator.cxx:110
StringVector::reflect
StringVector reflect(const G4LorentzVector &axis) const
Definition: StringVector.h:70
HyperbolaStep::m_stringOut
StringVector m_stringOut
Definition: HyperbolaStep.h:47
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
HyperbolaStepper::GetMaxExpRapidity
G4double GetMaxExpRapidity() const
Definition: HyperbolaStepper.h:75
HyperbolaStepper::GetField
const G4ElectroMagneticField * GetField() const
Definition: HyperbolaStepper.h:71
HyperbolaStepper::GetForce
G4double GetForce() const
Definition: HyperbolaStepper.h:70
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
HyperbolaStepper::GetCharge
G4double GetCharge() const
Definition: HyperbolaStepper.h:73
charge
double charge(const T &p)
Definition: AtlasPID.h:494
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
HyperbolaStep::m_stepper
const HyperbolaStepper * m_stepper
Definition: HyperbolaStep.h:36
y
#define y
HyperbolaStep::m_stringIn
StringVector m_stringIn
Definition: HyperbolaStep.h:45
StringVector::lv
G4LorentzVector lv() const
Definition: StringVector.h:66
HyperbolaStep::m_position
G4ThreeVector m_position
Definition: HyperbolaStep.h:41
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
HyperbolaStep::m_time
G4double m_time
Definition: HyperbolaStep.h:42
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
fitman.rho
rho
Definition: fitman.py:532
HyperbolaStep::m_fracLeft
G4double m_fracLeft
Definition: HyperbolaStep.h:40