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) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSOUTPUTROOTEVENTSAMPLERS_H
19#define BDSOUTPUTROOTEVENTSAMPLERS_H
20
21#include "Rtypes.h"
22#include "TObject.h"
23
24#include <string>
25#include <vector>
26
28class TTree;
29
30#ifndef __ROOTBUILD__
31#include "globals.hh"
35#endif
36
43class BDSOutputROOTEventSamplerS: public TObject
44{
45public:
46 std::string samplerName; //|| Don't split the header
47
48 int n;
49 std::vector<float> totalEnergy;
50 std::vector<float> theta;
51 std::vector<float> phi;
52 std::vector<float> rp;
53 std::vector<float> thetap;
54 std::vector<float> phip;
55 std::vector<float> p;
56 std::vector<float> T;
57
58 std::vector<float> weight;
59 std::vector<int> partID;
60 std::vector<int> parentID;
61 std::vector<int> trackID;
62 int modelID;
63 std::vector<int> turnNumber;
64
65 float S;
66
68 std::vector<int> charge;
69 std::vector<float> kineticEnergy;
70 std::vector<float> mass;
71 std::vector<float> rigidity;
72 std::vector<bool> isIon;
73 std::vector<int> ionA;
74 std::vector<int> ionZ;
75 std::vector<int> nElectrons;
77
79 std::vector<float> getKineticEnergy();
80 std::vector<float> getMass();
81 std::vector<float> getRigidity();
82 std::vector<bool> getIsIon();
83 std::vector<int> getIonA();
84 std::vector<int> getIonZ();
86
88 explicit BDSOutputROOTEventSamplerS(const std::string& samplerNameIn);
90#ifndef __ROOTBUILD__
91 void Fill(const BDSHitSamplerSphere* hit,
92 G4bool storeMass = false,
93 G4bool storeCharge = false,
94 G4bool storeElectrons = false,
95 G4bool storeRigidity = false,
96 G4bool storeKineticEnergy = false);
97#endif
98 void Fill(const BDSOutputROOTEventSamplerS* other);
99
101 inline void FillIon() {isIon = getIsIon(); ionA = getIonA(); ionZ = getIonZ();}
103
104 void SetBranchAddress(TTree*);
105 virtual void Flush();
106
107 static BDSOutputROOTParticleData* particleTable;
108
109 ClassDef(BDSOutputROOTEventSamplerS,1);
110};
111
112#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.