]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/UNICOR/AliUnicorAnalHighpt.cxx
Second attempt to add UNICOR. In its present version it is
[u/mrichter/AliRoot.git] / PWG2 / UNICOR / AliUnicorAnalHighpt.cxx
1 /************************************************************************* 
2 * Copyright(c) 1998-2048, ALICE Experiment at CERN, All rights reserved. * 
3 *                                                                        * 
4 * Author: The ALICE Off-line Project.                                    * 
5 * Contributors are mentioned in the code where appropriate.              * 
6 *                                                                        * 
7 * Permission to use, copy, modify and distribute this software and its   * 
8 * documentation strictly for non-commercial purposes is hereby granted   * 
9 * without fee, provided that the above copyright notice appears in all   * 
10 * copies and that both the copyright notice and this permission notice   * 
11 * appear in the supporting documentation. The authors make no claims     * 
12 * about the suitability of this software for any purpose. It is          * 
13 * provided "as is" without express or implied warranty.                  * 
14 **************************************************************************/
15
16 // Author: Dariusz Miskowiec <mailto:d.miskowiec@gsi.de> 2008
17
18 //=============================================================================
19 // high-pt correlation analyzer
20 // Loop over pairs and fill pair histograms. The first particle is always 
21 // taken from ev0 and the second from ev1 so for ev0=ev1 one is getting true 
22 // pairs, otherwise mixed ones. Overlaps a bit with AliUnicorAnalCorrel. 
23 //=============================================================================
24
25 #include <TROOT.h>
26 #include <TMath.h>
27 #include <TVector2.h>
28 #include "AliUnicorEvent.h"
29 #include "AliUnicorHN.h"
30 #include "AliUnicorAnalHighpt.h"
31
32 ClassImp(AliUnicorAnalHighpt)
33  
34 //=============================================================================
35 AliUnicorAnalHighpt::AliUnicorAnalHighpt(Char_t *nam, Double_t emi, Double_t ema, Int_t pid0, 
36                          Int_t pid1): AliUnicorAnal(nam), fPid0(pid0), fPid1(pid1)
37 {
38   // constructor
39   // emi and ema define the rapidity range for histogram
40
41   Double_t ewi = ema-emi; // width of the pseudorapidity range
42   double pi = TMath::Pi();
43   TAxis *ax[8];
44   ax[0] = new TAxis(2,-0.5,1.5);   ax[0]->SetTitle("trumix");
45   ax[1] = new TAxis(2,-0.5,1.5);   ax[1]->SetTitle("weigth"); // 1 or ass pt
46   ax[2] = new TAxis(5,0,0.5);      ax[2]->SetTitle("centrality");
47   ax[3] = new TAxis(3,emi,ema);    ax[3]->SetTitle("trig eta");
48   ax[4] = new TAxis(8,-pi,pi);     ax[4]->SetTitle("trig phi"); // w.r.t. RP
49   double a5[]={0,2.5,3,4,6,8,10,15,20,30,50,100};
50   ax[5] = new TAxis(11,a5);        ax[5]->SetTitle("trig pt (GeV)");
51   ax[6] = new TAxis(20,-ewi,ewi);  ax[6]->SetTitle("ass eta - trig eta"); 
52   ax[7] = new TAxis(36,-1,2*pi-1); ax[7]->SetTitle("ass phi - trig phi"); 
53   ax[8] = new TAxis(10,0,1);       ax[8]->SetTitle("ass pt / trig pt");
54
55   AliUnicorHN *pair = new AliUnicorHN("pair",9,ax);
56   for (int i=0; i<9; i++) delete ax[i];
57   fHistos.Add(pair);
58   gROOT->cd();
59   printf("%s object named %s created\n",ClassName(),GetName());
60 }
61 //=============================================================================
62 void AliUnicorAnalHighpt::Process(AliUnicorEvent *ev0, AliUnicorEvent *ev1) 
63 {
64   // process pairs from one or two (if mixing) events
65   // true pairs are within the triangle (j<i), mixed - all
66
67   // mixing-proof centrality and reaction plane angle
68
69   double cent = (ev0->Centrality()+ev1->Centrality())/2.0;
70   double q0x,q0y,q1x,q1y;
71   ev0->RP(q0x,q0y);
72   ev1->RP(q1x,q1y); 
73   double rpphi = atan2(q0y+q1y,q0x+q1x);
74
75   // loop over pairs 
76
77   int tmr = (ev0!=ev1); // 0 for true, 1 for mixed
78   AliUnicorHN *pair = (AliUnicorHN*) fHistos.At(0);
79   for (int i=0; i<ev0->NParticles(); i++) {
80     if (!ev0->ParticleGood(i,fPid0)) continue;
81     double eta0 = ev0->ParticleEta(i);
82     double phi0 = ev0->ParticlePhi(i);
83     double pt0 = ev0->ParticlePt(i);
84     for (int j=0; j<ev1->NParticles(); j++) {
85       if (ev0==ev1 && j==i) continue; // same particle
86       if (ev0==ev1 && j<i && fPid0==fPid1) continue;
87       if (!ev1->ParticleGood(j,fPid1)) continue;
88       double eta1 = ev1->ParticleEta(j);
89       double phi1 = ev1->ParticlePhi(j);
90       double pt1 = ev1->ParticlePt(j);
91       int order = (pt0>pt1); 
92       double deta = order*(eta1-eta0); // ass-trig
93       double dphi = order*(phi1-phi0);
94       dphi = TVector2::Phi_mpi_pi(dphi);
95       if (dphi<-1) dphi+=2*TMath::Pi(); 
96       phi0 = TVector2::Phi_mpi_pi(phi0-rpphi);  // wrt. reaction plane
97       pair->Fill(tmr,0,cent,eta0,phi0,pt0,deta,dphi,pt1/pt0,1);   // number of pairs
98       pair->Fill(tmr,1,cent,eta0,phi0,pt0,deta,dphi,pt1/pt0,pt1); // weigthed with ass pt
99     }
100   }
101 }
102 //=============================================================================