/***************************************************************************** 
 * Project: RooFit                                                           * 
 *                                                                           * 
 * This code was autogenerated by RooClassFactory                            * 
 *****************************************************************************/ 

// Your description goes here... 

#include "Riostream.h" 

#include "RooMomentMorph.h" 
#include "RooAbsCategory.h" 
#include "RooRealIntegral.h"
#include "RooRealConstant.h"
#include "RooRealVar.h"
#include "RooFormulaVar.h"
#include "RooCustomizer.h"
#include "RooAddPdf.h"
#include "RooAddition.h"
#include "RooMoment.h"
#include "RooLinearVar.h"
#include "RooChangeTracker.h"

#include "TMath.h"
#include "TH1.h"

using namespace std;

ClassImp(RooMomentMorph) 


//_____________________________________________________________________________
RooMomentMorph::RooMomentMorph() : _curNormSet(0), _mref(0), _M(0), _useHorizMorph(true)
{
  // coverity[UNINIT_CTOR]
  _varItr    = _varList.createIterator() ;
  _pdfItr    = _pdfList.createIterator() ; 
}



//_____________________________________________________________________________
RooMomentMorph::RooMomentMorph(const char *name, const char *title, 
                           RooAbsReal& _m,
                           const RooArgList& varList,
                           const RooArgList& pdfList,
                           const TVectorD& mrefpoints,
                           Setting setting) :
  RooAbsPdf(name,title), 
  _cacheMgr(this,10,kTRUE,kTRUE),
  m("m","m",this,_m),
  _varList("varList","List of variables",this),
  _pdfList("pdfList","List of pdfs",this),
  _setting(setting),
  _useHorizMorph(true)
{ 
  // CTOR

  // observables
  TIterator* varItr = varList.createIterator() ;
  RooAbsArg* var ;
  for (Int_t i=0; (var = (RooAbsArg*)varItr->Next()); ++i) {
    if (!dynamic_cast<RooAbsReal*>(var)) {
      coutE(InputArguments) << "RooMomentMorph::ctor(" << GetName() << ") ERROR: variable " << var->GetName() << " is not of type RooAbsReal" << endl ;
      throw string("RooPolyMorh::ctor() ERROR variable is not of type RooAbsReal") ;
    }
    _varList.add(*var) ;
  }
  delete varItr ;

  // reference p.d.f.s
  TIterator* pdfItr = pdfList.createIterator() ;
  RooAbsPdf* pdf ;
  for (Int_t i=0; (pdf = dynamic_cast<RooAbsPdf*>(pdfItr->Next())); ++i) {
    if (!pdf) {
      coutE(InputArguments) << "RooMomentMorph::ctor(" << GetName() << ") ERROR: pdf " << pdf->GetName() << " is not of type RooAbsPdf" << endl ;
      throw string("RooPolyMorh::ctor() ERROR pdf is not of type RooAbsPdf") ;
    }
    _pdfList.add(*pdf) ;
  }
  delete pdfItr ;

  _mref      = new TVectorD(mrefpoints);
  _varItr    = _varList.createIterator() ;
  _pdfItr    = _pdfList.createIterator() ; 

  // initialization
  initialize();
} 



//_____________________________________________________________________________
RooMomentMorph::RooMomentMorph(const char *name, const char *title, 
                           RooAbsReal& _m,
                           const RooArgList& varList,
                           const RooArgList& pdfList,
                           const RooArgList& mrefList,
                           Setting setting) :
  RooAbsPdf(name,title), 
  _cacheMgr(this,10,kTRUE,kTRUE),
  m("m","m",this,_m),
  _varList("varList","List of variables",this),
  _pdfList("pdfList","List of pdfs",this),
  _setting(setting),
  _useHorizMorph(true)
{ 
  // CTOR

  // observables
  TIterator* varItr = varList.createIterator() ;
  RooAbsArg* var ;
  for (Int_t i=0; (var = (RooAbsArg*)varItr->Next()); ++i) {
    if (!dynamic_cast<RooAbsReal*>(var)) {
      coutE(InputArguments) << "RooMomentMorph::ctor(" << GetName() << ") ERROR: variable " << var->GetName() << " is not of type RooAbsReal" << endl ;
      throw string("RooPolyMorh::ctor() ERROR variable is not of type RooAbsReal") ;
    }
    _varList.add(*var) ;
  }
  delete varItr ;

  // reference p.d.f.s
  TIterator* pdfItr = pdfList.createIterator() ;
  RooAbsPdf* pdf ;
  for (Int_t i=0; (pdf = dynamic_cast<RooAbsPdf*>(pdfItr->Next())); ++i) {
    if (!pdf) {
      coutE(InputArguments) << "RooMomentMorph::ctor(" << GetName() << ") ERROR: pdf " << pdf->GetName() << " is not of type RooAbsPdf" << endl ;
      throw string("RooPolyMorh::ctor() ERROR pdf is not of type RooAbsPdf") ;
    }
    _pdfList.add(*pdf) ;
  }
  delete pdfItr ;
  
  // reference points in m
  _mref      = new TVectorD(mrefList.getSize());
  TIterator* mrefItr = mrefList.createIterator() ;
  RooAbsReal* mref ;
  for (Int_t i=0; (mref = dynamic_cast<RooAbsReal*>(mrefItr->Next())); ++i) {
    if (!mref) {
      coutE(InputArguments) << "RooMomentMorph::ctor(" << GetName() << ") ERROR: mref " << mref->GetName() << " is not of type RooAbsReal" << endl ;
      throw string("RooPolyMorh::ctor() ERROR mref is not of type RooAbsReal") ;
    }
    if (!dynamic_cast<RooConstVar*>(mref)) {
      coutW(InputArguments) << "RooMomentMorph::ctor(" << GetName() << ") WARNING mref point " << i << " is not a constant, taking a snapshot of its value" << endl ;
    }
    (*_mref)[i] = mref->getVal() ;
  }
  delete mrefItr ;
  
  _varItr    = _varList.createIterator() ;
  _pdfItr    = _pdfList.createIterator() ; 

  // initialization
  initialize();
} 



//_____________________________________________________________________________
RooMomentMorph::RooMomentMorph(const RooMomentMorph& other, const char* name) :  
  RooAbsPdf(other,name), 
  _cacheMgr(other._cacheMgr,this),
  _curNormSet(0),
  m("m",this,other.m),
  _varList("varList",this,other._varList),
  _pdfList("pdfList",this,other._pdfList),
  _setting(other._setting),
  _useHorizMorph(other._useHorizMorph)
{ 
  _mref = new TVectorD(*other._mref) ;
  _varItr    = _varList.createIterator() ;
  _pdfItr    = _pdfList.createIterator() ; 

  // initialization
  initialize();
} 

//_____________________________________________________________________________
RooMomentMorph::~RooMomentMorph() 
{
  if (_mref)   delete _mref;
  if (_varItr) delete _varItr;
  if (_pdfItr) delete _pdfItr;
  if (_M)      delete _M;
}



//_____________________________________________________________________________
void RooMomentMorph::initialize() 
{

  Int_t nPdf = _pdfList.getSize();

  // other quantities needed
  if (nPdf!=_mref->GetNrows()) {
    coutE(InputArguments) << "RooMomentMorph::initialize(" << GetName() << ") ERROR: nPdf != nRefPoints" << endl ;
    assert(0) ;
  }

  TVectorD* dm = new TVectorD(nPdf);
  _M = new TMatrixD(nPdf,nPdf);

  // transformation matrix for non-linear extrapolation, needed in evaluate()
  TMatrixD M(nPdf,nPdf);
  for (Int_t i=0; i<_mref->GetNrows(); ++i) {
    (*dm)[i] = (*_mref)[i]-(*_mref)[0];
    M(i,0) = 1.;
    if (i>0) M(0,i) = 0.;
  }
  for (Int_t i=1; i<_mref->GetNrows(); ++i) {
    for (Int_t j=1; j<_mref->GetNrows(); ++j) {
      M(i,j) = TMath::Power((*dm)[i],(double)j);
    }
  }
  (*_M) = M.Invert();

  delete dm ;
}

//_____________________________________________________________________________
RooMomentMorph::CacheElem* RooMomentMorph::getCache(const RooArgSet* /*nset*/) const
{
  CacheElem* cache = (CacheElem*) _cacheMgr.getObj(0,(RooArgSet*)0) ;
  if (cache) {
    return cache ;
  }
  Int_t nVar = _varList.getSize();
  Int_t nPdf = _pdfList.getSize();

  RooAbsReal* null = 0 ;
  vector<RooAbsReal*> meanrv(nPdf*nVar,null);
  vector<RooAbsReal*> sigmarv(nPdf*nVar,null); 
  vector<RooAbsReal*> myrms(nVar,null);      
  vector<RooAbsReal*> mypos(nVar,null);      
  vector<RooAbsReal*> slope(nPdf*nVar,null); 
  vector<RooAbsReal*> offs(nPdf*nVar,null); 
  vector<RooAbsReal*> transVar(nPdf*nVar,null); 
  vector<RooAbsReal*> transPdf(nPdf,null);      

  RooArgSet ownedComps ;

  RooArgList fracl ;

  // fraction parameters
  RooArgList coefList("coefList");
  RooArgList coefList2("coefList2");
  for (Int_t i=0; i<2*nPdf; ++i) {
    std::string fracName = Form("frac_%d",i);

    RooRealVar* frac = new RooRealVar(fracName.c_str(),fracName.c_str(),1.) ;

    fracl.add(*frac); // to be set later 
    if (i<nPdf) coefList.add(*(RooRealVar*)(fracl.at(i))) ;
    else coefList2.add(*(RooRealVar*)(fracl.at(i))) ;
    ownedComps.add(*(RooRealVar*)(fracl.at(i))) ;
  }

  RooAddPdf* theSumPdf = 0;
  std::string sumpdfName = Form("%s_sumpdf",GetName());
    
  if (_useHorizMorph) {
    // mean and sigma
    RooArgList varList(_varList) ;
    for (Int_t i=0; i<nPdf; ++i) {
      for (Int_t j=0; j<nVar; ++j) {
	
	std::string meanName = Form("%s_mean_%d_%d",GetName(),i,j);
	std::string sigmaName = Form("%s_sigma_%d_%d",GetName(),i,j);      
	
        RooAbsMoment* mom = nVar==1 ? 
	  ((RooAbsPdf*)_pdfList.at(i))->sigma((RooRealVar&)*varList.at(j)) :
	  ((RooAbsPdf*)_pdfList.at(i))->sigma((RooRealVar&)*varList.at(j),varList) ;

	mom->setLocalNoDirtyInhibit(kTRUE) ;
	mom->mean()->setLocalNoDirtyInhibit(kTRUE) ;

	sigmarv[ij(i,j)] = mom ;
	meanrv[ij(i,j)]  = mom->mean() ;
	
	ownedComps.add(*sigmarv[ij(i,j)]) ;      
      }
    }
    
    // slope and offset (to be set later, depend on m)
    for (Int_t j=0; j<nVar; ++j) {
      RooArgList meanList("meanList");
      RooArgList rmsList("rmsList");
      for (Int_t i=0; i<nPdf; ++i) {
	meanList.add(*meanrv[ij(i,j)]);
	rmsList.add(*sigmarv[ij(i,j)]);
      }
      std::string myrmsName = Form("%s_rms_%d",GetName(),j);
      std::string myposName = Form("%s_pos_%d",GetName(),j);
      myrms[j] = new RooAddition(myrmsName.c_str(),myrmsName.c_str(),rmsList,coefList2);
      mypos[j] = new RooAddition(myposName.c_str(),myposName.c_str(),meanList,coefList2);
      ownedComps.add(RooArgSet(*myrms[j],*mypos[j])) ;
    }

    // construction of unit pdfs
    _pdfItr->Reset();
    RooAbsPdf* pdf;
    RooArgList transPdfList;
    
    for (Int_t i=0; i<nPdf; ++i) {
      _varItr->Reset() ;
      RooRealVar* var ;
      
      pdf = (RooAbsPdf*)_pdfItr->Next();
      std::string pdfName = Form("pdf_%d",i);
      RooCustomizer cust(*pdf,pdfName.c_str());
      
      for (Int_t j=0; j<nVar; ++j) {
	// slope and offset formulas
	std::string slopeName = Form("%s_slope_%d_%d",GetName(),i,j);
	std::string offsetName = Form("%s_offset_%d_%d",GetName(),i,j);
	slope[ij(i,j)]  = new RooFormulaVar(slopeName.c_str(),"@0/@1",RooArgList(*sigmarv[ij(i,j)],*myrms[j]));
	offs[ij(i,j)] = new RooFormulaVar(offsetName.c_str(),"@0-(@1*@2)",RooArgList(*meanrv[ij(i,j)],*mypos[j],*slope[ij(i,j)]));
	ownedComps.add(RooArgSet(*slope[ij(i,j)],*offs[ij(i,j)])) ;
	// linear transformations, so pdf can be renormalized
	var = (RooRealVar*)(_varItr->Next());
	std::string transVarName = Form("%s_transVar_%d_%d",GetName(),i,j);
	//transVar[ij(i,j)] = new RooFormulaVar(transVarName.c_str(),transVarName.c_str(),"@0*@1+@2",RooArgList(*var,*slope[ij(i,j)],*offs[ij(i,j)]));

	transVar[ij(i,j)] = new RooLinearVar(transVarName.c_str(),transVarName.c_str(),*var,*slope[ij(i,j)],*offs[ij(i,j)]);		

	// *** WVE this is important *** this declares that frac effectively depends on the morphing parameters
	// This will prevent the likelihood optimizers from erroneously declaring terms constant
	transVar[ij(i,j)]->addServer((RooAbsArg&)m.arg()) ;

	ownedComps.add(*transVar[ij(i,j)]) ;
	cust.replaceArg(*var,*transVar[ij(i,j)]);
      }
      transPdf[i] = (RooAbsPdf*) cust.build() ;
      transPdfList.add(*transPdf[i]);
      ownedComps.add(*transPdf[i]) ;
    }
    // sum pdf      
    theSumPdf = new RooAddPdf(sumpdfName.c_str(),sumpdfName.c_str(),transPdfList,coefList);
  }
  else {
    theSumPdf = new RooAddPdf(sumpdfName.c_str(),sumpdfName.c_str(),_pdfList,coefList);
  }

  // *** WVE this is important *** this declares that frac effectively depends on the morphing parameters
  // This will prevent the likelihood optimizers from erroneously declaring terms constant
  theSumPdf->addServer((RooAbsArg&)m.arg()) ;
  theSumPdf->addOwnedComponents(ownedComps) ;

  // change tracker for fraction parameters
  std::string trackerName = Form("%s_frac_tracker",GetName()) ;
  RooChangeTracker* tracker = new RooChangeTracker(trackerName.c_str(),trackerName.c_str(),m.arg(),kTRUE) ;

  // Store it in the cache
  cache = new CacheElem(*theSumPdf,*tracker,fracl) ;
  _cacheMgr.setObj(0,0,cache,0) ;

  return cache ;
}



//_____________________________________________________________________________
RooArgList RooMomentMorph::CacheElem::containedArgs(Action) 
{
  return RooArgList(*_sumPdf,*_tracker) ; 
}



//_____________________________________________________________________________
RooMomentMorph::CacheElem::~CacheElem() 
{ 
  delete _sumPdf ; 
  delete _tracker ; 
} 



//_____________________________________________________________________________
Double_t RooMomentMorph::getVal(const RooArgSet* set) const 
{
  // Special version of getVal() overrides RooAbsReal::getVal() to save value of current normalization set
  _curNormSet = set ? (RooArgSet*)set : (RooArgSet*)&_varList ;
  return RooAbsPdf::getVal(set) ;
}



//_____________________________________________________________________________
RooAbsPdf* RooMomentMorph::sumPdf(const RooArgSet* nset) 
{
  CacheElem* cache = getCache(nset ? nset : _curNormSet) ;
  
  if (cache->_tracker->hasChanged(kTRUE)) {
    cache->calculateFractions(*this,kFALSE); // verbose turned off
  } 
  
  return cache->_sumPdf ;
}


//_____________________________________________________________________________
Double_t RooMomentMorph::evaluate() const 
{ 
  CacheElem* cache = getCache(_curNormSet) ;
  
  if (cache->_tracker->hasChanged(kTRUE)) {
    cache->calculateFractions(*this,kFALSE); // verbose turned off
  } 
  
  Double_t ret = cache->_sumPdf->getVal(_pdfList.nset());
  return ret ;
} 

//_____________________________________________________________________________
RooRealVar* RooMomentMorph::CacheElem::frac(Int_t i ) 
{ 
  return (RooRealVar*)(_frac.at(i))  ; 
}



//_____________________________________________________________________________
const RooRealVar* RooMomentMorph::CacheElem::frac(Int_t i ) const 
{ 
  return (RooRealVar*)(_frac.at(i))  ; 
}


//_____________________________________________________________________________
void RooMomentMorph::CacheElem::calculateFractions(const RooMomentMorph& self, Bool_t verbose) const
{
  Int_t nPdf = self._pdfList.getSize();

  Double_t dm = self.m - (*self._mref)[0];

  // fully non-linear
  double sumposfrac=0.;
  for (Int_t i=0; i<nPdf; ++i) {
    double ffrac=0.;
    for (Int_t j=0; j<nPdf; ++j) { ffrac += (*self._M)(j,i) * (j==0?1.:TMath::Power(dm,(double)j)); }
    if (ffrac>=0) sumposfrac+=ffrac;
    // fractions for pdf
    ((RooRealVar*)frac(i))->setVal(ffrac);
    // fractions for rms and mean
    ((RooRealVar*)frac(nPdf+i))->setVal(ffrac);
    if (verbose) { cout << ffrac << endl; }
  }

  // various mode settings
  int imin = self.idxmin(self.m);
  int imax = self.idxmax(self.m);
  double mfrac = (self.m-(*self._mref)[imin])/((*self._mref)[imax]-(*self._mref)[imin]);
  switch (self._setting) {
    case NonLinear:
      // default already set above
    break;

    case SineLinear:
      mfrac = TMath::Sin( TMath::PiOver2()*mfrac ); // this gives a continuous differentiable transition between grid points. 

      // now fall through to Linear case

    case Linear: 
      for (Int_t i=0; i<2*nPdf; ++i)
        ((RooRealVar*)frac(i))->setVal(0.);      
      if (imax>imin) { // m in between mmin and mmax
        ((RooRealVar*)frac(imin))->setVal(1.-mfrac); 
        ((RooRealVar*)frac(nPdf+imin))->setVal(1.-mfrac);
        ((RooRealVar*)frac(imax))->setVal(mfrac);
        ((RooRealVar*)frac(nPdf+imax))->setVal(mfrac);
      } else if (imax==imin) { // m outside mmin and mmax
        ((RooRealVar*)frac(imin))->setVal(1.);
        ((RooRealVar*)frac(nPdf+imin))->setVal(1.);
      }
    break;
    case NonLinearLinFractions:
      for (Int_t i=0; i<nPdf; ++i)
        ((RooRealVar*)frac(i))->setVal(0.);
      if (imax>imin) { // m in between mmin and mmax
        ((RooRealVar*)frac(imin))->setVal(1.-mfrac);
        ((RooRealVar*)frac(imax))->setVal(mfrac);
      } else if (imax==imin) { // m outside mmin and mmax
        ((RooRealVar*)frac(imin))->setVal(1.);
      }
    break;
    case NonLinearPosFractions:
      for (Int_t i=0; i<nPdf; ++i) {
        if (((RooRealVar*)frac(i))->getVal()<0) ((RooRealVar*)frac(i))->setVal(0.);
        ((RooRealVar*)frac(i))->setVal(((RooRealVar*)frac(i))->getVal()/sumposfrac);
      }
    break;
  }
 
}

//_____________________________________________________________________________
int RooMomentMorph::idxmin(const double& mval) const
{
  int imin(0);
  Int_t nPdf = _pdfList.getSize();
  double mmin=-DBL_MAX;
  for (Int_t i=0; i<nPdf; ++i) 
    if ( (*_mref)[i]>mmin && (*_mref)[i]<=mval ) { mmin=(*_mref)[i]; imin=i; }
  return imin;
}


//_____________________________________________________________________________
int RooMomentMorph::idxmax(const double& mval) const
{
  int imax(0);
  Int_t nPdf = _pdfList.getSize();
  double mmax=DBL_MAX;
  for (Int_t i=0; i<nPdf; ++i) 
    if ( (*_mref)[i]<mmax && (*_mref)[i]>=mval ) { mmax=(*_mref)[i]; imax=i; }
  return imax;
}



 RooMomentMorph.cxx:1
 RooMomentMorph.cxx:2
 RooMomentMorph.cxx:3
 RooMomentMorph.cxx:4
 RooMomentMorph.cxx:5
 RooMomentMorph.cxx:6
 RooMomentMorph.cxx:7
 RooMomentMorph.cxx:8
 RooMomentMorph.cxx:9
 RooMomentMorph.cxx:10
 RooMomentMorph.cxx:11
 RooMomentMorph.cxx:12
 RooMomentMorph.cxx:13
 RooMomentMorph.cxx:14
 RooMomentMorph.cxx:15
 RooMomentMorph.cxx:16
 RooMomentMorph.cxx:17
 RooMomentMorph.cxx:18
 RooMomentMorph.cxx:19
 RooMomentMorph.cxx:20
 RooMomentMorph.cxx:21
 RooMomentMorph.cxx:22
 RooMomentMorph.cxx:23
 RooMomentMorph.cxx:24
 RooMomentMorph.cxx:25
 RooMomentMorph.cxx:26
 RooMomentMorph.cxx:27
 RooMomentMorph.cxx:28
 RooMomentMorph.cxx:29
 RooMomentMorph.cxx:30
 RooMomentMorph.cxx:31
 RooMomentMorph.cxx:32
 RooMomentMorph.cxx:33
 RooMomentMorph.cxx:34
 RooMomentMorph.cxx:35
 RooMomentMorph.cxx:36
 RooMomentMorph.cxx:37
 RooMomentMorph.cxx:38
 RooMomentMorph.cxx:39
 RooMomentMorph.cxx:40
 RooMomentMorph.cxx:41
 RooMomentMorph.cxx:42
 RooMomentMorph.cxx:43
 RooMomentMorph.cxx:44
 RooMomentMorph.cxx:45
 RooMomentMorph.cxx:46
 RooMomentMorph.cxx:47
 RooMomentMorph.cxx:48
 RooMomentMorph.cxx:49
 RooMomentMorph.cxx:50
 RooMomentMorph.cxx:51
 RooMomentMorph.cxx:52
 RooMomentMorph.cxx:53
 RooMomentMorph.cxx:54
 RooMomentMorph.cxx:55
 RooMomentMorph.cxx:56
 RooMomentMorph.cxx:57
 RooMomentMorph.cxx:58
 RooMomentMorph.cxx:59
 RooMomentMorph.cxx:60
 RooMomentMorph.cxx:61
 RooMomentMorph.cxx:62
 RooMomentMorph.cxx:63
 RooMomentMorph.cxx:64
 RooMomentMorph.cxx:65
 RooMomentMorph.cxx:66
 RooMomentMorph.cxx:67
 RooMomentMorph.cxx:68
 RooMomentMorph.cxx:69
 RooMomentMorph.cxx:70
 RooMomentMorph.cxx:71
 RooMomentMorph.cxx:72
 RooMomentMorph.cxx:73
 RooMomentMorph.cxx:74
 RooMomentMorph.cxx:75
 RooMomentMorph.cxx:76
 RooMomentMorph.cxx:77
 RooMomentMorph.cxx:78
 RooMomentMorph.cxx:79
 RooMomentMorph.cxx:80
 RooMomentMorph.cxx:81
 RooMomentMorph.cxx:82
 RooMomentMorph.cxx:83
 RooMomentMorph.cxx:84
 RooMomentMorph.cxx:85
 RooMomentMorph.cxx:86
 RooMomentMorph.cxx:87
 RooMomentMorph.cxx:88
 RooMomentMorph.cxx:89
 RooMomentMorph.cxx:90
 RooMomentMorph.cxx:91
 RooMomentMorph.cxx:92
 RooMomentMorph.cxx:93
 RooMomentMorph.cxx:94
 RooMomentMorph.cxx:95
 RooMomentMorph.cxx:96
 RooMomentMorph.cxx:97
 RooMomentMorph.cxx:98
 RooMomentMorph.cxx:99
 RooMomentMorph.cxx:100
 RooMomentMorph.cxx:101
 RooMomentMorph.cxx:102
 RooMomentMorph.cxx:103
 RooMomentMorph.cxx:104
 RooMomentMorph.cxx:105
 RooMomentMorph.cxx:106
 RooMomentMorph.cxx:107
 RooMomentMorph.cxx:108
 RooMomentMorph.cxx:109
 RooMomentMorph.cxx:110
 RooMomentMorph.cxx:111
 RooMomentMorph.cxx:112
 RooMomentMorph.cxx:113
 RooMomentMorph.cxx:114
 RooMomentMorph.cxx:115
 RooMomentMorph.cxx:116
 RooMomentMorph.cxx:117
 RooMomentMorph.cxx:118
 RooMomentMorph.cxx:119
 RooMomentMorph.cxx:120
 RooMomentMorph.cxx:121
 RooMomentMorph.cxx:122
 RooMomentMorph.cxx:123
 RooMomentMorph.cxx:124
 RooMomentMorph.cxx:125
 RooMomentMorph.cxx:126
 RooMomentMorph.cxx:127
 RooMomentMorph.cxx:128
 RooMomentMorph.cxx:129
 RooMomentMorph.cxx:130
 RooMomentMorph.cxx:131
 RooMomentMorph.cxx:132
 RooMomentMorph.cxx:133
 RooMomentMorph.cxx:134
 RooMomentMorph.cxx:135
 RooMomentMorph.cxx:136
 RooMomentMorph.cxx:137
 RooMomentMorph.cxx:138
 RooMomentMorph.cxx:139
 RooMomentMorph.cxx:140
 RooMomentMorph.cxx:141
 RooMomentMorph.cxx:142
 RooMomentMorph.cxx:143
 RooMomentMorph.cxx:144
 RooMomentMorph.cxx:145
 RooMomentMorph.cxx:146
 RooMomentMorph.cxx:147
 RooMomentMorph.cxx:148
 RooMomentMorph.cxx:149
 RooMomentMorph.cxx:150
 RooMomentMorph.cxx:151
 RooMomentMorph.cxx:152
 RooMomentMorph.cxx:153
 RooMomentMorph.cxx:154
 RooMomentMorph.cxx:155
 RooMomentMorph.cxx:156
 RooMomentMorph.cxx:157
 RooMomentMorph.cxx:158
 RooMomentMorph.cxx:159
 RooMomentMorph.cxx:160
 RooMomentMorph.cxx:161
 RooMomentMorph.cxx:162
 RooMomentMorph.cxx:163
 RooMomentMorph.cxx:164
 RooMomentMorph.cxx:165
 RooMomentMorph.cxx:166
 RooMomentMorph.cxx:167
 RooMomentMorph.cxx:168
 RooMomentMorph.cxx:169
 RooMomentMorph.cxx:170
 RooMomentMorph.cxx:171
 RooMomentMorph.cxx:172
 RooMomentMorph.cxx:173
 RooMomentMorph.cxx:174
 RooMomentMorph.cxx:175
 RooMomentMorph.cxx:176
 RooMomentMorph.cxx:177
 RooMomentMorph.cxx:178
 RooMomentMorph.cxx:179
 RooMomentMorph.cxx:180
 RooMomentMorph.cxx:181
 RooMomentMorph.cxx:182
 RooMomentMorph.cxx:183
 RooMomentMorph.cxx:184
 RooMomentMorph.cxx:185
 RooMomentMorph.cxx:186
 RooMomentMorph.cxx:187
 RooMomentMorph.cxx:188
 RooMomentMorph.cxx:189
 RooMomentMorph.cxx:190
 RooMomentMorph.cxx:191
 RooMomentMorph.cxx:192
 RooMomentMorph.cxx:193
 RooMomentMorph.cxx:194
 RooMomentMorph.cxx:195
 RooMomentMorph.cxx:196
 RooMomentMorph.cxx:197
 RooMomentMorph.cxx:198
 RooMomentMorph.cxx:199
 RooMomentMorph.cxx:200
 RooMomentMorph.cxx:201
 RooMomentMorph.cxx:202
 RooMomentMorph.cxx:203
 RooMomentMorph.cxx:204
 RooMomentMorph.cxx:205
 RooMomentMorph.cxx:206
 RooMomentMorph.cxx:207
 RooMomentMorph.cxx:208
 RooMomentMorph.cxx:209
 RooMomentMorph.cxx:210
 RooMomentMorph.cxx:211
 RooMomentMorph.cxx:212
 RooMomentMorph.cxx:213
 RooMomentMorph.cxx:214
 RooMomentMorph.cxx:215
 RooMomentMorph.cxx:216
 RooMomentMorph.cxx:217
 RooMomentMorph.cxx:218
 RooMomentMorph.cxx:219
 RooMomentMorph.cxx:220
 RooMomentMorph.cxx:221
 RooMomentMorph.cxx:222
 RooMomentMorph.cxx:223
 RooMomentMorph.cxx:224
 RooMomentMorph.cxx:225
 RooMomentMorph.cxx:226
 RooMomentMorph.cxx:227
 RooMomentMorph.cxx:228
 RooMomentMorph.cxx:229
 RooMomentMorph.cxx:230
 RooMomentMorph.cxx:231
 RooMomentMorph.cxx:232
 RooMomentMorph.cxx:233
 RooMomentMorph.cxx:234
 RooMomentMorph.cxx:235
 RooMomentMorph.cxx:236
 RooMomentMorph.cxx:237
 RooMomentMorph.cxx:238
 RooMomentMorph.cxx:239
 RooMomentMorph.cxx:240
 RooMomentMorph.cxx:241
 RooMomentMorph.cxx:242
 RooMomentMorph.cxx:243
 RooMomentMorph.cxx:244
 RooMomentMorph.cxx:245
 RooMomentMorph.cxx:246
 RooMomentMorph.cxx:247
 RooMomentMorph.cxx:248
 RooMomentMorph.cxx:249
 RooMomentMorph.cxx:250
 RooMomentMorph.cxx:251
 RooMomentMorph.cxx:252
 RooMomentMorph.cxx:253
 RooMomentMorph.cxx:254
 RooMomentMorph.cxx:255
 RooMomentMorph.cxx:256
 RooMomentMorph.cxx:257
 RooMomentMorph.cxx:258
 RooMomentMorph.cxx:259
 RooMomentMorph.cxx:260
 RooMomentMorph.cxx:261
 RooMomentMorph.cxx:262
 RooMomentMorph.cxx:263
 RooMomentMorph.cxx:264
 RooMomentMorph.cxx:265
 RooMomentMorph.cxx:266
 RooMomentMorph.cxx:267
 RooMomentMorph.cxx:268
 RooMomentMorph.cxx:269
 RooMomentMorph.cxx:270
 RooMomentMorph.cxx:271
 RooMomentMorph.cxx:272
 RooMomentMorph.cxx:273
 RooMomentMorph.cxx:274
 RooMomentMorph.cxx:275
 RooMomentMorph.cxx:276
 RooMomentMorph.cxx:277
 RooMomentMorph.cxx:278
 RooMomentMorph.cxx:279
 RooMomentMorph.cxx:280
 RooMomentMorph.cxx:281
 RooMomentMorph.cxx:282
 RooMomentMorph.cxx:283
 RooMomentMorph.cxx:284
 RooMomentMorph.cxx:285
 RooMomentMorph.cxx:286
 RooMomentMorph.cxx:287
 RooMomentMorph.cxx:288
 RooMomentMorph.cxx:289
 RooMomentMorph.cxx:290
 RooMomentMorph.cxx:291
 RooMomentMorph.cxx:292
 RooMomentMorph.cxx:293
 RooMomentMorph.cxx:294
 RooMomentMorph.cxx:295
 RooMomentMorph.cxx:296
 RooMomentMorph.cxx:297
 RooMomentMorph.cxx:298
 RooMomentMorph.cxx:299
 RooMomentMorph.cxx:300
 RooMomentMorph.cxx:301
 RooMomentMorph.cxx:302
 RooMomentMorph.cxx:303
 RooMomentMorph.cxx:304
 RooMomentMorph.cxx:305
 RooMomentMorph.cxx:306
 RooMomentMorph.cxx:307
 RooMomentMorph.cxx:308
 RooMomentMorph.cxx:309
 RooMomentMorph.cxx:310
 RooMomentMorph.cxx:311
 RooMomentMorph.cxx:312
 RooMomentMorph.cxx:313
 RooMomentMorph.cxx:314
 RooMomentMorph.cxx:315
 RooMomentMorph.cxx:316
 RooMomentMorph.cxx:317
 RooMomentMorph.cxx:318
 RooMomentMorph.cxx:319
 RooMomentMorph.cxx:320
 RooMomentMorph.cxx:321
 RooMomentMorph.cxx:322
 RooMomentMorph.cxx:323
 RooMomentMorph.cxx:324
 RooMomentMorph.cxx:325
 RooMomentMorph.cxx:326
 RooMomentMorph.cxx:327
 RooMomentMorph.cxx:328
 RooMomentMorph.cxx:329
 RooMomentMorph.cxx:330
 RooMomentMorph.cxx:331
 RooMomentMorph.cxx:332
 RooMomentMorph.cxx:333
 RooMomentMorph.cxx:334
 RooMomentMorph.cxx:335
 RooMomentMorph.cxx:336
 RooMomentMorph.cxx:337
 RooMomentMorph.cxx:338
 RooMomentMorph.cxx:339
 RooMomentMorph.cxx:340
 RooMomentMorph.cxx:341
 RooMomentMorph.cxx:342
 RooMomentMorph.cxx:343
 RooMomentMorph.cxx:344
 RooMomentMorph.cxx:345
 RooMomentMorph.cxx:346
 RooMomentMorph.cxx:347
 RooMomentMorph.cxx:348
 RooMomentMorph.cxx:349
 RooMomentMorph.cxx:350
 RooMomentMorph.cxx:351
 RooMomentMorph.cxx:352
 RooMomentMorph.cxx:353
 RooMomentMorph.cxx:354
 RooMomentMorph.cxx:355
 RooMomentMorph.cxx:356
 RooMomentMorph.cxx:357
 RooMomentMorph.cxx:358
 RooMomentMorph.cxx:359
 RooMomentMorph.cxx:360
 RooMomentMorph.cxx:361
 RooMomentMorph.cxx:362
 RooMomentMorph.cxx:363
 RooMomentMorph.cxx:364
 RooMomentMorph.cxx:365
 RooMomentMorph.cxx:366
 RooMomentMorph.cxx:367
 RooMomentMorph.cxx:368
 RooMomentMorph.cxx:369
 RooMomentMorph.cxx:370
 RooMomentMorph.cxx:371
 RooMomentMorph.cxx:372
 RooMomentMorph.cxx:373
 RooMomentMorph.cxx:374
 RooMomentMorph.cxx:375
 RooMomentMorph.cxx:376
 RooMomentMorph.cxx:377
 RooMomentMorph.cxx:378
 RooMomentMorph.cxx:379
 RooMomentMorph.cxx:380
 RooMomentMorph.cxx:381
 RooMomentMorph.cxx:382
 RooMomentMorph.cxx:383
 RooMomentMorph.cxx:384
 RooMomentMorph.cxx:385
 RooMomentMorph.cxx:386
 RooMomentMorph.cxx:387
 RooMomentMorph.cxx:388
 RooMomentMorph.cxx:389
 RooMomentMorph.cxx:390
 RooMomentMorph.cxx:391
 RooMomentMorph.cxx:392
 RooMomentMorph.cxx:393
 RooMomentMorph.cxx:394
 RooMomentMorph.cxx:395
 RooMomentMorph.cxx:396
 RooMomentMorph.cxx:397
 RooMomentMorph.cxx:398
 RooMomentMorph.cxx:399
 RooMomentMorph.cxx:400
 RooMomentMorph.cxx:401
 RooMomentMorph.cxx:402
 RooMomentMorph.cxx:403
 RooMomentMorph.cxx:404
 RooMomentMorph.cxx:405
 RooMomentMorph.cxx:406
 RooMomentMorph.cxx:407
 RooMomentMorph.cxx:408
 RooMomentMorph.cxx:409
 RooMomentMorph.cxx:410
 RooMomentMorph.cxx:411
 RooMomentMorph.cxx:412
 RooMomentMorph.cxx:413
 RooMomentMorph.cxx:414
 RooMomentMorph.cxx:415
 RooMomentMorph.cxx:416
 RooMomentMorph.cxx:417
 RooMomentMorph.cxx:418
 RooMomentMorph.cxx:419
 RooMomentMorph.cxx:420
 RooMomentMorph.cxx:421
 RooMomentMorph.cxx:422
 RooMomentMorph.cxx:423
 RooMomentMorph.cxx:424
 RooMomentMorph.cxx:425
 RooMomentMorph.cxx:426
 RooMomentMorph.cxx:427
 RooMomentMorph.cxx:428
 RooMomentMorph.cxx:429
 RooMomentMorph.cxx:430
 RooMomentMorph.cxx:431
 RooMomentMorph.cxx:432
 RooMomentMorph.cxx:433
 RooMomentMorph.cxx:434
 RooMomentMorph.cxx:435
 RooMomentMorph.cxx:436
 RooMomentMorph.cxx:437
 RooMomentMorph.cxx:438
 RooMomentMorph.cxx:439
 RooMomentMorph.cxx:440
 RooMomentMorph.cxx:441
 RooMomentMorph.cxx:442
 RooMomentMorph.cxx:443
 RooMomentMorph.cxx:444
 RooMomentMorph.cxx:445
 RooMomentMorph.cxx:446
 RooMomentMorph.cxx:447
 RooMomentMorph.cxx:448
 RooMomentMorph.cxx:449
 RooMomentMorph.cxx:450
 RooMomentMorph.cxx:451
 RooMomentMorph.cxx:452
 RooMomentMorph.cxx:453
 RooMomentMorph.cxx:454
 RooMomentMorph.cxx:455
 RooMomentMorph.cxx:456
 RooMomentMorph.cxx:457
 RooMomentMorph.cxx:458
 RooMomentMorph.cxx:459
 RooMomentMorph.cxx:460
 RooMomentMorph.cxx:461
 RooMomentMorph.cxx:462
 RooMomentMorph.cxx:463
 RooMomentMorph.cxx:464
 RooMomentMorph.cxx:465
 RooMomentMorph.cxx:466
 RooMomentMorph.cxx:467
 RooMomentMorph.cxx:468
 RooMomentMorph.cxx:469
 RooMomentMorph.cxx:470
 RooMomentMorph.cxx:471
 RooMomentMorph.cxx:472
 RooMomentMorph.cxx:473
 RooMomentMorph.cxx:474
 RooMomentMorph.cxx:475
 RooMomentMorph.cxx:476
 RooMomentMorph.cxx:477
 RooMomentMorph.cxx:478
 RooMomentMorph.cxx:479
 RooMomentMorph.cxx:480
 RooMomentMorph.cxx:481
 RooMomentMorph.cxx:482
 RooMomentMorph.cxx:483
 RooMomentMorph.cxx:484
 RooMomentMorph.cxx:485
 RooMomentMorph.cxx:486
 RooMomentMorph.cxx:487
 RooMomentMorph.cxx:488
 RooMomentMorph.cxx:489
 RooMomentMorph.cxx:490
 RooMomentMorph.cxx:491
 RooMomentMorph.cxx:492
 RooMomentMorph.cxx:493
 RooMomentMorph.cxx:494
 RooMomentMorph.cxx:495
 RooMomentMorph.cxx:496
 RooMomentMorph.cxx:497
 RooMomentMorph.cxx:498
 RooMomentMorph.cxx:499
 RooMomentMorph.cxx:500
 RooMomentMorph.cxx:501
 RooMomentMorph.cxx:502
 RooMomentMorph.cxx:503
 RooMomentMorph.cxx:504
 RooMomentMorph.cxx:505
 RooMomentMorph.cxx:506
 RooMomentMorph.cxx:507
 RooMomentMorph.cxx:508
 RooMomentMorph.cxx:509
 RooMomentMorph.cxx:510
 RooMomentMorph.cxx:511
 RooMomentMorph.cxx:512
 RooMomentMorph.cxx:513
 RooMomentMorph.cxx:514
 RooMomentMorph.cxx:515
 RooMomentMorph.cxx:516
 RooMomentMorph.cxx:517
 RooMomentMorph.cxx:518
 RooMomentMorph.cxx:519
 RooMomentMorph.cxx:520
 RooMomentMorph.cxx:521
 RooMomentMorph.cxx:522