Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FieldTrack.cc File Reference
#include "G4FieldTrack.hh"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const G4FieldTrack &SixVec)
 

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream & os,
const G4FieldTrack & SixVec )

Definition at line 33 of file G4FieldTrack.cc.

34{
35 const G4double* SixV = SixVec.SixVector;
36 const G4int precPos= 9; // For position
37 const G4int precEp= 9; // For Energy / momentum
38 const G4int precLen= 12; // For Length along track
39 const G4int precSpin= 9; // For polarisation
40 const G4int precTime= 6; // For time of flight
41 const G4long oldpr= os.precision(precPos);
42 os << " ( ";
43 os << " X= " << SixV[0] << " " << SixV[1] << " "
44 << SixV[2] << " "; // Position
45 os.precision(precEp);
46 os << " P= " << SixV[3] << " " << SixV[4] << " "
47 << SixV[5] << " "; // Momentum
48 os << " Pmag= "
49 << G4ThreeVector(SixV[3], SixV[4], SixV[5]).mag(); // mom magnitude
50 os << " Ekin= " << SixVec.fKineticEnergy ;
51 os.precision(precLen);
52 os << " l= " << SixVec.GetCurveLength();
53 os.precision(6);
54 os << " m0= " << SixVec.fRestMass_c2;
55 os << " (Pdir-1)= " << SixVec.fMomentumDir.mag()-1.0;
56 if( SixVec.fLabTimeOfFlight > 0.0 )
57 {
58 os.precision(precTime);
59 }
60 else
61 {
62 os.precision(3);
63 }
64 os << " t_lab= " << SixVec.fLabTimeOfFlight;
65 os << " t_proper= " << SixVec.fProperTimeOfFlight ;
66 G4ThreeVector pol= SixVec.GetPolarization();
67 if( pol.mag2() > 0.0 )
68 {
69 os.precision(precSpin);
70 os << " PolV= " << pol; // SixVec.GetPolarization();
71 }
72 else
73 {
74 os << " PolV= (0,0,0) ";
75 }
76 os << " ) ";
77 os.precision(oldpr);
78 return os;
79}
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
long G4long
Definition G4Types.hh:87
int G4int
Definition G4Types.hh:85
double mag2() const
double mag() const
G4double GetCurveLength() const
G4ThreeVector GetPolarization() const