BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
PerEntryHistogramSetC.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 "Event.hh"
19#include "PerEntryHistogramSetC.hh"
20
21#include "BDSOutputROOTEventSamplerC.hh"
22#include "RBDSException.hh"
23
24#include <set>
25#include <string>
26#include <vector>
27
28
29PerEntryHistogramSetC::PerEntryHistogramSetC(const HistogramDefSet* definitionIn,
30 Event* eventIn,
31 TChain* chainIn):
32 PerEntryHistogramSet(definitionIn, eventIn, chainIn),
33 sampler(nullptr)
34{;}
35
36PerEntryHistogramSetC::~PerEntryHistogramSetC()
37{;}
38
40{
41 if (!sampler)
42 {
43 sampler = event->GetSamplerC(branchName + "."); // cache sampler
44 if (!sampler)
45 {throw RBDSException("Cannot find csampler \"" + branchName + "\" or Model tree was not stored");}
46 }
47}
48
49void PerEntryHistogramSetC::GetPDGIDSetFromSampler(std::set<long long int>& setIn) const
50{
51 setIn.insert(sampler->partID.begin(), sampler->partID.end());
52}
Event loader.
Definition Event.hh:49
Specification for a set of histograms.
virtual void GetPDGIDSetFromSampler(std::set< long long int > &setIn) const
Histogram over a set of integers not number line.
General exception with possible name of object and message.