BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSOutputROOTEventSamplerS.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSOUTPUTROOTEVENTSAMPLERS_H
20#define BDSOUTPUTROOTEVENTSAMPLERS_H
21
22#include "Rtypes.h"
23#include "TObject.h"
24
25#include <string>
26#include <vector>
27
29class TTree;
30
31#ifndef __ROOTBUILD__
32#include "globals.hh"
36#endif
37
44class BDSOutputROOTEventSamplerS: public TObject
45{
46public:
47 std::string samplerName; //|| Don't split the header
48
49 int n;
50 std::vector<float> totalEnergy;
51 std::vector<float> theta;
52 std::vector<float> phi;
53 std::vector<float> rp;
54 std::vector<float> thetap;
55 std::vector<float> phip;
56 std::vector<float> p;
57 std::vector<float> T;
58
59 std::vector<float> weight;
60 std::vector<int> partID;
61 std::vector<int> parentID;
62 std::vector<int> trackID;
63 int modelID;
64 std::vector<int> turnNumber;
65
66 float S;
67
69 std::vector<int> charge;
70 std::vector<float> kineticEnergy;
71 std::vector<float> mass;
72 std::vector<float> rigidity;
73 std::vector<bool> isIon;
74 std::vector<int> ionA;
75 std::vector<int> ionZ;
76 std::vector<int> nElectrons;
78
80 std::vector<float> getKineticEnergy();
81 std::vector<float> getMass();
82 std::vector<float> getRigidity();
83 std::vector<bool> getIsIon();
84 std::vector<int> getIonA();
85 std::vector<int> getIonZ();
87
89 explicit BDSOutputROOTEventSamplerS(const std::string& samplerNameIn);
91#ifndef __ROOTBUILD__
92 void Fill(const BDSHitSamplerSphere* hit,
93 G4bool storeMass = false,
94 G4bool storeCharge = false,
95 G4bool storeElectrons = false,
96 G4bool storeRigidity = false,
97 G4bool storeKineticEnergy = false);
98#endif
99 void Fill(const BDSOutputROOTEventSamplerS* other);
100
102 inline void FillIon() {isIon = getIsIon(); ionA = getIonA(); ionZ = getIonZ();}
104
105 void SetBranchAddress(TTree*);
106 virtual void Flush();
107
108 static BDSOutputROOTParticleData* particleTable;
109
110 ClassDef(BDSOutputROOTEventSamplerS,1);
111};
112
113#endif
The information recorded from a particle impacting a sampler.
Information stored per spherical sampler per event.
std::vector< int > getIonZ()
Function to calculate on the fly the parameters.
std::vector< bool > isIon
These are not filled by default.
void FillIon()
Calculate and fill calculated variables.
std::vector< int > ionA
These are not filled by default.
std::vector< int > getIonA()
Function to calculate on the fly the parameters.
std::vector< int > charge
These are not filled by default.
std::vector< int > ionZ
These are not filled by default.
std::vector< float > rigidity
These are not filled by default.
virtual void Flush()
Clean Sampler.
std::vector< float > getKineticEnergy()
Function to calculate on the fly the parameters.
std::vector< float > kineticEnergy
These are not filled by default.
std::vector< bool > getIsIon()
Function to calculate on the fly the parameters.
std::vector< float > getMass()
Function to calculate on the fly the parameters.
std::vector< float > mass
These are not filled by default.
std::vector< float > getRigidity()
Function to calculate on the fly the parameters.
std::vector< int > nElectrons
These are not filled by default.
Geant4 particle data for particles used in simulation.
A set of spherical particle coordinates.
Full set of coordinates for association with primary vertex. Vector version.