Geant4-11
Static Public Member Functions
G4DriverReporter Class Reference

#include <G4DriverReporter.hh>

Static Public Member Functions

static void PrintStat_Aux (const G4FieldTrack &aFieldTrack, G4double requestStep, G4double actualStep, G4int subStepNo, G4double subStepSize, G4double dotVelocities)
 
static void PrintStatus (const G4double *StartArr, G4double xstart, const G4double *CurrentArr, G4double xcurrent, G4double requestStep, unsigned int subStepNo, unsigned int noIntegrationVariables)
 
static void PrintStatus (const G4FieldTrack &StartFT, const G4FieldTrack &CurrentFT, G4double requestStep, unsigned int subStepNo)
 

Detailed Description

Definition at line 41 of file G4DriverReporter.hh.

Member Function Documentation

◆ PrintStat_Aux()

void G4DriverReporter::PrintStat_Aux ( const G4FieldTrack aFieldTrack,
G4double  requestStep,
G4double  actualStep,
G4int  subStepNo,
G4double  subStepSize,
G4double  dotVelocities 
)
static

Definition at line 136 of file G4DriverReporter.cc.

142{
143 const G4ThreeVector Position = aFieldTrack.GetPosition();
144 const G4ThreeVector UnitVelocity = aFieldTrack.GetMomentumDir();
145
146 G4int oldprec= G4cout.precision(noPrecision);
147
148 if( subStepNo >= 0)
149 {
150 G4cout << std::setw( 5) << subStepNo << " ";
151 }
152 else
153 {
154 G4cout << std::setw( 5) << "Start" << " ";
155 }
156 G4double curveLen= aFieldTrack.GetCurveLength();
157 G4cout << std::setw( 7) << curveLen;
158 // G4cout.precision(noPrecision);
159 G4cout << std::setw( prec9) << Position.x() << " "
160 << std::setw( prec9) << Position.y() << " "
161 << std::setw( prec9) << Position.z() << " "
162 << std::setw( prec8) << UnitVelocity.x() << " "
163 << std::setw( prec8) << UnitVelocity.y() << " "
164 << std::setw( prec8) << UnitVelocity.z() << " ";
165 G4cout.precision(3);
166 G4double unitMagDif = UnitVelocity.mag2()-1.0;
167 if( std::fabs( unitMagDif ) < 1.0e-15 ) { unitMagDif = 0.0; }
168 G4cout << std::setw( 8) << unitMagDif << " ";
169 G4cout.precision(6);
170 G4cout << std::setw(10) << dotVeloc_StartCurr << " ";
171 G4cout.precision(oldprec);
172 G4cout << std::setw( prec7) << aFieldTrack.GetKineticEnergy();
173 G4cout << std::setw(12) << step_len << " ";
174
175 static G4ThreadLocal G4double oldCurveLength = 0.0;
176 static G4ThreadLocal G4double oldSubStepLength = 0.0;
177 static G4ThreadLocal G4int oldSubStepNo = -1;
178
179 G4double subStep_len = 0.0;
180 if( curveLen > oldCurveLength )
181 {
182 subStep_len= curveLen - oldCurveLength;
183 }
184 else if (subStepNo == oldSubStepNo)
185 {
186 subStep_len= oldSubStepLength;
187 }
188 oldCurveLength= curveLen;
189 oldSubStepLength= subStep_len;
190
191 G4cout << std::setw(12) << subStep_len << " ";
192 G4cout << std::setw(12) << subStepSize << " ";
193 if( requestStep != -1.0 )
194 {
195 G4cout << std::setw( prec9) << requestStep << " ";
196 }
197 else
198 {
199 G4cout << std::setw( prec9) << " InitialStep " << " ";
200 }
201 G4cout << G4endl;
202}
const G4int noPrecision
const int prec9
const int prec8
const int prec7
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
double z() const
double x() const
double mag2() const
double y() const
const G4ThreeVector & GetMomentumDir() const
G4double GetCurveLength() const
G4double GetKineticEnergy() const
G4ThreeVector GetPosition() const
#define G4ThreadLocal
Definition: tls.hh:77

References G4cout, G4endl, G4ThreadLocal, G4FieldTrack::GetCurveLength(), G4FieldTrack::GetKineticEnergy(), G4FieldTrack::GetMomentumDir(), G4FieldTrack::GetPosition(), CLHEP::Hep3Vector::mag2(), noPrecision, prec7, prec8, prec9, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by PrintStatus().

◆ PrintStatus() [1/2]

void G4DriverReporter::PrintStatus ( const G4double StartArr,
G4double  xstart,
const G4double CurrentArr,
G4double  xcurrent,
G4double  requestStep,
unsigned int  subStepNo,
unsigned int  noIntegrationVariables 
)
static

