30 boost::optional<string> clOpt = propTree.get_optional<
string>(
"Class");
33 string clName = clOpt.get();
34 TClass* cl = TClass::GetClass(clName.c_str());
35 printf(
"cl name %s\n", cl->GetName());
36 ROOT::NewFunc_t histNew = cl->GetNew();
37 string name = propTree.get<
string>(
"Name");
38 string title = propTree.get<
string>(
"Title");
39 string variable = propTree.get<
string>(
"Variable");
41 printf(
"Hist name %s\n", name.c_str());
43 boost::optional<pt::ptree>
dim = propTree.get_child(
"Dimensions");
45 for (
auto v =
dim.get().begin();
v !=
dim.get().end();
v++) {
46 dimVec.push_back(stof((*v).second.data()));
47 printf(
"%f\n", dimVec.back());
54 boost::optional<string> opt = propTree.get_optional<
string>(
"Options");
56 info->
opt = opt.get();
57 printf(
"info opt %s\n", info->
opt.c_str());
59 boost::optional<string> sel = propTree.get_optional<
string>(
"Selection");
64 switch (dimVec.size()) {
66 h =
static_cast<TH1*
>(histNew(0));
67 h->SetBins(dimVec[0], dimVec[1], dimVec[2]);
68 h->SetName(name.c_str());
69 h->SetTitle(title.c_str());
74 h =
static_cast<TH2*
>(histNew(0));
75 h->SetBins(dimVec[0], dimVec[1], dimVec[2], dimVec[3], dimVec[4], dimVec[5]);
76 h->SetName(name.c_str());
77 h->SetTitle(title.c_str());
82 h =
static_cast<TH3*
>(histNew(0));
83 h->SetBins(dimVec[0], dimVec[1], dimVec[2], dimVec[3], dimVec[4], dimVec[5], dimVec[6], dimVec[7],
85 h->SetName(name.c_str());
86 h->SetTitle(title.c_str());
91 throw string(
"Wrong dimensions!");
95 info->
temp =
static_cast<TH1*
>(info->
current->Clone((name +
"_temp").c_str()));
96 }
catch (std::exception& ex) {
97 printf(
"Exception for node: %s\n", ex.what());
111 boost::optional<uint32_t> optDivX = propTree.get_optional<uint32_t>(
"DivX");
112 boost::optional<uint32_t> optDivY = propTree.get_optional<uint32_t>(
"DivY");
113 uint32_t divX = optDivX ? *optDivX : 1;
114 uint32_t divY = optDivY ? *optDivY : 1;
116 printf(
"%d : %d \n", divX, divY);
118 if ((divX == 1) && (divY == 1)) {
126 boost::optional<pt::ptree&> pads = propTree.get_child_optional(
"Pads");
128 for (
auto&
v : pads.get()) {
129 printf(
"Parsing pad content: %s\n",
v.second.data().c_str());
136 }
catch (std::exception& ex) {
137 printf(
"Exception for branch: %s\n", ex.what());