38using std::endl, std::vector, std::string;
50 bool ignoreNonVisible) :
52 _catList(
"catList",
"list of cats", this),
53 _effFuncList(
"effFuncList",
"list of eff funcs",this),
54 _ignoreNonVisible(ignoreNonVisible)
60 coutE(InputArguments) <<
"RooMultiBinomial::ctor(" <<
GetName() <<
") ERROR: Wrong input, should have equal number of categories and efficiencies." << endl;
61 throw string(
"RooMultiBinomial::ctor() ERROR: Wrong input, should have equal number of categories and efficiencies") ;
71 _catList(
"catList",this,other._catList),
72 _effFuncList(
"effFuncList",this,other._effFuncList),
73 _ignoreNonVisible(other._ignoreNonVisible)
87 vector<double> effFuncVal(effFuncListSize);
88 for (
int i=0; i<effFuncListSize; ++i) {
94 for (
int i=0; i<effFuncListSize; ++i) {
95 if (effFuncVal[i]>1) {
96 coutW(Eval) <<
"WARNING: Efficiency >1 (equal to " << effFuncVal[i]
97 <<
" ), for i = " << i <<
"...TRUNCATED" << endl;
99 }
else if (effFuncVal[i]<0) {
100 effFuncVal[i] = 0.0 ;
101 coutW(Eval) <<
"WARNING: Efficiency <0 (equal to " << effFuncVal[i]
102 <<
" ), for i = " << i <<
"...TRUNCATED" << endl;
106 vector<double> effValue(effFuncListSize);
107 bool notVisible =
true;
111 for (
int i=0; i<effFuncListSize; ++i) {
114 effValue[i] = effFuncVal[i] ;
118 effValue[i] = 1 - effFuncVal[i] ;
120 coutW(Eval) <<
"WARNING: WRONG CATEGORY NAMES GIVEN!, label = " << (
static_cast<RooAbsCategory&
>(
_catList[i])).getCurrentIndex() << endl;
130 for (
int i=0; i<effFuncListSize; ++i) {
131 _effVal=_effVal*effValue[i];
A space to attach TBranches.
Storage_t::size_type size() const
Abstract base class for objects that represent a real value and implements functionality common to al...
RooArgList is a container object that can hold multiple RooAbsArg objects.
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
RooMultiBinomial is an efficiency function which makes all combinations of efficiencies given as inpu...
RooListProxy _effFuncList
double evaluate() const override
Calculate the raw value of the function which is the effFunc value if cat==1 and it is (1-effFunc) if...
const char * GetName() const override
Returns name of object.