47 #include "isolation.h"
48 #include "kinematics.h"
49 #include "lester_mt2_bisect.h"
58 double weight_square_left;
60 vector<double> weights_left;
61 vector<double> weights_squared_left;
67 cut(std::string cutname);
74 std::map<std::string, int> cutmap;
80 std::vector<cut*> cuts;
85 cutflow(
const std::string& name);
87 void addcut(
const std::string& cutname);
89 void applycut(
const std::string& cutname,
bool &condition,
double &weight);
91 void applycut(
const std::string& cutname,
bool &condition,
double ¢ralweight, vector<double> &weights);
93 void geteff_and_err(
double &eff,
double &err);
94 void geteff_and_err(
const std::string& cutname,
double &eff,
double &err);
95 void geteff_and_all_errs(
const std::string& cutname,vector<vector<int>> &weight_ensembles,
double &eff,
double &staterr,
double &syserrplus,
double &syserrminus);
97 void print(ostream &ss,vector<vector<int>> &weight_ensembles);
99 void print(ostream &ss);
110 map<string, YODA::Histo1D*> _YodaHisto1Ds;
111 map<string, YODA::Histo2D*> _YodaHisto2Ds;
112 map<string, YODA::Profile1D*> _YodaProfile1Ds;
116 bool _isMaster=
false;
118 std::string analysisname;
120 vector<double> _totalweights;
121 vector<vector<int>> _weight_ensembles;
126 std::vector<cutflow*> cutflows;
127 std::map<std::string, std::vector<cutflow*>> regionmap;
128 std::map<std::string, cutflow*> regions;
131 vector<double> _eventweights;
135 std::string DetectorFunction;
141 virtual void init() {};
143 virtual void Execute(std::mt19937 &engine) {};
145 virtual void Finalise() {};
158 void setup(
bool ismaster);
162 void AddRegionSelection(
const std::string ®ion_name);
164 void AddCut(
const std::string& cutname,
const std::string& region_name);
166 void AddCut(
const std::string& cutname,
const std::vector<std::string> region_names);
168 void ApplyCut(
bool condition,
const std::string& cutname);
171 void AddYodaHisto1D(
const std::string& objectname);
172 void AddYodaHisto1D(
const std::string& objectname,
size_t nbins,
double lower,
double upper);
173 void AddYodaHisto1D(
const std::string& objectname,
const std::vector<double>& binedges);
174 void FillYodaHisto1D(
const std::string& objectname,
double x,
double fraction=1.0);
175 YODA::Histo1D* GetYodaHisto1D(
const std::string& objectname);
177 void AddYodaHisto2D(
const std::string& objectname);
178 void AddYodaHisto2D(
const std::string& objectname,
size_t nbinsX,
size_t nbinsY,
double lowerX,
double upperX,
double lowerY,
double upperY);
179 void AddYodaHisto2D(
const std::string& objectname,
const std::vector<double>& xedges,
const std::vector<double>& yedges);
180 void FillYodaHisto2D(
const std::string& objectname,
double x,
double y,
double fraction=1.0);
181 YODA::Histo2D* GetYodaHisto2D(
const std::string& objectname);
183 void AddYodaProfile1D(
const std::string& objectname);
184 void AddYodaProfile1D(
const std::string& objectname,
size_t nbins,
double lower,
double upper);
185 void AddYodaProfile1D(
const std::string& objectname,
const std::vector<double>& binedges);
186 void FillYodaProfile1D(
const std::string& objectname,
double x,
double y,
double fraction=1.0);
187 YODA::Profile1D* GetYodaProfile1D(
const std::string& objectname);
189 void WriteHistos(ostream &os);
192 void set_weight(
double weight);
193 void set_weights(vector<double> &weights);
195 void Reweight(
double weight_multiplier);
198 void print_cutflows();
199 void set_xsection(
double xs);
202 void print_cutflows(ostream &os);
203 void write_results(ostream &ss);
204 void write_json(ostream &ss);
205 bool CheckConvergence(
double margin);
Definition: BaseAnalysis.h:106
Simple event class, separating particles into classes.
Definition: heputil.h:227
Definition: BaseAnalysis.h:55
Definition: BaseAnalysis.h:71