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<UniParam>::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) ;
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) ;
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) ;
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) ;
virtual const char * GetTitle() const
Returns title of object.
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...
Bool_t initializeInstance()
Initialize module after attachment to RooMCStudy object.
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...
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...
std::list< UniParam > _unifParams
ClassImp(RooRandomizeParamMCSModule)
Iterator abstract base class.
std::list< GausParam > _gausParams
const char * Data() const
RooRandomizeParamMCSModule()
Constructor.
Bool_t initializeRun(Int_t)
Initialize module at beginning of RooCMStudy run.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add element to an owning set.
std::map< std::string, std::string >::const_iterator iter
TIterator * createIterator(Bool_t dir=kIterForward) const
if on multiple lines(like in C++).**The" * configuration fragment. * * The "import myobject continue
Parses the configuration file.
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Bool_t processBeforeGen(Int_t)
Apply all smearings to generator parameters.
Double_t getVal(const RooArgSet *set=0) const
std::list< UniParamSet > _unifParamSets
std::list< GausParamSet > _gausParamSets
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual ~RooRandomizeParamMCSModule()
Destructor.
RooAbsArg * find(const char *name) const
Find object with given name in list.
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
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...
RooDataSet * finalizeRun()
Return auxiliary data of this module so that it is merged with RooMCStudy::fitParDataSet() ...
void sampleUniform(RooRealVar ¶m, Double_t lo, Double_t hi)
Request uniform smearing of param in range [lo,hi] in RooMCStudy generation cycle.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Mother of all ROOT objects.
virtual TObject * Next()=0
float type_of_call hi(const int &, const int &)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
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 Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.