BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
ResultEvent.hh
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#ifndef COMPRESULTEVENT_H
19#define COMPRESULTEVENT_H
20
21#include "Result.hh"
22#include "ResultSampler.hh"
23
24#include <sstream>
25#include <string>
26
33class ResultEvent: public Result
34{
35public:
36 std::vector<std::string> offendingBranches;
37 std::vector<ResultSampler> samplerResults;
38
39 virtual std::string print() const
40 {
41 std::stringstream ss;
42 ss << Result::print();
43 ss << "Offending branches: ";
44 for (const auto& branchName : offendingBranches)
45 {ss << branchName << " ";}
46 ss << "\nOffending samplers: ";
47 for (const auto& samplerResult : samplerResults)
48 {
49 if (!samplerResult.passed)
50 {ss << samplerResult.print();}
51 }
52 ss << "\n";
53 return ss.str();
54 }
55
56 virtual ~ResultEvent() {}
57};
58
59#endif
Result of comparison of single entry of an Event tree in BDSIM output.
virtual std::string print() const
Print the result of the test - ie information store in the class.
Base class of a result.
Definition Result.hh:36
virtual std::string print() const
Print the result of the test - ie information store in the class.
Definition Result.hh:57