5 #include <initializer_list> 15 const set<string> &file_names,
20 const SystCollection &systematics):
21 file_names_(file_names),
22 chain_(make_shared<TChain>(
"tree",
"tree")),
26 is_signal_(is_signal),
27 count_zeros_(count_zeros),
28 systematics_(systematics){
34 initializer_list<string> file_names,
39 const SystCollection &systematics):
40 file_names_(file_names),
41 chain_(make_shared<TChain>(
"tree",
"tree")),
45 is_signal_(is_signal),
46 count_zeros_(count_zeros),
47 systematics_(systematics){
75 return chain_->GetEntries();
79 double count, uncertainty;
127 for(
const auto& systematic: systematics){
140 }
catch(
const out_of_range &
e){
141 ERROR(
string(e.what())+
": bin "+
name_+
" does not contain systematic "+systematic.
Name()+
".");
152 bool found_it =
false;
154 if(systematic->Name() ==
name){
163 ERROR(
"Process "+
name_+
" does not contain systematic "+name);
189 stream <<
"Process::" << proc.
Name()
190 <<
"(cut=" << proc.
Cut()
192 <<
",is_data=" << proc.
IsData()
std::shared_ptr< TChain > chain_
bool HasSystematic(const Systematic &systematic) const
const std::string & Name() const
const SystCollection & Systematics() const
ostream & operator<<(ostream &stream, const Process &proc)
std::set< std::string > file_names_
void SetYieldAndUncertainty(double yield, double uncertainty)
void ReplaceAll(std::string &str, const std::string &orig, const std::string &rep)
const std::set< std::string > & FileNames() const
const bool & IsData() const
Process & AddSystematic(const Systematic &systematic)
const bool & CountZeros() const
GammaParams GetYield(const class Cut &cut=::Cut("1")) const
const double & Strength() const
bool operator<(const Process &p) const
Process & RemoveSystematics()
Process & SetSystematicStrength(const std::string &name, double strength)
bool operator==(const Process &p) const
const class Cut & Cut() const
const bool & IsSignal() const
void GetCountAndUncertainty(TTree &tree, const Cut &cut, double &count, double &uncertainty)
Process & RemoveSystematic(const Systematic &systematic)
std::set< Systematic > SystCollection
SystCollection systematics_
Process & AddSystematics(const SystCollection &systematic)
const std::string & Name() const