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

#include <HyperbolaStepper.h>

Inheritance diagram for HyperbolaStepper:
Collaboration diagram for HyperbolaStepper:

Public Member Functions

 HyperbolaStepper (InfracolorForce &string, const G4Track &track, const G4Field *field=0)
 
virtual ~HyperbolaStepper ()
 
virtual void Stepper (const G4double y[], const G4double[], G4double h, G4double yout[], G4double yerr[])
 
virtual G4double DistChord () const
 
virtual void ComputeRightHandSide (const G4double[], G4double[])
 
virtual G4int IntegratorOrder () const
 
G4double GetForce () const
 
const G4ElectroMagneticField * GetField () const
 
G4double GetMass () const
 
G4double GetCharge () const
 
const G4LorentzVector & GetStartMomentum () const
 
G4double GetMaxExpRapidity () const
 
G4double GetMaxLength () const
 
void Update (G4FieldTrack &fieldTrack, G4bool forceStep)
 
void SetDebug (G4bool debug)
 

Private Member Functions

void SetCurrStep (G4double length)
 

Private Attributes

InfracolorForcem_string
 
const G4ElectroMagneticField *const m_field
 
const G4double m_mass
 
const G4double m_charge
 
const G4LorentzVector m_startMomentum
 
const G4double m_maxExpRapidity
 
std::vector< HyperbolaStepm_steps
 
HyperbolaStep m_currStep
 
std::vector< HyperbolaStep >::size_type m_nPrevSteps
 
G4bool m_debug
 

Static Private Attributes

static const G4int m_NUM_VARS = 9
 

Detailed Description

Definition at line 19 of file HyperbolaStepper.h.

Constructor & Destructor Documentation

◆ HyperbolaStepper()

HyperbolaStepper::HyperbolaStepper ( InfracolorForce string,
const G4Track &  track,
const G4Field *  field = 0 
)

Definition at line 12 of file HyperbolaStepper.cxx.

16  :
17  // 9 "integration" variables:
18  // x, y, z, px, py, pz, KE, t_lab, steplength (in place of t_proper)
19  G4MagIntegratorStepper(new DummyEquation(), m_NUM_VARS),
20  m_string(string),
21  m_field(dynamic_cast<const G4ElectroMagneticField*>(field)),
22  m_mass(track.GetDynamicParticle()->GetMass()),
23  m_charge(track.GetDynamicParticle()->GetCharge()),
24  m_startMomentum(track.GetDynamicParticle()->Get4Momentum()),
26  m_steps(),
27  m_currStep(this, string, track),
28  m_nPrevSteps(0),
29  m_debug(false)
30 {
31  if (field != 0 && m_field == 0) {
32  G4Exception("HyperbolaStepper::HyperbolaStepper", "QuirkNonEM", FatalErrorInArgument, "Non-EM fields not supported");
33  }
34 
35  // Precompute steps
37  m_steps.push_back(m_currStep);
39  while (m_currStep.GetStringPtr() != string.GetStringVectors().end()) {
41  next.PrepareNextStep();
42  if (next.IsBoostLimited()) break; // don't allow 2nd+ step if it would be cut by boost limit
43  m_steps.push_back(next);
44  m_currStep = next;
46  }
47  m_nPrevSteps = m_steps.size() - 1;
48 }

◆ ~HyperbolaStepper()

HyperbolaStepper::~HyperbolaStepper ( )
virtual

Definition at line 50 of file HyperbolaStepper.cxx.

50  {
51  delete GetEquationOfMotion();
52 }

Member Function Documentation

◆ ComputeRightHandSide()

virtual void HyperbolaStepper::ComputeRightHandSide ( const  G4double[],
G4double  [] 
)
inlinevirtual

Definition at line 36 of file HyperbolaStepper.h.

36 {}

◆ DistChord()

G4double HyperbolaStepper::DistChord ( ) const
virtual

Definition at line 85 of file HyperbolaStepper.cxx.

85  {
86  // TODO
87  return 0;
88 }

◆ GetCharge()

G4double HyperbolaStepper::GetCharge ( ) const
inline

Definition at line 73 of file HyperbolaStepper.h.

73 {return m_charge;}

◆ GetField()

const G4ElectroMagneticField * HyperbolaStepper::GetField ( ) const
inline

Definition at line 71 of file HyperbolaStepper.h.

71 {return m_field;}

◆ GetForce()

G4double HyperbolaStepper::GetForce ( ) const
inline

Definition at line 70 of file HyperbolaStepper.h.

70 {return m_string.GetStringForce();}

◆ GetMass()

G4double HyperbolaStepper::GetMass ( ) const
inline

