CombineHarvester
CopyTools.cc
Go to the documentation of this file.
2 #include <string>
3 #include <vector>
6 
7 
8 namespace ch {
9 void SplitSyst(ch::CombineHarvester& cb, std::string const& syst_in,
10  std::string const& split1, std::string const& split2,
11  double val1, double val2) {
12  CloneSysts(cb.cp().syst_name({syst_in}), cb, [&](Systematic *s) {
13  s->set_name(split1);
14  s->set_value_u(val1);
15  });
16  CloneSysts(cb.cp().syst_name({syst_in}), cb, [&](Systematic *s) {
17  s->set_name(split2);
18  s->set_value_u(val2);
19  });
20  cb.syst_name({syst_in}, false);
21 }
22 }
CombineHarvester & syst_name(std::vector< std::string > const &vec, bool cond=true)
CombineHarvester cp()
Creates and returns a shallow copy of the CombineHarvester instance.
Definition: Algorithm.h:10
void SplitSyst(ch::CombineHarvester &cb, std::string const &syst_in, std::string const &split1, std::string const &split2, double val1, double val2)
Replace all instances of an existing systematic with two copies having modified values.
Definition: CopyTools.cc:9
void CloneSysts(ch::CombineHarvester &src, ch::CombineHarvester &dest, Function func)
Duplicate Systematic objects in one instance, which are then modified by a user-supplied function,...
Definition: CopyTools.h:60