/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 * @(#)root/roofitcore:$Id$
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/

//////////////////////////////////////////////////////////////////////////////
//
// BEGIN_HTML
// Class RooNLLVar implements a a -log(likelihood) calculation from a dataset
// and a PDF. The NLL is calculated as 
// <pre>
//  Sum[data] -log( pdf(x_data) )
// </pre>
// In extended mode, a (Nexpect - Nobserved*log(NExpected) term is added
// END_HTML
//

#include <algorithm>

#include "RooFit.h"
#include "Riostream.h"
#include "TMath.h"

#include "RooNLLVar.h"
#include "RooAbsData.h"
#include "RooAbsPdf.h"
#include "RooCmdConfig.h"
#include "RooMsgService.h"
#include "RooAbsDataStore.h"
#include "RooRealMPFE.h"
#include "RooRealSumPdf.h"
#include "RooRealVar.h"
#include "RooProdPdf.h"

ClassImp(RooNLLVar)
;

RooArgSet RooNLLVar::_emptySet ;


//_____________________________________________________________________________
RooNLLVar::RooNLLVar(const char *name, const char* title, RooAbsPdf& pdf, RooAbsData& indata,
		     const RooCmdArg& arg1, const RooCmdArg& arg2,const RooCmdArg& arg3,
		     const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6,
		     const RooCmdArg& arg7, const RooCmdArg& arg8,const RooCmdArg& arg9) :
  RooAbsOptTestStatistic(name,title,pdf,indata,
			 *(const RooArgSet*)RooCmdConfig::decodeObjOnTheFly("RooNLLVar::RooNLLVar","ProjectedObservables",0,&_emptySet
									    ,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9),
			 RooCmdConfig::decodeStringOnTheFly("RooNLLVar::RooNLLVar","RangeWithName",0,"",arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9),
			 RooCmdConfig::decodeStringOnTheFly("RooNLLVar::RooNLLVar","AddCoefRange",0,"",arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9),
			 RooCmdConfig::decodeIntOnTheFly("RooNLLVar::RooNLLVar","NumCPU",0,1,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9),
			 RooFit::BulkPartition,
			 RooCmdConfig::decodeIntOnTheFly("RooNLLVar::RooNLLVar","Verbose",0,1,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9),
			 RooCmdConfig::decodeIntOnTheFly("RooNLLVar::RooNLLVar","SplitRange",0,0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9),
			 RooCmdConfig::decodeIntOnTheFly("RooNLLVar::RooNLLVar","CloneData",0,1,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9))             
{
  // Construct likelihood from given p.d.f and (binned or unbinned dataset)
  //
  //  Extended()     -- Include extended term in calculation
  //  NumCPU()       -- Activate parallel processing feature
  //  Range()        -- Fit only selected region
  //  SumCoefRange() -- Set the range in which to interpret the coefficients of RooAddPdf components 
  //  SplitRange()   -- Fit range is split by index catory of simultaneous PDF
  //  ConditionalObservables() -- Define conditional observables 
  //  Verbose()      -- Verbose output of GOF framework classes
  //  CloneData()    -- Clone input dataset for internal use (default is kTRUE)

  RooCmdConfig pc("RooNLLVar::RooNLLVar") ;
  pc.allowUndefined() ;
  pc.defineInt("extended","Extended",0,kFALSE) ;

  pc.process(arg1) ;  pc.process(arg2) ;  pc.process(arg3) ;
  pc.process(arg4) ;  pc.process(arg5) ;  pc.process(arg6) ;
  pc.process(arg7) ;  pc.process(arg8) ;  pc.process(arg9) ;

  _extended = pc.getInt("extended") ;
  _weightSq = kFALSE ;
  _first = kTRUE ;
  _offset = 0.;
  _offsetCarry = 0.;
  _offsetSaveW2 = 0.;
  _offsetCarrySaveW2 = 0.;

  _binnedPdf = 0 ;
}



//_____________________________________________________________________________
RooNLLVar::RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& indata,
		     Bool_t extended, const char* rangeName, const char* addCoefRangeName,
		     Int_t nCPU, RooFit::MPSplit interleave, Bool_t verbose, Bool_t splitRange, Bool_t cloneData, Bool_t binnedL) : 
  RooAbsOptTestStatistic(name,title,pdf,indata,RooArgSet(),rangeName,addCoefRangeName,nCPU,interleave,verbose,splitRange,cloneData),
  _extended(extended),
  _weightSq(kFALSE),
  _first(kTRUE), _offsetSaveW2(0.), _offsetCarrySaveW2(0.)
{
  // Construct likelihood from given p.d.f and (binned or unbinned dataset)
  // For internal use.

  // If binned likelihood flag is set, pdf is a RooRealSumPdf representing a yield vector
  // for a binned likelihood calculation
  _binnedPdf = binnedL ? (RooRealSumPdf*)_funcClone : 0 ;

  // Retrieve and cache bin widths needed to convert unnormalized binnedPdf values back to yields
  if (_binnedPdf) {

    // The Active label will disable pdf integral calculations
    _binnedPdf->setAttribute("BinnedLikelihoodActive") ;
    
    RooArgSet* obs = _funcClone->getObservables(_dataClone) ;
    if (obs->getSize()!=1) {
      _binnedPdf = 0 ;
    } else {
      RooRealVar* var = (RooRealVar*) obs->first() ;
      std::list<Double_t>* boundaries = _binnedPdf->binBoundaries(*var,var->getMin(),var->getMax()) ;
      std::list<Double_t>::iterator biter = boundaries->begin() ;
      _binw.resize(boundaries->size()-1) ;
      Double_t lastBound = (*biter) ;
      biter++ ;
      int ibin=0 ;
      while (biter!=boundaries->end()) {
	_binw[ibin] = (*biter) - lastBound ;
	lastBound = (*biter) ;
	ibin++ ;
	biter++ ;
      }
    }
  }
}



