#include "RooFit.h"
#include "RooNLLVar.h"
#include "RooNLLVar.h"
#include "RooAbsData.h"
#include "RooAbsPdf.h"
#include "RooCmdConfig.h"
ClassImp(RooNLLVar)
;
RooArgSet RooNLLVar::_emptySet ;
RooNLLVar::RooNLLVar(const char *name, const char* title, RooAbsPdf& pdf, RooAbsData& data,
		     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) :
  RooAbsOptGoodnessOfFit(name,title,pdf,data,
			 *(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::decodeIntOnTheFly("RooNLLVar::RooNLLVar","NumCPU",0,1,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9),
			 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 pc("RooNLLVar::RooNLLVar") ;
  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") ;
}
RooNLLVar::RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& data,
		     Bool_t extended, const char* rangeName, Int_t nCPU, Bool_t verbose, Bool_t splitRange) : 
  RooAbsOptGoodnessOfFit(name,title,pdf,data,RooArgSet(),rangeName,nCPU,verbose,splitRange),
  _extended(extended)
{
  
}
RooNLLVar::RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& data,
		     const RooArgSet& projDeps, Bool_t extended, const char* rangeName,Int_t nCPU,Bool_t verbose, Bool_t splitRange) : 
  RooAbsOptGoodnessOfFit(name,title,pdf,data,projDeps,rangeName,nCPU,verbose,splitRange),
  _extended(extended)
{
  
}
RooNLLVar::RooNLLVar(const RooNLLVar& other, const char* name) : 
  RooAbsOptGoodnessOfFit(other,name),
  _extended(other._extended)
{
}
RooNLLVar::~RooNLLVar()
{
}
Double_t RooNLLVar::evaluatePartition(Int_t firstEvent, Int_t lastEvent) const 
{
  Int_t i ;
  Double_t result(0) ;
  
  Double_t sumWeight(0) ;
  for (i=firstEvent ; i<lastEvent ; i++) {
    
    
    _dataClone->get(i);
    if (_dataClone->weight()==0) continue ;
    
    Double_t term = _dataClone->weight() * _pdfClone->getLogVal(_normSet);
    sumWeight += _dataClone->weight() ;
    
    if(term == 0) {
      cout << "RooNLLVar::evaluatePartition(" << GetName() 
	   << "): WARNING: event " << i << " has zero or negative probability" << endl ;
      return 0 ;
    }
    result-= term;
  }
  
  
  if(_extended && firstEvent==0) {
    result+= _pdfClone->extendedTerm((Int_t)_dataClone->sumEntries(),_dataClone->get());
  }    
  
  
  if (_simCount>1) {
    result += sumWeight*log(1.0*_simCount) ;
  }
  return result ;
}
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.