]>
Commit | Line | Data |
---|---|---|
89b48e9e | 1 | #include "AliAnalysisTask.h" |
2 | #include "AliAnalysisManager.h" | |
3 | #include "AliAnalysisDataContainer.h" | |
4 | #include "AliITSRecPoint.h" | |
5 | #include "AliESDEvent.h" | |
ef6fa479 | 6 | #include "AliESDRun.h" |
7 | #include "AliDAQ.h" | |
89b48e9e | 8 | #include "AliTrackPointArray.h" |
9 | #include "AliITSgeomTGeo.h" | |
10 | #include "AliITSTPArrayFit.h" | |
11 | #include "AliESDfriend.h" | |
12 | #include "AliCDBManager.h" | |
13 | #include "AliCDBEntry.h" | |
14 | #include "AliITSCalibrationSDD.h" | |
15 | #include "AliITSresponseSDD.h" | |
16 | #include "AliGeomManager.h" | |
00a2ed4c | 17 | #include "AliMultiplicity.h" |
89b48e9e | 18 | #include <TSystem.h> |
19 | #include <TTree.h> | |
20 | #include <TH1F.h> | |
21 | #include <TH2F.h> | |
f09774b4 | 22 | #include <TProfile.h> |
89b48e9e | 23 | #include <TChain.h> |
24 | #include <TGeoGlobalMagField.h> | |
25 | #include "AliESDInputHandlerRP.h" | |
6a5f5ccc | 26 | #include "AliITSSumTP.h" |
27 | #include "AliMagF.h" | |
89b48e9e | 28 | |
29 | /************************************************************************** | |
30 | * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. * | |
31 | * * | |
32 | * Author: The ALICE Off-line Project. * | |
33 | * Contributors are mentioned in the code where appropriate. * | |
34 | * * | |
35 | * Permission to use, copy, modify and distribute this software and its * | |
36 | * documentation strictly for non-commercial purposes is hereby granted * | |
37 | * without fee, provided that the above copyright notice appears in all * | |
38 | * copies and that both the copyright notice and this permission notice * | |
39 | * appear in the supporting documentation. The authors make no claims * | |
40 | * about the suitability of this software for any purpose. It is * | |
41 | * provided "as is" without express or implied warranty. * | |
42 | **************************************************************************/ | |
43 | ||
44 | //************************************************************************* | |
45 | // Implementation of class AliAnalysiTaskITSAlignQA | |
46 | // AliAnalysisTaskSE to extract from ESD + ESDfriends | |
47 | // the track-to-point residuals and dE/dx vs, time for SDD modules | |
48 | // | |
49 | // Author: F. Prino, prino@to.infn.it | |
50 | //************************************************************************* | |
51 | ||
52 | ||
53 | #include "AliAnalysisTaskITSAlignQA.h" | |
54 | ||
55 | ClassImp(AliAnalysisTaskITSAlignQA) | |
56 | //______________________________________________________________________________ | |
57 | AliAnalysisTaskITSAlignQA::AliAnalysisTaskITSAlignQA() : AliAnalysisTaskSE("SDD Calibration"), | |
58 | fOutput(0), | |
59 | fHistNEvents(0), | |
60 | fHistPtAccept(0), | |
61 | fDoSPDResiduals(kTRUE), | |
62 | fDoSDDResiduals(kTRUE), | |
63 | fDoSSDResiduals(kTRUE), | |
64 | fDoSDDdEdxCalib(kTRUE), | |
826883ac | 65 | fDoSDDVDriftCalib(kTRUE), |
66 | fDoSDDDriftTime(kTRUE), | |
6a5f5ccc | 67 | fDoFillTPTree(kFALSE), |
89b48e9e | 68 | fUseITSsaTracks(kFALSE), |
9ea163ca | 69 | fLoadGeometry(kFALSE), |
df69bb07 | 70 | fUseVertex(kFALSE), |
71 | fUseVertexForZOnly(kFALSE), | |
6a5f5ccc | 72 | fUseTPCMomentum(kFALSE), |
df69bb07 | 73 | fMinVtxContributors(5), |
5104b23e | 74 | fRemovePileupWithSPD(kTRUE), |
89b48e9e | 75 | fMinITSpts(3), |
76 | fMinTPCpts(70), | |
77 | fMinPt(0.5), | |
78 | fNPtBins(8), | |
00a2ed4c | 79 | fMinMult(0), |
80 | fMaxMult(1e9), | |
6a5f5ccc | 81 | fCutDCAXY(1.e10), |
82 | fCutDCAZ(1.e10), | |
89b48e9e | 83 | fFitter(0), |
6a5f5ccc | 84 | fITSSumTP(), |
c607d68d | 85 | fTPTree(), |
89b48e9e | 86 | fRunNb(0), |
87 | fOCDBLocation("local://$ALICE_ROOT/OCDB") | |
88 | { | |
89 | // | |
90 | fFitter = new AliITSTPArrayFit(5); | |
91 | Double_t xbins[9]={0.3,0.5,0.75,1.,1.5,2.,3.,5.,10.}; | |
92 | SetPtBinLimits(8,xbins); | |
93 | DefineOutput(1, TList::Class()); | |
94 | } | |
95 | ||
96 | ||
97 | //___________________________________________________________________________ | |
98 | AliAnalysisTaskITSAlignQA::~AliAnalysisTaskITSAlignQA(){ | |
99 | // | |
c607d68d | 100 | if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) { |
101 | delete fOutput; | |
102 | delete fITSSumTP; | |
103 | } | |
6a5f5ccc | 104 | delete fFitter; |
c607d68d | 105 | delete fTPTree; |
6a5f5ccc | 106 | // |
89b48e9e | 107 | } |
108 | //___________________________________________________________________________ | |
109 | void AliAnalysisTaskITSAlignQA::UserCreateOutputObjects() { | |
110 | // | |
9ea163ca | 111 | |
112 | if(fLoadGeometry) LoadGeometryFromOCDB(); | |
89b48e9e | 113 | |
114 | fOutput = new TList(); | |
115 | fOutput->SetOwner(); | |
116 | fOutput->SetName("OutputHistos"); | |
117 | ||
00a2ed4c | 118 | fHistNEvents = new TH1F("hNEvents", "Number of processed events",kNEvStatBins,-0.5,kNEvStatBins-0.5); |
89b48e9e | 119 | fHistNEvents->Sumw2(); |
120 | fHistNEvents->SetMinimum(0); | |
00a2ed4c | 121 | fHistNEvents->GetXaxis()->SetBinLabel(kEvAll+1,"All Events"); |
122 | fHistNEvents->GetXaxis()->SetBinLabel(kEvCnt+1,"After Centrality cut"); | |
123 | fHistNEvents->GetXaxis()->SetBinLabel(kEvVtx+1,"After Vertex cut"); | |
124 | fHistNEvents->GetXaxis()->SetBinLabel(kEvPlp+1,"After Pileup cut"); | |
125 | fHistNEvents->GetXaxis()->SetBinLabel(kNTracks+1,"Tracks Accepted"); | |
89b48e9e | 126 | fOutput->Add(fHistNEvents); |
127 | ||
128 | fHistPtAccept = new TH1F("hPtAccept","Pt distrib of accepted tracks",50,0.,5.); | |
129 | fHistPtAccept->Sumw2(); | |
130 | fHistPtAccept->SetMinimum(0); | |
131 | fOutput->Add(fHistPtAccept); | |
132 | ||
133 | if(fDoSPDResiduals) CreateSPDHistos(); | |
826883ac | 134 | if(fDoSDDResiduals || fDoSDDdEdxCalib || fDoSDDVDriftCalib || fDoSDDDriftTime) CreateSDDHistos(); |
89b48e9e | 135 | if(fDoSSDResiduals) CreateSSDHistos(); |
6a5f5ccc | 136 | // |
137 | if (fDoFillTPTree) { | |
c607d68d | 138 | TFile* troutf = OpenFile(2); |
139 | if (!troutf) { | |
140 | AliFatal("Failed to open output file for AliITSSumTP tree"); | |
141 | exit(1); | |
142 | } | |
6a5f5ccc | 143 | fITSSumTP = new AliITSSumTP(); |
c607d68d | 144 | fTPTree = new TTree("ITSSumTP","ITS TP Summary"); |
145 | fTPTree->Branch("AliITSSumTP","AliITSSumTP",&fITSSumTP); | |
6a5f5ccc | 146 | CreateUserInfo(); |
c607d68d | 147 | PostData(2,fTPTree); |
6a5f5ccc | 148 | } |
149 | // | |
9ea163ca | 150 | PostData(1,fOutput); |
89b48e9e | 151 | } |
152 | ||
153 | //___________________________________________________________________________ | |
154 | void AliAnalysisTaskITSAlignQA::CreateSPDHistos(){ | |
155 | // Histos for SPD | |
156 | ||
157 | ||
158 | for(Int_t iMod=0; iMod<kNSPDmods; iMod++){ | |
159 | fHistSPDResidX[iMod] = new TH2F(Form("hSPDResidX%d",iMod), | |
160 | Form("hSPDResidX%d",iMod), | |
161 | fNPtBins,fPtBinLimits, | |
162 | 250,-0.05,0.05); | |
163 | fHistSPDResidX[iMod]->Sumw2(); | |
164 | fOutput->Add(fHistSPDResidX[iMod]); | |
165 | ||
166 | fHistSPDResidZ[iMod] = new TH2F(Form("hSPDResidZ%d",iMod), | |
167 | Form("hSPDResidZ%d",iMod), | |
168 | fNPtBins,fPtBinLimits, | |
169 | 250,-0.1,0.1); | |
170 | fHistSPDResidZ[iMod]->Sumw2(); | |
171 | fOutput->Add(fHistSPDResidZ[iMod]); | |
172 | } | |
173 | return; | |
174 | } | |
175 | ||
176 | //___________________________________________________________________________ | |
177 | void AliAnalysisTaskITSAlignQA::CreateSDDHistos(){ | |
178 | // Histos for SDD | |
179 | ||
180 | for(Int_t iMod=0; iMod<kNSDDmods; iMod++){ | |
826883ac | 181 | if (fDoSDDResiduals) { |
f09774b4 | 182 | fHistSDDResidX[iMod] = new TH2F(Form("hSDDResidX%d",iMod+kNSPDmods), |
183 | Form("hSDDResidX%d",iMod+kNSPDmods), | |
89b48e9e | 184 | fNPtBins,fPtBinLimits, |
185 | 300,-0.15,0.15); | |
186 | fHistSDDResidX[iMod]->Sumw2(); | |
187 | fOutput->Add(fHistSDDResidX[iMod]); | |
188 | ||
f09774b4 | 189 | fHistSDDResidZ[iMod] = new TH2F(Form("hSDDResidZ%d",iMod+kNSPDmods), |
190 | Form("hSDDResidZ%d",iMod+kNSPDmods), | |
89b48e9e | 191 | fNPtBins,fPtBinLimits, |
192 | 200,-0.1,0.1); | |
193 | fHistSDDResidZ[iMod]->Sumw2(); | |
194 | fOutput->Add(fHistSDDResidZ[iMod]); | |
195 | ||
196 | fHistSDDResidXvsX[iMod] = new TH2F(Form("hSDDResidXvsX%d",iMod+kNSPDmods), | |
197 | Form("hSDDResidXvsX%d",iMod+kNSPDmods), | |
198 | 40,-3.5,3.5,300,-0.15,0.15); | |
199 | fHistSDDResidXvsX[iMod]->Sumw2(); | |
200 | fOutput->Add(fHistSDDResidXvsX[iMod]); | |
201 | ||
202 | fHistSDDResidXvsZ[iMod] = new TH2F(Form("hSDDResidXvsZ%d",iMod+kNSPDmods), | |
203 | Form("hSDDResidXvsZ%d",iMod+kNSPDmods), | |
204 | 10,-3.8,3.8,300,-0.15,0.15); | |
205 | fHistSDDResidXvsZ[iMod]->Sumw2(); | |
206 | fOutput->Add(fHistSDDResidXvsZ[iMod]); | |
207 | ||
208 | fHistSDDResidZvsX[iMod] = new TH2F(Form("hSDDResidZvsX%d",iMod+kNSPDmods), | |
209 | Form("hSDDResidZvsX%d",iMod+kNSPDmods), | |
210 | 40,-3.5,3.5,200,-0.1,0.1); | |
211 | fHistSDDResidZvsX[iMod]->Sumw2(); | |
212 | fOutput->Add(fHistSDDResidZvsX[iMod]); | |
213 | ||
214 | fHistSDDResidZvsZ[iMod] = new TH2F(Form("hSDDResidZvsZ%d",iMod+kNSPDmods), | |
215 | Form("hSDDResidZvsZ%d",iMod+kNSPDmods), | |
216 | 10,-3.8,3.8,200,-0.1,0.1); | |
217 | fHistSDDResidZvsZ[iMod]->Sumw2(); | |
218 | fOutput->Add(fHistSDDResidZvsZ[iMod]); | |
f09774b4 | 219 | // |
826883ac | 220 | } |
221 | // | |
222 | if (fDoSDDVDriftCalib) { | |
f09774b4 | 223 | for (int ix=0;ix<2;ix++) { // profile histos per side |
224 | // | |
225 | char* hnm = Form("hpSDDResXvsXD%d_%d",iMod+kNSPDmods,ix); | |
226 | int nbX = 50, nbZ = 20, nbXOffs = 2, nbZOffs = 2; | |
227 | double xRange = 3.5085e4, zRange = 7.5264e4, xOffs = nbXOffs*xRange/nbX, zOffs = nbZOffs*zRange/nbZ; | |
228 | fHProfSDDResidXvsXD[iMod][ix] = new TProfile(hnm, hnm, nbX+2*nbXOffs, -xOffs, xRange + xOffs); | |
229 | fHProfSDDResidXvsXD[iMod][ix]->Sumw2(); | |
230 | fOutput->Add(fHProfSDDResidXvsXD[iMod][ix]); | |
231 | // | |
232 | hnm = Form("hpSDDDrTimevsXD%d_%d",iMod+kNSPDmods,ix); | |
233 | fHProfSDDDrTimevsXD[iMod][ix] = new TProfile(hnm, hnm, nbX+2*nbXOffs, -xOffs, xRange + xOffs); | |
234 | fHProfSDDDrTimevsXD[iMod][ix]->Sumw2(); | |
235 | fOutput->Add(fHProfSDDDrTimevsXD[iMod][ix]); | |
236 | // | |
237 | hnm = Form("hpSDDResXvsZ%d_%d",iMod+kNSPDmods,ix); | |
238 | fHProfSDDResidXvsZ[iMod][ix] = new TProfile(hnm, hnm, nbZ+2*nbZOffs, -(0.5*zRange+zOffs),(0.5*zRange+zOffs)); | |
239 | fHProfSDDResidXvsZ[iMod][ix]->Sumw2(); | |
240 | fOutput->Add(fHProfSDDResidXvsZ[iMod][ix]); | |
241 | // | |
242 | hnm = Form("hpSDDDrTimevsZ%d_%d",iMod+kNSPDmods,ix); | |
243 | fHProfSDDDrTimevsZ[iMod][ix] = new TProfile(hnm, hnm, nbZ+2*nbZOffs, -(0.5*zRange+zOffs),(0.5*zRange+zOffs)); | |
244 | fHProfSDDDrTimevsZ[iMod][ix]->Sumw2(); | |
245 | fOutput->Add(fHProfSDDDrTimevsZ[iMod][ix]); | |
246 | // | |
247 | } | |
89b48e9e | 248 | } |
826883ac | 249 | |
89b48e9e | 250 | if(fDoSDDdEdxCalib){ |
251 | fHistSDDdEdxvsDrTime[iMod] = new TH2F(Form("hSDDdEdxvsDrTime%d",iMod+kNSPDmods), | |
252 | Form("hSDDdEdxvsDrTime%d",iMod+kNSPDmods), | |
253 | 16,0.,6400.,100,0.,300.); | |
254 | fHistSDDdEdxvsDrTime[iMod]->Sumw2(); | |
255 | fOutput->Add(fHistSDDdEdxvsDrTime[iMod]); | |
256 | } | |
826883ac | 257 | // |
258 | if (fDoSDDDriftTime) { | |
259 | fHistSDDDrTimeAll[iMod]=new TH1F(Form("hSDDDrTimeAll%d",iMod+kNSPDmods), | |
260 | Form("hSDDDrTimeAll%d",iMod+kNSPDmods), | |
89b48e9e | 261 | 3200,0.,6400.); |
826883ac | 262 | fHistSDDDrTimeAll[iMod]->Sumw2(); |
263 | fHistSDDDrTimeAll[iMod]->SetMinimum(0.); | |
264 | fOutput->Add(fHistSDDDrTimeAll[iMod]); | |
265 | ||
266 | fHistSDDDrTimeExtra[iMod]=new TH1F(Form("hSDDDrTimeExtra%d",iMod+kNSPDmods), | |
267 | Form("hSDDDrTimeExtra%d",iMod+kNSPDmods), | |
268 | 3200,0.,6400.); | |
269 | fHistSDDDrTimeExtra[iMod]->Sumw2(); | |
270 | fHistSDDDrTimeExtra[iMod]->SetMinimum(0.); | |
271 | fOutput->Add(fHistSDDDrTimeExtra[iMod]); | |
272 | ||
273 | fHistSDDDrTimeAttac[iMod]=new TH1F(Form("hSDDDrTimeAttac%d",iMod+kNSPDmods), | |
274 | Form("hSDDDrTimeAttac%d",iMod+kNSPDmods), | |
275 | 3200,0.,6400.); | |
276 | fHistSDDDrTimeAttac[iMod]->Sumw2(); | |
277 | fHistSDDDrTimeAttac[iMod]->SetMinimum(0.); | |
278 | fOutput->Add(fHistSDDDrTimeAttac[iMod]); | |
279 | } | |
89b48e9e | 280 | } |
281 | return; | |
826883ac | 282 | // |
89b48e9e | 283 | } |
826883ac | 284 | |
89b48e9e | 285 | //___________________________________________________________________________ |
286 | void AliAnalysisTaskITSAlignQA::CreateSSDHistos(){ | |
287 | // Histos for SSD | |
288 | for(Int_t iMod=0; iMod<kNSSDmods; iMod++){ | |
289 | fHistSSDResidX[iMod] = new TH2F(Form("hSSDResidX%d",iMod+kNSPDmods+kNSDDmods), | |
290 | Form("hSSDResidX%d",iMod+kNSPDmods+kNSDDmods), | |
291 | fNPtBins,fPtBinLimits, | |
292 | 250,-0.1,0.1); | |
293 | fHistSSDResidX[iMod]->Sumw2(); | |
294 | fOutput->Add(fHistSSDResidX[iMod]); | |
295 | ||
296 | fHistSSDResidZ[iMod] = new TH2F(Form("hSSDResidZ%d",iMod+kNSPDmods+kNSDDmods), | |
297 | Form("hSSDResidZ%d",iMod+kNSPDmods+kNSDDmods), | |
298 | fNPtBins,fPtBinLimits, | |
299 | 250,-1.,1.); | |
300 | fHistSSDResidZ[iMod]->Sumw2(); | |
301 | fOutput->Add(fHistSSDResidZ[iMod]); | |
302 | } | |
303 | return; | |
304 | } | |
305 | //______________________________________________________________________________ | |
306 | void AliAnalysisTaskITSAlignQA::UserExec(Option_t *) | |
307 | { | |
df69bb07 | 308 | // |
309 | static AliTrackPointArray* arrayITS = 0; | |
6a5f5ccc | 310 | AliTrackPointArray* arrayITSNoVtx = 0; |
89b48e9e | 311 | // |
312 | AliESDEvent *esd = (AliESDEvent*) (InputEvent()); | |
6a5f5ccc | 313 | if (fITSSumTP) fITSSumTP->Reset(); |
89b48e9e | 314 | |
315 | if(!esd) { | |
316 | printf("AliAnalysisTaskITSAlignQA::Exec(): bad ESD\n"); | |
317 | return; | |
318 | } | |
319 | ||
89b48e9e | 320 | if(!ESDfriend()) { |
321 | printf("AliAnalysisTaskITSAlignQA::Exec(): bad ESDfriend\n"); | |
322 | return; | |
323 | } | |
df69bb07 | 324 | // |
ef6fa479 | 325 | static Bool_t firstCheck = kTRUE; |
326 | if (firstCheck) { | |
327 | // | |
328 | if (TMath::Abs(esd->GetCurrentL3())<300) { // no field | |
329 | SetMinPt(0.005); | |
330 | AliInfo("No magnetic field: eliminating pt cut"); | |
331 | } | |
332 | const AliESDRun *esdrn = esd->GetESDRun(); | |
333 | if (!esdrn) return; | |
334 | Int_t activeDetectors = esdrn->GetDetectorsInReco(); | |
335 | if ( !(activeDetectors & AliDAQ::kTPC) ) { | |
336 | AliInfo("No TPC, suppress TPC points request"); | |
337 | SetUseITSstandaloneTracks(kTRUE); | |
338 | SetUseTPCMomentum(kFALSE); | |
339 | } | |
340 | firstCheck = kFALSE; | |
341 | } | |
342 | // | |
00a2ed4c | 343 | if (!AcceptCentrality(esd)) return; |
344 | fHistNEvents->Fill(kEvCnt); | |
345 | ||
5104b23e | 346 | const AliESDVertex* vtx=0,*vtxSPD=0; |
00a2ed4c | 347 | fHistNEvents->Fill(kEvAll); |
6a5f5ccc | 348 | vtx = esd->GetPrimaryVertex(); |
349 | vtxSPD = esd->GetPrimaryVertexSPD(); | |
350 | // | |
df69bb07 | 351 | if (fUseVertex) { // check the vertex if it is requested as an extra point |
5104b23e | 352 | if (!AcceptVertex(vtx,vtxSPD)) return; |
353 | } | |
00a2ed4c | 354 | |
355 | fHistNEvents->Fill(kEvVtx); | |
5104b23e | 356 | if (fRemovePileupWithSPD){ |
357 | // skip events tagged by SPD as pileup | |
358 | if(esd->IsPileupFromSPD()) return; | |
df69bb07 | 359 | } |
00a2ed4c | 360 | fHistNEvents->Fill(kEvPlp); |
5104b23e | 361 | |
df69bb07 | 362 | // |
89b48e9e | 363 | fFitter->SetBz(esd->GetMagneticField()); |
364 | ||
365 | const AliTrackPointArray *array = 0; | |
366 | Int_t ntracks = esd->GetNumberOfTracks(); | |
367 | ||
368 | for (Int_t itrack=0; itrack < ntracks; itrack++) { | |
df69bb07 | 369 | // |
370 | if (arrayITS) {delete arrayITS; arrayITS = 0;} // reset points from previous tracks | |
6a5f5ccc | 371 | arrayITSNoVtx = 0; |
df69bb07 | 372 | // |
89b48e9e | 373 | AliESDtrack * track = esd->GetTrack(itrack); |
374 | if(!track) continue; | |
6a5f5ccc | 375 | if(!AcceptTrack(track, vtx)) continue; |
89b48e9e | 376 | array = track->GetTrackPointArray(); |
377 | if(!array) continue; | |
df69bb07 | 378 | arrayITS = PrepareTrack(array, vtx); |
6a5f5ccc | 379 | if (fITSSumTP) { |
380 | arrayITSNoVtx = PrepareTrack(array, 0); | |
381 | arrayITSNoVtx->SetUniqueID(itrack); | |
382 | fITSSumTP->AddTrack(arrayITSNoVtx); | |
383 | } | |
df69bb07 | 384 | // |
00a2ed4c | 385 | fHistNEvents->Fill(kNTracks); |
386 | // | |
df69bb07 | 387 | Int_t npts = arrayITS->GetNPoints(); |
388 | Int_t npts1 = fUseVertexForZOnly ? npts-1 : npts; | |
389 | // | |
89b48e9e | 390 | if(fDoSPDResiduals){ |
df69bb07 | 391 | FitAndFillSPD(1,arrayITS,npts1,track); |
392 | FitAndFillSPD(2,arrayITS,npts1,track); | |
89b48e9e | 393 | } |
826883ac | 394 | if(fDoSDDResiduals || fDoSDDdEdxCalib || fDoSDDVDriftCalib || fDoSDDDriftTime) { |
df69bb07 | 395 | FitAndFillSDDrphi(arrayITS,npts,track); |
826883ac | 396 | if (fDoSDDResiduals) { |
397 | FitAndFillSDDz(3,arrayITS,npts1,track); | |
398 | FitAndFillSDDz(4,arrayITS,npts1,track); | |
399 | } | |
9ea163ca | 400 | } |
89b48e9e | 401 | if(fDoSSDResiduals){ |
df69bb07 | 402 | FitAndFillSSD(5,arrayITS,npts1,track); |
403 | FitAndFillSSD(6,arrayITS,npts1,track); | |
89b48e9e | 404 | } |
405 | } | |
6a5f5ccc | 406 | // |
407 | if (fITSSumTP) { // store vertex and mometum info | |
408 | fITSSumTP->SetVertex(vtx); | |
409 | TObjArray& tps = fITSSumTP->GetTracks(); | |
410 | int ntp = tps.GetEntriesFast(); | |
411 | fITSSumTP->BookNTracks(ntp); | |
412 | for (int it=ntp;it--;) { | |
413 | AliTrackPointArray* tp = (AliTrackPointArray*)tps[it]; | |
414 | if (!tp) continue; | |
415 | AliESDtrack* esdTr = esd->GetTrack(tp->GetUniqueID()); | |
416 | double crv = esdTr->GetC(esd->GetMagneticField()); | |
417 | double crve = TMath::Sqrt(esdTr->GetSigma1Pt2()) * esd->GetMagneticField()*kB2C; | |
418 | fITSSumTP->SetCrvGlo(it,crv); | |
419 | fITSSumTP->SetCrvGloErr(it,crve); | |
420 | const AliExternalTrackParam* inTPC = esdTr->GetTPCInnerParam(); | |
421 | if (inTPC) { | |
422 | crv = inTPC->GetC(esd->GetMagneticField()); | |
423 | crve = TMath::Sqrt(inTPC->GetSigma1Pt2()) * esd->GetMagneticField()*kB2C; | |
424 | fITSSumTP->SetCrvTPC(it,crv); | |
425 | fITSSumTP->SetCrvTPCErr(it,crve); | |
426 | } | |
427 | } | |
428 | fITSSumTP->SetUniqueID(fCurrentRunNumber); | |
c607d68d | 429 | if (ntp) fTPTree->Fill(); |
6a5f5ccc | 430 | } |
89b48e9e | 431 | |
6a5f5ccc | 432 | // |
89b48e9e | 433 | PostData(1,fOutput); |
434 | ||
435 | } | |
df69bb07 | 436 | |
89b48e9e | 437 | //___________________________________________________________________________ |
6a5f5ccc | 438 | Bool_t AliAnalysisTaskITSAlignQA::AcceptTrack(const AliESDtrack * track, const AliESDVertex* vtx) |
439 | { | |
89b48e9e | 440 | // track selection cuts |
441 | Bool_t accept=kTRUE; | |
442 | if(fUseITSsaTracks){ | |
3fc3b1ea | 443 | if(track->GetNcls(1)>0) accept=kFALSE; |
89b48e9e | 444 | }else{ |
445 | if(track->GetNcls(1)<fMinTPCpts) accept=kFALSE; | |
446 | } | |
447 | if(track->GetNcls(0) < fMinITSpts) accept=kFALSE; | |
448 | Int_t trstatus=track->GetStatus(); | |
449 | if(!(trstatus&AliESDtrack::kITSrefit)) accept=kFALSE; | |
6a5f5ccc | 450 | Float_t pt = 0; |
3fc3b1ea | 451 | if (fUseTPCMomentum && track->IsOn(AliESDtrack::kTPCrefit)) pt = track->GetTPCInnerParam()->Pt(); |
452 | else pt = track->Pt(); | |
453 | // | |
89b48e9e | 454 | if(pt<fMinPt) accept=kFALSE; |
6a5f5ccc | 455 | // |
456 | // if vertex constraint is used, apply soft DCA cut | |
457 | if (vtx) { | |
458 | Double_t dz[2],cov[3]; | |
459 | AliExternalTrackParam trc = *track; | |
3fc3b1ea | 460 | if (!trc.PropagateToDCA(vtx, fFitter->GetBz(), 3.0, dz, cov)) accept=kFALSE; |
6a5f5ccc | 461 | else { |
3fc3b1ea | 462 | if (dz[0]*dz[0]/(1e-4+cov[0])>fCutDCAXY) accept=kFALSE; |
463 | if (dz[1]*dz[1]/(4e-4+cov[2])>fCutDCAZ) accept=kFALSE; | |
6a5f5ccc | 464 | } |
465 | } | |
466 | // | |
89b48e9e | 467 | if(accept) fHistPtAccept->Fill(pt); |
468 | return accept; | |
469 | } | |
df69bb07 | 470 | |
471 | //___________________________________________________________________________ | |
5104b23e | 472 | Bool_t AliAnalysisTaskITSAlignQA::AcceptVertex(const AliESDVertex * vtx, const AliESDVertex * vtxSPD) { |
df69bb07 | 473 | // vertex selection cuts |
5104b23e | 474 | if (!vtx || vtx->GetStatus()<1) return kFALSE; |
475 | if (!vtxSPD || vtxSPD->GetStatus()<1) return kFALSE; | |
df69bb07 | 476 | if (vtx->GetNContributors()<fMinVtxContributors) return kFALSE; |
5104b23e | 477 | if (TMath::Abs(vtx->GetZ()-vtxSPD->GetZ())>0.3) return kFALSE; |
df69bb07 | 478 | return kTRUE; |
479 | } | |
480 | ||
89b48e9e | 481 | //___________________________________________________________________________ |
482 | void AliAnalysisTaskITSAlignQA::FitAndFillSPD(Int_t iLayer, const AliTrackPointArray *array, Int_t npts,AliESDtrack * track){ | |
483 | // fit track and fills histos for SPD | |
484 | fFitter->AttachPoints(array,0, npts-1); | |
485 | Int_t iPtSPD[4],modIdSPD[4]; | |
486 | Int_t nPtSPD=0; | |
487 | Double_t resGlo[3],resLoc[3]; | |
488 | for(Int_t ipt=0; ipt<npts; ipt++) { | |
489 | AliTrackPoint point; | |
490 | Int_t modId; | |
491 | array->GetPoint(point,ipt); | |
492 | Int_t volId = point.GetVolumeID(); | |
df69bb07 | 493 | if (volId == kVtxSensVID) continue; // this is a vertex constraint |
89b48e9e | 494 | Int_t layerId = AliGeomManager::VolUIDToLayer(volId,modId); |
495 | if(layerId==iLayer){ | |
496 | modId+=AliITSgeomTGeo::GetModuleIndex(layerId,1,1); | |
497 | iPtSPD[nPtSPD] = ipt; | |
498 | modIdSPD[nPtSPD] = modId; | |
499 | ++nPtSPD; | |
500 | fFitter->SetCovIScale(ipt,1e-4); | |
501 | } | |
502 | } | |
503 | if(nPtSPD>0){ | |
3fc3b1ea | 504 | double pt = (fUseTPCMomentum && track->IsOn(AliESDtrack::kTPCrefit)) ? track->GetTPCInnerParam()->Pt() : track->Pt(); |
6a5f5ccc | 505 | fFitter->Fit(track->Charge(),pt,0.); |
89b48e9e | 506 | Double_t chi2=fFitter->GetChi2NDF(); |
507 | if ( chi2<0 || chi2>1e4 ) return; // fit failed, abandon this track | |
508 | for (Int_t ip=0; ip<nPtSPD;ip++) { | |
509 | fFitter->GetResiduals(resGlo,iPtSPD[ip]); | |
510 | TGeoHMatrix *mcurr = AliITSgeomTGeo::GetMatrix(modIdSPD[ip]); | |
511 | mcurr->MasterToLocalVect(resGlo,resLoc); | |
512 | Int_t index=modIdSPD[ip]; | |
6a5f5ccc | 513 | fHistSPDResidX[index]->Fill(pt,resLoc[0]); |
514 | fHistSPDResidZ[index]->Fill(pt,resLoc[2]); | |
89b48e9e | 515 | } |
516 | } | |
517 | } | |
518 | //___________________________________________________________________________ | |
9ea163ca | 519 | void AliAnalysisTaskITSAlignQA::FitAndFillSDDrphi(const AliTrackPointArray *array, Int_t npts, AliESDtrack * track){ |
520 | // fit track and fills histos for SDD along rphi (drift coord.) | |
89b48e9e | 521 | Double_t dedx[4]; |
522 | track->GetITSdEdxSamples(dedx); | |
523 | ||
524 | fFitter->AttachPoints(array,0, npts-1); | |
f09774b4 | 525 | Int_t iPtSDD[4],modIdSDD[4],modSide[4]; |
526 | Double_t xLocSDD[4],zLocSDD[4],drTime[4]; | |
89b48e9e | 527 | Int_t nPtSDD=0; |
528 | Int_t nPtSSDSPD=0; | |
529 | Double_t resGlo[3],resLoc[3]; | |
530 | Float_t posGloF[3]; | |
531 | Double_t posGlo[3],posLoc[3]; | |
f09774b4 | 532 | |
89b48e9e | 533 | for(Int_t ipt=0; ipt<npts; ipt++) { |
534 | AliTrackPoint point; | |
535 | Int_t modId; | |
536 | array->GetPoint(point,ipt); | |
537 | Int_t volId = point.GetVolumeID(); | |
df69bb07 | 538 | if (volId == kVtxSensVID) continue; // this is a vertex constraint |
89b48e9e | 539 | Int_t layerId = AliGeomManager::VolUIDToLayer(volId,modId); |
540 | if(layerId==3 || layerId==4){ | |
f09774b4 | 541 | drTime[nPtSDD] = point.GetDriftTime(); |
89b48e9e | 542 | modId+=AliITSgeomTGeo::GetModuleIndex(layerId,1,1); |
543 | Int_t index=modId-kNSPDmods; | |
826883ac | 544 | if (fDoSDDDriftTime) { |
545 | fHistSDDDrTimeAll[index]->Fill(drTime[nPtSDD]); | |
546 | if(point.IsExtra()) fHistSDDDrTimeExtra[index]->Fill(drTime[nPtSDD]); | |
547 | else fHistSDDDrTimeAttac[index]->Fill(drTime[nPtSDD]); | |
548 | } | |
549 | if (fDoSDDdEdxCalib) { | |
550 | Float_t dedxLay=dedx[layerId-3]; | |
551 | if(dedxLay>1.) fHistSDDdEdxvsDrTime[index]->Fill(drTime[nPtSDD],dedxLay); | |
552 | } | |
89b48e9e | 553 | iPtSDD[nPtSDD] = ipt; |
554 | modIdSDD[nPtSDD] = modId; | |
f09774b4 | 555 | modSide[nPtSDD] = point.GetClusterType()&BIT(16) ? 0:1; |
89b48e9e | 556 | point.GetXYZ(posGloF); |
557 | for(Int_t icoor=0;icoor<3;icoor++) posGlo[icoor]=posGloF[icoor]; | |
558 | AliITSgeomTGeo::GlobalToLocal(modId,posGlo,posLoc); | |
559 | xLocSDD[nPtSDD]=posLoc[0]; | |
560 | zLocSDD[nPtSDD]=posLoc[2]; | |
561 | ++nPtSDD; | |
562 | fFitter->SetCovIScale(ipt,1e-4); // scaling for inverted errors of SDD | |
563 | }else{ | |
564 | ++nPtSSDSPD; | |
565 | } | |
566 | } | |
567 | if(nPtSDD>0 && nPtSSDSPD>=2){ | |
3fc3b1ea | 568 | double pt = (fUseTPCMomentum && track->IsOn(AliESDtrack::kTPCrefit)) ? track->GetTPCInnerParam()->Pt() : track->Pt(); |
6a5f5ccc | 569 | fFitter->Fit(track->Charge(),pt,0.); |
89b48e9e | 570 | Double_t chi2=fFitter->GetChi2NDF(); |
571 | if ( chi2<0 || chi2>1e4 ) return; // fit failed, abandon this track | |
572 | for (Int_t ip=0; ip<nPtSDD;ip++) { | |
573 | fFitter->GetResiduals(resGlo,iPtSDD[ip]); | |
574 | TGeoHMatrix *mcurr = AliITSgeomTGeo::GetMatrix(modIdSDD[ip]); | |
575 | mcurr->MasterToLocalVect(resGlo,resLoc); | |
576 | Int_t index=modIdSDD[ip]-kNSPDmods; | |
826883ac | 577 | if (fDoSDDResiduals) { |
6a5f5ccc | 578 | fHistSDDResidX[index]->Fill(pt,resLoc[0]); |
826883ac | 579 | fHistSDDResidXvsX[index]->Fill(xLocSDD[ip],resLoc[0]); |
580 | fHistSDDResidXvsZ[index]->Fill(zLocSDD[ip],resLoc[0]); | |
581 | } | |
f09774b4 | 582 | // |
826883ac | 583 | if (fDoSDDVDriftCalib) { |
584 | double cf = modSide[ip] ? 1.e4:-1.e4; | |
585 | double xMeas = cf*xLocSDD[ip]; // measured coordinate in microns | |
586 | double xRes = cf*resLoc[0]; // X residual in microns | |
587 | double xDriftTrue = 3.5085e4 - (xMeas + xRes); // "true" drift distance | |
588 | // | |
589 | fHProfSDDResidXvsXD[index][modSide[ip]]->Fill(xDriftTrue, xRes); | |
590 | fHProfSDDResidXvsZ[index][modSide[ip]]->Fill(zLocSDD[ip]*1e4, xRes); | |
591 | fHProfSDDDrTimevsXD[index][modSide[ip]]->Fill(xDriftTrue, drTime[ip]); | |
592 | fHProfSDDDrTimevsZ[index][modSide[ip]]->Fill(zLocSDD[ip]*1e4, drTime[ip]); | |
593 | } | |
9ea163ca | 594 | } |
595 | } | |
596 | } | |
597 | //___________________________________________________________________________ | |
598 | void AliAnalysisTaskITSAlignQA::FitAndFillSDDz(Int_t iLayer, const AliTrackPointArray *array, Int_t npts, AliESDtrack * track){ | |
599 | // fit track and fills histos for SDD along z | |
600 | ||
601 | fFitter->AttachPoints(array,0, npts-1); | |
602 | Int_t iPtSDD[4],modIdSDD[4]; | |
603 | Double_t xLocSDD[4],zLocSDD[4]; | |
604 | Int_t nPtSDD=0; | |
605 | Double_t resGlo[3],resLoc[3]; | |
606 | Float_t posGloF[3]; | |
607 | Double_t posGlo[3],posLoc[3]; | |
608 | for(Int_t ipt=0; ipt<npts; ipt++) { | |
609 | AliTrackPoint point; | |
610 | Int_t modId; | |
611 | array->GetPoint(point,ipt); | |
612 | Int_t volId = point.GetVolumeID(); | |
df69bb07 | 613 | if (volId == kVtxSensVID) continue; // this is a vertex constraint |
9ea163ca | 614 | Int_t layerId = AliGeomManager::VolUIDToLayer(volId,modId); |
615 | if(layerId==iLayer){ | |
616 | modId+=AliITSgeomTGeo::GetModuleIndex(layerId,1,1); | |
617 | iPtSDD[nPtSDD] = ipt; | |
618 | modIdSDD[nPtSDD] = modId; | |
619 | point.GetXYZ(posGloF); | |
620 | for(Int_t icoor=0;icoor<3;icoor++) posGlo[icoor]=posGloF[icoor]; | |
621 | AliITSgeomTGeo::GlobalToLocal(modId,posGlo,posLoc); | |
622 | xLocSDD[nPtSDD]=posLoc[0]; | |
623 | zLocSDD[nPtSDD]=posLoc[2]; | |
624 | ++nPtSDD; | |
625 | fFitter->SetCovIScale(ipt,1e-4); // scaling for inverted errors of SDD | |
626 | } | |
627 | } | |
628 | if(nPtSDD>0){ | |
3fc3b1ea | 629 | double pt = (fUseTPCMomentum && track->IsOn(AliESDtrack::kTPCrefit)) ? track->GetTPCInnerParam()->Pt() : track->Pt(); |
6a5f5ccc | 630 | fFitter->Fit(track->Charge(),pt,0.); |
9ea163ca | 631 | Double_t chi2=fFitter->GetChi2NDF(); |
632 | if ( chi2<0 || chi2>1e4 ) return; // fit failed, abandon this track | |
633 | for (Int_t ip=0; ip<nPtSDD;ip++) { | |
634 | fFitter->GetResiduals(resGlo,iPtSDD[ip]); | |
635 | TGeoHMatrix *mcurr = AliITSgeomTGeo::GetMatrix(modIdSDD[ip]); | |
636 | mcurr->MasterToLocalVect(resGlo,resLoc); | |
637 | Int_t index=modIdSDD[ip]-kNSPDmods; | |
6a5f5ccc | 638 | fHistSDDResidZ[index]->Fill(pt,resLoc[2]); |
89b48e9e | 639 | fHistSDDResidZvsX[index]->Fill(xLocSDD[ip],resLoc[2]); |
640 | fHistSDDResidZvsZ[index]->Fill(zLocSDD[ip],resLoc[2]); | |
641 | } | |
642 | } | |
643 | } | |
644 | //___________________________________________________________________________ | |
645 | void AliAnalysisTaskITSAlignQA::FitAndFillSSD(Int_t iLayer, const AliTrackPointArray *array, Int_t npts,AliESDtrack * track){ | |
646 | // fit track and fills histos for SSD | |
647 | fFitter->AttachPoints(array,0, npts-1); | |
648 | Int_t iPtSSD[4],modIdSSD[4]; | |
649 | Int_t nPtSSD=0; | |
650 | Double_t resGlo[3],resLoc[3]; | |
651 | for(Int_t ipt=0; ipt<npts; ipt++) { | |
652 | AliTrackPoint point; | |
653 | Int_t modId; | |
654 | array->GetPoint(point,ipt); | |
655 | Int_t volId = point.GetVolumeID(); | |
df69bb07 | 656 | if (volId == kVtxSensVID) continue; // this is a vertex constraint |
89b48e9e | 657 | Int_t layerId = AliGeomManager::VolUIDToLayer(volId,modId); |
658 | if(layerId==iLayer){ | |
659 | modId+=AliITSgeomTGeo::GetModuleIndex(layerId,1,1); | |
660 | iPtSSD[nPtSSD] = ipt; | |
661 | modIdSSD[nPtSSD] = modId; | |
662 | ++nPtSSD; | |
663 | fFitter->SetCovIScale(ipt,1e-4); | |
664 | } | |
665 | } | |
666 | if(nPtSSD>0){ | |
3fc3b1ea | 667 | double pt = (fUseTPCMomentum && track->IsOn(AliESDtrack::kTPCrefit)) ? track->GetTPCInnerParam()->Pt() : track->Pt(); |
6a5f5ccc | 668 | fFitter->Fit(track->Charge(),pt,0.); |
89b48e9e | 669 | Double_t chi2=fFitter->GetChi2NDF(); |
670 | if ( chi2<0 || chi2>1e4 ) return; // fit failed, abandon this track | |
671 | for (Int_t ip=0; ip<nPtSSD;ip++) { | |
672 | fFitter->GetResiduals(resGlo,iPtSSD[ip]); | |
673 | TGeoHMatrix *mcurr = AliITSgeomTGeo::GetMatrix(modIdSSD[ip]); | |
674 | mcurr->MasterToLocalVect(resGlo,resLoc); | |
675 | Int_t index=modIdSSD[ip]-kNSPDmods-kNSDDmods; | |
6a5f5ccc | 676 | fHistSSDResidX[index]->Fill(pt,resLoc[0]); |
677 | fHistSSDResidZ[index]->Fill(pt,resLoc[2]); | |
89b48e9e | 678 | } |
679 | } | |
680 | } | |
681 | //______________________________________________________________________________ | |
682 | void AliAnalysisTaskITSAlignQA::Terminate(Option_t */*option*/) | |
683 | { | |
684 | // Terminate analysis | |
685 | fOutput = dynamic_cast<TList*> (GetOutputData(1)); | |
686 | if (!fOutput) { | |
687 | printf("ERROR: fOutput not available\n"); | |
688 | return; | |
689 | } | |
690 | ||
691 | fHistNEvents = dynamic_cast<TH1F*>(fOutput->FindObject("hNEvents")); | |
96e2c861 | 692 | if(fHistNEvents){ |
c607d68d | 693 | AliInfo(Form("Number of analyzed events = %d, %d tracks accepted", |
694 | (Int_t)fHistNEvents->GetBinContent(kEvAcc+1),(Int_t)fHistNEvents->GetBinContent(kNTracks+1))); | |
96e2c861 | 695 | }else{ |
696 | printf("Warning: pointer to fHistNEvents is NULL\n"); | |
697 | } | |
89b48e9e | 698 | return; |
699 | } | |
700 | ||
701 | ||
702 | //___________________________________________________________________________ | |
703 | void AliAnalysisTaskITSAlignQA::LoadGeometryFromOCDB(){ | |
704 | //method to get the gGeomanager | |
705 | // it is called at the CreatedOutputObject stage | |
706 | // to comply with the CAF environment | |
707 | AliInfo("Loading geometry"); | |
708 | ||
709 | AliCDBManager *man = AliCDBManager::Instance(); | |
710 | man->SetDefaultStorage(fOCDBLocation.Data()); | |
711 | man->SetRun(fRunNb); | |
712 | AliCDBEntry* obj = man->Get(AliCDBPath("GRP", "Geometry", "Data")); | |
96e2c861 | 713 | if(obj){ |
714 | AliGeomManager::SetGeometry((TGeoManager*)obj->GetObject()); | |
715 | AliGeomManager::GetNalignable("ITS"); | |
716 | AliGeomManager::ApplyAlignObjsFromCDB("ITS"); | |
717 | } | |
718 | else AliFatal("Geometry object not found in OCDB"); | |
89b48e9e | 719 | } |
720 | ||
721 | ||
df69bb07 | 722 | //______________________________________________________________________________________ |
723 | AliTrackPointArray* AliAnalysisTaskITSAlignQA::PrepareTrack(const AliTrackPointArray* inp, const AliESDVertex* vtx) | |
724 | { | |
725 | // Extract from the global TrackPointArray the ITS part and optionally add vertex as the last measured point | |
726 | // | |
727 | int npts = inp->GetNPoints(); | |
728 | int modID=0,nptITS = 0; | |
729 | int itsRefs[24]; | |
730 | const UShort_t *vids = inp->GetVolumeID(); | |
731 | for(int ipt=0; ipt<npts; ipt++) { // count ITS points | |
732 | if (vids[ipt]<=0) continue; | |
733 | int layerId = AliGeomManager::VolUIDToLayer(vids[ipt],modID); | |
734 | if(layerId<1 || layerId>6) continue; | |
735 | itsRefs[nptITS++] = ipt; | |
736 | } | |
737 | // | |
738 | AliTrackPointArray *trackCopy = new AliTrackPointArray(nptITS + (vtx ? 1:0)); // reserve extra space if vertex provided | |
739 | AliTrackPoint point; | |
740 | for(int ipt=0; ipt<nptITS; ipt++) { | |
741 | inp->GetPoint(point,itsRefs[ipt]); | |
742 | trackCopy->AddPoint(ipt,&point); | |
743 | } | |
744 | // | |
745 | if (vtx) { | |
746 | PrepareVertexConstraint(vtx,point); | |
747 | trackCopy->AddPoint(nptITS,&point); // add vertex constraint as a last point | |
748 | } | |
749 | return trackCopy; | |
750 | } | |
89b48e9e | 751 | |
df69bb07 | 752 | //_______________________________________________________________________________________ |
753 | void AliAnalysisTaskITSAlignQA::PrepareVertexConstraint(const AliESDVertex* vtx, AliTrackPoint &point) | |
754 | { | |
755 | // convert vertex to measured point with dummy VID | |
756 | if (!vtx) return; | |
757 | // | |
758 | double cmat[6]; | |
759 | float cmatF[6]; | |
760 | point.SetVolumeID(kVtxSensVID); | |
761 | // | |
762 | vtx->GetCovMatrix(cmat); | |
763 | cmatF[0] = cmat[0]; // xx | |
764 | cmatF[1] = cmat[1]; // xy | |
765 | cmatF[2] = cmat[3]; // xz | |
766 | cmatF[3] = cmat[2]; // yy | |
767 | cmatF[4] = cmat[4]; // yz | |
768 | cmatF[5] = cmat[5]; // zz | |
769 | point.SetXYZ(vtx->GetX(),vtx->GetY(),vtx->GetZ(), cmatF); | |
770 | } | |
89b48e9e | 771 | |
5104b23e | 772 | |
00a2ed4c | 773 | //_______________________________________________________________________________________ |
774 | Bool_t AliAnalysisTaskITSAlignQA::AcceptCentrality(const AliESDEvent *esd) const | |
775 | { | |
776 | // check if events is in the required multiplicity range | |
777 | // | |
778 | const AliMultiplicity *alimult = esd->GetMultiplicity(); | |
779 | Int_t nclsSPDouter=0; | |
780 | if(alimult) nclsSPDouter = alimult->GetNumberOfITSClusters(1); | |
781 | if(nclsSPDouter<fMinMult || nclsSPDouter>fMaxMult) return kFALSE; | |
782 | // | |
783 | return kTRUE; | |
784 | } | |
6a5f5ccc | 785 | |
786 | //_______________________________________________________________________________________ | |
787 | void AliAnalysisTaskITSAlignQA::CreateUserInfo() | |
788 | { | |
789 | // if needed, set user info of the output tree | |
c607d68d | 790 | if (!fTPTree) { |
791 | AliError("TrackPoints summary tree does not exist"); | |
792 | return; | |
793 | } | |
6a5f5ccc | 794 | // |
795 | const TMap *cdbMap = AliCDBManager::Instance()->GetStorageMap(); | |
796 | const TList *cdbList = AliCDBManager::Instance()->GetRetrievedIds(); | |
797 | // | |
798 | TMap *cdbMapCopy = new TMap(cdbMap->GetEntries()); | |
799 | cdbMapCopy->SetOwner(1); | |
800 | cdbMapCopy->SetName("cdbMap"); | |
801 | TIter iter(cdbMap->GetTable()); | |
802 | // | |
803 | TPair* pair = 0; | |
804 | while((pair = dynamic_cast<TPair*> (iter.Next()))){ | |
805 | TObjString* keyStr = dynamic_cast<TObjString*> (pair->Key()); | |
806 | TObjString* valStr = dynamic_cast<TObjString*> (pair->Value()); | |
807 | if (keyStr && valStr) cdbMapCopy->Add(new TObjString(keyStr->GetName()), new TObjString(valStr->GetName())); | |
808 | } | |
809 | ||
810 | TList *cdbListCopy = new TList(); | |
811 | cdbListCopy->SetOwner(1); | |
812 | cdbListCopy->SetName("cdbList"); | |
813 | // | |
814 | TIter iter2(cdbList); | |
815 | AliCDBId* id=0; | |
816 | while((id = dynamic_cast<AliCDBId*> (iter2.Next()))){ | |
817 | cdbListCopy->Add(new TObjString(id->ToString().Data())); | |
818 | } | |
819 | // | |
c607d68d | 820 | fTPTree->GetUserInfo()->Add(cdbMapCopy); |
821 | fTPTree->GetUserInfo()->Add(cdbListCopy); | |
6a5f5ccc | 822 | // |
823 | AliMagF *fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); | |
824 | Double_t bz = fld ? fld->SolenoidField() : 0; | |
825 | TString bzString; bzString+=bz; | |
826 | TObjString *bzObjString = new TObjString(bzString); | |
827 | TList *bzList = new TList(); | |
828 | bzList->SetOwner(1); | |
829 | bzList->SetName("BzkGauss"); | |
830 | bzList->Add(bzObjString); | |
c607d68d | 831 | fTPTree->GetUserInfo()->Add(bzList); |
6a5f5ccc | 832 | // |
833 | } |