1 |
auterman |
1.1 |
#ifndef CLS_H
|
2 |
|
|
#define CLS_H
|
3 |
|
|
|
4 |
|
|
#include <string>
|
5 |
|
|
#include <vector>
|
6 |
|
|
|
7 |
|
|
#ifndef ROOT_TObjArray
|
8 |
|
|
#include "TObjArray.h"
|
9 |
|
|
#endif
|
10 |
|
|
#include "TVectorDfwd.h"
|
11 |
|
|
|
12 |
|
|
class TH1;
|
13 |
|
|
class TH1D;
|
14 |
|
|
class TObjArray;
|
15 |
|
|
class ConfigFile;
|
16 |
|
|
|
17 |
|
|
class cls
|
18 |
|
|
{
|
19 |
|
|
public:
|
20 |
|
|
cls();
|
21 |
|
|
cls(std::string n,TH1*s,TH1*b,TH1*d); //One signal histogram
|
22 |
|
|
cls(std::string n,std::string ScanParName,std::vector<double>ScanPar,std::vector<TH1*>s,TH1*b,TH1*d); //Many signal histogram
|
23 |
|
|
virtual ~cls(){};
|
24 |
|
|
|
25 |
|
|
void SetOutputFileName(const std::string n){outputfilename_=n;};
|
26 |
|
|
void SetSignal(TH1 const &s){signal_=&s;};
|
27 |
|
|
void SetBackground(TH1 const &b){backgd_=&b;};
|
28 |
|
|
void SetData(TH1 const &d){data_=&d;};
|
29 |
|
|
void SetUncertainty(TH1 *es,TH1 *eb,TObjArray *names){esup_=esdn_=es; ebup_=ebdn_=eb;names_=names;syst_=true;};
|
30 |
|
|
void SetUncertainty(TH1 *esup,TH1 *esdn,TH1 *ebup,TH1 *ebdn, TObjArray *names){esup_=esup;esdn_=esdn; ebup_=ebup;ebdn_=ebdn; names_=names;syst_=true;};
|
31 |
|
|
|
32 |
|
|
void WriteResult(const std::string out);
|
33 |
|
|
void WriteResult(ConfigFile *);
|
34 |
|
|
double GetObservedXsecLimit(double cl, double min=0, double max=1000);
|
35 |
|
|
double GetExpectedXsecLimit(double cl, double min=0, double max=1000);
|
36 |
|
|
void Draw(bool doeps=false);
|
37 |
|
|
void DrawVsSignalParam(bool doeps=false);
|
38 |
|
|
void DrawVsXsec(bool doeps=false);
|
39 |
|
|
void SetStat(bool stat){stat_=stat;};
|
40 |
|
|
void SetNMC(int n){fNMC_=n;};
|
41 |
|
|
double operator()(const double x, const double * par);
|
42 |
|
|
|
43 |
|
|
private:
|
44 |
|
|
TH1 * MakePseudoData(TH1 const*b, TH1 const*s=0);
|
45 |
|
|
void GetXandYbyInterpolation( const double x, TH1D *& signal);
|
46 |
|
|
double GetTotalStatError(const TH1* arg);
|
47 |
|
|
void Sort(double &v1, double &v2);
|
48 |
|
|
|
49 |
|
|
bool stat_;
|
50 |
|
|
bool syst_;
|
51 |
|
|
bool isPseudoData;
|
52 |
|
|
bool do1DScan_;
|
53 |
|
|
int plotindex_;
|
54 |
|
|
int fNMC_;
|
55 |
|
|
std::string outputfilename_, ScanParName_;
|
56 |
|
|
std::vector<double> ScanPar_;
|
57 |
|
|
std::vector <TH1*> signals_;
|
58 |
|
|
TH1 const *signal_, *backgd_, *data_;
|
59 |
|
|
TObjArray* names_;//systematics with same names are correlated
|
60 |
|
|
TH1 const *esup_, //systematic uncertainty *s*ignal u*p*
|
61 |
|
|
*esdn_, //systematic uncertainty *s*ignal dow*n*
|
62 |
|
|
*ebup_, //systematic uncertainty *b*ackground u*p*
|
63 |
|
|
*ebdn_; //systematic uncertainty *b*ackground dow*n*
|
64 |
|
|
};
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
#endif
|