1 #include "ConfigTreeTools.hxx" 4 ConfigTreeTools::ConfigTreeTools(
const std::string& file){
14 Initialize(syst,conf);
28 void ConfigTreeTools::Initialize(
const std::string& file){
54 for (
int it = 0; it < nSyst; it++) {
55 if (systs[it]->IsEnabled()){
56 if (systs[it]->Name() == name)
return j;
76 for (
int it = 0; it < nSyst; it++) {
77 if (systs[it]->IsEnabled()){
78 if (systs[it]->GetIndex() == weight)
return j;
91 std::cout <<
"no file and tree associated yet !!!" << std::endl;
96 TChain* chain =
new TChain(
"config");
97 chain->AddFile(_fileName.c_str());
99 if (chain->FindLeaf(name.c_str())){
100 chain->SetBranchAddress(name.c_str(), &var);
101 Long64_t centry = chain->LoadTree(0);
102 Int_t nb = chain->GetEntry(0);
115 std::cout <<
"no file and tree associated yet !!!" << std::endl;
119 TChain* chain =
new TChain(
"config");
120 chain->AddFile(_fileName.c_str());
122 if (chain->FindLeaf(name.c_str())){
123 chain->SetBranchAddress(name.c_str(), &var);
124 Long64_t centry = chain->LoadTree(0);
125 Int_t nb = chain->GetEntry(0);
139 std::cout <<
"no file and tree associated yet !!!" << std::endl;
144 TChain* chain =
new TChain(
"config");
145 chain->AddFile(_fileName.c_str());
147 if (chain->FindLeaf(name.c_str())){
148 chain->SetBranchAddress(name.c_str(), &var);
149 Long64_t centry = chain->LoadTree(0);
150 Int_t nb = chain->GetEntry(0);
162 std::cout <<
"no file and tree associated yet !!!" << std::endl;
166 TChain* chain =
new TChain(
"config");
167 chain->AddFile(_fileName.c_str());
169 if (chain->FindLeaf(name.c_str())){
170 chain->SetBranchAddress(name.c_str(), var);
171 Long64_t centry = chain->LoadTree(0);
172 Int_t nb = chain->GetEntry(0);
177 return std::string(var);
The maximum number of systematics that is supported.
void DisableAllSystematics()
Disable all Systematics.
EventWeightBase ** GetWeightSystematics(int &nSys)
Get the vector of weightsSystematics.
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.
void ReadConfigurations(const std::string &file)
Read configurations from a file.
void ReadSystematics(const std::string &file)
Read the systematics from a file.
ConfigurationBase * GetConfiguration(Int_t index) const
return the configuration with a given index