14 #ifndef __STEBYECUTS__H
15 #define __STEBYECUTS__H
50 char mcutTypeName[64];
62 virtual void setCutFile(
const char* cutFileName);
63 virtual bool isLoaded();
65 virtual bool loadCuts();
66 virtual void dataValue(
const char* name,
float value);
68 virtual int createCutHists(
const char* name,
float* range,
int nvals=2);
69 virtual int createCutHists(
const char* name,
double* range,
int nvals=2);
70 virtual int createCutHists(
const char* name,
int* range,
int nvals=2);
71 virtual int createCutHists(
const char* name,
unsigned int* range,
int nvals=2);
72 virtual void addCutHists(TH1* before, TH1* after,
const char* name=NULL);
73 virtual void setDoFillHists(
bool filling);
74 virtual bool doFillHists();
77 virtual void fillHistogram(
const char* name,
float value,
bool passed);
78 virtual void fillHistogram(
const char* name,
float val1,
float val2,
bool passed);
79 virtual void fillHistogram(
const char* name,
float val1,
float val2,
float val3,
bool passed);
80 virtual void fillHistograms(
bool passed);
81 virtual void writeCutHists(TFile* tf);
82 virtual bool loadBaseCuts(
const char* name,
const char** vals,
int nvals)=0;
83 bool loadBaseCuts(
const char* name,
const char* val1,
const char* val2,
const char* val3=
"",
const char* val4=
"");
84 virtual void loadUserCuts(
const char* name,
const char** vals,
int nvals)=0;
85 void loadUserCuts(
const char* name,
const char* val1,
const char* val2);
86 virtual void printCuts(std::ostream& of,
int i=-1);
87 virtual void printCuts(
const char* fileName);
88 virtual void printCutStats(std::ostream& of) = 0;
89 virtual bool loadCutDB();
91 virtual bool isCut(
const char* cutName);
92 virtual int cutID(
const char* cutName);
93 virtual float maxVal(
const char* cutName);
94 virtual float maxVal(
int cutID);
95 virtual float minVal(
const char* cutName);
96 virtual float minVal(
int cutID);
98 virtual void setRange(
const char* cutName,
float xmin,
float xmax);
99 virtual void setRange(
int cutID,
float xmin,
float xmax);
105 inline void StEStructCuts::dataValue(
const char* name,
float value){
108 if(i<0 || i==mnumVars)
return;
112 inline int StEStructCuts::createCutHists(
const char* name,
double* range,
int nvals){
113 float* tmp=
new float[nvals];
114 for(
int i=0;i<nvals;i++)tmp[i]=(
float)range[i];
115 int retVal=createCutHists(name,tmp,nvals);
120 inline int StEStructCuts::createCutHists(
const char* name,
int* range,
int nvals){
121 float* tmp=
new float[nvals];
122 for(
int i=0;i<nvals;i++)tmp[i]=(
float)range[i];
123 int retVal=createCutHists(name,tmp,nvals);
128 inline int StEStructCuts::createCutHists(
const char* name,
unsigned int* range,
int nvals){
129 float* tmp=
new float[nvals];
130 for(
int i=0;i<nvals;i++)tmp[i]=(
float)range[i];
131 int retVal=createCutHists(name,tmp,nvals);
137 inline bool StEStructCuts::isLoaded(){
return (mcutFileName) ?
true : false ; }
140 inline int StEStructCuts::cutID(
const char* cutName){
142 if(mnumVars<0)
return -1;
144 for(i=0;i<mnumVars;i++)
if(strstr(cutName,mvarName[i]))
break;
150 inline bool StEStructCuts::isCut(
const char* cutName){
151 int id=cutID(cutName);
152 if(
id<0)
return false;
156 inline float StEStructCuts::minVal(
int cutID){
157 if(cutID<0 || cutID==mnumVars)
return 0.;
158 return mminVal[cutID];
161 inline float StEStructCuts::minVal(
const char* cutName){
162 return minVal(cutID(cutName));
165 inline float StEStructCuts::maxVal(
int cutID){
166 if(cutID<0 || cutID==mnumVars)
return 0.;
167 return mmaxVal[cutID];
171 inline float StEStructCuts::maxVal(
const char* cutName){
172 return maxVal(cutID(cutName));
175 inline void StEStructCuts::setRange(
int cutID,
float xmin,
float xmax){
176 if(cutID<0 || cutID==mnumVars)
return;
181 inline void StEStructCuts::setRange(
const char* cutName,
float xmin,
float xmax){
182 setRange(cutID(cutName),xmin,xmax);
185 inline void StEStructCuts::setDoFillHists(
bool filling) {
186 mDoFillHists = filling;
188 inline bool StEStructCuts::doFillHists() {