70 _unifParams(other._unifParams),
71 _gausParams(other._gausParams),
101 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::initializeInstance: variable " << param.
GetName() <<
" is not a parameter of RooMCStudy model and is ignored!" << endl ;
122 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::initializeInstance: variable " << param.
GetName() <<
" is not a parameter of RooMCStudy model and is ignored!" << endl ;
150 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::sampleSumUniform() ERROR: input parameter " << arg->
GetName() <<
" is not a RooRealVar and is ignored" << endl ;
166 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::sampleSumUniform: variable " << arg2->
GetName() <<
" is not a parameter of RooMCStudy model and is ignored!" << endl ;
168 okset2.
add(*actualVar) ;
205 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::sampleSumGauss() ERROR: input parameter " << arg->
GetName() <<
" is not a RooRealVar and is ignored" << endl ;
220 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::sampleSumUniform: variable " << arg2->
GetName() <<
" is not a parameter of RooMCStudy model and is ignored!" << endl ;
222 okset2.
add(*actualVar) ;
246 std::list<UniParam>::iterator uiter ;
252 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::initializeInstance: variable " << uiter->_param->GetName() <<
" is not a parameter of RooMCStudy model and is ignored!" << endl ;
256 uiter->_param = actualPar ;
259 TString parName =
Form(
"%s_gen",uiter->_param->GetName()) ;
260 TString parTitle =
Form(
"%s as generated",uiter->_param->GetTitle()) ;
266 std::list<GausParam>::iterator giter ;
272 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::initializeInstance: variable " << giter->_param->GetName() <<
" is not a parameter of RooMCStudy model and is ignored!" << endl ;
276 giter->_param = actualPar ;
279 TString parName =
Form(
"%s_gen",giter->_param->GetName()) ;
280 TString parTitle =
Form(
"%s as generated",giter->_param->GetTitle()) ;
287 std::list<UniParamSet>::iterator usiter ;
292 TIterator* psiter = usiter->_pset.createIterator() ;
297 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::initializeInstance: variable " << arg->
GetName() <<
" is not a parameter of RooMCStudy model and is ignored!" << endl ;
299 actualPSet.
add(*actualVar) ;
303 usiter->_pset.removeAll() ;
304 usiter->_pset.add(actualPSet) ;
307 TIterator* iter = usiter->_pset.createIterator() ;
319 std::list<GausParamSet>::iterator ugiter ;
324 TIterator* psiter = ugiter->_pset.createIterator() ;
329 oocoutW((
TObject*)0,
InputArguments) <<
"RooRandomizeParamMCSModule::initializeInstance: variable " << arg->
GetName() <<
" is not a parameter of RooMCStudy model and is ignored!" << endl ;
331 actualPSet.
add(*actualVar) ;
334 ugiter->_pset.removeAll() ;
335 ugiter->_pset.add(actualPSet) ;
338 TIterator* iter = ugiter->_pset.createIterator() ;
374 std::list<UniParam>::iterator uiter ;
377 oocoutE((
TObject*)0,
Generation) <<
"RooRandomizeParamMCSModule::processBeforeGen: applying uniform smearing to generator parameter "
378 << uiter->_param->GetName() <<
" in range [" << uiter->_lo <<
"," << uiter->_hi <<
"], chosen value for this sample is " << newVal << endl ;
379 uiter->_param->setVal(newVal) ;
386 std::list<GausParam>::iterator giter ;
389 oocoutI((
TObject*)0,
Generation) <<
"RooRandomizeParamMCSModule::processBeforeGen: applying gaussian smearing to generator parameter "
390 << giter->_param->GetName() <<
" with a mean of " << giter->_mean <<
" and a width of " << giter->_sigma <<
", chosen value for this sample is " << newVal << endl ;
391 giter->_param->setVal(newVal) ;
398 std::list<UniParamSet>::iterator usiter ;
403 oocoutI((
TObject*)0,
Generation) <<
"RooRandomizeParamMCSModule::processBeforeGen: applying uniform smearing to sum of set of generator parameters "
405 <<
" in range [" << usiter->_lo <<
"," << usiter->_hi <<
"], chosen sum value for this sample is " << newVal << endl ;
408 RooAddition sumVal(
"sumVal",
"sumVal",usiter->_pset) ;
412 TIterator* iter = usiter->_pset.createIterator() ;
423 std::list<GausParamSet>::iterator gsiter ;
428 oocoutI((
TObject*)0,
Generation) <<
"RooRandomizeParamMCSModule::processBeforeGen: applying gaussian smearing to sum of set of generator parameters "
430 <<
" with a mean of " << gsiter->_mean <<
" and a width of " << gsiter->_sigma
431 <<
", chosen value for this sample is " << newVal << endl ;
434 RooAddition sumVal(
"sumVal",
"sumVal",gsiter->_pset) ;
438 TIterator* iter = gsiter->_pset.createIterator() ;
float type_of_call hi(const int &, const int &)
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
TIterator * createIterator(Bool_t dir=kIterForward) const R__SUGGEST_ALTERNATIVE("begin()
TIterator-style iteration over contained elements.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsMCStudyModule is a base class for add-on modules to RooMCStudy that can perform additional calc...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooAddition calculates the sum of a set of RooAbsReal terms, or when constructed with two sets,...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
virtual Bool_t addOwned(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
RooDataSet is a container class to hold unbinned data.
virtual void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
RooRandomizeParamMCSModule is an add-on modules to RooMCStudy that allows you to randomize input gene...
void sampleUniform(RooRealVar ¶m, Double_t lo, Double_t hi)
Request uniform smearing of param in range [lo,hi] in RooMCStudy generation cycle.
Bool_t initializeInstance()
Initialize module after attachment to RooMCStudy object.
std::list< GausParam > _gausParams
void sampleSumGauss(const RooArgSet ¶mSet, Double_t lo, Double_t hi)
Request gaussian smearing of sum of parameters in paramSet uniform smearing with mean 'mean' and widt...
virtual ~RooRandomizeParamMCSModule()
Destructor.
void sampleGaussian(RooRealVar ¶m, Double_t mean, Double_t sigma)
Request Gaussian smearing of param in with mean 'mean' and width 'sigma' in RooMCStudy generation cyc...
std::list< UniParamSet > _unifParamSets
Bool_t processBeforeGen(Int_t)
Apply all smearings to generator parameters.
Bool_t initializeRun(Int_t)
Initialize module at beginning of RooCMStudy run.
RooRandomizeParamMCSModule()
Constructor.
void sampleSumUniform(const RooArgSet ¶mSet, Double_t lo, Double_t hi)
Request uniform smearing of sum of parameters in paramSet uniform smearing in range [lo,...
RooDataSet * finalizeRun()
Return auxiliary data of this module so that it is merged with RooMCStudy::fitParDataSet()
std::list< GausParamSet > _gausParamSets
std::list< UniParam > _unifParams
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
Iterator abstract base class.
virtual TObject * Next()=0
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
const char * Data() const