//_____________________________________________________________________________
RooNLLVar::RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& indata,
		     const RooArgSet& projDeps, Bool_t extended, const char* rangeName,const char* addCoefRangeName, 
		     Int_t nCPU,RooFit::MPSplit interleave,Bool_t verbose, Bool_t splitRange, Bool_t cloneData, Bool_t binnedL) : 
  RooAbsOptTestStatistic(name,title,pdf,indata,projDeps,rangeName,addCoefRangeName,nCPU,interleave,verbose,splitRange,cloneData),
  _extended(extended),
  _weightSq(kFALSE),
  _first(kTRUE), _offsetSaveW2(0.), _offsetCarrySaveW2(0.)
{
  // Construct likelihood from given p.d.f and (binned or unbinned dataset)
  // For internal use.  

  // If binned likelihood flag is set, pdf is a RooRealSumPdf representing a yield vector
  // for a binned likelihood calculation
  _binnedPdf = binnedL ? (RooRealSumPdf*)_funcClone : 0 ;

  // Retrieve and cache bin widths needed to convert unnormalized binnedPdf values back to yields
  if (_binnedPdf) {
    
    RooArgSet* obs = _funcClone->getObservables(_dataClone) ;
    if (obs->getSize()!=1) {
      _binnedPdf = 0 ;
    } else {
      RooRealVar* var = (RooRealVar*) obs->first() ;
      std::list<Double_t>* boundaries = _binnedPdf->binBoundaries(*var,var->getMin(),var->getMax()) ;
      std::list<Double_t>::iterator biter = boundaries->begin() ;
      _binw.resize(boundaries->size()-1) ;
      Double_t lastBound = (*biter) ;
      biter++ ;
      int ibin=0 ;
      while (biter!=boundaries->end()) {
	_binw[ibin] = (*biter) - lastBound ;
	lastBound = (*biter) ;
	ibin++ ;
	biter++ ;
      }
    }
  }
}



//_____________________________________________________________________________
RooNLLVar::RooNLLVar(const RooNLLVar& other, const char* name) : 
  RooAbsOptTestStatistic(other,name),
  _extended(other._extended),
  _weightSq(other._weightSq),
  _first(kTRUE), _offsetSaveW2(other._offsetSaveW2),
  _offsetCarrySaveW2(other._offsetCarrySaveW2),
  _binw(other._binw) {
  // Copy constructor

  _binnedPdf = other._binnedPdf ? (RooRealSumPdf*)_funcClone : 0 ;
}




