Logo ROOT  
Reference Guide
RooNLLVar.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooNLLVar.h,v 1.10 2007/07/21 21:32:52 wouter Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_NLL_VAR
17 #define ROO_NLL_VAR
18 
19 #include "RooAbsOptTestStatistic.h"
20 #include "RooCmdArg.h"
21 #include "RooAbsPdf.h"
22 #include <vector>
23 #include <utility>
24 
25 class RooRealSumPdf ;
26 
28 public:
29 
30  // Constructors, assignment etc
32  RooNLLVar(const char *name, const char* title, RooAbsPdf& pdf, RooAbsData& data,
33  const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),const RooCmdArg& arg3=RooCmdArg::none(),
34  const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none(),
35  const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none(),const RooCmdArg& arg9=RooCmdArg::none()) ;
36 
37  RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& data,
38  Bool_t extended, const char* rangeName=0, const char* addCoefRangeName=0,
40  Bool_t cloneData=kTRUE, Bool_t binnedL=kFALSE) ;
41 
42  RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& data,
43  const RooArgSet& projDeps, Bool_t extended=kFALSE, const char* rangeName=0,
44  const char* addCoefRangeName=0, Int_t nCPU=1, RooFit::MPSplit interleave=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE,
45  Bool_t cloneData=kTRUE, Bool_t binnedL=kFALSE) ;
46 
47  RooNLLVar(const RooNLLVar& other, const char* name=0);
48  virtual TObject* clone(const char* newname) const { return new RooNLLVar(*this,newname); }
49 
50  virtual RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
51  const RooArgSet& projDeps, const char* rangeName, const char* addCoefRangeName=0,
52  Int_t nCPU=1, RooFit::MPSplit interleave=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE, Bool_t binnedL=kFALSE) {
53  return new RooNLLVar(name,title,(RooAbsPdf&)pdf,adata,projDeps,_extended,rangeName, addCoefRangeName, nCPU, interleave,verbose,splitRange,kFALSE,binnedL) ;
54  }
55 
56  virtual ~RooNLLVar();
57 
58  void applyWeightSquared(Bool_t flag) ;
59 
60  virtual Double_t defaultErrorLevel() const { return 0.5 ; }
61 
62  void batchMode(bool on = true) {
63  _batchEvaluations = on;
64  }
65 
66 protected:
67 
68  virtual Bool_t processEmptyDataSets() const { return _extended ; }
69  virtual Double_t evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const;
70 
71  static RooArgSet _emptySet ; // Supports named argument constructor
72 
73 private:
74  std::tuple<double, double, double> computeBatched(
75  std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const;
76 
77  std::tuple<double, double, double> computeScalar(
78  std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const;
79 
81  bool _batchEvaluations{false};
82  Bool_t _weightSq ; // Apply weights squared?
83  mutable Bool_t _first ; //!
86 
87  mutable std::vector<Double_t> _binw ; //!
88  mutable RooRealSumPdf* _binnedPdf ; //!
89 
90  ClassDef(RooNLLVar,3) // Function representing (extended) -log(L) of p.d.f and dataset
91 };
92 
93 #endif
94 
RooCmdArg
Definition: RooCmdArg.h:27
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooNLLVar::evaluatePartition
virtual Double_t evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const
Calculate and return likelihood on subset of data.
Definition: RooNLLVar.cxx:255
RooNLLVar::_offsetSaveW2
Double_t _offsetSaveW2
Definition: RooNLLVar.h:84
RooAbsData
Definition: RooAbsData.h:46
RooAbsOptTestStatistic::data
RooAbsData & data()
Definition: RooAbsOptTestStatistic.cxx:792
RooNLLVar::_binnedPdf
RooRealSumPdf * _binnedPdf
Definition: RooNLLVar.h:88
RooNLLVar::defaultErrorLevel
virtual Double_t defaultErrorLevel() const
Definition: RooNLLVar.h:60
RooNLLVar::batchMode
void batchMode(bool on=true)
Definition: RooNLLVar.h:62
RooAbsOptTestStatistic.h
RooFit::MPSplit
MPSplit
Definition: RooGlobalFunc.h:70
RooAbsReal
Definition: RooAbsReal.h:61
RooNLLVar::computeBatched
std::tuple< double, double, double > computeBatched(std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const
Definition: RooNLLVar.cxx:443
RooNLLVar::computeScalar
std::tuple< double, double, double > computeScalar(std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const
Definition: RooNLLVar.cxx:510
RooCmdArg::none
static const RooCmdArg & none()
Return reference to null argument.
Definition: RooCmdArg.cxx:52
RooNLLVar::_extended
Bool_t _extended
Definition: RooNLLVar.h:80
bool
RooAbsTestStatistic
Definition: RooAbsTestStatistic.h:37
RooNLLVar::clone
virtual TObject * clone(const char *newname) const
Definition: RooNLLVar.h:48
RooAbsPdf.h
RooNLLVar::processEmptyDataSets
virtual Bool_t processEmptyDataSets() const
Definition: RooNLLVar.h:68
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooNLLVar::RooNLLVar
RooNLLVar()
Definition: RooNLLVar.h:31
RooNLLVar
Definition: RooNLLVar.h:27
RooNLLVar::_binw
std::vector< Double_t > _binw
Definition: RooNLLVar.h:87
RooNLLVar::_batchEvaluations
bool _batchEvaluations
Definition: RooNLLVar.h:81
RooNLLVar::create
virtual RooAbsTestStatistic * create(const char *name, const char *title, RooAbsReal &pdf, RooAbsData &adata, const RooArgSet &projDeps, const char *rangeName, const char *addCoefRangeName=0, Int_t nCPU=1, RooFit::MPSplit interleave=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE, Bool_t binnedL=kFALSE)
Definition: RooNLLVar.h:50
RooFit::BulkPartition
@ BulkPartition
Definition: RooGlobalFunc.h:70
RooNLLVar::_first
Bool_t _first
Definition: RooNLLVar.h:83
RooCmdArg.h
RooNLLVar::_offsetCarrySaveW2
Double_t _offsetCarrySaveW2
Definition: RooNLLVar.h:85
Double_t
double Double_t
Definition: RtypesCore.h:59
RooNLLVar::applyWeightSquared
void applyWeightSquared(Bool_t flag)
Definition: RooNLLVar.cxx:226
RooAbsOptTestStatistic
Definition: RooAbsOptTestStatistic.h:28
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooNLLVar::_weightSq
Bool_t _weightSq
Definition: RooNLLVar.h:82
RooAbsPdf
Definition: RooAbsPdf.h:40
RooNLLVar::_emptySet
static RooArgSet _emptySet
Definition: RooNLLVar.h:71
RooRealSumPdf
Definition: RooRealSumPdf.h:25
RooArgSet
Definition: RooArgSet.h:28
int
RooNLLVar::~RooNLLVar
virtual ~RooNLLVar()
Destructor.
Definition: RooNLLVar.cxx:217