本文整理汇总了C++中TNtuple::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ TNtuple::Reset方法的具体用法?C++ TNtuple::Reset怎么用?C++ TNtuple::Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TNtuple
的用法示例。
在下文中一共展示了TNtuple::Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_contour
TNtuple* LikelihoodSpace::get_contour(float delta) {
TNtuple* contour = (TNtuple*) this->samples->Clone("lscontour");
contour->Reset();
// Get list of branch names
std::vector<std::string> names;
for (int i=0; i<this->samples->GetListOfBranches()->GetEntries(); i++) {
std::string name = this->samples->GetListOfBranches()->At(i)->GetName();
if (name == "likelihood") {
continue;
}
names.push_back(name);
}
float* params_branch = new float[names.size()];
for (size_t i=0; i<names.size(); i++) {
this->samples->SetBranchAddress(names[i].c_str(), ¶ms_branch[i]);
}
float ml_branch;
this->samples->SetBranchAddress("likelihood", &ml_branch);
// Build a new TNtuple with samples inside the contour
float* v = new float[names.size() + 1];
for (int i=0; i<this->samples->GetEntries(); i++) {
this->samples->GetEntry(i);
if (ml_branch < this->ml + delta) {
for (size_t j=0; j<names.size(); j++) {
v[j] = params_branch[j];
}
v[names.size()] = ml_branch;
contour->Fill(v);
}
}
this->samples->ResetBranchAddresses();
delete[] v;
return contour;
}