]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/AliJetHadronCorrectionv1.cxx
Manager class for control histos added. (Guillermo Contreras)
[u/mrichter/AliRoot.git] / JETAN / AliJetHadronCorrectionv1.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 // To be modified for hadron correction using particle ID and track merging
18 // Author : magali.estienne@ires.in2p3.fr
19 //===============================================================
20 // Author : Mark Horner (LBL/UCT)
21
22 // --- Standard library ---
23 #include "Riostream.h"
24 #include "TMath.h"
25
26 // --- AliRoot header files ---
27 //#include "../EMCAL/AliJetGeometry.h"
28 #include "AliJetDummyGeo.h"
29 //#include "AliEMCALGeometry.h"
30 #include "AliJetHadronCorrectionv1.h"
31
32 ClassImp(AliJetHadronCorrectionv1)
33
34 Double_t AliJetHadronCorrectionv1::fgParLookup[HCPARAMETERS][HCPARAMETERSETS] = 
35 {  
36     {-2.82271e-4 , -2.39954e-4},   
37     {2.50796e-2  , 2.07172e-2},   
38     {1.02861e-3  , 1.48576e-3},   
39     {2.11539e-2  , -1.38473-2},   
40     {2.27003e-2  , 2.78252e-2},   
41     {1.65078e-6  , 1.51821e-6}
42 };
43
44 AliJetHadronCorrectionv1* AliJetHadronCorrectionv1::fgHadrCorr = 0;
45
46 void AliJetHadronCorrectionv1::SetGeometry(AliJetDummyGeo *geometry)
47 {
48   // Initialise EMCAL geometry
49     if (!geometry)
50     {
51         SetParameters();
52         fSamplingFraction = geometry->GetSampling();
53         cout<<"Setting the sampling fraction to :"<<fSamplingFraction<<endl; 
54     }else
55     {
56         SetParameters(geometry->GetName());
57         fSamplingFraction = geometry->GetSampling();
58         cout<<"Setting the sampling fraction to :"<<fSamplingFraction<<endl; 
59     }
60     return;     
61 }       
62
63 /*
64 ###########################################################################
65 ###########################################################################
66
67 This will have to be modified with the inclusion of the new EMCAL geometry
68 That means I guess a new study of the hadron correction...
69
70 Geometry : SHISH...
71
72 ###########################################################################
73 ###########################################################################
74 */
75
76
77
78         
79 void AliJetHadronCorrectionv1::SetGeometry(TString name,Double_t fs)
80 {
81   // Initialise EMCAL geometry
82   cout << "Setting sampling fraction to "<<fSamplingFraction<<endl;     
83    fSamplingFraction = fs;      
84   if ( name == ""              ||
85        name == "EMCAL_5655_21" ||
86        name == "EMCALArch1a"   ||
87        name == "EMCALArch1aN"  ||
88        name == "G56_2_55_19"   ||
89        name == "G56_2_55_19_104_14" )
90   { // set parameters to this hadron correction
91      cout<<"HC parameters!"<<endl;
92      for (Int_t i=0;i<6;i++)
93      {
94            fPar[i] = fgParLookup[i][0];  
95            cout <<fPar[i]<<endl;
96      }
97   }else if( name == "EMCAL_6564_21" ||  
98             name == "G65_2_64_19" )
99   {       
100       cout<<"HC parameters!"<<endl;
101      for (Int_t i=0;i<6;i++)
102      {
103            fPar[i] = fgParLookup[i][1];  
104            cout <<fPar[i]<<endl;
105      }
106   }else
107   {
108     printf("Geometry not defined in hadron correction\n"); 
109   }       
110         
111 }       
112
113         
114 AliJetHadronCorrectionv1::AliJetHadronCorrectionv1(const char *name,const char *title) 
115                            :AliJetHadronCorrection(name, title)
116 {
117   fgHadrCorr = this;
118 }
119
120 /*
121 AliJetHadronCorrectionv1::AliJetHadronCorrectionv1(const char *name,const char *title,AliJetGeometry *geometry)
122 {
123
124   fHadrCorr = this;
125   SetGeometry(geometry);  
126         
127 }       
128 */
129
130 AliJetHadronCorrectionv1*
131 AliJetHadronCorrectionv1::Instance()
132 {
133   // return pointer to global instance. Instantiate if needed
134   if (! fgHadrCorr) new AliJetHadronCorrectionv1();
135   return fgHadrCorr;
136 }
137
138 Double_t 
139 AliJetHadronCorrectionv1::GetEnergy(Double_t pmom, Double_t eta, Int_t /*gid*/)
140 {
141   // Return parametrised energy response
142   Double_t etai = TMath::Abs(eta); 
143   Double_t value =  fPar[5]*pmom*pmom*pmom+ fPar[0]*pmom*pmom+fPar[1]*pmom +fPar[2]*pmom*etai +fPar[3]*etai + fPar[4];
144   return fSamplingFraction*value;
145    
146 }