BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Data Fields | Static Public Attributes
BDSOutputROOTEventSampler< U > Class Template Reference

Information stored per sampler per event. More...

#include <BDSOutputROOTEventSampler.hh>

Inheritance diagram for BDSOutputROOTEventSampler< U >:
Inheritance graph
Collaboration diagram for BDSOutputROOTEventSampler< U >:
Collaboration graph

Public Member Functions

 BDSOutputROOTEventSampler (std::string samplerNameIn)
 
void Fill (const BDSHitSampler *hit, G4bool storeMass=false, G4bool storeCharge=false, G4bool storePolarCoords=false, G4bool storeElectrons=false, G4bool storeRigidity=false, G4bool storeKineticEnergy=false)
 
void Fill (const BDSParticleCoordsFull &coords, G4double momentumIn, G4double charge, G4int pdgID, G4int turnsTaken, G4int beamlineIndex, G4int nElectronsIn, G4double massIn, G4double rigidityIn, G4bool fillIon=true, G4bool *isIon=nullptr, G4int *ionA=nullptr, G4int *ionZ=nullptr)
 
void FillPolarCoords (const BDSParticleCoordsFull &coords)
 Calculate polar coords and fill. More...
 
void Fill (const BDSPrimaryVertexInformationV *vertexInfos, const G4int turnsTaken)
 Fill a vertex directly. More...
 
void Fill (const BDSOutputROOTEventSampler< U > *other)
 
void SetBranchAddress (TTree *)
 
virtual void Flush ()
 Clean Sampler. More...
 
 ClassDef (BDSOutputROOTEventSampler, 5)
 
std::vector< U > getKineticEnergy ()
 Function to calculate on the fly the parameters. More...
 
std::vector< U > getMass ()
 Function to calculate on the fly the parameters. More...
 
std::vector< U > getRigidity ()
 Function to calculate on the fly the parameters. More...
 
std::vector< bool > getIsIon ()
 Function to calculate on the fly the parameters. More...
 
std::vector< int > getIonA ()
 Function to calculate on the fly the parameters. More...
 
std::vector< int > getIonZ ()
 Function to calculate on the fly the parameters. More...
 
void FillIon ()
 Calculate and fill calculated variables. More...
 

Data Fields

std::string samplerName
 
int n
 
std::vector< U > energy
 
std::vector< U > x
 
std::vector< U > y
 
z
 
std::vector< U > xp
 
std::vector< U > yp
 
std::vector< U > zp
 
std::vector< U > p
 
std::vector< U > T
 
std::vector< U > weight
 
std::vector< int > partID
 
std::vector< int > parentID
 
std::vector< int > trackID
 
int modelID
 
std::vector< int > turnNumber
 
S
 
std::vector< U > r
 
std::vector< U > rp
 
std::vector< U > phi
 
std::vector< U > phip
 
std::vector< U > theta
 
std::vector< int > charge
 These are not filled by default. More...
 
std::vector< U > kineticEnergy
 These are not filled by default. More...
 
std::vector< U > mass
 These are not filled by default. More...
 
std::vector< U > rigidity
 These are not filled by default. More...
 
std::vector< bool > isIon
 These are not filled by default. More...
 
std::vector< int > ionA
 These are not filled by default. More...
 
std::vector< int > ionZ
 These are not filled by default. More...
 
std::vector< int > nElectrons
 These are not filled by default. More...
 

Static Public Attributes

static BDSOutputROOTParticleDataparticleTable = nullptr
 

Detailed Description

template<class U>
class BDSOutputROOTEventSampler< U >

Information stored per sampler per event.

Author
Stewart Boogert

Definition at line 44 of file BDSOutputROOTEventSampler.hh.

Constructor & Destructor Documentation

◆ BDSOutputROOTEventSampler()

template<class U >
BDSOutputROOTEventSampler< U >::BDSOutputROOTEventSampler ( std::string  samplerNameIn)
explicit

Definition at line 47 of file BDSOutputROOTEventSampler.cc.

◆ ~BDSOutputROOTEventSampler()

template<class U >
BDSOutputROOTEventSampler< U >::~BDSOutputROOTEventSampler
virtual

Definition at line 54 of file BDSOutputROOTEventSampler.cc.

Member Function Documentation

◆ Fill() [1/4]

template<class U >
void BDSOutputROOTEventSampler< U >::Fill ( const BDSHitSampler hit,
G4bool  storeMass = false,
G4bool  storeCharge = false,
G4bool  storePolarCoords = false,
G4bool  storeElectrons = false,
G4bool  storeRigidity = false,
G4bool  storeKineticEnergy = false 
)

