1 #include "ConfigurationBase.hxx" 4 ConfigurationBase::ConfigurationBase(){
19 ConfigurationBase::ConfigurationBase(Int_t index,
const std::string& name, UInt_t ntoys, Int_t randomSeed,
ToyMaker* toyMaker){
39 std::cout <<
"*********** Configuration: " <<
Name() <<
" *************" << std::endl;
41 std::cout <<
" enabled: " << (Int_t)IsEnabled() << std::endl;
45 std::cout <<
" NToys: " <<
GetNToys() << std::endl;
64 std::set<Int_t> enabled;
71 for (std::vector<Int_t>::const_iterator it = indices.begin();it!=indices.end();it++)
76 for (std::set<Int_t>::iterator it = enabled.begin();it!=enabled.end();it++)
90 for (std::vector<ToyExperiment*>::const_iterator it=toys.begin();it!=toys.end();it++){
93 for (UInt_t i = 0; i<NMAXSYSTEMATICS;i++){
96 if (wtoy.npar>=NMAXPARAMETERS)
return;
99 wtoy.par_index[wtoy.npar] = wtoy.npar;
103 for (UInt_t ipar2 = wtoy.npar;ipar2<NMAXPARAMETERS;ipar2++){
104 wtoy.variations[ipar2] = 0;
105 wtoy.weights[ipar2] = 0;
106 wtoy.par_index[ipar2] = -1;
108 _toys.push_back(wtoy);
const std::vector< ToyExperiment * > & GetToyExperiments() const
Returns the Toy experiment vector.
std::string _name
Name of the configuration.
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
UInt_t GetNParameters() const
Number of parameters for this systematic.
ToyMaker * _toyMaker
The ToyMaker, which fills the toy.
void EnableAllSystematics()
Enable all Systematics.
Float_t * Weights
the vector of Weights, one for each of the systematic parameters
Int_t GetNToys() const
Get and sets the number of toys.
std::vector< Int_t > _systematicsEnabled
Vector of indices of the systematics enabled in this configuration.
std::vector< Int_t > _variationsEnabled
Vector of indices of the variations enabled in this configuration.
const std::vector< Int_t > & GetEnabledEventVariations()
Get the variations enabled for this configuration.
void DumpVariationSystematics()
Dump all variationSystematics.
std::vector< Int_t > _weightsEnabled
Vector of indices of the weights enabled in this configuration.
std::vector< bool > _toyEnabled
Tell wether a toy is enabled or not.
void CreateToyExperiments(const SystematicManager &syst)
Create the ToyExperiments using the ToyMaker and the SystematicManager.
A Class that allows saving the variations in the config tree.
const std::string & Name() const
Returns the name of this configuration.
const std::vector< Int_t > & GetEnabledEventWeights()
Get the weights enabled for this configuration.
Int_t GetToyRandomSeed() const
Get and sets the random seed used to generate the toys.
The maximum number of systematics that is supported.
std::vector< ToyVariationWrite > _toys
The variations for each of the toys.
Int_t _toy_ref
The reference toy with the nominal selection.
std::vector< SystematicBase * > & GetSystematics()
Get the vector containing all systematics (contains NULL pointers)
void CreateToyExperiments(Int_t ntoys, const std::vector< SystematicBase *> &systematicsEnabled)
Create the Toy Experiment, provided the number of toys,.
void DisableAllSystematics()
Disable all Systematics.
void DumpWeightSystematics()
Dump all weightSystematics.
ToyVariations * GetToyVariations(UInt_t index) const
returns the variations for a given systematic (index)
bool _enabled
Is this configuration enabled ?
void EnableSystematics(const std::vector< Int_t > &systs)
Enable the systematics registered with the given indices.
const std::vector< Int_t > & GetEnabledSystematics()
Get the systematics enabled for this configuration.
Int_t _conf_index
Configuration index.
void EnableSystematics(const std::vector< Int_t > &indices)
Enable the systematic registered with the given name.
Int_t _ntoys
Number of Toy experiments or virtual analyses.
Int_t _toy_randomSeed
The random seed used to generate the toys.