Definition at line 38 of file G4DriverReporter.cc.

50{
51 G4FieldTrack StartFT(G4ThreeVector(0,0,0),
52 G4ThreeVector(0,0,0), 0., 0., 0., 0. );
53 G4FieldTrack CurrentFT (StartFT);
54
55 StartFT.LoadFromArray( StartArr, noIntegrationVariables);
56 StartFT.SetCurveLength( xstart);
57 CurrentFT.LoadFromArray( CurrentArr, noIntegrationVariables);
58 CurrentFT.SetCurveLength( xcurrent );
59
60 PrintStatus(StartFT, CurrentFT, requestStep, subStepNo );
61}
CLHEP::Hep3Vector G4ThreeVector
static void PrintStatus(const G4double *StartArr, G4double xstart, const G4double *CurrentArr, G4double xcurrent, G4double requestStep, unsigned int subStepNo, unsigned int noIntegrationVariables)

References G4FieldTrack::LoadFromArray(), PrintStatus(), and G4FieldTrack::SetCurveLength().

Referenced by G4MagInt_Driver::AccurateAdvance(), G4OldMagIntDriver::AccurateAdvance(), and PrintStatus().

◆ PrintStatus() [2/2]

void G4DriverReporter::PrintStatus ( const G4FieldTrack StartFT,
const G4FieldTrack CurrentFT,
G4double  requestStep,
unsigned int  subStepNo 
)
static

Definition at line 69 of file G4DriverReporter.cc.

73{
74 G4int verboseLevel= 2; // fVerboseLevel;
75 G4int oldPrec= G4cout.precision(noPrecision);
76 // G4cout.setf(ios_base::fixed,ios_base::floatfield);
77
78 const G4ThreeVector StartPosition= StartFT.GetPosition();
79 const G4ThreeVector StartUnitVelocity= StartFT.GetMomentumDir();
80 const G4ThreeVector CurrentPosition= CurrentFT.GetPosition();
81 const G4ThreeVector CurrentUnitVelocity= CurrentFT.GetMomentumDir();
82
83 G4double DotStartCurrentVeloc= StartUnitVelocity.dot(CurrentUnitVelocity);
84
85 G4double step_len= CurrentFT.GetCurveLength() - StartFT.GetCurveLength();
86 G4double subStepSize = step_len;
87
88 if( (subStepNo <= 1) || (verboseLevel > 3) )
89 {
90 subStepNo = - subStepNo; // To allow printing banner
91
92 G4cout << "------------------------------------------------------------------"
93 << G4endl;
94 G4cout << std::setw( 6) << " " << std::setw( 25)
95 << " G4DriverReporter: Current Position and Direction" << " "
96 << G4endl;
97 G4cout << std::setw( 5) << "Step#" << " "
98 << std::setw( prec7) << "s-curve" << " "
99 << std::setw( prec9) << "X(mm)" << " "
100 << std::setw( prec9) << "Y(mm)" << " "
101 << std::setw( prec9) << "Z(mm)" << " "
102 << std::setw( prec8) << " N_x " << " "
103 << std::setw( prec8) << " N_y " << " "
104 << std::setw( prec8) << " N_z " << " "
105 << std::setw( 6) << " N^2-1 " << " "
106 << std::setw(10) << " N(0).N " << " "
107 << std::setw( 7) << "KinEner " << " "
108 << std::setw(12) << "Track-l" << " " // Add the Sub-step ??
109 << std::setw(12) << "Step-len" << " "
110 << std::setw(12) << "Step-len" << " "
111 << std::setw( 9) << "ReqStep" << " "
112 << G4endl;
113 }
114
115 G4cout.precision(noPrecision);
116
117 if( (subStepNo <= 0) )
118 {
119 PrintStat_Aux( StartFT, requestStep, 0.,
120 0, 0.0, 1.0);
121 }
122
123 // if( verboseLevel <= 3 )
124 {
125 G4cout.precision(noPrecision);
126 PrintStat_Aux( CurrentFT, requestStep, step_len,
127 subStepNo, subStepSize, DotStartCurrentVeloc );
128 }
129 G4cout << "------------------------------------------------------------------"
130 << G4endl;
131 G4cout.precision(oldPrec);
132}
double dot(const Hep3Vector &) const
static void PrintStat_Aux(const G4FieldTrack &aFieldTrack, G4double requestStep, G4double actualStep, G4int subStepNo, G4double subStepSize, G4double dotVelocities)

References CLHEP::Hep3Vector::dot(), G4cout, G4endl, G4FieldTrack::GetCurveLength(), G4FieldTrack::GetMomentumDir(), G4FieldTrack::GetPosition(), noPrecision, prec7, prec8, prec9, and PrintStat_Aux().


The documentation for this class was generated from the following files: