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