28using std::endl, std::vector;
54 if(
fNToys == 0 )
return nullptr;
72 oocoutP(
nullptr,
Generation) << endl << endl <<
" GENERATING FROM nullptr DENSITY " << endl << endl;
110 for(
int j=0;
j <
result->numEntries();
j++ ) {
138 ooccoutE(
nullptr,
InputArguments) <<
"Cannot use multiple null densities and only ask for one weight." << endl;
143 ooccoutI(
nullptr,
InputArguments) <<
"No explicit null densities specified. Going to add one based on the given paramPoint and the global fPdf. ... but cannot do that inside const function." << endl;
150 ooccoutD(
nullptr,
InputArguments) <<
"Using given parameter point. Replaces snapshot for the only null currently defined." << endl;
157 weights.push_back( weight );
182 ooccoutE(
nullptr,
InputArguments) <<
"Cannot use multiple null densities and only ask for one weight and NLL." << endl;
187 ooccoutI(
nullptr,
InputArguments) <<
"No explicit null densities specified. Going to add one based on the given paramPoint and the global fPdf. ... but cannot do that inside const function." << endl;
191 ooccoutI(
nullptr,
InputArguments) <<
"Using given parameter point. Overwrites snapshot for the only null currently defined." << endl;
197 weights.push_back( weight );
214 ooccoutI(
nullptr,
InputArguments) <<
"weights.size() != nullDesnities.size(). You need to provide a vector with the correct size." << endl;
250 oocoutE(
nullptr,
InputArguments) <<
"ToyMCImportanceSampler: Need to specify the null density explicitly." << endl;
263 oocoutE(
nullptr,
InputArguments) <<
"ToyMCImportanceSampler: Something wrong. NullNLLs must be of same size as null densities." << endl;
270 oocoutE(
nullptr,
InputArguments) <<
"ToyMCImportanceSampler: no importance density given or index out of range." << endl;
325 for(
unsigned int i=0; i < weights.size(); i++ ) weights[i] =
globalWeight;
438 oocoutI(
nullptr,
InputArguments) <<
"Using fitFavoredMu and error to set the number of imp points" << endl;
458 for(
int i=1; i <=
n; i++ ) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
void Print(Option_t *options=nullptr) const override
Print the object to the defaultPrintStream().
RooFit::OwningPtr< RooArgSet > getVariables(bool stripDisconnected=true) const
Return RooArgSet with all variables (tree leaf nodes of expression tree)
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
Abstract base class for binned and unbinned datasets.
Abstract interface for all probability density functions.
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
Container class to hold unbinned data.
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
ToyMCImportanceSampler is an extension of the ToyMCSampler for Importance Sampling.
void AddImportanceDensity(RooAbsPdf *p, const RooArgSet *s)
For importance sampling with multiple densities/snapshots: This is used to check the current Likeliho...
std::vector< const RooArgSet * > fImportanceSnapshots
~ToyMCImportanceSampler() override
RooDataSet * GetSamplingDistributionsSingleWorker(RooArgSet ¶mPoint) override
overwrite GetSamplingDistributionsSingleWorker(paramPoint) with a version that loops over nulls and i...
RooAbsData * GenerateToyData(RooArgSet ¶mPoint, double &weight) const override
std::vector< const RooArgSet * > fNullSnapshots
void SetDensityToGenerateFromByIndex(unsigned int i, bool fromNull=false)
specifies the pdf to sample from
std::vector< RooAbsPdf * > fImportanceDensities
toysStrategies fToysStrategy
std::vector< std::unique_ptr< RooAbsReal > > fImpNLLs
!
std::vector< std::unique_ptr< RooAbsReal > > fNullNLLs
!
unsigned int fIndexGenDensity
int CreateImpDensitiesForOnePOIAdaptively(RooAbsPdf &pdf, const RooArgSet &allPOI, RooRealVar &poi, double nStdDevOverlap=0.5, double poiValueForBackground=0.0)
poi has to be fitted beforehand. This function expects this to be the muhat value.
void ClearCache() override
helper method for clearing the cache
RooArgSet fConditionalObs
set of conditional observables
std::vector< RooAbsPdf * > fNullDensities
support multiple null densities
int CreateNImpDensitiesForOnePOI(RooAbsPdf &pdf, const RooArgSet &allPOI, RooRealVar &poi, int n, double poiValueForBackground=0.0)
n is the number of importance densities
const RooArgSet * fGlobalObservables
virtual void GenerateGlobalObservables(RooAbsPdf &pdf) const
generate global observables
virtual RooDataSet * GetSamplingDistributionsSingleWorker(RooArgSet ¶mPoint)
This is the main function for serial runs.
NuisanceParametersSampler * fNuisanceParametersSampler
!
const RooArgSet * fObservables
RooAbsPdf * fPdf
densities, snapshots, and test statistics to reweight to
bool fExpectedNuisancePar
whether to use expectation values for nuisance parameters (ie Asimov data set)
const RooArgSet * fNuisancePars
std::vector< TestStatistic * > fTestStatistics
std::unique_ptr< RooAbsData > Generate(RooAbsPdf &pdf, RooArgSet &observables, const RooDataSet *protoData=nullptr, int forceEvents=0) const
helper for GenerateToyData
Int_t fNToys
number of toys to generate
virtual void ClearCache()
helper method for clearing the cache
RooAbsPdf * fPriorNuisance
prior pdf for nuisance parameters
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
RooCmdArg WeightVar(const char *name="weight", bool reinterpretAsWeight=false)
RooCmdArg Constrain(const RooArgSet ¶ms)
RooCmdArg CloneData(bool flag)
RooCmdArg ConditionalObservables(Args_t &&... argsOrArgSet)
Create a RooCmdArg to declare conditional observables.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Namespace for the RooStats classes.
@ EXPONENTIALTOYDISTRIBUTION
Int_t CeilNint(Double_t x)
Returns the nearest integer of TMath::Ceil(x).