ra4_stats  0341147a0dc35f80f4e12c6003afb76a38e2ed6e
free_systematic.cpp
Go to the documentation of this file.
1 #include "free_systematic.hpp"
2 
3 using namespace std;
4 
6  name_(name),
7  strengths_(){
8 }
9 
10 const string & FreeSystematic::Name() const{
11  return name_;
12 }
13 
15  return name_;
16 }
17 
18 bool FreeSystematic::HasEntry(const Bin &bin, const Process &process) const{
19  pair<Bin, Process> bp(bin, process);
20  return strengths_.find(bp) != strengths_.end()
21  && strengths_.at(bp) != 0.;
22 }
23 
24 double FreeSystematic::Strength(const Bin &bin, const Process &process) const{
25  if(HasEntry(bin, process)){
26  pair<Bin, Process> bp(bin, process);
27  return strengths_.at(bp);
28  }else{
29  return 0.;
30  }
31 }
32 
33 double & FreeSystematic::Strength(const Bin &bin, const Process &process){
34  pair<Bin, Process> bp(bin, process);
35  return strengths_[bp];
36 }
37 
38 bool FreeSystematic::operator<(const FreeSystematic &syst) const{
39  return tie(name_, strengths_) < tie(syst.name_, syst.strengths_);
40 }
41 
43  return tie(name_, strengths_) == tie(syst.name_, syst.strengths_);
44 }
45 
46 ostream & operator<<(ostream &stream, const FreeSystematic &syst){
47  stream << "FreeSystematic::" << syst.Name();
48  return stream;
49 }
Definition: bin.hpp:12
std::map< std::pair< Bin, Process >, double > strengths_
bool operator<(const FreeSystematic &syst) const
double Strength(const Bin &bin, const Process &process) const
STL namespace.
FreeSystematic(const std::string &name)
bool HasEntry(const Bin &bin, const Process &process) const
ostream & operator<<(ostream &stream, const FreeSystematic &syst)
bool operator==(const FreeSystematic &syst) const
const std::string & Name() const
std::string name_