Definition at line 72 of file HyperbolaStepper.h.

72 {return m_mass;}

◆ GetMaxExpRapidity()

G4double HyperbolaStepper::GetMaxExpRapidity ( ) const
inline

Definition at line 75 of file HyperbolaStepper.h.

75 {return m_maxExpRapidity;}

◆ GetMaxLength()

G4double HyperbolaStepper::GetMaxLength ( ) const
inline

Definition at line 77 of file HyperbolaStepper.h.

77 {return m_steps.back().GetMaxLength();}

◆ GetStartMomentum()

const G4LorentzVector & HyperbolaStepper::GetStartMomentum ( ) const
inline

Definition at line 74 of file HyperbolaStepper.h.

74 {return m_startMomentum;}

◆ IntegratorOrder()

virtual G4int HyperbolaStepper::IntegratorOrder ( ) const
inlinevirtual

Definition at line 37 of file HyperbolaStepper.h.

37 {return 1;}

◆ SetCurrStep()

void HyperbolaStepper::SetCurrStep ( G4double  length)
private

Definition at line 54 of file HyperbolaStepper.cxx.

54  {
55  if (m_currStep.GetLength() == length) return;
56  std::vector<HyperbolaStep>::size_type i = 0;
57  while (i+1 < m_steps.size() && m_steps[i+1].GetLength() < length) i++;
58  m_currStep = m_steps[i];
60  m_nPrevSteps = i;
61 }

◆ SetDebug()

void HyperbolaStepper::SetDebug ( G4bool  debug)
inline

Definition at line 79 of file HyperbolaStepper.h.

79 {m_debug = debug;}

◆ Stepper()

void HyperbolaStepper::Stepper ( const G4double  y[],
const  G4double[],
G4double  h,
G4double  yout[],
G4double  yerr[] 
)
virtual

Definition at line 63 of file HyperbolaStepper.cxx.

69  {
70  G4int maxvar = GetNumberOfStateVariables();
71  for (G4int i = 0; i < maxvar; i++) yout[i] = y[i];
72 
73  if (m_debug) G4cout << "HyperbolaStepper: asked to move " << h << G4endl;
74  if (m_debug) G4cout << "HyperbolaStepper: start = " << y[0] << ", " << y[1] << ", " << y[2] << " [" << y[8] << "]" << G4endl;
75 
76  SetCurrStep(y[8] + h);
77  m_currStep.Dump(yout);
78 
79  if (m_debug) G4cout << "HyperbolaStepper: end = " << yout[0] << ", " << yout[1] << ", " << yout[2] << " [" << yout[8] << "]" << G4endl;
80 
81  // TODO: Errors
82  for (G4int i = 0; i < m_NUM_VARS; i++) yerr[i] = 0;
83 }

◆ Update()

void HyperbolaStepper::Update ( G4FieldTrack &  fieldTrack,
G4bool  forceStep 
)

Definition at line 90 of file HyperbolaStepper.cxx.

90  {
91  if (forceStep) {
92  // Propagator refused to take step through detector geometry because length too short;
93  // take step ourselves and update string state and quirk 4-momentum only (don't change position)
94  m_currStep = m_steps.back();
96  m_nPrevSteps = m_steps.size() - 1;
97  G4LorentzVector p = m_currStep.GetMomentum();
98  fieldTrack.UpdateFourMomentum(p.t() - m_mass, p.vect().unit());
99  } else {
100  SetCurrStep(fieldTrack.GetProperTimeOfFlight());
101  }
102 
103  // Update string vectors
105  for (std::vector<HyperbolaStep>::size_type i = 0; i < m_nPrevSteps; i++) {
106  if (m_debug) G4cout << "HyperbolaStepper: pushing vector " << m_steps[i].GetStringOut().lv() << G4endl;
107  m_string.GetReactionForce()->PushStringVector(m_steps[i].GetStringOut());
108  }
109  if (m_debug) G4cout << "HyperbolaStepper: pushing vector " << m_currStep.GetStringOut().lv() << G4endl;
111 }

Member Data Documentation

◆ m_charge

const G4double HyperbolaStepper::m_charge
private

Definition at line 57 of file HyperbolaStepper.h.

◆ m_currStep

HyperbolaStep HyperbolaStepper::m_currStep
private

Definition at line 62 of file HyperbolaStepper.h.

◆ m_debug

G4bool HyperbolaStepper::m_debug
private

Definition at line 65 of file HyperbolaStepper.h.

◆ m_field

const G4ElectroMagneticField* const HyperbolaStepper::m_field
private

Definition at line 55 of file HyperbolaStepper.h.

◆ m_mass

const G4double HyperbolaStepper::m_mass
private

