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

#include <InfracolorForce.h>

Collaboration diagram for InfracolorForce:

Public Member Functions

 InfracolorForce ()
 
 ~InfracolorForce ()
 
void SetReactionForce (InfracolorForce *reactionForce)
 
const InfracolorForceGetReactionForce () const
 
InfracolorForceGetReactionForce ()
 
void SetFirstStringLength (G4double firstStringLength)
 
void StartTracking (const G4Track *dest)
 
void TrackKilled ()
 
G4bool IsSourceAlive () const
 
G4bool IsSourceInitialized () const
 
G4bool HasNextStringVector () const
 
const std::deque< StringVector > & GetStringVectors () const
 
void PopTo (std::deque< StringVector >::const_iterator stringPtr, G4double fracLeft)
 
void PushStringVector (const StringVector &v)
 
void SetStringForce (G4double stringForce)
 
G4double GetStringForce () const
 
void SetMaxBoost (G4double maxBoost)
 
G4double GetMaxExpRapidity () const
 
void SetMaxMergeT (G4double maxMergeT)
 
void SetMaxMergeMag (G4double maxMergeMag)
 
G4int GetNStrings () const
 
G4LorentzVector GetSumStrings () const
 
G4ThreeVector GetAngMomentum () const
 
G4ThreeVector GetMomentOfE () const
 
void Clear ()
 

Private Member Functions

void CombineStringVector (const StringVector &v)
 

Private Attributes

G4double m_stringForce
 
InfracolorForcem_reactionForce
 
G4LorentzVector m_initU
 
G4bool m_initialized
 
G4bool m_killed
 
G4bool m_firstStep
 
std::deque< StringVectorm_stringVectors
 
StringVector m_firstString
 
StringVector m_borrowedString
 
G4double m_firstStringLength
 
G4double m_maxExpRapidity
 
G4double m_maxMergeT
 
G4double m_maxMergeMag
 

Detailed Description

Definition at line 14 of file InfracolorForce.h.

Constructor & Destructor Documentation

◆ InfracolorForce()

InfracolorForce::InfracolorForce ( )

Definition at line 10 of file InfracolorForce.cxx.

10  :
11  m_stringForce(0.0),
12  m_reactionForce(0),
13  m_initU(),
14  m_initialized(false),
15  m_killed(false),
16  m_firstStep(false),
18  m_firstString(),
21  m_maxExpRapidity(1e-3),
22  m_maxMergeT(0.0),
23  m_maxMergeMag(0.0)
24 {}

◆ ~InfracolorForce()

InfracolorForce::~InfracolorForce ( )

Definition at line 26 of file InfracolorForce.cxx.

26 {}

Member Function Documentation

◆ Clear()

void InfracolorForce::Clear ( )

Definition at line 57 of file InfracolorForce.cxx.

57  {
58  m_initU.set(0,0,0,0);
59  m_initialized = false;
60  m_killed = false;
61  m_firstStep = false;
62  m_stringVectors.clear();
63  m_firstString.set(0,0,0,0);
64  m_borrowedString.set(0,0,0,0);
65 }

◆ CombineStringVector()

void InfracolorForce::CombineStringVector ( const StringVector v)
private

Definition at line 112 of file InfracolorForce.cxx.

112  {
113  if (m_stringVectors.empty()) {
114  m_stringVectors.push_back(v);
115  } else {
116  G4LorentzVector sum = m_stringVectors.back().lv() + v.lv();
117  if (sum.t() < m_maxMergeT && sum.m2() < sqr(m_maxMergeMag)) {
118  m_stringVectors.back().set(sum.vect(), sum.m());
119  } else {
120  m_stringVectors.push_back(v);
121  }
122  }
123 }

◆ GetAngMomentum()

G4ThreeVector InfracolorForce::GetAngMomentum ( ) const

Definition at line 134 of file InfracolorForce.cxx.

134  {
135  std::deque<StringVector>::const_iterator it = m_stringVectors.begin();
136  G4LorentzVector x(0,0,0,0);
137  G4ThreeVector L(0,0,0);
138  for (; it != m_stringVectors.end(); ++it) {
139  G4LorentzVector dx = it->lv();
140  L += m_stringForce * x.vect().cross(dx.vect());
141  x += dx;
142  }
143  return L;
144 }

