Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RooFit::TestStatistics::RooSumL Class Reference

Likelihood class that sums over multiple -log components.

The likelihood is often a product of components, for instance when fitting simultaneous pdfs, but also when using subsidiary pdfs. Hence, the negative log likelihood that we, in fact, calculate is often a sum over these components. This sum is implemented by this class.

Definition at line 25 of file RooSumL.h.

Public Types

enum class  Extended { Auto , Yes , No }

Public Member Functions

 RooSumL (RooAbsPdf *pdf, RooAbsData *data, std::vector< std::unique_ptr< RooAbsL > > components, RooAbsL::Extended extended=RooAbsL::Extended::Auto)
void constOptimizeTestStatistic (RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt) override
 Interface function signaling a request to perform constant term optimization.
virtual double defaultErrorLevel () const
ROOT::Math::KahanSum< doubleevaluatePartition (Section events, std::size_t components_begin, std::size_t components_end) override
std::string GetClassName () const override
const std::vector< std::unique_ptr< RooAbsL > > & GetComponents () const
virtual std::string GetInfo () const
virtual std::string GetName () const
std::size_t getNComponents () const
std::size_t getNEvents () const
virtual std::unique_ptr< RooArgSetgetParameters ()
ROOT::Math::KahanSum< doublegetSubsidiaryValue ()
virtual std::string GetTitle () const
void initClones (RooAbsPdf &inpdf, RooAbsData &indata)
bool isExtended () const
virtual std::size_t numDataEntries () const
 Number of dataset entries.
void setSimCount (std::size_t value)

Static Public Member Functions

static bool isExtendedHelper (RooAbsPdf *pdf, Extended extended)

Protected Attributes

std::shared_ptr< RooAbsDatadata_
bool extended_ = false
std::size_t N_components_ = 1
std::size_t N_events_ = 1
std::unique_ptr< RooArgSetnormSet_
 Pointer to set with observables used for normalization.
std::shared_ptr< RooAbsPdfpdf_
std::size_t sim_count_ = 1

Private Attributes

std::vector< std::unique_ptr< RooAbsL > > components_

#include <RooFit/TestStatistics/RooSumL.h>

Inheritance diagram for RooFit::TestStatistics::RooSumL:
RooFit::TestStatistics::RooAbsL

Member Enumeration Documentation

◆ Extended

enum class RooFit::TestStatistics::RooAbsL::Extended
stronginherited
Enumerator
Auto 
Yes 
No 

Definition at line 35 of file RooAbsL.h.

Constructor & Destructor Documentation

◆ RooSumL()

RooFit::TestStatistics::RooSumL::RooSumL ( RooAbsPdf * pdf,
RooAbsData * data,
std::vector< std::unique_ptr< RooAbsL > > components,
RooAbsL::Extended extended = RooAbsL::Extended::Auto )
Parameters
[in]pdfRaw pointer to the pdf; will not be cloned in this object.
[in]dataRaw pointer to the dataset; will not be cloned in this object.
[in]componentsThe component likelihoods.
extendedSet extended term calculation on, off or use Extended::Auto to determine automatically based on the pdf whether to activate or not.
Warning
components must be passed with std::move, otherwise it cannot be moved into the RooSumL because of the unique_ptr!
Note
The number of events in RooSumL is that of the full dataset. Components will have their own number of events that may be more relevant.

Definition at line 43 of file RooSumL.cxx.

Member Function Documentation

◆ constOptimizeTestStatistic()

void RooFit::TestStatistics::RooSumL::constOptimizeTestStatistic ( RooAbsArg::ConstOpCode opcode,
bool doAlsoTrackingOpt )
overridevirtual

Interface function signaling a request to perform constant term optimization.

The default implementation takes no action other than to forward the calls to all servers. May be overridden in likelihood classes without a cached dataset, like RooSubsidiaryL.

Reimplemented from RooFit::TestStatistics::RooAbsL.

Definition at line 123 of file RooSumL.cxx.

◆ defaultErrorLevel()

virtual double RooFit::TestStatistics::RooAbsL::defaultErrorLevel ( ) const
inlinevirtualinherited

Definition at line 124 of file RooAbsL.h.

◆ evaluatePartition()

ROOT::Math::KahanSum< double > RooFit::TestStatistics::RooSumL::evaluatePartition ( Section events,
std::size_t components_begin,
std::size_t components_end )
overridevirtual
Note
Compared to the RooAbsTestStatistic implementation that this was taken from, we leave out Hybrid and SimComponents interleaving support here. This should be implemented by a calculator (i.e. LikelihoodWrapper or LikelihoodGradientWrapper derived class), if desired.

Implements RooFit::TestStatistics::RooAbsL.

Definition at line 92 of file RooSumL.cxx.

◆ GetClassName()

std::string RooFit::TestStatistics::RooSumL::GetClassName ( ) const
inlineoverridevirtual

