Pluto v6.3.0
Loading...
Searching...
No Matches
ntuple_to_pparticle.C
Go to the documentation of this file.
1//TITLE Convert an TNtuple (from the example above) to a PParticle and make a bulk decay
2
3{
4 //Using the ntuple from:
5 // * hello_world.C
6 // * batch_write_ntuple.C
7
8 TFile *f = new TFile("ntuple.root");
9
10 //Define an "empty" reaction
12
13 TNtuple *ntuple = (TNtuple *)f->Get("ntuple");
14
16
17 //reconstruct the eta:
18 my_reaction.Do("myeta = P3M(eta_px,eta_py,eta_pz,0.54745); myeta->SetID(eta.pid)");
19
20 //Add eta to particle stream:
21 my_reaction.Do("Push(myeta)");
22
23 //Bulk decay of eta
25 pl->SetRecursiveMode(1); //Let also the products decay
26 pl->SetTauMax(0.001); //maxTau in ns
27 my_reaction.AddBulk(pl);
28
29 //This is for debugging the decay chain:
30 //my_reaction->Do("echo *******new event");
31 //my_reaction->Do("foreach(*); id = [*]->ID(); echo PID: $id");
32
33 my_reaction.Print();
34
35 cout << my_reaction.Loop() << " events recovered" << endl;
36}
TFile * f
Definition analyze_g12C.C:8
TNtuple * ntuple
PPlutoBulkDecay * pl
Definition bulk_decay.C:6
PReaction my_reaction("output")
PReaction my_reaction("3.5","p","7Li","p (n) phi [K+ K-] (6Li)","delme")