//_____________________________________________________________________________
RooNLLVar::~RooNLLVar()
{
  // Destructor
}




//_____________________________________________________________________________
void RooNLLVar::applyWeightSquared(Bool_t flag) 
{ 
  if (_gofOpMode==Slave) {
    if (flag != _weightSq) {
      _weightSq = flag;
      std::swap(_offset, _offsetSaveW2);
      std::swap(_offsetCarry, _offsetCarrySaveW2);
    }
    setValueDirty();
  } else if ( _gofOpMode==MPMaster) {
    for (Int_t i=0 ; i<_nCPU ; i++)
      _mpfeArray[i]->applyNLLWeightSquared(flag);
  } else if ( _gofOpMode==SimMaster) {
    for (Int_t i=0 ; i<_nGof ; i++)
      ((RooNLLVar*)_gofArray[i])->applyWeightSquared(flag);
  }
} 



//_____________________________________________________________________________
Double_t RooNLLVar::evaluatePartition(Int_t firstEvent, Int_t lastEvent, Int_t stepSize) const 
{
  // Calculate and return likelihood on subset of data from firstEvent to lastEvent
  // processed with a step size of 'stepSize'. If this an extended likelihood and
  // and the zero event is processed the extended term is added to the return
  // likelihood.

  // Throughout the calculation, we use Kahan's algorithm for summing to
  // prevent loss of precision - this is a factor four more expensive than
  // straight addition, but since evaluating the PDF is usually much more
  // expensive than that, we tolerate the additional cost...
  Int_t i ;
  Double_t result(0), carry(0);
  
  RooAbsPdf* pdfClone = (RooAbsPdf*) _funcClone ;

  // cout << "RooNLLVar::evaluatePartition(" << GetName() << ") projDeps = " << (_projDeps?*_projDeps:RooArgSet()) << endl ;
  
  _dataClone->store()->recalculateCache( _projDeps, firstEvent, lastEvent, stepSize,(_binnedPdf?kFALSE:kTRUE) ) ;

  Double_t sumWeight(0), sumWeightCarry(0);

  // If pdf is marked as binned - do a binned likelihood calculation here (sum of log-Poisson for each bin)
  if (_binnedPdf) {

    for (i=firstEvent ; i<lastEvent ; i+=stepSize) {
      
      _dataClone->get(i) ;
      
      if (!_dataClone->valid()) continue;
      
      Double_t eventWeight = _dataClone->weight();


      // Calculate log(Poisson(N|mu) for this bin
      Double_t N = eventWeight ;
      Double_t mu = _binnedPdf->getVal()*_binw[i] ; 
      //cout << "RooNLLVar::binnedL(" << GetName() << ") N=" << N << " mu = " << mu << endl ;

      if (mu<=0 && N>0) {

	// Catch error condition: data present where zero events are predicted
	logEvalError(Form("Observed %f events in bin %d with zero event yield",N,i)) ;
	
      } else if (fabs(mu)<1e-10 && fabs(N)<1e-10) {

	// Special handling of this case since log(Poisson(0,0)=0 but can't be calculated with usual log-formula
	// since log(mu)=0. No update of result is required since term=0.

      } else {

	Double_t term = -1*(-mu + N*log(mu) - TMath::LnGamma(N+1)) ;

	// Kahan summation of sumWeight
	Double_t y = eventWeight - sumWeightCarry;
	Double_t t = sumWeight + y;
	sumWeightCarry = (t - sumWeight) - y;
	sumWeight = t;
	
	// Kahan summation of result
	y = term - carry;
	t = result + y;
	carry = (t - result) - y;
	result = t;
      }
    }


  } else {

    for (i=firstEvent ; i<lastEvent ; i+=stepSize) {
            
      _dataClone->get(i) ;
      
      if (!_dataClone->valid()) continue;
      
      Double_t eventWeight = _dataClone->weight();
      if (0. == eventWeight * eventWeight) continue ;
      if (_weightSq) eventWeight = _dataClone->weightSquared() ;
      
      Double_t term = -eventWeight * pdfClone->getLogVal(_normSet);
      
      
      Double_t y = eventWeight - sumWeightCarry;
      Double_t t = sumWeight + y;
      sumWeightCarry = (t - sumWeight) - y;
      sumWeight = t;
      
      y = term - carry;
      t = result + y;
      carry = (t - result) - y;
      result = t;
    }
    
    // include the extended maximum likelihood term, if requested
    if(_extended && _setNum==_extSet) {
      if (_weightSq) {
	
	// Calculate sum of weights-squared here for extended term
	Double_t sumW2(0), sumW2carry(0);
	for (i=0 ; i<_dataClone->numEntries() ; i++) {
	  _dataClone->get(i);
	  Double_t y = _dataClone->weightSquared() - sumW2carry;
	  Double_t t = sumW2 + y;
	  sumW2carry = (t - sumW2) - y;
	  sumW2 = t;
	}

	Double_t expected= pdfClone->expectedEvents(_dataClone->get());
		
	// Adjust calculation of extended term with W^2 weighting: adjust poisson such that 
	// estimate of Nexpected stays at the same value, but has a different variance, rescale
        // both the observed and expected count of the Poisson with a factor sum[w] / sum[w^2] which is 
        // the effective weight of the Poisson term. 
	// i.e. change Poisson(Nobs = sum[w]| Nexp ) --> Poisson( sum[w] * sum[w] / sum[w^2] | Nexp * sum[w] / sum[w^2] )
        // weighted by the effective weight  sum[w^2]/ sum[w] in the likelihood. 
        // Since here we compute the likelihood with the weight square we need to multiply by the 
        // square of the effective weight 
        // expectedW = expected * sum[w] / sum[w^2]   : effective expected entries
        // observedW =  sum[w]  * sum[w] / sum[w^2]   : effective observed entries
        // The extended term for the likelihood weighted by the square of the weight will be then: 
        //  (sum[w^2]/ sum[w] )^2 * expectedW -  (sum[w^2]/ sum[w] )^2 * observedW * log (expectedW)  and this is  
        //  using the previous expressions for expectedW and observedW
        //  sum[w^2] / sum[w] * expected - sum[w^2] * log (expectedW)
        //  and since the weights are constants in the likelihood we can use log(expected) instead of log(expectedW)

	Double_t expectedW2 = expected * sumW2 / _dataClone->sumEntries() ;
	Double_t extra= expectedW2 - sumW2*log(expected );	

	// Double_t y = pdfClone->extendedTerm(sumW2, _dataClone->get()) - carry;
	    
	Double_t y = extra - carry ;

	Double_t t = result + y;
	carry = (t - result) - y;
	result = t;
      } else {
	Double_t y = pdfClone->extendedTerm(_dataClone->sumEntries(), _dataClone->get()) - carry;
	Double_t t = result + y;
	carry = (t - result) - y;
	result = t;
      }
    }    
  }


  // If part of simultaneous PDF normalize probability over 
  // number of simultaneous PDFs: -sum(log(p/n)) = -sum(log(p)) + N*log(n) 
  if (_simCount>1) {
    Double_t y = sumWeight*log(1.0*_simCount) - carry;
    Double_t t = result + y;
    carry = (t - result) - y;
    result = t;
  }

  //timer.Stop() ;
  //cout << "RooNLLVar::evalPart(" << GetName() << ") SET=" << _setNum << " first=" << firstEvent << ", last=" << lastEvent << ", step=" << stepSize << ") result = " << result << " CPU = " << timer.CpuTime() << endl ;

  // At the end of the first full calculation, wire the caches
  if (_first) {
    _first = kFALSE ;
    _funcClone->wireAllCaches() ;
  }
  

  // Check if value offset flag is set.
  if (_doOffset) {
    
    // If no offset is stored enable this feature now
    if (_offset==0 && result !=0 ) {
      coutI(Minimization) << "RooNLLVar::evaluatePartition(" << GetName() << ") first = "<< firstEvent << " last = " << lastEvent << " Likelihood offset now set to " << result << std::endl ;
      _offset = result ;
      _offsetCarry = carry;
    }

    // Substract offset
    Double_t y = -_offset - (carry + _offsetCarry);
    Double_t t = result + y;
    carry = (t - result) - y;
    result = t;
  }

    
  _evalCarry = carry;
  return result ;
}




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