1 #ifndef __KVEVENTCLASSIFIER_H
2 #define __KVEVENTCLASSIFIER_H
4 #include "KVVarGlob1.h"
95 std::vector<double> fCuts;
100 bool fIntegerVariable;
101 std::unique_ptr<TFormula> fFormula;
102 std::vector<std::string> fValues;
104 int calc_where()
const;
108 fBins(false), fWithVal(false), fWithExpression(false), fIntegerVariable(false), fFormula(nullptr)
111 :
KVVarGlob1((value ==
"") ? Form(
"%s_EC", b->GetName()) : Form(
"%s_%s_EC", b->GetName(), value.Data())),
112 fVar(b), fVal(value), fBcuts(false), fBins(false), fWithVal(value !=
""), fWithExpression(false), fIntegerVariable(false), fFormula(nullptr)
122 void
Copy(TObject& other)
const override
148 int where = calc_where();
165 if (fBins)
return fCuts.size() / 2;
195 KVError::Error(
this,
"AddCut",
"You cannot mix cuts & bins (and you already defined some bins)");
222 KVError::Error(
this,
"AddBin",
"You cannot mix cuts & bins (and you already defined some cuts)");
226 fCuts.push_back(xmin);
227 fCuts.push_back(xmax);
230 void Init()
override;
Simple class for sorting events according to global variables.
Bool_t IsGlobalVariable() const override
void Copy(TObject &other) const override
void AddBin(double xmin, double xmax)
virtual ~KVEventClassifier()
int GetMaxEventClassNumber() const
KVEventClassifier(KVVarGlob *b, const TString &value="")
int GetEventClassification() const
void Calculate() override
Abstract base class for global variables which calculate a single value.
void Copy(TObject &obj) const override
Base class for all global variable implementations.
void Error(UserClass p, const char *location, const char *va_(fmt),...)