30 #include "RooMsgService.h" 31 #include "RooArgSet.h" 32 #include "RooRandom.h" 33 class RooAbsAnaConvPdf;
48 const RooDataSet *prototype,
const RooArgSet* auxProto, Bool_t verbose)
49 : RooConvGenContext(model, vars, prototype, auxProto, verbose)
51 cxcoutI(Generation) <<
"RooEffConvGenContext::ctor() setting up special generator context " 52 <<
"to apply an efficiency to the analytical convolution p.d.f. " 53 << reinterpret_cast<const RooAbsPdf*>(&model)->GetName() <<
" for generation of observable(s) " << vars << endl ;
59 const RooDataSet *prototype,
const RooArgSet* auxProto, Bool_t verbose)
60 : RooConvGenContext(model, vars, prototype, auxProto, verbose)
62 cxcoutI(Generation) <<
"RooEffConvGenContext::ctor() setting up special generator context " 63 <<
"to apply an efficiency to the analytical convolution p.d.f. " 64 << reinterpret_cast<const RooAbsPdf*>(&model)->GetName() <<
" for generation of observable(s) " << vars << endl ;
70 const RooDataSet *prototype,
const RooArgSet* auxProto, Bool_t verbose)
71 : RooConvGenContext(model, vars, prototype, auxProto, verbose)
73 cxcoutI(Generation) <<
"RooEffConvGenContext::ctor() setting up special generator context " 74 <<
"to apply an efficiency to the analytical convolution p.d.f. " 75 << reinterpret_cast<const RooAbsPdf*>(&model)->GetName() <<
" for generation of observable(s) " << vars << endl ;
82 RooConvGenContext::initGenerator(theEvent);
87 RooAbsReal* eff = const_cast<RooAbsReal*>(
efficiency());
89 = (RooArgSet*)_modelVars->selectCommon(*eff->getVariables());
90 effVars->remove(*_cvModel, kTRUE, kTRUE);
91 effVars->add(*_cvOut);
92 eff->recursiveRedirectServers(*effVars, kTRUE, kFALSE, kTRUE);
97 {
return attach(theEvent); }
105 _modelGen->generateEvent(*_modelVars, remaining);
106 _pdfGen->generateEvent(*_pdfVars, remaining);
109 Double_t convValSmeared = _cvPdf->getVal() + _cvModel->getVal();
111 if (!_cvOut->isValidReal(convValSmeared))
continue;
115 _cvOut->setVal(convValSmeared);
119 coutE(Generation) << ClassName() <<
"::" << GetName()
120 <<
":generateEvent: value of efficiency is larger " 121 <<
"than assumed maximum of 1." << endl;
124 if (val > RooRandom::uniform() *
_maxEff) {
126 theEvent = *_modelVars;
127 theEvent = *_pdfVars;
128 _cvOut->setVal(convValSmeared);
138 const RooAbsEffResModel* model = dynamic_cast<const RooAbsEffResModel*>(_modelCloneSet->first());
140 RooAbsReal* eff = const_cast<RooAbsReal*>(model->
efficiency());
141 Int_t maxCode = eff->getMaxVal(*_modelVars);
145 Double_t maxVal = eff->maxVal(maxCode);
153 const RooAbsEffResModel* model = dynamic_cast<const RooAbsEffResModel*>(_modelCloneSet->first());
RooEffConvGenContext(const RooFFTConvPdf &model, const RooArgSet &vars, const RooDataSet *prototype=0, const RooArgSet *auxProto=0, Bool_t _verbose=kFALSE)
virtual ~RooEffConvGenContext()
virtual void initGenerator(const RooArgSet &theEvent)
virtual void generateEvent(RooArgSet &theEvent, Int_t remaining)
virtual const RooAbsReal * efficiency() const =0
const RooAbsReal * efficiency()
virtual void attach(const RooArgSet ¶ms)