Implements RooFit::TestStatistics::RooAbsL.

Definition at line 40 of file RooSumL.h.

◆ GetComponents()

const std::vector< std::unique_ptr< RooAbsL > > & RooFit::TestStatistics::RooSumL::GetComponents ( ) const
inline

Definition at line 42 of file RooSumL.h.

◆ GetInfo()

virtual std::string RooFit::TestStatistics::RooAbsL::GetInfo ( ) const
inlinevirtualinherited

Reimplemented in RooFit::TestStatistics::RooSubsidiaryL.

Definition at line 120 of file RooAbsL.h.

◆ GetName()

std::string RooFit::TestStatistics::RooAbsL::GetName ( ) const
virtualinherited

Reimplemented in RooFit::TestStatistics::RooSubsidiaryL.

Definition at line 287 of file RooAbsL.cxx.

◆ getNComponents()

std::size_t RooFit::TestStatistics::RooAbsL::getNComponents ( ) const
inlineinherited

Definition at line 131 of file RooAbsL.h.

◆ getNEvents()

std::size_t RooFit::TestStatistics::RooAbsL::getNEvents ( ) const
inlineinherited

Definition at line 130 of file RooAbsL.h.

◆ getParameters()

std::unique_ptr< RooArgSet > RooFit::TestStatistics::RooAbsL::getParameters ( )
virtualinherited

Reimplemented in RooFit::TestStatistics::RooSubsidiaryL.

Definition at line 238 of file RooAbsL.cxx.

◆ getSubsidiaryValue()

ROOT::Math::KahanSum< double > RooFit::TestStatistics::RooSumL::getSubsidiaryValue ( )
Note
This function assumes there is only one subsidiary component.

Definition at line 112 of file RooSumL.cxx.

◆ GetTitle()

std::string RooFit::TestStatistics::RooAbsL::GetTitle ( ) const
virtualinherited

Reimplemented in RooFit::TestStatistics::RooSubsidiaryL.

Definition at line 294 of file RooAbsL.cxx.

◆ initClones()

void RooFit::TestStatistics::RooAbsL::initClones ( RooAbsPdf & inpdf,
RooAbsData & indata )
inherited

Definition at line 125 of file RooAbsL.cxx.

◆ isExtended()

bool RooFit::TestStatistics::RooAbsL::isExtended ( ) const
inlineinherited

Definition at line 132 of file RooAbsL.h.

◆ isExtendedHelper()

bool RooFit::TestStatistics::RooAbsL::isExtendedHelper ( RooAbsPdf * pdf,
Extended extended )
staticinherited

Definition at line 35 of file RooAbsL.cxx.

◆ numDataEntries()

std::size_t RooFit::TestStatistics::RooAbsL::numDataEntries ( ) const
virtualinherited

Number of dataset entries.

Typically equal to the number of dataset events, except in RooSubsidiaryL, which has no events.

Reimplemented in RooFit::TestStatistics::RooSubsidiaryL.

Definition at line 301 of file RooAbsL.cxx.

◆ setSimCount()

void RooFit::TestStatistics::RooAbsL::setSimCount ( std::size_t value)
inlineinherited

Definition at line 133 of file RooAbsL.h.

Member Data Documentation

◆ components_

std::vector<std::unique_ptr<RooAbsL> > RooFit::TestStatistics::RooSumL::components_
private

Definition at line 45 of file RooSumL.h.

◆ data_

std::shared_ptr<RooAbsData> RooFit::TestStatistics::RooAbsL::data_
protectedinherited

Definition at line 143 of file RooAbsL.h.

◆ extended_

bool RooFit::TestStatistics::RooAbsL::extended_ = false
protectedinherited

Definition at line 149 of file RooAbsL.h.

◆ N_components_

std::size_t RooFit::TestStatistics::RooAbsL::N_components_ = 1
protectedinherited

Definition at line 147 of file RooAbsL.h.

◆ N_events_

std::size_t RooFit::TestStatistics::RooAbsL::N_events_ = 1
protectedinherited

Definition at line 146 of file RooAbsL.h.

◆ normSet_

std::unique_ptr<RooArgSet> RooFit::TestStatistics::RooAbsL::normSet_
protectedinherited

Pointer to set with observables used for normalization.

Definition at line 144 of file RooAbsL.h.

◆ pdf_

std::shared_ptr<RooAbsPdf> RooFit::TestStatistics::RooAbsL::pdf_
protectedinherited

Definition at line 142 of file RooAbsL.h.

◆ sim_count_

std::size_t RooFit::TestStatistics::RooAbsL::sim_count_ = 1
protectedinherited

Definition at line 151 of file RooAbsL.h.


The documentation for this class was generated from the following files:
  • roofit/roofitcore/inc/RooFit/TestStatistics/RooSumL.h
  • roofit/roofitcore/src/TestStatistics/RooSumL.cxx