@@ -35,11 +35,6 @@ when any of the parameters of the input p.d.f. has changed.
3535#include " RooHistPdf.h"
3636#include " RooRealVar.h"
3737
38- using std::string;
39-
40-
41-
42-
4338// //////////////////////////////////////////////////////////////////////////////
4439// / Construct running integral of function '_func' over x_print from
4540// / the lower bound on _x to the present value of _x using a numeric
@@ -70,37 +65,25 @@ RooNumRunningInt::RooNumRunningInt(const RooNumRunningInt& other, const char* na
7065 {
7166 }
7267
73-
74-
75- // //////////////////////////////////////////////////////////////////////////////
76- // / Destructor
77-
78- RooNumRunningInt::~RooNumRunningInt ()
79- {
80- }
81-
82-
8368// //////////////////////////////////////////////////////////////////////////////
8469// / Return unique name for RooAbsCachedPdf cache components
8570// / constructed from input function name
8671
8772const char * RooNumRunningInt::inputBaseName () const
8873{
89- static string ret ;
90- ret = func.arg ().GetName () ;
91- ret += " _NUMRUNINT" ;
92- return ret.c_str () ;
93- } ;
94-
95-
74+ static std::string ret;
75+ ret = func.arg ().GetName ();
76+ ret += " _NUMRUNINT" ;
77+ return ret.c_str ();
78+ }
9679
9780// //////////////////////////////////////////////////////////////////////////////
9881// / Construct RunningIntegral CacheElement
9982
10083RooNumRunningInt::RICacheElem::RICacheElem (const RooNumRunningInt &self, const RooArgSet *nset)
10184 : FuncCacheElem(self, nset),
10285 _self(&const_cast <RooNumRunningInt &>(self)),
103- _xx(static_cast <RooRealVar *>( hist()->get()->find(self.x.arg().GetName() )))
86+ _xx(* hist ()->get()->find(self.x.arg().GetName()))
10487{
10588 // Instantiate temp arrays
10689 _ax.resize (hist ()->numEntries ());
@@ -110,7 +93,7 @@ RooNumRunningInt::RICacheElem::RICacheElem(const RooNumRunningInt &self, const R
11093
11194 for (int i=0 ; i<hist ()->numEntries () ; i++) {
11295 hist ()->get (i) ;
113- _ax[i] = _xx->getVal () ;
96+ _ax[i] = static_cast <RooRealVar *>( _xx. first ()) ->getVal ();
11497 _ay[i] = -1 ;
11598 }
11699
@@ -125,7 +108,7 @@ RooArgList RooNumRunningInt::RICacheElem::containedArgs(Action action)
125108 RooArgList ret ;
126109 ret.add (FuncCacheElem::containedArgs (action)) ;
127110 ret.add (*_self) ;
128- ret.add (* _xx) ;
111+ ret.add (_xx);
129112 return ret ;
130113}
131114
@@ -234,9 +217,8 @@ void RooNumRunningInt::RICacheElem::addRange(Int_t ixlo, Int_t ixhi, Int_t nbins
234217void RooNumRunningInt::RICacheElem::addPoint (Int_t ix)
235218{
236219 hist ()->get (ix) ;
237- _self->x = _xx->getVal () ;
238- _ay[ix] = _self->func .arg ().getVal (*_xx) ;
239-
220+ _self->x = static_cast <RooRealVar *>(_xx.first ())->getVal ();
221+ _ay[ix] = _self->func .arg ().getVal (_xx);
240222}
241223
242224
@@ -295,5 +277,3 @@ double RooNumRunningInt::evaluate() const
295277 std::cout << " RooNumRunningInt::evaluate(" << GetName () << " )" << std::endl ;
296278 return 0 ;
297279}
298-
299-
0 commit comments