BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
ResultEventTree.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 COMPRESULTEVENTTREE_H
19#define COMPRESULTEVENTTREE_H
20
21#include "Result.hh"
22#include "ResultEvent.hh"
23
24#include <sstream>
25#include <string>
26
34{
35public:
36 int t1NEntries;
37 int t2NEntries;
38 std::vector<int> offendingEvents;
39 std::vector<ResultEvent> eventResults;
40
41 virtual std::string print() const
42 {
43 std::stringstream ss;
44 ss << Result::print();
45 ss << "Event Tree (1/2) entries (" << t1NEntries << "/" << t2NEntries << ")\n";
46 ss << "Offending event numbers: ";
47 for (const auto& eventNo : offendingEvents)
48 {ss << eventNo << " ";}
49 for (const auto& eventResult : eventResults)
50 {
51 if (!eventResult.passed)
52 {ss << eventResult.print();}
53 }
54 ss << "\n";
55 return ss.str();
56 }
57
58 virtual ~ResultEventTree(){}
59};
60
61#endif
Result of comparison of all entries in 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