19#include "BDSOutputROOTEventAperture.hh"
20#include "BDSOutputROOTParticleData.hh"
23#include "CLHEP/Units/SystemOfUnits.h"
24#include "BDSHitApertureImpact.hh"
31BDSOutputROOTEventAperture::BDSOutputROOTEventAperture()
36BDSOutputROOTEventAperture::~BDSOutputROOTEventAperture()
41 G4bool isPrimaryFirstImpact)
44 energy.push_back((
float)hit->totalEnergy / CLHEP::GeV);
45 S.push_back((
double)hit->S / CLHEP::m);
46 weight.push_back((
float)hit->weight);
47 isPrimary.push_back(hit->parentID == 0);
49 partID.push_back((
int)hit->partID);
50 turn.push_back((
int)hit->turnsTaken);
51 x.push_back((
float)hit->x / CLHEP::m);
52 y.push_back((
float)hit->y / CLHEP::m);
53 xp.push_back((
float)hit->xp / CLHEP::rad);
54 yp.push_back((
float)hit->yp / CLHEP::rad);
55 T.push_back((
float)hit->globalTime / CLHEP::ns);
56 kineticEnergy.push_back((
float)hit->preStepKineticEnergy / CLHEP::GeV);
57 G4int pid = hit->partID;
59 G4bool isIonL =
false;
61 {isIonL = particleTable->
IsIon(pid);}
62 if (particleTable && isIonL)
64 auto& ionInfo = particleTable->GetIonInfo(pid);
65 isIon.push_back(
true);
66 ionA.push_back((
int)ionInfo.a);
67 ionZ.push_back((
int)ionInfo.z);
68 nElectrons.push_back(0);
72 G4bool isIonAgain = hit->nElectrons > 0;
73 isIon.push_back(isIonAgain);
76 nElectrons.push_back(hit->nElectrons);
79 trackID.push_back((
int)hit->trackID);
80 parentID.push_back((
int)hit->parentID);
81 modelID.push_back((
int)hit->beamlineIndex);
94 isPrimary = other->isPrimary;
104 isIon = other->isIon;
107 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.