Definition at line 56 of file HyperbolaStepper.h.

◆ m_maxExpRapidity

const G4double HyperbolaStepper::m_maxExpRapidity
private

Definition at line 59 of file HyperbolaStepper.h.

◆ m_nPrevSteps

std::vector<HyperbolaStep>::size_type HyperbolaStepper::m_nPrevSteps
private

Definition at line 63 of file HyperbolaStepper.h.

◆ m_NUM_VARS

const G4int HyperbolaStepper::m_NUM_VARS = 9
staticprivate

Definition at line 52 of file HyperbolaStepper.h.

◆ m_startMomentum

const G4LorentzVector HyperbolaStepper::m_startMomentum
private

Definition at line 58 of file HyperbolaStepper.h.

◆ m_steps

std::vector<HyperbolaStep> HyperbolaStepper::m_steps
private

Definition at line 61 of file HyperbolaStepper.h.

◆ m_string

InfracolorForce& HyperbolaStepper::m_string
private

Definition at line 54 of file HyperbolaStepper.h.


The documentation for this class was generated from the following files:
InfracolorForce::GetStringForce
G4double GetStringForce() const
Definition: InfracolorForce.h:98
HyperbolaStep::GetStringOut
const StringVector & GetStringOut() const
Definition: HyperbolaStep.h:57
HyperbolaStep::GetLength
G4double GetLength() const
Definition: HyperbolaStep.h:56
HyperbolaStep::GetStringPtr
std::deque< StringVector >::const_iterator GetStringPtr() const
Definition: HyperbolaStep.h:52
HyperbolaStepper::m_startMomentum
const G4LorentzVector m_startMomentum
Definition: HyperbolaStepper.h:58
DummyEquation
Definition: DummyEquation.h:14
HyperbolaStepper::m_field
const G4ElectroMagneticField *const m_field
Definition: HyperbolaStepper.h:55
HyperbolaStepper::m_nPrevSteps
std::vector< HyperbolaStep >::size_type m_nPrevSteps
Definition: HyperbolaStepper.h:63
HyperbolaStep::GetFracLeft
G4double GetFracLeft() const
Definition: HyperbolaStep.h:53
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
HyperbolaStepper::m_currStep
HyperbolaStep m_currStep
Definition: HyperbolaStepper.h:62
HyperbolaStepper::m_maxExpRapidity
const G4double m_maxExpRapidity
Definition: HyperbolaStepper.h:59
InfracolorForce::PopTo
void PopTo(std::deque< StringVector >::const_iterator stringPtr, G4double fracLeft)
Definition: InfracolorForce.cxx:72
InfracolorForce::PushStringVector
void PushStringVector(const StringVector &v)
Definition: InfracolorForce.cxx:95
HyperbolaStep::GetMaxLength
G4double GetMaxLength() const
Definition: HyperbolaStep.h:55
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
HyperbolaStep::GetMomentum
const G4LorentzVector & GetMomentum() const
Definition: HyperbolaStep.h:58
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
HyperbolaStepper::SetCurrStep
void SetCurrStep(G4double length)
Definition: HyperbolaStepper.cxx:54
lumiFormat.i
int i
Definition: lumiFormat.py:85
InfracolorForce::GetReactionForce
const InfracolorForce * GetReactionForce() const
Definition: InfracolorForce.h:64
HyperbolaStepper::m_mass
const G4double m_mass
Definition: HyperbolaStepper.h:56
HyperbolaStepper::GetMaxExpRapidity
G4double GetMaxExpRapidity() const
Definition: HyperbolaStepper.h:75
HyperbolaStepper::m_steps
std::vector< HyperbolaStep > m_steps
Definition: HyperbolaStepper.h:61
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
HyperbolaStepper::m_string
InfracolorForce & m_string
Definition: HyperbolaStepper.h:54
HyperbolaStep::Dump
void Dump(G4double y[])
Definition: HyperbolaStep.cxx:121
HyperbolaStepper::m_charge
const G4double m_charge
Definition: HyperbolaStepper.h:57
y
#define y
h
HyperbolaStepper::m_NUM_VARS
static const G4int m_NUM_VARS
Definition: HyperbolaStepper.h:52
StringVector::lv
G4LorentzVector lv() const
Definition: StringVector.h:66
HyperbolaStep::Step
void Step(G4double length)
Definition: HyperbolaStep.cxx:63
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
HyperbolaStepper::m_debug
G4bool m_debug
Definition: HyperbolaStepper.h:65
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
HyperbolaStep::PrepareNextStep
void PrepareNextStep()
Definition: HyperbolaStep.cxx:31
HyperbolaStep
Definition: HyperbolaStep.h:17