Pluto v6.3.0
Loading...
Searching...
No Matches
batch_read_ntuple.C
Go to the documentation of this file.
1//TITLE Re-read an TNtuple (from the example above) and make a histogram
2
3{
4
5 //Reads ntuple written by
6 // * hello_world.C
7 // * batch_write_ntuple.C
8
9 TFile *f = new TFile("ntuple.root");
10 TH1F * histo = new TH1F ("histo", "cos theta of eta", 100, -1., 1.);
11
12 //Define an "empty" reaction
14
16
17 //reconstruct the eta:
18 my_reaction.Do("myeta = P3M(eta_px,eta_py,eta_pz,0.54745)");
19
20 //NB: The following numbers can be obtained via:
21 //PParticle p("p"); PParticle p2("p",3.5); q=p+p2 ; q.Print()
22 my_reaction.Do("cm = P3E(0.000000,0.000000,4.337961,5.376545) ; myeta->Boost(cm);");
23 my_reaction.Do(histo,"if (myeta->M() > 0); _x= myeta->CosTheta();");
24
25 my_reaction.Print();
26
27 cout << my_reaction.Loop() << " events recovered" << endl;
28
29 histo->Draw();
30}
TFile * f
Definition analyze_g12C.C:8
TNtuple * ntuple
PReaction my_reaction("3.5","p","7Li","p (n) phi [K+ K-] (6Li)","delme")
TH1F * histo