]>
Commit | Line | Data |
---|---|---|
fc7e3b59 | 1 | /************************************************************************** |
2 | * This file is property of and copyright by the ALICE HLT Project * | |
3 | * ALICE Experiment at CERN, All rights reserved. * | |
4 | * * | |
5 | * Primary Author: Svein Lindal <slindal@fys.uio.no> * | |
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 | /// @file AliAnaConvCorrBase.cxx | |
17 | /// @author Svein Lindal | |
18 | /// @brief Base class for analysation of conversion particle - track correlations | |
19 | ||
20 | ||
21 | #include "AliAnaConvCorrBase.h" | |
22 | #include "AliAODTrack.h" | |
23 | ||
24 | #include "TClonesArray.h" | |
25 | #include "TH1F.h" | |
4267afec | 26 | #include "TH2F.h" |
fc7e3b59 | 27 | #include "TList.h" |
fc7e3b59 | 28 | #include "AliAODConversionParticle.h" |
29 | ||
fc7e3b59 | 30 | #include <iostream> |
31 | ||
32 | // Gamma - jet correlation analysis task | |
33 | // Authors: Svein Lindal | |
34 | ||
35 | ||
36 | using namespace std; | |
37 | ClassImp(AliAnaConvCorrBase) | |
38 | ||
39 | //________________________________________________________________________ | |
296f4e9c | 40 | AliAnaConvCorrBase::AliAnaConvCorrBase(TString name, TString title = "title") : TNamed(name, title), |
fc7e3b59 | 41 | fHistograms(NULL), |
3bff49c3 | 42 | fAxesList(), |
43 | fTrigAxisList(), | |
44 | fTrackAxisList(), | |
296f4e9c | 45 | fAxistPt(), |
46 | fAxiscPt(), | |
47 | fAxisdEta(), | |
48 | fAxisdPhi(), | |
3bff49c3 | 49 | fAxisIso(), |
50 | fAxisMEEta(), | |
51 | fAxisMEPhi(), | |
52 | fCorrSparse(NULL), | |
53 | fTrigSparse(NULL), | |
54 | fTrackSparse(NULL) | |
fc7e3b59 | 55 | { |
56 | //Constructor | |
d9f6f50a | 57 | fAxesList.SetOwner(kFALSE); |
58 | fTrackAxisList.SetOwner(kFALSE); | |
59 | fTrigAxisList.SetOwner(kFALSE); | |
4574af57 | 60 | |
296f4e9c | 61 | SetUpDefaultBins(); |
d9f6f50a | 62 | |
fc7e3b59 | 63 | } |
64 | ||
65 | ||
66 | //________________________________________________________________________________ | |
67 | AliAnaConvCorrBase::~AliAnaConvCorrBase() { | |
fc7e3b59 | 68 | ///destructor |
fc7e3b59 | 69 | } |
70 | ||
3bff49c3 | 71 | //________________________________________________________________________________ |
fc7e3b59 | 72 | void AliAnaConvCorrBase::CreateHistograms() { |
811b0806 | 73 | CreateBaseHistograms(); |
74 | } | |
75 | ||
296f4e9c | 76 | ///________________________________________________________________________________ |
77 | void AliAnaConvCorrBase::SetUpDefaultBins() { | |
78 | //Set up default bins | |
4267afec | 79 | fAxisdEta.Set(40, -1.6, 1.6); |
296f4e9c | 80 | fAxisdEta.SetNameTitle("dEta", "delta eta"); |
296f4e9c | 81 | |
d64241db | 82 | fAxisdPhi.Set(32, -TMath::PiOver2(), 3*TMath::PiOver2()); |
296f4e9c | 83 | fAxisdPhi.SetNameTitle("dPhi", "delta Phi"); |
296f4e9c | 84 | |
4267afec | 85 | Double_t tptbins[14] = {3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 12.5, 15, 20, 25, 30, 50, 100}; |
86 | fAxistPt.Set(13, tptbins); | |
296f4e9c | 87 | fAxistPt.SetNameTitle("tPt", "trigger Pt"); |
296f4e9c | 88 | |
4267afec | 89 | Double_t cptbins[18] = {1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 8.0, 10.0, 12.5, 15, 20, 25, 30, 50, 100}; |
90 | fAxiscPt.Set(17, cptbins); | |
296f4e9c | 91 | fAxiscPt.SetNameTitle("cPt", "track Pt"); |
3bff49c3 | 92 | |
93 | fAxisIso.Set(3, -0.5, 2.5); | |
94 | fAxisIso.SetNameTitle("iso", "isolation"); | |
95 | ||
96 | fAxesList.AddAt(&fAxisdEta, 0); | |
97 | fAxesList.AddAt(&fAxisdPhi, 1); | |
98 | fAxesList.AddAt(&fAxistPt, 2); | |
296f4e9c | 99 | fAxesList.AddAt(&fAxiscPt, 3); |
3bff49c3 | 100 | fAxesList.AddAt(&fAxisIso, 4); |
101 | ||
4267afec | 102 | fAxisMEEta.Set(320, -0.8, 0.8); |
3bff49c3 | 103 | fAxisMEEta.SetNameTitle("eta", "eta"); |
104 | ||
4267afec | 105 | fAxisMEPhi.Set(256, 0, TMath::TwoPi()); |
3bff49c3 | 106 | fAxisMEPhi.SetNameTitle("phi", "phi"); |
107 | ||
108 | fTrackAxisList.AddAt(&fAxisMEEta, 0); | |
109 | fTrackAxisList.AddAt(&fAxisMEPhi, 1); | |
110 | fTrackAxisList.AddAt(&fAxistPt, 2); | |
111 | fTrackAxisList.AddAt(&fAxiscPt, 3); | |
112 | fTrackAxisList.AddAt(&fAxisIso, 4); | |
113 | ||
114 | fTrigAxisList.AddAt(&fAxisMEEta, 0); | |
115 | fTrigAxisList.AddAt(&fAxisMEPhi, 1); | |
116 | fTrigAxisList.AddAt(&fAxistPt, 2); | |
117 | fTrigAxisList.AddAt(&fAxisIso, 3); | |
296f4e9c | 118 | |
296f4e9c | 119 | } |
120 | ||
3bff49c3 | 121 | |
811b0806 | 122 | //________________________________________________________________________ |
123 | void AliAnaConvCorrBase::CreateBaseHistograms() { | |
fc7e3b59 | 124 | //Create histograms add, to outputlis |
125 | ||
d64241db | 126 | //cout << "Creating histograms for "<< GetName() << endl; |
811b0806 | 127 | |
fc7e3b59 | 128 | fHistograms = new TList(); |
3bff49c3 | 129 | fHistograms->SetOwner(kTRUE); |
fc7e3b59 | 130 | fHistograms->SetName(fName); |
131 | ||
fc7e3b59 | 132 | |
3bff49c3 | 133 | fCorrSparse = CreateSparse(GetName(), GetTitle(), &fAxesList); |
134 | fHistograms->Add(fCorrSparse); | |
135 | ||
136 | fTrackSparse = CreateSparse(Form("%s_%s", GetName(), "METrack"), Form("%s %s", GetTitle(), "ME Tracks"), &fTrackAxisList); | |
137 | fHistograms->Add(fTrackSparse); | |
138 | ||
139 | fTrigSparse = CreateSparse(Form("%s_%s", GetName(), "METrig"), Form("%s %s", GetTitle(), "ME Triggers"), &fTrigAxisList); | |
140 | fHistograms->Add(fTrigSparse); | |
296f4e9c | 141 | |
fc7e3b59 | 142 | } |
143 | ||
296f4e9c | 144 | ///________________________________________________________________________ |
145 | THnSparseF * AliAnaConvCorrBase::CreateSparse(TString nameString, TString titleString, TList * axesList) { | |
146 | //Create sparse | |
147 | const Int_t dim = axesList->GetSize(); | |
148 | ||
d64241db | 149 | //cout << nameString << " " << titleString << " " << " dimesion: " << dim << endl; |
296f4e9c | 150 | |
151 | TAxis * axes[dim]; | |
152 | Int_t bins[dim]; | |
153 | Double_t min[dim]; | |
154 | Double_t max[dim]; | |
155 | ||
156 | for(Int_t i = 0; i<dim; i++) { | |
157 | TAxis * axis = dynamic_cast<TAxis*>(axesList->At(i)); | |
158 | if(axis) axes[i] = axis; | |
159 | else { | |
160 | cout << "AliAnalysisTaskdPhi::CreateSparse: Error error, all the axes are not present in axis list" << endl; | |
161 | return NULL; | |
162 | } | |
163 | } | |
fc7e3b59 | 164 | |
296f4e9c | 165 | for(Int_t i = 0; i<dim; i++) { |
d64241db | 166 | //cout << axes[i]->GetTitle() << endl; |
167 | bins[i] = axes[i]->GetNbins(); | |
296f4e9c | 168 | min[i] = axes[i]->GetBinLowEdge(1); |
169 | max[i] = axes[i]->GetBinUpEdge(axes[i]->GetNbins()); | |
170 | } | |
fc7e3b59 | 171 | |
296f4e9c | 172 | THnSparseF * sparse = new THnSparseF(Form("%s", nameString.Data()), |
173 | Form("%s", titleString.Data()), | |
174 | dim, bins, min, max); | |
811b0806 | 175 | |
296f4e9c | 176 | for(Int_t i = 0; i<dim; i++) { |
177 | sparse->GetAxis(i)->SetNameTitle(axes[i]->GetName(), axes[i]->GetTitle() ); | |
178 | if(axes[i]->GetXbins()->GetSize() > 0) { | |
179 | sparse->SetBinEdges(i, axes[i]->GetXbins()->GetArray() ); | |
180 | } | |
811b0806 | 181 | } |
296f4e9c | 182 | return sparse; |
fc7e3b59 | 183 | } |
184 | ||
fc7e3b59 | 185 | |
296f4e9c | 186 | |
187 | //________________________________________________________________ | |
3bff49c3 | 188 | void AliAnaConvCorrBase::CorrelateWithTracks(AliAODConversionParticle * particle, TObjArray * tracks, Int_t const tIDs[4], Int_t isolated = 0) { |
296f4e9c | 189 | //Correlate particle with tracks |
190 | ||
d64241db | 191 | |
296f4e9c | 192 | |
3bff49c3 | 193 | Int_t nDim = fAxesList.GetSize(); |
296f4e9c | 194 | Double_t dphivalues[nDim]; |
3bff49c3 | 195 | Double_t trackValues[nDim]; |
196 | Double_t trigValues[nDim - 1]; | |
197 | ||
2dd6ec26 | 198 | trigValues[0] = particle->Eta(); |
199 | trigValues[1] = particle->Phi(); | |
200 | trigValues[2] = particle->Pt(); | |
201 | trigValues[3] = isolated; | |
2dd6ec26 | 202 | |
d64241db | 203 | if(nDim > 4) { |
204 | dphivalues[5] = particle->M(); | |
205 | trackValues[5] = particle->M(); | |
206 | trigValues[4] = particle->M(); | |
207 | } | |
4267afec | 208 | |
209 | fTrigSparse->Fill(trigValues); | |
210 | ||
d64241db | 211 | |
296f4e9c | 212 | for(int ij = 0; ij < tracks->GetEntriesFast(); ij++) { |
213 | AliVTrack * track = static_cast<AliVTrack*>(tracks->UncheckedAt(ij)); | |
214 | Int_t tid = track->GetID(); | |
215 | ||
216 | if((tid > 0) && (tid == tIDs[0] || tid == tIDs[1] || tid == tIDs[2] || tid == tIDs[3]) ) { | |
217 | continue; | |
218 | } | |
219 | ||
296f4e9c | 220 | dphivalues[0] = particle->Eta() - track->Eta(); |
3bff49c3 | 221 | dphivalues[1] = GetDPhi(particle->Phi() - track->Phi()); |
296f4e9c | 222 | dphivalues[2] = particle->Pt(); |
223 | dphivalues[3] = track->Pt(); | |
3bff49c3 | 224 | dphivalues[4] = isolated; |
225 | ||
226 | trackValues[0] = track->Eta(); | |
227 | trackValues[1] = track->Phi(); | |
228 | trackValues[2] = particle->Pt(); | |
229 | trackValues[3] = track->Pt(); | |
230 | trackValues[4] = isolated; | |
231 | ||
3bff49c3 | 232 | |
3bff49c3 | 233 | |
234 | fCorrSparse->Fill(dphivalues); | |
235 | fTrackSparse->Fill(trackValues); | |
296f4e9c | 236 | } |
237 | } | |
238 |