CombineHarvester
CopyTools.h
Go to the documentation of this file.
1 #ifndef CombineTools_CopyTools_h
2 #define CombineTools_CopyTools_h
3 #include <string>
4 #include <map>
5 #include <vector>
6 #include <set>
9 
10 namespace ch {
11 
21 template <typename Function>
23  Function func) {
24  src.ForEachObs([&](ch::Observation *obs) {
25  ch::Observation cpy = *obs;
26  func(&cpy);
27  dest.InsertObservation(cpy);
28  });
29 }
30 
40 template <typename Function>
42  Function func) {
43  src.ForEachProc([&](ch::Process *proc) {
44  ch::Process cpy = *proc;
45  func(&cpy);
46  dest.InsertProcess(cpy);
47  });
48 }
49 
59 template <typename Function>
61  Function func) {
62  src.ForEachSyst([&](ch::Systematic *sys) {
63  ch::Systematic cpy = *sys;
64  func(&cpy);
65  dest.InsertSystematic(cpy);
66  });
67 }
68 
92 template <typename Function>
94  Function func) {
95  CloneProcs(src, dest, func);
96  CloneSysts(src, dest, func);
97 }
98 
114 void SplitSyst(ch::CombineHarvester& cb, std::string const& syst_in,
115  std::string const& split1, std::string const& split2,
116  double val1, double val2);
117 }
118 
119 #endif
void ForEachSyst(Function func)
void ForEachProc(Function func)
void InsertProcess(ch::Process const &proc)
void ForEachObs(Function func)
void InsertSystematic(ch::Systematic const &sys)
void InsertObservation(ch::Observation const &obs)
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 CloneProcs(ch::CombineHarvester &src, ch::CombineHarvester &dest, Function func)
Duplicate Process objects in one instance, which are then modified by a user-supplied function,...
Definition: CopyTools.h:41
void CloneProcsAndSysts(ch::CombineHarvester &src, ch::CombineHarvester &dest, Function func)
Duplicate the Process and Systematic objects in one instance, which are then modified by a user-suppl...
Definition: CopyTools.h:93
void CloneObs(ch::CombineHarvester &src, ch::CombineHarvester &dest, Function func)
Duplicate Observation objects in one instance, which are then modified by a user-supplied function,...
Definition: CopyTools.h:22
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