18#include "BDSOutputROOTEventAperture.hh"
19#include "BDSOutputROOTParticleData.hh"
22#include "CLHEP/Units/SystemOfUnits.h"
23#include "BDSHitApertureImpact.hh"
30BDSOutputROOTEventAperture::BDSOutputROOTEventAperture()
35BDSOutputROOTEventAperture::~BDSOutputROOTEventAperture()
40 G4bool isPrimaryFirstImpact)
43 energy.push_back((
float)hit->totalEnergy / CLHEP::GeV);
44 S.push_back((
double)hit->S / CLHEP::m);
45 weight.push_back((
float)hit->weight);
46 isPrimary.push_back(hit->parentID == 0);
48 partID.push_back((
int)hit->partID);
49 turn.push_back((
int)hit->turnsTaken);
50 x.push_back((
float)hit->x / CLHEP::m);
51 y.push_back((
float)hit->y / CLHEP::m);
52 xp.push_back((
float)hit->xp / CLHEP::rad);
53 yp.push_back((
float)hit->yp / CLHEP::rad);
54 T.push_back((
float)hit->globalTime / CLHEP::ns);
55 kineticEnergy.push_back((
float)hit->preStepKineticEnergy / CLHEP::GeV);
56 G4int pid = hit->partID;
58 G4bool isIonL =
false;
60 {isIonL = particleTable->
IsIon(pid);}
61 if (particleTable && isIonL)
63 auto& ionInfo = particleTable->GetIonInfo(pid);
64 isIon.push_back(
true);
65 ionA.push_back((
int)ionInfo.a);
66 ionZ.push_back((
int)ionInfo.z);
67 nElectrons.push_back(0);
71 G4bool isIonAgain = hit->nElectrons > 0;
72 isIon.push_back(isIonAgain);
75 nElectrons.push_back(hit->nElectrons);
78 trackID.push_back((
int)hit->trackID);
79 parentID.push_back((
int)hit->parentID);
80 modelID.push_back((
int)hit->beamlineIndex);
93 isPrimary = other->isPrimary;
103 isIon = other->isIon;
106 nElectrons = other->nElectrons;
Snapshot of information for particle passing through a collimator.
Data stored for energy deposition hits per event.
std::vector< float > kineticEnergy
Kinetic energy in GeV at pre step point.
std::vector< int > parentID
ParentID that created the deposit.
std::vector< int > turn
Turn number.
std::vector< float > energy
Total energy of particle.
std::vector< int > trackID
TrackID that created the deposit.
std::vector< bool > firstPrimaryImpact
Whether the first time the primary is passing through.
std::vector< int > modelID
Geometry model index.
std::vector< float > weight
Weight associated with loss.
std::vector< float > T
Global time (time since beginning of event).
std::vector< double > S
Global curvilinear S coordinate.
std::vector< int > partID
ParticleID that create the deposit.
Geant4 particle data for particles used in simulation.
bool IsIon(const int &pdgID) const
This doesn't count a proton (even with electrons) as an ion.