41 RooUniform::RooUniform(
const char *name,
const char *title,
const RooArgSet& _x) :
42 RooAbsPdf(name,title),
43 x(
"x",
"Observables",this,kTRUE,kFALSE)
50 RooUniform::RooUniform(
const RooUniform& other,
const char* name) :
51 RooAbsPdf(other,name), x(
"x",this,other.x)
57 Double_t RooUniform::evaluate()
const
65 Int_t RooUniform::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars,
const char* )
const
67 Int_t nx = x.getSize() ;
70 coutW(Integration) <<
"RooUniform::getAnalyticalIntegral(" << GetName() <<
") WARNING: p.d.f. has " << x.getSize()
71 <<
" observables, analytical integration is only implemented for the first 31 observables" << endl ;
76 for (
int i=0 ; i<x.getSize() ; i++) {
77 if (allVars.find(x.at(i)->GetName())) {
79 analVars.add(*allVars.find(x.at(i)->GetName())) ;
88 Double_t RooUniform::analyticalIntegral(Int_t code,
const char* rangeName)
const
91 for (
int i=0 ; i<32 ; i++) {
93 RooAbsRealLValue* var = (RooAbsRealLValue*)x.at(i) ;
94 ret *= (var->getMax(rangeName) - var->getMin(rangeName)) ;
103 Int_t RooUniform::getGenerator(
const RooArgSet& directVars, RooArgSet &generateVars, Bool_t )
const
105 Int_t nx = x.getSize() ;
108 coutW(Integration) <<
"RooUniform::getGenerator(" << GetName() <<
") WARNING: p.d.f. has " << x.getSize()
109 <<
" observables, internal integrator is only implemented for the first 31 observables" << endl ;
114 for (
int i=0 ; i<x.getSize() ; i++) {
115 if (directVars.find(x.at(i)->GetName())) {
117 generateVars.add(*directVars.find(x.at(i)->GetName())) ;
127 void RooUniform::generateEvent(Int_t code)
131 ((RooAbsRealLValue*)x.at(0))->randomize() ;
135 for (
int i=0 ; i<32 ; i++) {
137 RooAbsRealLValue* var = (RooAbsRealLValue*)x.at(i) ;