Selector to process tree friends.
#define ProofFriends_cxx
ProofFriends::ProofFriends()
{
fXY = 0;
fZ = 0;
fR = 0;
fRZ = 0;
}
{
}
void ProofFriends::SlaveBegin(
TTree * )
{
fXY =
new TH2F(
"histo1",
"y:x", 50, 5., 15., 50, 10., 30.);
fZ =
new TH1F(
"histo2",
"z , sqrt(dx*dx+dy*dy) < 1", 50, 0., 5.);
fZ->SetFillColor(kBlue);
fOutput->Add(fXY);
fOutput->Add(fZ);
if (fDoFriends) {
fR =
new TH1F(
"histo3",
"Tfrnd.r , sqrt(dx*dx+dy*dy) < 1, z < 1", 50, 5., 15.);
fRZ =
new TH2F(
"histo4",
"Tfrnd.r:z , sqrt(dx*dx+dy*dy) < 1, z < 1", 50, 0., 1., 50, 5., 15.);
fR->SetFillColor(kRed);
fOutput->Add(fR);
fOutput->Add(fRZ);
}
}
{
fXY->Fill(x, y, 1.);
fZ->Fill(z, 1.);
if (fDoFriends) {
b_r->GetEntry(entry);
fR->Fill(r, 1.);
fRZ->Fill(z, r, 1.);
}
}
void ProofFriends::SlaveTerminate()
{
}
void ProofFriends::Terminate()
{
if (!fPlot) return;
TCanvas *c1 =
new TCanvas(
"c1",
"Proof ProofFriends canvas",200,10,700,700);
if ((fXY = dynamic_cast<TH2F *>(fOutput->FindObject("histo1")))) {
fXY->GetXaxis()->SetTitle("x");
fXY->GetYaxis()->SetTitle("y");
fXY->Draw("");
}
if ((fZ = dynamic_cast<TH1F *>(fOutput->FindObject("histo2")))) {
fZ->GetXaxis()->SetTitle("z");
fZ->GetYaxis()->SetTitle("N / 0.1");
fZ->Draw("");
}
if (fDoFriends) {
if ((fR = dynamic_cast<TH1F *>(fOutput->FindObject("histo3")))) {
}
if ((fRZ = dynamic_cast<TH2F *>(fOutput->FindObject("histo4")))) {
fRZ->GetXaxis()->SetTitle("z");
fRZ->GetXaxis()->CenterTitle(1);
fRZ->GetXaxis()->SetTitleOffset(1.5);
fRZ->GetYaxis()->SetTitle("Tfrnd.r");
fRZ->GetYaxis()->CenterTitle(1);
fRZ->GetYaxis()->SetTitleOffset(1.75);
fRZ->GetZaxis()->SetTitle("N / 0.1 / 0.2");
fRZ->GetZaxis()->SetTitleOffset(1.25);
fRZ->Draw("lego");
}
}
}