Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
20#include "RooCmdArg.h"
21#include "RooAbsPdf.h"
22#include <vector>
23#include <utility>
24
25class RooRealSumPdf ;
26namespace RooBatchCompute {
27struct RunContext;
28}
29
31public:
32
33 // Constructors, assignment etc
34 RooNLLVar();
35 RooNLLVar(const char *name, const char* title, RooAbsPdf& pdf, RooAbsData& data,
36 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),const RooCmdArg& arg3=RooCmdArg::none(),
37 const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none(),
38 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none(),const RooCmdArg& arg9=RooCmdArg::none()) ;
39
40 RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& data,
41 Bool_t extended, const char* rangeName=0, const char* addCoefRangeName=0,
42 Int_t nCPU=1, RooFit::MPSplit interleave=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE,
43 Bool_t cloneData=kTRUE, Bool_t binnedL=kFALSE, double integrateBinsPrecision = -1.) ;
44
45 RooNLLVar(const char *name, const char *title, RooAbsPdf& pdf, RooAbsData& data,
46 const RooArgSet& projDeps, Bool_t extended=kFALSE, const char* rangeName=0,
47 const char* addCoefRangeName=0, Int_t nCPU=1, RooFit::MPSplit interleave=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE,
48 Bool_t cloneData=kTRUE, Bool_t binnedL=kFALSE, double integrateBinsPrecision = -1.) ;
49
50 RooNLLVar(const RooNLLVar& other, const char* name=0);
51 virtual TObject* clone(const char* newname) const { return new RooNLLVar(*this,newname); }
52
53 virtual RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
54 const RooArgSet& projDeps, const char* rangeName, const char* addCoefRangeName=0,
55 Int_t nCPU=1, RooFit::MPSplit interleave=RooFit::BulkPartition, Bool_t verbose=kTRUE, Bool_t splitRange=kFALSE, Bool_t binnedL=kFALSE);
56
57 virtual ~RooNLLVar();
58
59 void applyWeightSquared(Bool_t flag) ;
60
61 virtual Double_t defaultErrorLevel() const { return 0.5 ; }
62
63 void batchMode(bool on = true) {
65 }
66
67protected:
68
69 virtual Bool_t processEmptyDataSets() const { return _extended ; }
70 virtual Double_t evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const;
71
72 static RooArgSet _emptySet ; // Supports named argument constructor
73
74private:
75 std::tuple<double, double, double> computeBatched(
76 std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const;
77
78 std::tuple<double, double, double> computeScalar(
79 std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const;
80
82 bool _batchEvaluations{false};
83 Bool_t _weightSq{false}; // Apply weights squared?
84 mutable Bool_t _first{true}; //!
87
88 mutable std::vector<Double_t> _binw ; //!
89 mutable RooRealSumPdf* _binnedPdf{nullptr}; //!
90 mutable std::unique_ptr<RooBatchCompute::RunContext> _evalData; //! Struct to store function evaluation workspaces.
91
92 ClassDef(RooNLLVar,3) // Function representing (extended) -log(L) of p.d.f and dataset
93};
94
95#endif
96
const Bool_t kFALSE
Definition RtypesCore.h:92
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:49
RooAbsOptTestStatistic is the abstract base class for test statistics objects that evaluate a functio...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:61
RooAbsTestStatistic is the abstract base class for all test statistics.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:29
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition RooCmdArg.h:27
static const RooCmdArg & none()
Return reference to null argument.
Definition RooCmdArg.cxx:52
Class RooNLLVar implements a -log(likelihood) calculation from a dataset and a PDF.
Definition RooNLLVar.h:30
void applyWeightSquared(Bool_t flag)
virtual TObject * clone(const char *newname) const
Definition RooNLLVar.h:51
RooRealSumPdf * _binnedPdf
Definition RooNLLVar.h:89
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)
Create a test statistic using several properties of the current instance.
Bool_t _extended
Definition RooNLLVar.h:81
bool _batchEvaluations
Definition RooNLLVar.h:82
static RooArgSet _emptySet
Definition RooNLLVar.h:72
virtual ~RooNLLVar()
Destructor.
Bool_t _first
Definition RooNLLVar.h:84
void batchMode(bool on=true)
Definition RooNLLVar.h:63
virtual Double_t defaultErrorLevel() const
Definition RooNLLVar.h:61
virtual Bool_t processEmptyDataSets() const
Definition RooNLLVar.h:69
std::vector< Double_t > _binw
Definition RooNLLVar.h:88
Double_t _offsetCarrySaveW2
Definition RooNLLVar.h:86
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.
Double_t _offsetSaveW2
Definition RooNLLVar.h:85
std::tuple< double, double, double > computeBatched(std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const
Compute probabilites of all data events.
std::tuple< double, double, double > computeScalar(std::size_t stepSize, std::size_t firstEvent, std::size_t lastEvent) const
std::unique_ptr< RooBatchCompute::RunContext > _evalData
Definition RooNLLVar.h:90
Bool_t _weightSq
Definition RooNLLVar.h:83
The class RooRealSumPdf implements a PDF constructed from a sum of functions:
Mother of all ROOT objects.
Definition TObject.h:37
Namespace for dispatching RooFit computations to various backends.
@ BulkPartition