]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/AliJetHadronCorrectionv0.cxx
Updates
[u/mrichter/AliRoot.git] / JETAN / AliJetHadronCorrectionv0.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2002, 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
17 /* $Id$ */
18
19 //===============================================================
20 // To be modified for hadron correction using particle ID and track merging
21 // Author : magali.estienne@ires.in2p3.fr
22 //===============================================================
23
24
25 // --- AliRoot header files ---
26 #include "AliJetHadronCorrectionv0.h"
27
28 const Int_t maxVariant = 8;  // size eta grid
29 const Int_t nVec = 11;       // size momentum grid
30 const Int_t nPol = 4;        // number coefficients of polynom
31 static Double_t etaGrid[maxVariant]={ 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.67};
32 static Double_t pGrid[nVec]={ 0.5, 1.0, 2.0, 3.0, 5.0, 10.0, 20.0, 30.0, 50.0, 70.0, 100.0};
33 // c[][] - first index for eta, second for momentum 
34 static Double_t c[maxVariant][nPol] ={
35     {1.305705e-01, 3.725653e-01, -1.219962e-02, 1.806235e-04},
36     {1.296153e-01, 3.827408e-01, -1.238640e-02, 1.822804e-04},
37     {1.337690e-01, 3.797454e-01, -1.245227e-02, 1.848243e-04},
38     {1.395796e-01, 3.623994e-01, -9.196803e-03, 1.243278e-04},
39     {1.457184e-01, 3.753655e-01, -1.035324e-02, 1.473447e-04},
40     {1.329164e-01, 4.219044e-01, -1.310515e-02, 1.948883e-04},
41     {8.136581e-02, 4.646087e-01, -1.531917e-02, 2.274749e-04},
42     {1.119836e-01, 4.262497e-01, -1.160125e-02, 1.628738e-04} };
43
44 ClassImp(AliJetHadronCorrectionv0)
45
46 AliJetHadronCorrectionv0* AliJetHadronCorrectionv0::fHadrCorr = 0;
47
48 AliJetHadronCorrectionv0::AliJetHadronCorrectionv0(const char *name,const char *title) 
49                            :AliJetHadronCorrection(name, title)
50 {
51   fHadrCorr = this;
52 }
53
54 AliJetHadronCorrectionv0*
55 AliJetHadronCorrectionv0::Instance()
56 {
57   fHadrCorr = new AliJetHadronCorrectionv0();
58   return fHadrCorr;
59 }
60
61 Double_t 
62 AliJetHadronCorrectionv0::GetEnergy(Double_t pmom, Double_t eta, Int_t /*gid*/)
63 {
64 // Get energy for momentum pmom and pseudorapidity eta
65   Int_t iEta=0; // index 
66   Double_t etaw = TMath::Abs(eta);
67   if(etaw > etaGrid[maxVariant-1]) etaw = etaGrid[maxVariant-1];
68   for(Int_t i=0; i<maxVariant; i++) if(eta>=etaGrid[i]) {iEta = i; break;}
69
70   Double_t e[2], y, pw = pmom;
71   if(pmom > pGrid[nVec-1]) pw = pGrid[nVec-1];
72   for(Int_t i=0; i<2; i++){ // e for two eta value
73     e[i] = c[iEta][0];
74     y = 1.;
75     for(Int_t j=1; j<nPol; j++){
76       y *= pw;
77       e[i] += c[iEta][j]*y;
78     }
79     if(i==0) iEta ++;
80   }
81
82   Double_t deta = etaGrid[iEta] - etaGrid[iEta-1];
83   Double_t a = (e[1] - e[0])/deta; // slope 
84   Double_t energy = e[0] + a*(eta-etaGrid[iEta-1]);
85   return energy;
86 }