24#include "ResultEvent.hh"
26#include "BDSOutputROOTEventSampler.hh"
42 const static double Chi2Tolerance = 40;
43 const static double TreeTolerance = 0.05;
44 const static double OpticsSimgaTolerance = 10;
45 const static double EventTreeTolerance = 1e-10;
48 std::vector<Result*>
Files(TFile* f1, TFile* f2);
55 std::vector<Result*>& results);
58 void Histograms(TH1* h1, TH1* h2, std::vector<Result*>& results);
61 void Trees(TTree* t1, TTree* t2, std::vector<Result*>& results);
65 void Optics(TTree* t1, TTree* t2, std::vector<Result*>& results);
67 void EventTree(TTree* t1, TTree* t2, std::vector<Result*>& results,
68 const std::vector<std::string>& samplerNames,
69 const std::vector<std::string>& samplerCNames,
70 const std::vector<std::string>& samplerSNames);
84 bool Diff(
const std::vector<T>& v1, std::vector<T>& v2,
int i) {
return std::abs(v1[i] - v2[i]) > (T)EventTreeTolerance;}
86 bool Diff(
const std::vector<bool>& v1, std::vector<bool>& v2,
int i) {
return v1[i] != v2[i];}
89 bool Diff(T v1, T v2) {
return std::abs(v1 - v2) > (T)Compare::EventTreeTolerance;}
91 bool Diff(
bool v1,
bool v2) {
return v1 != v2;}
98 bool Summarise(
const std::vector<Result*>& results);
103 bool IsInVector(std::string key,
const std::vector<std::string>& vec);
105 inline bool NanOrInf(
const double& val) {
return std::isnan(val) || std::isinf(val);}
107 inline bool GTEZero(
const double& val) {
return val >= 0;}
108 inline bool LTZero(
const double& val) {
return val < 0;}
Information stored per sampler per event.
Result of comparison of single entry of an Event tree in BDSIM output.
Comparison utility functions.
std::vector< Result * > Files(TFile *f1, TFile *f2)
Compare two files.
void Trees(TTree *t1, TTree *t2, std::vector< Result * > &results)
Compare two TTrees.
bool Summarise(const std::vector< Result * > &results)
Loop over results and print any failed ones. Returns true if all passed.
bool Diff(const std::vector< T > &v1, std::vector< T > &v2, int i)
Return true if they're different.
bool hasPrimaries
Bool for checking if primaries were written to file.
void PrintNoMatching(std::string className, std::string objectName)
void Histograms(TH1 *h1, TH1 *h2, std::vector< Result * > &results)
Compare two histogams.
void Directories(TDirectory *d1, TDirectory *d2, std::vector< Result * > &results)
void Optics(TTree *t1, TTree *t2, std::vector< Result * > &results)
bool StringStartsWith(std::string aString, std::string prefix)
Check whether a string is prefixed with another string.