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
11
PReaction
my_reaction
(
"output"
);
12
13
TNtuple *
ntuple
= (TNtuple *)
f
->Get(
"ntuple"
);
14
15
my_reaction
.Input(
ntuple
);
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
24
PPlutoBulkDecay
*
pl
=
new
PPlutoBulkDecay
();
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
}
f
TFile * f
Definition
analyze_g12C.C:8
ntuple
TNtuple * ntuple
Definition
batch_write_ntuple.C:6
pl
PPlutoBulkDecay * pl
Definition
bulk_decay.C:6
PPlutoBulkDecay
Definition
PPlutoBulkDecay.h:11
PReaction
Definition
PReaction.h:37
my_reaction
PReaction my_reaction("output")
my_reaction
PReaction my_reaction("3.5","p","7Li","p (n) phi [K+ K-] (6Li)","delme")
pluto6
macros
ntuple_to_pparticle.C
Generated by
1.14.0