]>
Commit | Line | Data |
---|---|---|
7148817a | 1 | // Author: Dariusz Miskowiec <mailto:d.miskowiec@gsi.de> 2008 |
2 | ||
3 | //============================================================================= | |
4 | // pt-fluctuations analyzer | |
5 | //============================================================================= | |
6 | ||
7 | #include <TROOT.h> | |
8 | #include <TRandom2.h> | |
9 | #include <TVector2.h> | |
10 | #include <TMath.h> | |
11 | #include "AliDEvent.h" | |
12 | #include "AliDHN.h" | |
13 | #include "AliDAnalPtfluc.h" | |
14 | ||
15 | ClassImp(AliDAnalPtfluc) | |
16 | ||
17 | //============================================================================= | |
18 | AliDAnalPtfluc::AliDAnalPtfluc(Char_t *nam, Int_t pid0, Int_t pid1) : | |
19 | AliDAnal(nam), fPid0(pid0), fPid1(pid1) | |
20 | { | |
21 | // constructor | |
22 | ||
23 | TAxis *ax[5]; | |
24 | ax[0] = new TAxis(2,-0.5,1.5); ax[0]->SetTitle("trumix"); | |
25 | ax[1] = new TAxis(9,0,0.9); ax[1]->SetTitle("centrality"); | |
26 | ax[2] = new TAxis(6,-0.5,5.5); ax[2]->SetTitle("n-pt0-pt1-pt00-pt11-pt01"); | |
27 | ax[3] = new TAxis(48,-180,180); ax[3]->SetTitle("dphi (deg)"); | |
28 | ax[4] = new TAxis(40,-2,2); ax[4]->SetTitle("deta"); | |
29 | AliDHN *pair = new AliDHN("pair",5,ax); | |
30 | for (int i=0; i<5; i++) delete ax[i]; | |
31 | fHistos.Add(pair); | |
32 | gROOT->cd(); | |
33 | printf("%s object named %s created\n",ClassName(),GetName()); | |
34 | } | |
35 | //============================================================================= | |
36 | void AliDAnalPtfluc::Process(Int_t tmr, AliDEvent *ev0, AliDEvent *ev1) | |
37 | { | |
38 | // process pairs from one or two (if mixing) events | |
39 | ||
40 | double ptmin=0.1; // GeV | |
41 | double ptmax=1.5; // GeV | |
42 | double etamin=-9; | |
43 | double etamax=9; | |
44 | ||
45 | // mixing-and-rotating-proof centrality | |
46 | ||
47 | double cent = (ev0->Centrality()+ev1->Centrality())/2.0; | |
48 | ||
49 | // loop over pairs | |
50 | ||
51 | AliDHN *pair = (AliDHN*) fHistos.At(0); | |
52 | static TRandom2 ran; | |
53 | for (int i=0; i<ev0->NParticles(); i++) { | |
54 | if (!ev0->ParticleGood(i,fPid0)) continue; | |
55 | double eta0 = ev0->ParticleEta(i); | |
56 | double phi0 = ev0->ParticlePhi(i); | |
57 | double pt0 = ev0->ParticlePt(i); | |
58 | if (eta0 < etamin) continue; | |
59 | if (eta0 > etamax) continue; | |
60 | if (pt0 < ptmin) continue; | |
61 | if (pt0 > ptmax) continue; | |
62 | for (int j=0; j<ev1->NParticles(); j++) { | |
63 | if (ev0==ev1 && j==i) continue; | |
64 | if (ev0==ev1 && j<i && fPid0==fPid1) continue; | |
65 | if (!ev1->ParticleGood(j,fPid1)) continue; | |
66 | double eta1 = ev1->ParticleEta(j); | |
67 | double phi1 = ev1->ParticlePhi(j); | |
68 | double pt1 = ev1->ParticlePt(j); | |
69 | if (eta1 < etamin) continue; | |
70 | if (eta1 > etamax) continue; | |
71 | if (pt1 < ptmin) continue; | |
72 | if (pt1 > ptmax) continue; | |
73 | double deta = eta1-eta0; | |
74 | double dphi = phi1-phi0; | |
75 | // randomize order | |
76 | if (ran.Rndm()<0.5) { | |
77 | double buf = pt0; | |
78 | pt0 = pt1; | |
79 | pt1 = buf; | |
80 | deta = -deta; | |
81 | dphi = -dphi; | |
82 | } | |
83 | dphi = TVector2::Phi_mpi_pi(dphi); | |
84 | dphi*=TMath::RadToDeg(); | |
85 | pair->Fill(tmr, cent, 0, dphi, deta, 1); // number of pairs | |
86 | pair->Fill(tmr, cent, 1, dphi, deta, pt0); | |
87 | pair->Fill(tmr, cent, 2, dphi, deta, pt1); | |
88 | pair->Fill(tmr, cent, 3, dphi, deta, pt0*pt0); | |
89 | pair->Fill(tmr, cent, 4, dphi, deta, pt1*pt1); | |
90 | pair->Fill(tmr, cent, 5, dphi, deta, pt0*pt1); | |
91 | } | |
92 | } | |
93 | } | |
94 | //============================================================================= |