13.3.7. Macro “samplingOATRandom.C”
13.3.7.1. Objective
This part shows the complete code used to produce the console display in Random mode.
13.3.7.2. Macro Uranie
TDataServer *tds = new TDataServer("tdsoat","Data server for simple OAT design");
TCanvas c("can","can",10,32,1200,600);
// step 1
tds->addAttribute(new TUniformDistribution("x1", -5.0, 5.0));
tds->addAttribute(new TNormalDistribution("x2", 11.0, 1.0));
// step 2
tds->getAttribute("x1")->setDefaultValue(0.0);
tds->getAttribute("x2")->setDefaultValue(10.0);
// step 3
TOATDesign *oatSampler = new TOATDesign(tds, "lhs", 1000);
// step 4
Bool_t use_percentage = kTRUE;
oatSampler->setRange("x1", 2.0);
oatSampler->setRange("x2", 40.0, use_percentage);
// step 5
oatSampler->generateSample();
// display
TPad *apad = new TPad("apad","apad",0, 0.03, 1, 1);
apad->Draw();
apad->Divide(2,1);
apad->cd(1);
tds->draw("x1","__modified_att__ == 1");
apad->cd(2);
tds->draw("x2","__modified_att__ == 2");