◆ GetMaxExpRapidity()

G4double InfracolorForce::GetMaxExpRapidity ( ) const
inline

Definition at line 107 of file InfracolorForce.h.

107  {
108  return m_maxExpRapidity;
109 }

◆ GetMomentOfE()

G4ThreeVector InfracolorForce::GetMomentOfE ( ) const

Definition at line 146 of file InfracolorForce.cxx.

146  {
147  std::deque<StringVector>::const_iterator it = m_stringVectors.begin();
148  G4LorentzVector x(0,0,0,0);
149  G4ThreeVector Excm(0,0,0);
150  for (; it != m_stringVectors.end(); ++it) {
151  G4LorentzVector dx = it->lv();
152  Excm += m_stringForce * (dx.t() * x.vect() - dx.vect() * x.t());
153  x += dx;
154  }
155  return Excm;
156 }

◆ GetNStrings()

G4int InfracolorForce::GetNStrings ( ) const
inline

Definition at line 121 of file InfracolorForce.h.

121  {
122  return m_stringVectors.size();
123 }

◆ GetReactionForce() [1/2]

InfracolorForce * InfracolorForce::GetReactionForce ( )
inline

Definition at line 68 of file InfracolorForce.h.

68  {
69  return m_reactionForce;
70 }

◆ GetReactionForce() [2/2]

const InfracolorForce * InfracolorForce::GetReactionForce ( ) const
inline

Definition at line 64 of file InfracolorForce.h.

64  {
65  return m_reactionForce;
66 }

◆ GetStringForce()

G4double InfracolorForce::GetStringForce ( ) const
inline

Definition at line 98 of file InfracolorForce.h.

98  {
99  return m_stringForce;
100 }

◆ GetStringVectors()

const std::deque< StringVector > & InfracolorForce::GetStringVectors ( ) const
inline

Definition at line 89 of file InfracolorForce.h.

89  {
90  return m_stringVectors;
91 }

◆ GetSumStrings()

G4LorentzVector InfracolorForce::GetSumStrings ( ) const

Definition at line 125 of file InfracolorForce.cxx.

125  {
126  G4LorentzVector x(0,0,0,0);
127  std::deque<StringVector>::const_iterator it = m_stringVectors.begin();
128  for (; it != m_stringVectors.end(); ++it) {
129  x += it->lv();
130  }
131  return x - m_borrowedString.lv();
132 }

◆ HasNextStringVector()

G4bool InfracolorForce::HasNextStringVector ( ) const
inline

Definition at line 85 of file InfracolorForce.h.

85  {
86  return !m_stringVectors.empty();
87 }

◆ IsSourceAlive()

G4bool InfracolorForce::IsSourceAlive ( ) const
inline

Definition at line 77 of file InfracolorForce.h.

77  {
78  return !m_reactionForce->m_killed;
79 }

◆ IsSourceInitialized()

G4bool InfracolorForce::IsSourceInitialized ( ) const
inline

Definition at line 81 of file InfracolorForce.h.

81  {
83 }

◆ PopTo()

void InfracolorForce::PopTo ( std::deque< StringVector >::const_iterator  stringPtr,
G4double  fracLeft 
)

Definition at line 72 of file InfracolorForce.cxx.

72  {
73  if (fracLeft > 1.0 || fracLeft < 0.0) {
74  Clear();
76  G4Exception("InfracolorForce::PopTo", "QuirkStringBadFraction", EventMustBeAborted, "invalid fraction of string vector");
77  }
78  if (m_firstStep) {
79  if (stringPtr == m_stringVectors.begin()) {
80  m_borrowedString = (1 - fracLeft) * m_firstString;
81  } else {
83  }
84  m_firstStep = false;
85  m_stringVectors.clear();
86  } else {
87  std::deque<StringVector>::iterator stringPtr2 = m_stringVectors.begin() + (stringPtr - m_stringVectors.begin());
88  m_stringVectors.erase(m_stringVectors.begin(), stringPtr2);
89  if (fracLeft != 1.0 && !m_stringVectors.empty()) {
90  m_stringVectors[0] *= fracLeft;
91  }
92  }
93 }

