BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
__w
bdsim
bdsim
analysis
PerEntryHistogramSetC.cc
1
/*
2
Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3
University of London 2001 - 2024.
4
5
This file is part of BDSIM.
6
7
BDSIM is free software: you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published
9
by the Free Software Foundation version 3 of the License.
10
11
BDSIM is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
#include "Event.hh"
20
#include "PerEntryHistogramSetC.hh"
21
22
#include "BDSOutputROOTEventSamplerC.hh"
23
#include "RBDSException.hh"
24
25
#include <set>
26
#include <string>
27
#include <vector>
28
29
30
PerEntryHistogramSetC::PerEntryHistogramSetC(
const
HistogramDefSet
* definitionIn,
31
Event
* eventIn,
32
TChain* chainIn):
33
PerEntryHistogramSet
(definitionIn, eventIn, chainIn),
34
sampler(nullptr)
35
{;}
36
37
PerEntryHistogramSetC::~PerEntryHistogramSetC()
38
{;}
39
40
void
PerEntryHistogramSetC::CheckSampler
()
41
{
42
if
(!sampler)
43
{
44
sampler =
event
->GetSamplerC(branchName +
"."
);
// cache sampler
45
if
(!sampler)
46
{
throw
RBDSException
(
"Cannot find csampler \""
+ branchName +
"\" or Model tree was not stored"
);}
47
}
48
}
49
50
void
PerEntryHistogramSetC::GetPDGIDSetFromSampler
(std::set<long long int>& setIn)
const
51
{
52
setIn.insert(sampler->partID.begin(), sampler->partID.end());
53
}
Event
Event loader.
Definition
Event.hh:50
HistogramDefSet
Specification for a set of histograms.
Definition
HistogramDefSet.hh:36
PerEntryHistogramSetC::CheckSampler
virtual void CheckSampler()
Definition
PerEntryHistogramSetC.cc:40
PerEntryHistogramSetC::GetPDGIDSetFromSampler
virtual void GetPDGIDSetFromSampler(std::set< long long int > &setIn) const
Definition
PerEntryHistogramSetC.cc:50
PerEntryHistogramSet
Histogram over a set of integers not number line.
Definition
PerEntryHistogramSet.hh:62
RBDSException
General exception with possible name of object and message.
Definition
RBDSException.hh:35
Generated on Sat Oct 18 2025 18:31:03 for BDSIM by
1.9.8