19#include "BDSOutputROOTEventLoss.hh"
22#include "CLHEP/Units/SystemOfUnits.h"
23#include "BDSHitEnergyDeposition.hh"
24#include "BDSTrajectoryPoint.hh"
25#include "BDSTrajectoryPointHit.hh"
30BDSOutputROOTEventLoss::BDSOutputROOTEventLoss():
40 storeStepLength(false),
41 storePhysicsProcesses(false)
48BDSOutputROOTEventLoss::BDSOutputROOTEventLoss(
bool storeTurnIn,
54 bool storeStepLengthIn,
55 bool storePreStepKineticEnergyIn,
56 bool storePhysicsProcessesIn):
58 storeTurn(storeTurnIn),
59 storeLinks(storeLinksIn),
60 storeModelID(storeModelIDIn),
61 storeLocal(storeLocalIn),
62 storeGlobal(storeGlobalIn),
63 storeTime(storeTimeIn),
64 storeStepLength(storeStepLengthIn),
65 storePreStepKineticEnergy(storePreStepKineticEnergyIn),
66 storePhysicsProcesses(storePhysicsProcessesIn)
72BDSOutputROOTEventLoss::~BDSOutputROOTEventLoss()
81 S.push_back ( (
float) (hit->point->
GetPostS() / CLHEP::m));
83 partID.push_back( (
int) hit->pdgID);
84 trackID.push_back( (
int) hit->trackID);
85 if (hit->parentID !=0)
86 {
parentID.push_back((
int) hit->parentID);}
95 x.push_back( (
float) (pos.x() / CLHEP::m));
96 y.push_back( (
float) (pos.y() / CLHEP::m));
97 z.push_back( (
float) (pos.z() / CLHEP::m));
102 const G4ThreeVector& pos = hit->point->GetPosition();
103 X.push_back( (
float) (pos.x() / CLHEP::m));
104 Y.push_back( (
float) (pos.y() / CLHEP::m));
105 Z.push_back( (
float) (pos.z() / CLHEP::m));
116 if (storePhysicsProcesses)
126 energy.push_back( (
float) (hit->GetEnergy() / CLHEP::GeV));
127 S.push_back ( (
float) (hit->GetSHit() / CLHEP::m));
128 weight.push_back( (
float) hit->GetWeight());
145 x.push_back( (
float) (hit->
Getx() / CLHEP::m));
146 y.push_back( (
float) (hit->
Gety() / CLHEP::m));
147 z.push_back( (
float) (hit->
Getz() / CLHEP::m));
152 X.push_back( (
float) (hit->
GetX() / CLHEP::m));
153 Y.push_back( (
float) (hit->
GetY() / CLHEP::m));
154 Z.push_back( (
float) (hit->
GetZ() / CLHEP::m));
166 if (storePhysicsProcesses)
196 postStepProcessType = other->postStepProcessType;
197 postStepProcessSubType = other->postStepProcessSubType;
200void BDSOutputROOTEventLoss::Flush()
220 postStepProcessType.clear();
221 postStepProcessSubType.clear();
Information recorded for a single piece of energy deposition.
G4double GetZ() const
Accessor for extra piece of information.
G4int GetTurnsTaken() const
Accessor for extra piece of information.
G4int GetPartID() const
Accessor for extra piece of information.
G4int GetTrackID() const
Accessor for extra piece of information.
G4double GetY() const
Accessor for extra piece of information.
G4int GetBeamlineIndex() const
Accessor for extra piece of information.
G4double GetPreStepKineticEnergy() const
Accessor for extra piece of information.
G4int GetParentID() const
Accessor for extra piece of information.
G4double Getz() const
Accessor for extra piece of information.
G4double GetX() const
Accessor for extra piece of information.
G4double Getx() const
Accessor for extra piece of information.
G4double Gety() const
Accessor for extra piece of information.
G4int GetPostStepProcessType() const
Accessor for extra piece of information.
G4double GetGlobalTime() const
Accessor for extra piece of information.
G4int GetPostStepProcessSubType() const
Accessor for extra piece of information.
G4double GetStepLength() const
Accessor for extra piece of information.
Data stored for energy deposition hits per event.
bool storePreStepKineticEnergy
Whether to store pre step kinetic energy.
std::vector< float > y
Local coordinate.
bool storeLinks
Whether to store links between Eloss and model and trajectors.
std::vector< float > preStepKineticEnergy
Kinetic energy in GeV at pre step point.
bool storeLocal
Whether to store local coordinates.
bool storeGlobal
Whether to store global coordinates.
bool storeTurn
Store turn number.
std::vector< int > modelID
Geometry model index.
std::vector< float > weight
Weight associated with loss.
bool storeTime
Whether to store global time.
std::vector< int > trackID
TrackID that created the deposit.
std::vector< int > parentID
ParentID that created the deposit.
std::vector< float > z
Local coordinate.
std::vector< float > x
Local coordinate.
std::vector< int > turn
Turn number.
std::vector< float > stepLength
Step length taken for hit.
bool storeModelID
Whether to store the beam line index.
void Fill(const BDSOutputROOTEventLoss *other)
Fill from another instance.
std::vector< float > energy
Energy deposited in step.
bool storeStepLength
Whether to store step length.
std::vector< int > partID
ParticleID that create the deposit.
std::vector< float > S
Global curvilinear S coordinate.
std::vector< float > T
Global time (time since beginning of event).
A summary trajectory object of a loss point.
G4double GetKineticEnergy() const
Accessor for the extra information links.
G4double GetPostS() const
Accessor.
G4int GetPostProcessType() const
Accessor.
G4ThreeVector GetPostPosLocal() const
Accessor.
G4int GetTurnsTaken() const
Accessor for the extra information links.
G4double GetEnergyDeposit() const
Accessor.
G4double GetPostWeight() const
Accessor.
G4int GetPostProcessSubType() const
Accessor.
G4int GetBeamLineIndex() const
Accessor.
G4double GetPostGlobalTime() const
Accessor.