◆ PushStringVector()

void InfracolorForce::PushStringVector ( const StringVector v)

Definition at line 95 of file InfracolorForce.cxx.

95  {
96  if (v.t() == 0) return;
97  if (m_borrowedString.t() == 0) {
99  } else if (m_borrowedString.t() <= v.t()) {
100  G4double r = m_borrowedString.t() / v.t();
101  CombineStringVector((1-r) * v);
102  m_borrowedString.set(0,0,0,0);
103  } else {
104  G4double r = v.t() / m_borrowedString.t();
105  m_borrowedString *= 1-r;
106  G4Exception("InfracolorForce::PushStringVector()",
107  "BorrowedStringSplit", JustWarning,
108  "Initial step too long.");
109  }
110 }

◆ SetFirstStringLength()

void InfracolorForce::SetFirstStringLength ( G4double  firstStringLength)
inline

Definition at line 72 of file InfracolorForce.h.

72  {
73  m_firstStringLength = firstStringLength;
74  m_reactionForce->m_firstStringLength = firstStringLength;
75 }

◆ SetMaxBoost()

void InfracolorForce::SetMaxBoost ( G4double  maxBoost)
inline

Definition at line 102 of file InfracolorForce.h.

102  {
103  m_maxExpRapidity = std::sqrt((1.0 + maxBoost) / (1.0 - maxBoost));
105 }

◆ SetMaxMergeMag()

void InfracolorForce::SetMaxMergeMag ( G4double  maxMergeMag)
inline

Definition at line 116 of file InfracolorForce.h.

116  {
117  m_maxMergeMag = maxMergeMag;
118  m_reactionForce->m_maxMergeMag = maxMergeMag;
119 }

◆ SetMaxMergeT()

void InfracolorForce::SetMaxMergeT ( G4double  maxMergeT)
inline

Definition at line 111 of file InfracolorForce.h.

111  {
112  m_maxMergeT = maxMergeT;
113  m_reactionForce->m_maxMergeT = maxMergeT;
114 }

◆ SetReactionForce()

void InfracolorForce::SetReactionForce ( InfracolorForce reactionForce)
inline

Definition at line 60 of file InfracolorForce.h.

60  {
61  m_reactionForce = reactionForce;
62 }

◆ SetStringForce()

void InfracolorForce::SetStringForce ( G4double  stringForce)
inline

Definition at line 93 of file InfracolorForce.h.

93  {
94  m_stringForce = stringForce;
95  m_reactionForce->m_stringForce = stringForce;
96 }

◆ StartTracking()

void InfracolorForce::StartTracking ( const G4Track *  dest)

Definition at line 28 of file InfracolorForce.cxx.

28  {
29  if (m_reactionForce == 0) {
30  G4Exception("InfracolorForce::StartTracking", "NoAntiQuirk", FatalErrorInArgument, "InfracolorForce: No antiquirk defined");
31  }
32  if (dest->GetCurrentStepNumber() != 0) return;
33 
34  // Clear old stuff
36  Clear();
38  }
39 
40  // Set momentum
41  m_initialized = true;
42  m_initU = dest->GetDynamicParticle()->Get4Momentum();
43  m_initU /= m_initU.m();
44 
45  // Compute first string vector
47  m_firstStep = true;
48  G4double dot = m_initU * m_reactionForce->m_initU;
49  G4LorentzVector firstString = m_reactionForce->m_initU - m_initU * (dot - std::sqrt(dot*dot - 1));
50  firstString *= m_firstStringLength / firstString.t();
51  m_firstString.set(firstString.vect(), 0);
52  m_stringVectors.push_back(m_firstString);
53  // TODO: Check oscillation period
54  }
55 }

◆ TrackKilled()

void InfracolorForce::TrackKilled ( )

Definition at line 67 of file InfracolorForce.cxx.