Definition at line 59 of file BDSOutputROOTEventSampler.cc.

◆ Fill() [2/4]

template<class U >
void BDSOutputROOTEventSampler< U >::Fill ( const BDSOutputROOTEventSampler< U > *  other)

Definition at line 219 of file BDSOutputROOTEventSampler.cc.

◆ Fill() [3/4]

template<class U >
void BDSOutputROOTEventSampler< U >::Fill ( const BDSParticleCoordsFull coords,
G4double  momentumIn,
G4double  charge,
G4int  pdgID,
G4int  turnsTaken,
G4int  beamlineIndex,
G4int  nElectronsIn,
G4double  massIn,
G4double  rigidityIn,
G4bool  fillIon = true,
G4bool *  isIon = nullptr,
G4int *  ionA = nullptr,
G4int *  ionZ = nullptr 
)

Used for filling primary coordinates only. Optional arguments allow us to fill ion information when a particle table is not available. All must be defined to use them.

Definition at line 110 of file BDSOutputROOTEventSampler.cc.

◆ Fill() [4/4]

template<class U >
void BDSOutputROOTEventSampler< U >::Fill ( const BDSPrimaryVertexInformationV vertexInfos,
const G4int  turnsTaken 
)

Fill a vertex directly.

Definition at line 198 of file BDSOutputROOTEventSampler.cc.

References BDSOutputROOTParticleData::Fill(), and BDSPrimaryVertexInformationV::vertices.

Here is the call graph for this function:

◆ FillIon()

template<class U >
void BDSOutputROOTEventSampler< U >::FillIon ( )
inline

◆ FillPolarCoords()

template<class U >
void BDSOutputROOTEventSampler< U >::FillPolarCoords ( const BDSParticleCoordsFull coords)

Calculate polar coords and fill.

Definition at line 160 of file BDSOutputROOTEventSampler.cc.

◆ Flush()

template<class U >
void BDSOutputROOTEventSampler< U >::Flush
virtual

Clean Sampler.

Definition at line 262 of file BDSOutputROOTEventSampler.cc.

Referenced by BDSOutputStructures::ClearStructuresEventLevel(), and Event::Flush().

Here is the caller graph for this function:

◆ getIonA()

template<class U >
std::vector< int > BDSOutputROOTEventSampler< U >::getIonA

Function to calculate on the fly the parameters.

Definition at line 349 of file BDSOutputROOTEventSampler.cc.

Referenced by BDSOutputROOTEventSampler< U >::FillIon().

Here is the caller graph for this function:

◆ getIonZ()

template<class U >
std::vector< int > BDSOutputROOTEventSampler< U >::getIonZ

Function to calculate on the fly the parameters.

Definition at line 360 of file BDSOutputROOTEventSampler.cc.

Referenced by BDSOutputROOTEventSampler< U >::FillIon().

Here is the caller graph for this function:

◆ getIsIon()

template<class U >
std::vector< bool > BDSOutputROOTEventSampler< U >::getIsIon

Function to calculate on the fly the parameters.

Definition at line 333 of file BDSOutputROOTEventSampler.cc.

Referenced by BDSOutputROOTEventSampler< U >::FillIon().

Here is the caller graph for this function:

◆ getKineticEnergy()

template<class U >
std::vector< U > BDSOutputROOTEventSampler< U >::getKineticEnergy

Function to calculate on the fly the parameters.

Definition at line 300 of file BDSOutputROOTEventSampler.cc.

◆ getMass()

template<class U >
std::vector< U > BDSOutputROOTEventSampler< U >::getMass

Function to calculate on the fly the parameters.

Definition at line 311 of file BDSOutputROOTEventSampler.cc.

◆ getRigidity()

template<class U >
std::vector< U > BDSOutputROOTEventSampler< U >::getRigidity

Function to calculate on the fly the parameters.

Definition at line 322 of file BDSOutputROOTEventSampler.cc.

◆ SetBranchAddress()

template<class U >
void BDSOutputROOTEventSampler< U >::SetBranchAddress ( TTree *  )

Definition at line 259 of file BDSOutputROOTEventSampler.cc.

Field Documentation

◆ charge

template<class U >
std::vector<int> BDSOutputROOTEventSampler< U >::charge

These are not filled by default.

Definition at line 76 of file BDSOutputROOTEventSampler.hh.

◆ energy

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::energy

Definition at line 50 of file BDSOutputROOTEventSampler.hh.

◆ ionA

