Pluto v6.3.0
Loading...
Searching...
No Matches
use_DensityMatrix.C
Go to the documentation of this file.
1//TITLE Using the density matrix
2
3{
4
5 //Creates the matrix object:
6 PDensityMatrix *matrix = new PDensityMatrix();
7
8 //Open the HSD-file:
9 matrix->ReadDensityMatrix("fort.925", 3, kTRUE, 0.49, 0.51);
10 //Options:
11 // * Filename
12 // * Number of dimension-columns (Important!)
13 // * Correct integral for the bin width
14 // * Lower bound for section selection
15 // * Upper bound for section selection
16
17 //Create a seed particle:
18 PParticle *seed = new PParticle("dilepton", 0., 0., 0.);
19 //matrix->AddParticle(seed); //Do not use that when in already taken in PReaction as seed!!!
20
21 //Use matrix 12:
22 matrix->SetMatrix(12);
23 //(counting from 0, the columns for the dimensions must be substracted)
24
25 //Convert _x, _y and _z into physical variables:
26 matrix->Do("mt = sqrt(_z*_z + _x*_x)");
27 matrix->Do("p3 = mt * sinh(_y)");
28 matrix->Do("phi = sampleFlat() * TMath::Pi() * 2.0");
29 matrix->Do("p1 = _z * sin(phi)");
30 matrix->Do("p2 = _z * cos(phi)");
31 matrix->Do("[dilepton]->SetPx(p1)");
32 matrix->Do("[dilepton]->SetPy(p2)");
33 matrix->Do("[dilepton]->SetPz(p3)");
34 matrix->Do("[dilepton]->SetM(_x)");
35
36 //Optional boost by a TLorentzVector:
37 //just dummy! must be replaced by parameters of the fireball c.m.
38 //N.b. the sign of pz must be negative to boost in forward direction
39 PParticle boost(0, 0, 0, -4.0, 1.0);
40
41 *(makeDynamicData()->GetBatchParticle("boost")) = boost; //copy to script
42 //id, Px, Py, Pz (GeV/c), mass (GeV/c**2)
43 matrix->Do("foreach(*); [*]->Boost(boost)");
44
45 //Start the reaction:
46 PParticle *ep = new PParticle("e+");
47 PParticle *em = new PParticle("e-");
48 PParticle *p[] = {seed, em, ep};
50 dilepton_decay.AddPrologueBulk(matrix);
51
53 PReaction my_reaction(c, "output", 1);
54
55 //Just for debugging...
56 TH1F *histo1 = new TH1F("histo1", "ee mass", 100, 0.01, 1.5);
57 my_reaction.Do(histo1, "_x = ([e+]+[e-])->M()");
58 TH2F *histo2 = new TH2F("histo2","Y vs. Pt", 100, -4.0, 6.0, 300, 0.,1.);
59 my_reaction.Do(histo2, "_x = ([e+]+[e-])->Rapidity(); _y = ([e+]+[e-])->Pt()");
60
61 my_reaction.Loop(1000000);
62
63 histo1->Draw();
64
65}
PParticle * ep
PParticle * em
Bool_t ReadDensityMatrix(const char *filename, Int_t dim, Bool_t use_bin_width, Double_t min_selection, Double_t max_selection)
Bool_t Do(const char *command)
void SetMatrix(Int_t i)
PChannel * c[]
PParticle * p
Definition dp_mult.C:24
TH1F * histo1
PReaction my_reaction("3.5","p","7Li","p (n) phi [K+ K-] (6Li)","delme")
TH2F * histo2
PChannel dilepton_decay(p, 2)
* makeDynamicData() -> GetBatchParticle("boost"))=boost
PParticle * seed
PReaction my_reaction(c, "output", 1)
PParticle boost(0, 0, 0, -4.0, 1.0)