BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
RunAnalysis.cc
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#include "HistogramMeanFromFile.hh"
19#include "rebdsim.hh" // for debug __METHOD_NAME__
20#include "Run.hh"
21#include "RunAnalysis.hh"
22
23#include "TChain.h"
24
25#include <iostream>
26
27ClassImp(RunAnalysis)
28
30 Analysis("Run.", nullptr, "RunHistogramsMerged"),
31 run(nullptr)
32{;}
33
35 TChain* chainIn,
36 bool perEntryAnalysis,
37 bool debugIn):
38 Analysis("Run.", chainIn, "RunHistogramsMerged", perEntryAnalysis, debugIn),
39 run(runIn)
40{;}
41
42RunAnalysis::~RunAnalysis() noexcept
43{;}
44
46{
47 if (debug)
48 {std::cout << __METHOD_NAME__ << chain->GetEntries() << " " << std::endl;}
49
50 // loop over events
51 for (int i = 0; i < chain->GetEntries(); ++i)
52 {
53 chain->GetEntry(i);
54
55 if (i == 0)
57 else
59
60 // per event histograms
62
64 }
65}
Base class for any TTree analysis.
Definition Analysis.hh:43
bool debug
Whether debug print out is used or not.
Definition Analysis.hh:97
HistogramMeanFromFile * histoSum
Merge of per event stored histograms.
Definition Analysis.hh:96
void AccumulatePerEntryHistograms(long int entryNumber)
Accumulate means and variances for per entry histograms.
Definition Analysis.cc:110
virtual void UserProcess()
Virtual function for user to overload and use. Does nothing by default.
Definition Analysis.cc:82
Accumulator to merge pre-made per-entry histograms.
void Accumulate(BDSOutputROOTEventHistograms *hNew)
Analysis of a run.
virtual void Process()
Operate on each entry in the run tree.
Run * run
Run object that data loaded from the file will be loaded into.
Class to overlay a run from a ROOT file with.
Definition Run.hh:35
BDSOutputROOTEventHistograms * Histos
Member that ROOT can map file data to locally.
Definition Run.hh:51