Pluto v6.3.0
Loading...
Searching...
No Matches
test_batch.C
Go to the documentation of this file.
1//TITLE <b>The event loop interface:</b> Make histograms in one single line without ana macro with the PBatch script language
2
3{
4 PData::SetWeightVersion(0); //Disable 1/N_ev * BR weighting
5
6 //First define our histograms
7 TH2F *histo = new TH2F ("histo", "Dalitz", 30, 1., 4., 30, 1., 4.);
8 TH1F *histo1 = new TH1F ("histo1", "p/pi0 missing mass", 100, 0.1, 2.0);
9 TH1F *histo2 = new TH1F ("histo2", "cos theta of pp", 20, -1., 1.);
10 TH1F *histo3 = new TH1F ("histo3", "cos theta of D+ decay", 20, -1., 1.);
11
12 TH2F *histo_p1 = new TH2F ("histo_p1", "px vs. vy of the pp pair", 30, -1., 1., 30, -1., 1.);
13
14 //If you want another decay angle of the D, uncomment this line:
15 ((PScatterDistribution *)makeDistributionManager()->GetDistribution("pp_delta_waves1"))->SetAngleFunction(new TF1("delme","(1+3*x*x)*.25",-1,1));
16
17 //No D+ angular distribution?
18 //makeDistributionManager()->Disable("pp_delta+_angle");
19
20 //Define the reaction as usual
21 PReaction my_reaction(3.13, "p", "p", "p D+ [p pi0]", "delme", 1, 0, 0, 0);
22
23 //Combine the masses of p,1 and pi0, p,2, pi0 to the Dalitz plot
24 my_reaction.Do(histo, "_x = ([p,1] + [pi0])->M2() ; _y = ([p,2] + [pi0])->M2() ");
25
26 //Missing mass of the p2 and pi0 pair:
27 my_reaction.Do(histo1, "miss= [p + p]- ( [p,2]+ [pi0] );_x=miss->M()");
28
29 //pp aligment angle: Important: copy the proton before boosting it, otherwise you
30 //will have the boosted particle on tape
31 my_reaction.Do(histo2, "p1=[p,1]; p1->Boost([p + p]); _x=cos(p1->Theta())");
32
33 //The decay angle of the D+:
34 my_reaction.Do(histo3, "_pi0=[pi0]; _d=[D+]; _pi0->Rot(_d); _d->Rot(_d); _pi0->Boost(_d); _x= cos(_pi0->Theta())");
35
36 //Momentum of a pair
37 //All methods of a PParticle of the type ->XXX(void) can be used
38 //Syntax can be ->XXX() or .XXX() (as you like)
39 my_reaction.Do(histo_p1, "pp_pair= [p,1] + [p,2];_x=pp_pair.Px(); _y=pp_pair->Py()");
40
41 my_reaction.Loop(50000);
42
43
44 TCanvas *c1 = new TCanvas();
45
46 c1->Divide(2,2);
47
48 c1->cd(1);
49 gStyle->SetPalette(1,0);
50 histo->Draw("colz");
51 c1->cd(2);
52 histo2->Draw("e1");
53 c1->cd(3);
54 histo1->Draw("e1");
55 c1->cd(4);
56 histo3->Draw("e1");
57
58 TCanvas *c2 = new TCanvas();
59
60 histo_p1->Draw("colz");
61
62}
TH1F * histo3
new TCanvas()
static void SetWeightVersion(Int_t i)
Definition PData.h:20
PChannel * c2
TH1F * histo1
PReaction my_reaction("3.5","p","7Li","p (n) phi [K+ K-] (6Li)","delme")
TH2F * histo_p1
Definition test_batch.C:12
PReaction my_reaction(3.13, "p", "p", "p D+ [p pi0]", "delme", 1, 0, 0, 0)
PScatterDistribution * makeDistributionManager() -> GetDistribution("pp_delta_waves1")) ->SetAngleFunction(new TF1("delme","(1+3*x*x)*.25",-1, 1))
TH2F * histo2
TH1F * histo