25 _gamma("
gamma","gamma",this),
26 _nominal("nominal","nominal",this),
27 _nominalErr("nominalErr","nominalErr",this),
37 if (phfSet.getSize()==1) {
43 <<
") ERROR: input object must be a RooParamHistFunc" << endl ;
44 throw std::string(
"RoohistConstraint::ctor ERROR incongruent input arguments") ;
52 const char* vname =
Form(
"%s_nominal_bin_%i",
GetName(),i) ;
65 addOwnedComponents(allVars) ;
72 RooFIter phiter = phfSet.fwdIterator() ;
75 vector<RooParamHistFunc*> phvec ;
78 while((arg=phiter.
next())) {
82 phvec.push_back(phfComp) ;
86 gammaSet.
add(phfComp->
_p) ;
90 <<
") ERROR: incongruent input arguments: all input RooParamHistFuncs should have same #bins" << endl ;
91 throw std::string(
"RoohistConstraint::ctor ERROR incongruent input arguments") ;
95 <<
") ERROR: incongruent input arguments: all input RooParamHistFuncs should have the same bin parameters" << endl ;
96 throw std::string(
"RoohistConstraint::ctor ERROR incongruent input arguments") ;
102 <<
") WARNING: ignoring input argument " << arg->
GetName() <<
" which is not of type RooParamHistFunc" << endl;
106 _gamma.add(gammaSet) ;
113 for (vector<RooParamHistFunc*>::iterator iter = phvec.begin() ; iter != phvec.end() ; ++iter) {
114 sumVal += (*iter)->getNominal(i) ;
117 if (sumVal<threshold) {
119 const char* vname =
Form(
"%s_nominal_bin_%i",
GetName(),i) ;
123 for (vector<RooParamHistFunc*>::iterator iter = phvec.begin() ; iter != phvec.end() ; ++iter) {
124 sumVal2 += (*iter)->getNominal(i) ;
129 vname =
Form(
"%s_nominal_error_bin_%i",
GetName(),i) ;
133 for (vector<RooParamHistFunc*>::iterator iter = phvec.begin() ; iter != phvec.end() ; ++iter) {
134 sumErr2 +=
pow((*iter)->getNominalError(i),2) ;
141 _nominalErr.add(*vare) ;
147 addOwnedComponents(allVars) ;
153 _gamma(
"gamma",this,other._gamma),
154 _nominal(
"nominal",this,other._nominal),
155 _nominalErr(
"nominalErr",this,other._nominalErr),
156 _relParam(other._relParam)
193 cout <<
"ERROR gam=0 and nom>0" << endl ;
205 for (
Int_t ii=0 ; ii<5000 ; ii++) _lut[ii] = 0 ;
207 for (
Int_t j=1 ; j<=5000 ; j++) {
209 for (
Int_t ii=j ; ii<=5000 ; ii++) {
219 cout <<
"logSum i=" << i << endl ;
220 for (
Int_t j=5000 ; j<=i ; j++) {
virtual const char * GetName() const
Returns name of object.
std::string GetName(const std::string &scope_name)
static long int sum(long int i)
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
virtual const RooArgSet * get() const
Double_t getVal(const RooArgSet *set=0) const
Double_t getLogVal(const RooArgSet *set=0) const
Return the log of the current value with given normalization An error message is printed if the argum...
Double_t evaluate() const
double pow(double, double)
virtual Double_t weight() const
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooAbsArg * at(Int_t idx) const
void setConstant(Bool_t value=kTRUE)
char * Form(const char *fmt,...)
Double_t logSum(Int_t i) const
Double_t Poisson(Double_t x, Double_t par)
Compute the Poisson distribution function for (x,par) The Poisson PDF is implemented by means of Eule...
virtual Int_t numEntries() const
Return the number of bins.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooFIter fwdIterator() const
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...