template<class U >
std::vector<int> BDSOutputROOTEventSampler< U >::ionA

These are not filled by default.

Definition at line 81 of file BDSOutputROOTEventSampler.hh.

Referenced by BDSOutputROOTEventSampler< U >::FillIon().

◆ ionZ

template<class U >
std::vector<int> BDSOutputROOTEventSampler< U >::ionZ

These are not filled by default.

Definition at line 82 of file BDSOutputROOTEventSampler.hh.

Referenced by BDSOutputROOTEventSampler< U >::FillIon().

◆ isIon

template<class U >
std::vector<bool> BDSOutputROOTEventSampler< U >::isIon

These are not filled by default.

Definition at line 80 of file BDSOutputROOTEventSampler.hh.

Referenced by BDSOutputROOTEventSampler< U >::FillIon().

◆ kineticEnergy

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::kineticEnergy

These are not filled by default.

Definition at line 77 of file BDSOutputROOTEventSampler.hh.

◆ mass

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::mass

These are not filled by default.

Definition at line 78 of file BDSOutputROOTEventSampler.hh.

◆ modelID

template<class U >
int BDSOutputROOTEventSampler< U >::modelID

Definition at line 64 of file BDSOutputROOTEventSampler.hh.

◆ n

template<class U >
int BDSOutputROOTEventSampler< U >::n

Definition at line 49 of file BDSOutputROOTEventSampler.hh.

◆ nElectrons

template<class U >
std::vector<int> BDSOutputROOTEventSampler< U >::nElectrons

These are not filled by default.

Definition at line 83 of file BDSOutputROOTEventSampler.hh.

◆ p

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::p

Definition at line 57 of file BDSOutputROOTEventSampler.hh.

◆ parentID

template<class U >
std::vector<int> BDSOutputROOTEventSampler< U >::parentID

Definition at line 62 of file BDSOutputROOTEventSampler.hh.

◆ particleTable

template<class U >
BDSOutputROOTParticleData * BDSOutputROOTEventSampler< U >::particleTable = nullptr
static

Definition at line 135 of file BDSOutputROOTEventSampler.hh.

◆ partID

template<class U >
std::vector<int> BDSOutputROOTEventSampler< U >::partID

Definition at line 61 of file BDSOutputROOTEventSampler.hh.

◆ phi

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::phi

Definition at line 71 of file BDSOutputROOTEventSampler.hh.

◆ phip

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::phip

Definition at line 72 of file BDSOutputROOTEventSampler.hh.

◆ r

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::r

Definition at line 69 of file BDSOutputROOTEventSampler.hh.

◆ rigidity

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::rigidity

These are not filled by default.

Definition at line 79 of file BDSOutputROOTEventSampler.hh.

◆ rp

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::rp

Definition at line 70 of file BDSOutputROOTEventSampler.hh.

◆ S

template<class U >
U BDSOutputROOTEventSampler< U >::S

Definition at line 67 of file BDSOutputROOTEventSampler.hh.

◆ samplerName

template<class U >
std::string BDSOutputROOTEventSampler< U >::samplerName

Definition at line 47 of file BDSOutputROOTEventSampler.hh.

◆ T

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::T

Definition at line 58 of file BDSOutputROOTEventSampler.hh.

◆ theta

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::theta

Definition at line 73 of file BDSOutputROOTEventSampler.hh.

◆ trackID

template<class U >
std::vector<int> BDSOutputROOTEventSampler< U >::trackID

Definition at line 63 of file BDSOutputROOTEventSampler.hh.

◆ turnNumber

template<class U >
std::vector<int> BDSOutputROOTEventSampler< U >::turnNumber

Definition at line 65 of file BDSOutputROOTEventSampler.hh.

◆ weight

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::weight

Definition at line 60 of file BDSOutputROOTEventSampler.hh.

◆ x

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::x

Definition at line 51 of file BDSOutputROOTEventSampler.hh.

◆ xp

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::xp

Definition at line 54 of file BDSOutputROOTEventSampler.hh.

◆ y

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::y

Definition at line 52 of file BDSOutputROOTEventSampler.hh.

◆ yp

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::yp

Definition at line 55 of file BDSOutputROOTEventSampler.hh.

◆ z

template<class U >
U BDSOutputROOTEventSampler< U >::z

Definition at line 53 of file BDSOutputROOTEventSampler.hh.

◆ zp

template<class U >
std::vector<U> BDSOutputROOTEventSampler< U >::zp

Definition at line 56 of file BDSOutputROOTEventSampler.hh.


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