]>
Commit | Line | Data |
---|---|---|
cf6522d1 | 1 | //Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili |
641e1e0c | 2 | //University of Tennessee at Knoxville |
cf6522d1 | 3 | // |
4 | // This class is designed for the analysis of the hadronic component of | |
5 | // transverse energy. It is used by AliAnalysisTaskHadEt. | |
6 | // This gets information about the hadronic component of the transverse energy | |
7 | // from tracks reconstructed in an event | |
8 | // it has daughters, AliAnalysisHadEtMonteCarlo and | |
9 | // AliAnalysisHadEtReconstructed which loop over either Monte Carlo data or | |
10 | // real data to get Et | |
3ce6b879 | 11 | |
641e1e0c | 12 | #include "AliAnalysisHadEt.h" |
13 | #include "TMath.h" | |
14 | #include "TList.h" | |
15 | #include "TH1F.h" | |
16 | #include "TH2F.h" | |
17 | #include <iostream> | |
18 | #include "AliAnalysisEtCuts.h" | |
020abff0 | 19 | #include "AliMCEvent.h" |
641e1e0c | 20 | #include "AliVEvent.h" |
020abff0 | 21 | #include "AliStack.h" |
22 | #include "AliESDtrackCuts.h" | |
23 | #include "TDatabasePDG.h" | |
24 | #include "TParticle.h" | |
25 | #include "Rtypes.h" | |
4b40b2b1 | 26 | #include "AliPDG.h" |
641e1e0c | 27 | |
28 | using namespace std; | |
29 | ||
30 | ClassImp(AliAnalysisHadEt); | |
31 | ||
32 | ||
4b40b2b1 | 33 | Int_t AliAnalysisHadEt::fgnumOfEtaBins = 16; |
34 | Float_t AliAnalysisHadEt::fgEtaAxis[17]={-0.78, -0.7, -0.58, -0.46, -0.34, -0.22, -0.12, -0.06, -0.0, 0.06, 0.12, 0.22, 0.34, 0.46, 0.58, 0.7, 0.78}; | |
020abff0 | 35 | Int_t AliAnalysisHadEt::fgNumOfPtBins = 111; |
36 | Float_t AliAnalysisHadEt::fgPtAxis[117]= | |
641e1e0c | 37 | {0.0,0.01,0.02,0.03,0.04, 0.05, 0.06,0.07,0.08,0.09, 0.10,0.11, .12,0.13, .14,0.15, .16,0.17, .18,0.19, |
38 | 0.2, .22, .24, .26, .28, 0.30, 0.32, .34, .36, .38, 0.40, .42, .44, .46, .48, | |
39 | 0.5, .52, .54, .56, .58, 0.60, 0.62, .64, .66, .68, 0.70, .72, .74, .76, .78, | |
40 | .80, .82, .84, .86, .88, 0.90, 0.92, .94, .96, .98, 1.00,1.05, 1.1,1.15, 1.2, | |
41 | 1.25, 1.3,1.35,1.40,1.45, 1.50, 1.55, 1.6,1.65, 1.7, 1.75, 1.8,1.85, 1.9,1.95, | |
42 | 2.0, 2.2, 2.4, 2.6, 2.8, 3.00, 3.20, 3.4, 3.6, 3.8, 4.00, 4.2, 4.4, 4.6, 4.8, | |
43 | 5.0, 5.5, 6.0, 6.5, 7.0, 7.50, 8.00, 8.5, 9.0, 9.5, 10.0,12.0,14.0,16.0,18.0, | |
44 | 20.0,25.0,30.0,35.0,40.0, 45.0, 50.0}; | |
45 | ||
d6214a64 | 46 | |
7d2d1773 | 47 | AliAnalysisHadEt::AliAnalysisHadEt() : AliAnalysisEtCommon() |
7d2d1773 | 48 | ,fSumEt(0) |
49 | ,fSumEtAcc(0) | |
50 | ,fTotEt(0) | |
51 | ,fTotEtAcc(0) | |
52 | ,fTotNeutralEt(0) | |
53 | ,fTotNeutralEtAcc(0) | |
54 | ,fTotChargedEt(0) | |
55 | ,fTotChargedEtAcc(0) | |
56 | ,fMultiplicity(0) | |
57 | ,fChargedMultiplicity(0) | |
58 | ,fNeutralMultiplicity(0) | |
59 | ,fhistoList(0) | |
020abff0 | 60 | {//default constructor |
641e1e0c | 61 | |
62 | } | |
63 | ||
64 | AliAnalysisHadEt::~AliAnalysisHadEt() | |
020abff0 | 65 | {//destructor |
951efd81 | 66 | delete fEsdtrackCutsITSTPC; |
67 | delete fEsdtrackCutsITS; | |
68 | delete fEsdtrackCutsTPC; | |
641e1e0c | 69 | } |
70 | ||
71 | Int_t AliAnalysisHadEt::AnalyseEvent(AliVEvent *event) | |
020abff0 | 72 | { //this line is basically here to eliminate a compiler warning that event is not used. Making it a virtual function did not work with the plugin. |
7d2d1773 | 73 | AliAnalysisEtCommon::AnalyseEvent(event); |
0065531a | 74 | ResetEventValues(); |
641e1e0c | 75 | return 0; |
76 | } | |
77 | ||
641e1e0c | 78 | |
79 | void AliAnalysisHadEt::Init() | |
0065531a | 80 | {// clear variables, set up cuts and PDG info |
7d2d1773 | 81 | AliAnalysisEtCommon::Init(); |
641e1e0c | 82 | } |
83 | ||
84 | void AliAnalysisHadEt::ResetEventValues() | |
020abff0 | 85 | {//Resets event values of et to zero |
7d2d1773 | 86 | AliAnalysisEtCommon::ResetEventValues(); |
0065531a | 87 | fTotEt = 0; |
88 | fTotEtAcc = 0; | |
89 | fTotNeutralEt = 0; | |
90 | fTotNeutralEtAcc = 0; | |
91 | fTotChargedEt = 0; | |
92 | fTotChargedEtAcc = 0; | |
93 | fMultiplicity = 0; | |
94 | fChargedMultiplicity = 0; | |
95 | fNeutralMultiplicity = 0; | |
96 | ||
4998becf | 97 | } |
641e1e0c | 98 | void AliAnalysisHadEt::CreateEtaPtHisto2D(TString name, TString title) |
020abff0 | 99 | { //creates a 2-d histogram in eta and phi and adds it to the list of histograms to be saved |
641e1e0c | 100 | TString *histoname = new TString(); |
101 | TString *histotitle = new TString(); | |
102 | ||
103 | histoname->Append(name); | |
104 | histotitle->Append(title); | |
641e1e0c | 105 | |
020abff0 | 106 | TH2F *histo = new TH2F(histoname->Data(),histotitle->Data(),fgNumOfPtBins, fgPtAxis, fgnumOfEtaBins, fgEtaAxis); |
641e1e0c | 107 | histo->SetYTitle("#eta"); |
108 | histo->SetXTitle("p_{T}"); | |
109 | histo->SetZTitle("E_{T}"); | |
110 | histo->Sumw2(); | |
020abff0 | 111 | fhistoList->Add(histo); |
641e1e0c | 112 | delete histoname; |
113 | delete histotitle; | |
114 | ||
115 | } | |
116 | ||
117 | void AliAnalysisHadEt::CreateHisto1D(TString name, TString title, TString xtitle, TString ytitle,Int_t xbins, Float_t xlow,Float_t xhigh) | |
020abff0 | 118 | { //creates a 1d histogram of the given dimensions and adds it to the list of histograms to be saved |
641e1e0c | 119 | TString *histoname = new TString(); |
120 | TString *histotitle = new TString(); | |
641e1e0c | 121 | histoname->Append(name); |
122 | histotitle->Append(title); | |
641e1e0c | 123 | TH1F *histo = new TH1F(histoname->Data(),histotitle->Data(),xbins,xlow,xhigh); |
124 | histo->SetYTitle(ytitle); | |
125 | histo->SetXTitle(xtitle); | |
126 | histo->Sumw2(); | |
020abff0 | 127 | fhistoList->Add(histo); |
641e1e0c | 128 | delete histoname; |
129 | delete histotitle; | |
641e1e0c | 130 | } |
131 | void AliAnalysisHadEt::CreateIntHisto1D(TString name, TString title, TString xtitle, TString ytitle,Int_t xbins, Int_t xlow,Int_t xhigh) | |
020abff0 | 132 | { //creates a 1d integer histogram and adds it to the list of histograms to be saved |
641e1e0c | 133 | TString *histoname = new TString(); |
134 | TString *histotitle = new TString(); | |
641e1e0c | 135 | histoname->Append(name); |
136 | histotitle->Append(title); | |
641e1e0c | 137 | TH1I *histo = new TH1I(histoname->Data(),histotitle->Data(),xbins,xlow,xhigh); |
138 | histo->SetYTitle(ytitle); | |
139 | histo->SetXTitle(xtitle); | |
140 | histo->Sumw2(); | |
020abff0 | 141 | fhistoList->Add(histo); |
641e1e0c | 142 | delete histoname; |
143 | delete histotitle; | |
144 | ||
145 | } | |
146 | void AliAnalysisHadEt::CreateHisto2D(TString name, TString title, TString xtitle, TString ytitle,Int_t xbins, Float_t xlow,Float_t xhigh,Int_t ybins,Float_t ylow,Float_t yhigh) | |
020abff0 | 147 | { //creates a 2d histogram and adds it to the list of histograms to be saved |
641e1e0c | 148 | TString *histoname = new TString(); |
149 | TString *histotitle = new TString(); | |
641e1e0c | 150 | histoname->Append(name); |
151 | histotitle->Append(title); | |
641e1e0c | 152 | TH2F *histo = new TH2F(histoname->Data(),histotitle->Data(),xbins,xlow,xhigh,ybins,ylow,yhigh); |
153 | histo->SetYTitle(ytitle); | |
154 | histo->SetXTitle(xtitle); | |
155 | histo->Sumw2(); | |
020abff0 | 156 | fhistoList->Add(histo); |
641e1e0c | 157 | delete histoname; |
158 | delete histotitle; | |
159 | ||
160 | } | |
161 | void AliAnalysisHadEt::CreateIntHisto2D(TString name, TString title, TString xtitle, TString ytitle,Int_t xbins, Int_t xlow,Int_t xhigh,Int_t ybins,Int_t ylow,Int_t yhigh) | |
020abff0 | 162 | { //creates a 2-d integer histogram and adds it to the list of histograms to be saved |
641e1e0c | 163 | TString *histoname = new TString(); |
164 | TString *histotitle = new TString(); | |
641e1e0c | 165 | histoname->Append(name); |
166 | histotitle->Append(title); | |
641e1e0c | 167 | TH2I *histo = new TH2I(histoname->Data(),histotitle->Data(),xbins,xlow,xhigh,ybins,ylow,yhigh); |
168 | histo->SetYTitle(ytitle); | |
169 | histo->SetXTitle(xtitle); | |
170 | histo->Sumw2(); | |
020abff0 | 171 | fhistoList->Add(histo); |
641e1e0c | 172 | delete histoname; |
173 | delete histotitle; | |
174 | ||
175 | } | |
176 | ||
177 | void AliAnalysisHadEt::CreateEtaHisto1D(TString name, TString title) | |
020abff0 | 178 | { //creates 1d histogram in eta and adds it to the list of histograms to be saved |
641e1e0c | 179 | TString *histoname = new TString(); |
180 | TString *histotitle = new TString(); | |
641e1e0c | 181 | histoname->Append(name); |
182 | histotitle->Append(title); | |
020abff0 | 183 | TH1F *histo = new TH1F(histoname->Data(),histotitle->Data(),fgnumOfEtaBins, fgEtaAxis); |
641e1e0c | 184 | histo->SetYTitle("E_{T}"); |
185 | histo->SetXTitle("#eta"); | |
186 | histo->Sumw2(); | |
020abff0 | 187 | fhistoList->Add(histo); |
641e1e0c | 188 | delete histoname; |
189 | delete histotitle; | |
641e1e0c | 190 | } |
191 | void AliAnalysisHadEt::FillHisto1D(TString histname, Float_t x, Float_t weight) | |
020abff0 | 192 | {//fills a 1d histogram with the name histoname with the value x and the weight "weight" |
641e1e0c | 193 | TH1F *histo; |
194 | TString *name = new TString(); | |
641e1e0c | 195 | name->Append(histname); |
020abff0 | 196 | histo = (TH1F *)fhistoList->FindObject(name->Data()); |
641e1e0c | 197 | if(histo){ |
198 | histo->Fill((Double_t)x, weight); | |
199 | } | |
200 | else{cerr<<"CorrelationMaker::FillHisto1D: no histogram "<< name->Data()<<endl;} | |
201 | delete name; | |
202 | } | |
203 | void AliAnalysisHadEt::FillHisto2D(TString histname, Float_t x, Float_t y, Float_t weight) | |
020abff0 | 204 | {//fills a 2d histogram with the name histoname with the value x and the weight "weight" |
641e1e0c | 205 | TH2F *histo; |
206 | TString *name = new TString(); | |
641e1e0c | 207 | name->Append(histname); |
020abff0 | 208 | histo = (TH2F *)fhistoList->FindObject(name->Data()); |
641e1e0c | 209 | if(histo){ |
210 | histo->Fill((Double_t)x,(Double_t)y, weight); | |
211 | } | |
212 | else{cerr<<"CorrelationMaker::FillHisto2D: no histogram "<< name->Data()<<endl;} | |
213 | delete name; | |
214 | } | |
215 | ||
216 | ||
020abff0 | 217 | Float_t AliAnalysisHadEt::Et(TParticle *part, float mass){//function to calculate et in the same way as it would be calculated in a calorimeter |
218 | if(mass+1000<0.01){//if no mass given return default. The default argument is -1000 | |
641e1e0c | 219 | if(TMath::Abs(part->GetPDG(0)->PdgCode())==2212 || TMath::Abs(part->GetPDG(0)->PdgCode())==2112){ |
220 | if(part->GetPDG(0)->PdgCode()==-2212 || part->GetPDG(0)->PdgCode()==-2112){//antiproton or antineutron | |
221 | //for antinucleons we specifically want to return the kinetic energy plus twice the rest mass | |
222 | return (part->Energy()+part->GetMass())*TMath::Sin(part->Theta()); | |
223 | } | |
0e866ddc | 224 | if(part->GetPDG(0)->PdgCode()==2212 || part->GetPDG(0)->PdgCode()==2112){//proton or neutron |
641e1e0c | 225 | //for nucleons we specifically want to return the kinetic energy only |
226 | return (part->Energy()-part->GetMass())*TMath::Sin(part->Theta()); | |
227 | } | |
228 | } | |
229 | else{//otherwise go to the default | |
230 | return part->Energy()*TMath::Sin(part->Theta()); | |
231 | } | |
232 | } | |
233 | else{//otherwise use the mass that was given | |
234 | return (TMath::Sqrt(TMath::Power(part->P(),2.0)+TMath::Power(mass,2.0)))*TMath::Sin(part->Theta()); | |
235 | } | |
236 | return 0.0; | |
237 | } | |
464aa50c | 238 | Float_t AliAnalysisHadEt::Et(Float_t p, Float_t theta, Int_t pid, Short_t charge) const {//function to calculate et in the same way as it would be calculated in a calorimeter |
7d2d1773 | 239 | if(pid==AliAnalysisEtCommon::fgPiPlusCode || pid==AliAnalysisEtCommon::fgPiMinusCode){//Nothing special for pions |
4b40b2b1 | 240 | return TMath::Sqrt(p*p + fgPionMass*fgPionMass) * TMath::Sin(theta); |
3ce6b879 | 241 | } |
7d2d1773 | 242 | if(pid==AliAnalysisEtCommon::fgKPlusCode || pid==AliAnalysisEtCommon::fgKMinusCode){//Nothing special for kaons |
243 | return TMath::Sqrt(p*p + AliAnalysisEtCommon::fgKaonMass*AliAnalysisEtCommon::fgKaonMass) * TMath::Sin(theta); | |
3ce6b879 | 244 | } |
7d2d1773 | 245 | if(pid==AliAnalysisEtCommon::fgEPlusCode || pid==AliAnalysisEtCommon::fgEMinusCode){//Nothing special for electrons |
246 | return TMath::Sqrt(p*p + AliAnalysisEtCommon::fgElectronMass*AliAnalysisEtCommon::fgElectronMass) * TMath::Sin(theta); | |
3ce6b879 | 247 | } |
7d2d1773 | 248 | if(pid==AliAnalysisEtCommon::fgProtonCode || pid==AliAnalysisEtCommon::fgAntiProtonCode){//But for protons we must be careful... |
3ce6b879 | 249 | if(charge<0.0){//antiprotns: kinetic energy plus twice the rest mass |
7d2d1773 | 250 | return (TMath::Sqrt(p*p + AliAnalysisEtCommon::fgProtonMass*AliAnalysisEtCommon::fgProtonMass) + AliAnalysisEtCommon::fgProtonMass) * TMath::Sin(theta); |
3ce6b879 | 251 | } |
252 | if(charge>0.0){//antiprotns: kinetic energy only | |
7d2d1773 | 253 | return (TMath::Sqrt(p*p + AliAnalysisEtCommon::fgProtonMass*AliAnalysisEtCommon::fgProtonMass) - AliAnalysisEtCommon::fgProtonMass) * TMath::Sin(theta); |
3ce6b879 | 254 | } |
255 | } | |
256 | cerr<<"Uh-oh! Et not set properly!"<<endl; | |
257 | return 0.0; | |
258 | } | |
7d2d1773 | 259 |