67  {
68  //G4cout << "killed, and other killed is " << m_reactionForce->m_killed << G4endl;
69  m_killed = true;
70 }

Member Data Documentation

◆ m_borrowedString

StringVector InfracolorForce::m_borrowedString
private

Definition at line 53 of file InfracolorForce.h.

◆ m_firstStep

G4bool InfracolorForce::m_firstStep
private

Definition at line 50 of file InfracolorForce.h.

◆ m_firstString

StringVector InfracolorForce::m_firstString
private

Definition at line 52 of file InfracolorForce.h.

◆ m_firstStringLength

G4double InfracolorForce::m_firstStringLength
private

Definition at line 54 of file InfracolorForce.h.

◆ m_initialized

G4bool InfracolorForce::m_initialized
private

Definition at line 48 of file InfracolorForce.h.

◆ m_initU

G4LorentzVector InfracolorForce::m_initU
private

Definition at line 47 of file InfracolorForce.h.

◆ m_killed

G4bool InfracolorForce::m_killed
private

Definition at line 49 of file InfracolorForce.h.

◆ m_maxExpRapidity

G4double InfracolorForce::m_maxExpRapidity
private

Definition at line 55 of file InfracolorForce.h.

◆ m_maxMergeMag

G4double InfracolorForce::m_maxMergeMag
private

Definition at line 57 of file InfracolorForce.h.

◆ m_maxMergeT

G4double InfracolorForce::m_maxMergeT
private

Definition at line 56 of file InfracolorForce.h.

◆ m_reactionForce

InfracolorForce* InfracolorForce::m_reactionForce
private

Definition at line 46 of file InfracolorForce.h.

◆ m_stringForce

G4double InfracolorForce::m_stringForce
private

Definition at line 45 of file InfracolorForce.h.

◆ m_stringVectors

std::deque<StringVector> InfracolorForce::m_stringVectors
private

Definition at line 51 of file InfracolorForce.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
InfracolorForce::m_initU
G4LorentzVector m_initU
Definition: InfracolorForce.h:47
StringVector::t
G4double t() const
Definition: StringVector.h:62
InfracolorForce::m_maxExpRapidity
G4double m_maxExpRapidity
Definition: InfracolorForce.h:55
InfracolorForce::m_firstStringLength
G4double m_firstStringLength
Definition: InfracolorForce.h:54
StringVector::set
void set(const G4ThreeVector &p, G4double m)
Definition: StringVector.h:74
skel.it
it
Definition: skel.GENtoEVGEN.py:396
InfracolorForce::m_initialized
G4bool m_initialized
Definition: InfracolorForce.h:48
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
x
#define x
InfracolorForce::m_stringVectors
std::deque< StringVector > m_stringVectors
Definition: InfracolorForce.h:51
InfracolorForce::m_stringForce
G4double m_stringForce
Definition: InfracolorForce.h:45
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
InfracolorForce::CombineStringVector
void CombineStringVector(const StringVector &v)
Definition: InfracolorForce.cxx:112
sqr
#define sqr(t)
Definition: PolygonTriangulator.cxx:110
InfracolorForce::Clear
void Clear()
Definition: InfracolorForce.cxx:57
InfracolorForce::m_reactionForce
InfracolorForce * m_reactionForce
Definition: InfracolorForce.h:46
InfracolorForce::m_maxMergeT
G4double m_maxMergeT
Definition: InfracolorForce.h:56
InfracolorForce::m_killed
G4bool m_killed
Definition: InfracolorForce.h:49
InfracolorForce::m_firstString
StringVector m_firstString
Definition: InfracolorForce.h:52
python.PyAthena.v
v
Definition: PyAthena.py:154
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
InfracolorForce::m_maxMergeMag
G4double m_maxMergeMag
Definition: InfracolorForce.h:57
StringVector::lv
G4LorentzVector lv() const
Definition: StringVector.h:66
dot
Definition: dot.py:1
InfracolorForce::m_borrowedString
StringVector m_borrowedString
Definition: InfracolorForce.h:53
InfracolorForce::m_firstStep
G4bool m_firstStep
Definition: InfracolorForce.h:50