BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSOutputROOT.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 BDSOUTPUTROOT_H
19#define BDSOUTPUTROOT_H
20
21#include "BDSOutput.hh"
22
23#include "globals.hh"
24
25#include "Rtypes.h"
26
27class TFile;
28class TTree;
29
37{
38public:
40 BDSOutputROOT() = delete;
41
44 BDSOutputROOT(const G4String& fileName,
45 G4int fileNumberOffset,
46 G4int compressionLevelIn = -1);
47 virtual ~BDSOutputROOT();
48
49 virtual void NewFile();
50 virtual void CloseFile();
51
53 virtual void UpdateSamplers();
54private:
56 virtual void WriteHeader();
57
59 virtual void WriteHeaderEndOfFile();
60
62 virtual void WriteParticleData();
63
65 virtual void WriteBeam();
66
68 virtual void WriteOptions();
69
71 virtual void WriteModel();
72
75 virtual void WriteFileEventLevel();
76
79 virtual void WriteFileRunLevel();
80
83 void Close();
84
94};
95
96#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 WriteHeaderEndOfFile()
Overwrite contents of header in the 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:72