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++) {
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...
RooFIter fwdIterator() const
virtual const RooArgSet * get() const
Double_t evaluate() const
std::map< std::string, std::string >::const_iterator iter
double pow(double, double)
Double_t getVal(const RooArgSet *set=0) const
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual Double_t weight() const
void setConstant(Bool_t value=kTRUE)
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
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...
RooAbsArg * at(Int_t idx) const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
ClassImp(RooHistConstraint) RooHistConstraint
virtual Int_t numEntries() const
Return the number of bins.
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...
Double_t logSum(Int_t i) const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.