ATLAS Offline Software
Loading...
Searching...
No Matches
Result Struct Reference
Collaboration diagram for Result:

Public Member Functions

bool operator== (const Result &) const
void Print () const

Public Attributes

float value = 0
float statUp = 0
float statDown = 0
std::map< CP::SystematicVariation, float > variations

Detailed Description

Definition at line 49 of file fbtTestBasics.cxx.

Member Function Documentation

◆ operator==()

bool Result::operator== ( const Result & rhs) const

Definition at line 277 of file fbtTestBasics.cxx.

278{
279 auto compare = [&](auto x1, auto x2) -> bool
280 {
281 bool closeEnough = std::fabs(x1 - x2) < std::max(1e-5, 1e-3 * std::min(std::fabs(x1), std::fabs(x2)));;
282 if(!closeEnough)
283 {
284 std::cout << "ERROR: found different values for the equality test: " << x1 << " vs " << x2 << std::endl;
285 }
286 return closeEnough;
287 };
288 FBT_CHECK( compare(value, rhs.value) );
289 FBT_CHECK( compare(statUp, rhs.statUp) );
291 FBT_CHECK( variations.size() == rhs.variations.size() );
292 for(auto& kv : variations)
293 {
294 auto itr = rhs.variations.find(kv.first);
295 FBT_CHECK( itr != rhs.variations.end() );
296 FBT_CHECK( compare(kv.second, itr->second) );
297 }
298 return true;
299}
#define FBT_CHECK(x)
std::pair< int, int > compare(const AmgSymMatrix(N) &m1, const AmgSymMatrix(N) &m2, double precision=1e-9, bool relative=false)
compare two matrices, returns the indices of the first element that fails the condition,...
std::map< CP::SystematicVariation, float > variations
float statUp
float value
float statDown

◆ Print()

void Result::Print ( ) const

Definition at line 301 of file fbtTestBasics.cxx.

302{
303 std::cout << "Result: total yield = " << value << " +" << statUp << " -" << statDown << std::endl;
304 for(auto& kv : variations)
305 {
306 std::cout << " variation " << kv.first.name() << " = " << kv.second << std::endl;
307 }
308}

Member Data Documentation

◆ statDown

float Result::statDown = 0

Definition at line 51 of file fbtTestBasics.cxx.

◆ statUp

float Result::statUp = 0

Definition at line 51 of file fbtTestBasics.cxx.

◆ value

float Result::value = 0

Definition at line 51 of file fbtTestBasics.cxx.

◆ variations

std::map<CP::SystematicVariation, float> Result::variations

Definition at line 52 of file fbtTestBasics.cxx.


The documentation for this struct was generated from the following file: