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