Xephyr  0.0
Public Member Functions | List of all members
ToyGenerator Class Reference

Helper class to generate toys given an input likelihood. It can generate toys for the calibration dataset and for the "science data" dataset. More...

#include <ToyGenerator.h>

Inheritance diagram for ToyGenerator:
errorHandler

Public Member Functions

 ToyGenerator (TString sampleName, TString outDir)
 
void setLikelihood (pdfLikelihood *like)
 pointer to the defined likelihood
 
void setAverageCalibrationEvents (double evnt)
 the total number of events to which the calibtration pdfs will be rescaled. More...
 
void setAverageDataEvents (double evnt)
 the total number of events to which the science data pdfs will be rescaled. More...
 
void generateCalibration (int N, bool randomizeNP=false)
 generate N toys of the calibration dataset.
 
void generateData (double mu, int N, bool randomizeNP=false)
 generate N toys of the 'science data' dataset with injected signal fraction 'mu'.
 
void setSeed (int seed)
 set the seed for the toy generation. YOU MUST CHANGE THIS for any run.
 
void setGeneration (int generation)
 set the Generation, this info will be available in the generated tree (so that u can hadd them), it is optional and non ncecessary.
 
void setLikeType (int lktype)
 set the LikeliHood Type, this info will be available in the generated tree (so that u can hadd them), it is optional and non ncecessary.
 
void randomizeNuissanceParameter ()
 this will randomize the nominal value of the nuissance parameters, according to their distro. More...
 
void setTreeName (TString newname)
 sets a new tree name prefix
 
- Public Member Functions inherited from errorHandler
 errorHandler (TString name)
 
void Error (TString functionName, TString message)
 Send an Error message to the user. More...
 
void Warning (TString functionName, TString message)
 Send a Warning message to the user. More...
 
void Info (TString functionName, TString message)
 Send an Info message to the user. More...
 
void Debug (TString functionName, TString message)
 Send a Debug message to the user. More...
 
void setPrintLevel (int level)
 Set the local printing level (for this instance only) More...
 
int getPrintLevel ()
 Return the current print level for this instance. remind that if you set with setPrintLevel this will override the global print level.
 

Additional Inherited Members

- Public Attributes inherited from errorHandler
int localPrintLevel
 
TString className
 
- Static Public Attributes inherited from errorHandler
static int globalPrintLevel = 1
 

Detailed Description

Helper class to generate toys given an input likelihood. It can generate toys for the calibration dataset and for the "science data" dataset.

Constructor & Destructor Documentation

◆ ToyGenerator()

ToyGenerator::ToyGenerator ( TString  sampleName,
TString  outDir 
)

Constructor:

Parameters
sampleNamename of the file and tree prefix
outDirpath to dir where you want to save toys

Member Function Documentation

◆ randomizeNuissanceParameter()

void ToyGenerator::randomizeNuissanceParameter ( )

this will randomize the nominal value of the nuissance parameters, according to their distro.

The generated toys will not be generated now from nominal distro. YOU MUST change seed for each repetition of this.

◆ setAverageCalibrationEvents()

void ToyGenerator::setAverageCalibrationEvents ( double  evnt)
inline

the total number of events to which the calibtration pdfs will be rescaled.

The fraction of events given to each pdf component is defined in the likelihood. This is just an overall scale.

◆ setAverageDataEvents()

void ToyGenerator::setAverageDataEvents ( double  evnt)
inline

the total number of events to which the science data pdfs will be rescaled.

This overrides the number of events set in the likelihood. The fraction of events given to each pdf component is defined in the likelihood. This is just an overall scale. Typically you don't want to set this, but you must set "setAverageCalibrationEvents" instead.


The documentation for this class was generated from the following files: