BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSOutputROOT.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
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 BDSOUTPUTROOT_H
20#define BDSOUTPUTROOT_H
21
22#include "BDSOutput.hh"
23
24#include "globals.hh"
25
26#include "Rtypes.h"
27
28class TFile;
29class TTree;
30
38{
39public:
41 BDSOutputROOT() = delete;
42
45 BDSOutputROOT(const G4String& fileName,
46 G4int fileNumberOffset,
47 G4int compressionLevelIn = -1);
48 virtual ~BDSOutputROOT();
49
50 virtual void NewFile();
51 virtual void CloseFile();
52
54 virtual void UpdateSamplers();
55private:
57 virtual void WriteHeader();
58
60 virtual void WriteParticleData();
61
63 virtual void WriteBeam();
64
66 virtual void WriteOptions();
67
69 virtual void WriteModel();
70
73 virtual void WriteFileEventLevel();
74
77 virtual void WriteFileRunLevel();
78
81 void Close();
82
92};
93
94#endif
ROOT Event output class.
G4int compressionLevel
ROOT compression level for files.
virtual void WriteModel()
Copy model and write to file.
virtual void WriteHeader()
Copy header and write to file.
virtual void WriteFileRunLevel()
virtual void WriteParticleData()
Copy geant4 data to file.
TTree * theBeamOutputTree
Beam Tree.
virtual void UpdateSamplers()
Implementation for ROOT output. Only for link - not for regular use.
TTree * theParticleDataTree
Geant4 Data Tree.
TTree * theOptionsOutputTree
Options tree.
virtual void WriteOptions()
Copy options and write to file.
virtual void WriteBeam()
Copy beam and write to file.
TTree * theEventOutputTree
Event tree.
TTree * theModelOutputTree
Model tree.
virtual void CloseFile()
Write contents and close file.
virtual void NewFile()
Open a new file.
TTree * theRunOutputTree
Output histogram tree.
virtual void WriteFileEventLevel()
TTree * theHeaderOutputTree
Header Tree.
BDSOutputROOT()=delete
No default constructor.
TFile * theRootOutputFile
Output file.
Output base class that defines interface for all output types.
Definition: BDSOutput.hh:73