本文整理汇总了C++中TNtuple::Principal方法的典型用法代码示例。如果您正苦于以下问题:C++ TNtuple::Principal方法的具体用法?C++ TNtuple::Principal怎么用?C++ TNtuple::Principal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TNtuple
的用法示例。
在下文中一共展示了TNtuple::Principal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Interpolate
void Interpolate(const TString& trigger="INEL")
{
if (gSystem->Getenv("FWD"))
fwd = gSystem->Getenv("FWD");
else
fwd = gSystem->ExpandPathName("$ALICE_PHYSICS/PWGLF/FORWARD/analysis2");
gROOT->SetMacroPath(Form("%s/dndeta:%s", gROOT->GetMacroPath(),fwd));
if (!gROOT->GetClass("Drawer")) gROOT->LoadMacro("Drawer.C+");
TH1* h0900 = GetOne( 900, trigger);
TH1* h2760 = GetOne(2760, trigger);
TH1* h7000 = GetOne(7000, trigger);
TH1* h8000 = GetOne(8000, trigger);
Info("","900: %p 2760: %p 7000: %p 8000: %p",
h0900, h2760, h7000, h8000);
Double_t e8000 = (trigger.EqualTo("INEL") ? 0.852 : 0.93);
h8000->Scale(e8000);
TFile* out = TFile::Open("trends.root", "RECREATE");
THStack* sOrig = new THStack("orig", Form("pp - %s", trigger.Data()));
sOrig->Add(h8000);
sOrig->Add(h7000);
sOrig->Add(h2760);
sOrig->Add(h0900);
TCanvas* cOrig = new TCanvas("cOrig", "Original", 1200, 1200);
cOrig->SetTopMargin(0.01);
cOrig->SetRightMargin(0.01);
sOrig->Draw("nostack");
sOrig->GetHistogram()->SetYTitle("1/#it{N} d#it{N}_{ch}/d#it{#eta}");
sOrig->GetHistogram()->SetXTitle("#it{#eta}");
sOrig->DrawClone("nostack");
sOrig->Write();
TLegend* l = cOrig->BuildLegend(.35, .2, .55, .6, "#sqrt{s}");
l->SetFillColor(0);
l->SetFillStyle(0);
l->SetBorderSize(0);
cOrig->Modified();
cOrig->Update();
cOrig->cd();
cOrig->Write();
Info("", "Wrote original");
TCanvas* cG = new TCanvas("cG", "one", 1200, 1200);
cG->SetTopMargin(0.01);
cG->SetRightMargin(0.01);
Info("","Creating tuple");
TNtuple* tuple = new TNtuple("tuple", "Tuple",
"eta:deta:"
"v0900:e0900:v2760:e2760:"
"v7000:e7000:v8000:e8000");
TMultiGraph* mg = new TMultiGraph;
Int_t n = h0900->GetNbinsX();
Info("","Loop over bins %d", n);
for (Int_t i = 1; i <= n; i++) {
Info("", "Getting one bin %d,%p,%p,%p,%p,%p,%p",
i, h0900,h2760,h7000,h8000,mg,tuple);
OneBin(i, h0900, h2760, h7000, h8000, mg, tuple);
}
mg->Draw("alp");
cG->Modified();
cG->Update();
cG->cd();
TPrincipal* p =tuple->Principal("v0900:v2760:v7000:v8000","eta<0", "npdhc");
}