]>
Commit | Line | Data |
---|---|---|
aac12889 | 1 | /* created by fbellini@cern.ch on 14/09/2010 */ |
2 | /* last modified by fbellini on 08/10/2010 */ | |
3 | ||
4 | ||
5 | #ifndef ALIANALYSISTASKTOFQA_CXX | |
6 | #define ALIANALYSISTASKTOFQA_CXX | |
7 | ||
8 | #include "TChain.h" | |
9 | #include "TTree.h" | |
10 | #include "TH1F.h" | |
11 | #include "TH2F.h" | |
12 | #include "TCanvas.h" | |
13 | //#include "TArrayI.h" | |
14 | #include "AliAnalysisTaskSE.h" | |
15 | #include "AliAnalysisManager.h" | |
16 | #include "AliESDEvent.h" | |
17 | #include "AliESDInputHandler.h" | |
18 | #include "AliAnalysisTaskTOFqa.h" | |
19 | #include "AliAnalysisFilter.h" | |
20 | #include "AliESDtrackCuts.h" | |
21 | //#include "AliPID.h" | |
22 | //#include "AliESDpid.h" | |
23 | //#include "TRandom.h" | |
24 | #include "AliLog.h" | |
25 | //#include "AliTOFT0.h" | |
26 | #include "AliTOFRawStream.h" | |
27 | #include "AliTOFGeometry.h" | |
28 | ||
29 | ClassImp(AliAnalysisTaskTOFqa) | |
30 | ||
31 | //________________________________________________________________________ | |
32 | AliAnalysisTaskTOFqa::AliAnalysisTaskTOFqa() : | |
33 | fRunNumber(-1), | |
34 | fESD(0x0), | |
35 | fTrackFilter(0x0), | |
36 | fVertex(0x0), | |
37 | fNTOFtracks(0), | |
38 | fNPrimaryTracks(0), | |
39 | fT0(0), | |
40 | fHlist(0x0), | |
41 | fHlistExperts(0x0) | |
42 | { | |
43 | // Default constructor | |
44 | } | |
45 | //________________________________________________________________________ | |
46 | AliAnalysisTaskTOFqa::AliAnalysisTaskTOFqa(const char *name) : | |
47 | AliAnalysisTaskSE(name), | |
48 | fRunNumber(-1), | |
49 | fESD(0x0), | |
50 | fTrackFilter(0x0), | |
51 | fVertex(0x0), | |
52 | fNTOFtracks(0), | |
53 | fNPrimaryTracks(0), | |
54 | fT0(0), | |
55 | fHlist(0x0), | |
56 | fHlistExperts(0) | |
57 | { | |
58 | // Constructor | |
59 | // Define input and output slots here | |
60 | Info("AliAnalysisTaskTOFqa","Calling Constructor"); | |
61 | ||
62 | // Input slot #0 works with a TChain | |
63 | DefineInput(0, TChain::Class()); | |
64 | ||
65 | // Output slot #0 writes into a TH1 container | |
66 | // Output slot #1 writes into a user defined container | |
67 | DefineOutput(1, TList::Class()); | |
68 | DefineOutput(2, TList::Class()); | |
69 | } | |
70 | ||
71 | //________________________________________________________________________ | |
72 | AliAnalysisTaskTOFqa::AliAnalysisTaskTOFqa(const AliAnalysisTaskTOFqa& copy) | |
73 | : AliAnalysisTaskSE(), | |
74 | fRunNumber(copy.fRunNumber), | |
75 | fESD(copy.fESD), | |
76 | fTrackFilter(copy.fTrackFilter), | |
77 | fVertex(copy.fVertex), | |
78 | fNTOFtracks(copy.fNTOFtracks), | |
79 | fNPrimaryTracks(copy.fNPrimaryTracks), | |
80 | fT0(copy.fT0), | |
81 | fHlist(copy.fHlist), | |
82 | fHlistExperts(copy.fHlistExperts) | |
83 | { | |
84 | // Copy constructor | |
85 | } | |
86 | ||
87 | //___________________________________________________________________________ | |
88 | AliAnalysisTaskTOFqa& AliAnalysisTaskTOFqa::operator=(const AliAnalysisTaskTOFqa& copy) | |
89 | { | |
90 | // | |
91 | // Assignment operator | |
92 | // | |
93 | if (this!=©) { | |
94 | AliAnalysisTaskSE::operator=(copy) ; | |
95 | fRunNumber=copy.fRunNumber; | |
96 | fESD=copy.fESD; | |
97 | fTrackFilter=copy.fTrackFilter; | |
98 | fVertex=copy.fVertex; | |
99 | fNTOFtracks=copy.fNTOFtracks; | |
100 | fNPrimaryTracks=copy.fNPrimaryTracks; | |
101 | fT0=copy.fT0; | |
102 | fHlist=copy.fHlist; | |
103 | fHlistExperts=copy.fHlistExperts; | |
104 | } | |
105 | return *this; | |
106 | } | |
107 | ||
108 | //___________________________________________________________________________ | |
109 | AliAnalysisTaskTOFqa::~AliAnalysisTaskTOFqa() { | |
110 | // | |
111 | //destructor | |
112 | // | |
113 | ||
114 | Info("~AliAnalysisTaskTOFqa","Calling Destructor"); | |
115 | if (fVertex) delete fVertex; | |
116 | if (fTrackFilter) delete fTrackFilter; | |
117 | if (fESD) delete fESD; | |
118 | if (fHlist) { | |
119 | delete fHlist; | |
120 | fHlist = 0; | |
121 | } | |
122 | if (fHlistExperts) { | |
123 | delete fHlistExperts; | |
124 | fHlistExperts = 0; | |
125 | } | |
126 | } | |
127 | ||
128 | //________________________________________________________________________ | |
129 | void AliAnalysisTaskTOFqa::ConnectInputData(Option_t *) | |
130 | { | |
131 | // Connect ESD or AOD here | |
132 | // Called once | |
133 | ||
134 | TTree* tree = dynamic_cast<TTree*> (GetInputData(0)); | |
135 | if (!tree) { | |
136 | Printf("ERROR: Could not read chain from input slot 0"); | |
137 | } else { | |
138 | // Disable all branches and enable only the needed ones | |
139 | // The next two lines are different when data produced as AliESDEvent is read | |
140 | tree->SetBranchStatus("*", kFALSE); | |
141 | tree->SetBranchStatus("Tracks.*", kTRUE); | |
142 | tree->SetBranchStatus("AliESDTZERO.*", kTRUE); | |
143 | AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); | |
144 | ||
145 | if (!esdH) { | |
146 | Printf("ERROR: Could not get ESDInputHandler"); | |
147 | } else | |
148 | fESD = esdH->GetEvent(); | |
149 | } | |
150 | ||
151 | } | |
152 | ||
153 | //________________________________________________________________________ | |
154 | void AliAnalysisTaskTOFqa::UserCreateOutputObjects() | |
155 | { | |
156 | //Defines output objects and histograms | |
157 | Info("CreateOutputObjects","CreateOutputObjects (TList) of task %s", GetName()); | |
158 | OpenFile(1); | |
159 | if (!fHlist) fHlist = new TList(); | |
160 | if (!fHlistExperts) fHlistExperts = new TList(); | |
161 | //0 | |
162 | TH1I* hTOFmatchedESDperEvt = new TH1I("hTOFmatchedPerEvt", "Number of matched TOF tracks per event;Number of TOF matched ESD tracks;Counts", 100, 0, 100) ; | |
163 | hTOFmatchedESDperEvt->SetLineWidth(2); | |
164 | hTOFmatchedESDperEvt->SetLineColor(kBlue); | |
165 | fHlist->AddLast(hTOFmatchedESDperEvt) ; | |
166 | //1 | |
167 | TH1F* hTOFmatchedESDtime = new TH1F("hTOFmatchedESDtime", "Matched ESDs tracks: TOF Time spectrum; t [ns];Counts", 250, 0., 610. ) ; | |
168 | hTOFmatchedESDtime->SetLineWidth(2); | |
169 | hTOFmatchedESDtime->SetLineColor(kBlue); | |
170 | hTOFmatchedESDtime->SetFillColor(kBlue); | |
171 | fHlist->AddLast(hTOFmatchedESDtime) ; | |
172 | //2 | |
173 | TH1F* hTOFmatchedESDrawTime = new TH1F("hTOFmatchedESDrawTime", "Matched ESDs tracks: TOF raw Time spectrum;t_{raw} [ns];Counts", 250, 0., 610.) ; | |
174 | hTOFmatchedESDrawTime->SetLineWidth(2); | |
175 | hTOFmatchedESDrawTime->SetLineColor(kGreen+2); | |
176 | hTOFmatchedESDrawTime->SetFillColor(kGreen+2); | |
177 | fHlist->AddLast(hTOFmatchedESDrawTime) ; | |
178 | //3 | |
179 | TH1F* hTOFmatchedESDToT = new TH1F("hTOFmatchedESDToT", "Matched ESDs tracks: TOF ToT spectrum; ToT [ns];Counts",100, 0., 48.8) ; | |
180 | hTOFmatchedESDToT->SetLineWidth(2); | |
181 | hTOFmatchedESDToT->SetLineColor(kBlue); | |
182 | hTOFmatchedESDToT->SetFillColor(kBlue); | |
183 | fHlist->AddLast(hTOFmatchedESDToT) ; | |
184 | //4 | |
185 | TH1F* hTOFmatchedESDP = new TH1F("hTOFmatchedESDP", "TPC-TOF matched tracks momentum distribution (GeV/c); P(GeV/c);tracks", 500,0.,5.) ; | |
186 | hTOFmatchedESDP->SetLineWidth(1); | |
187 | hTOFmatchedESDP->SetLineColor(kBlue); | |
188 | hTOFmatchedESDP->SetMarkerStyle(21); | |
189 | hTOFmatchedESDP->SetMarkerSize(0.6); | |
190 | hTOFmatchedESDP->SetMarkerColor(kBlue); | |
191 | fHlist->AddLast(hTOFmatchedESDP) ; | |
192 | //5 | |
193 | TH1F* hTOFmatchedESDPt = new TH1F("hTOFmatchedESDPt", "TPC-TOF matched tracks p_{T} distribution (GeV/c); p_{T}(GeV/c);tracks", 500,0.,5.) ; | |
194 | hTOFmatchedESDPt->SetLineWidth(1); | |
195 | hTOFmatchedESDPt->SetLineColor(kBlue); | |
196 | hTOFmatchedESDPt->SetMarkerStyle(4); | |
197 | hTOFmatchedESDPt->SetMarkerSize(0.6); | |
198 | hTOFmatchedESDPt->SetMarkerColor(kBlue); | |
199 | fHlist->AddLast(hTOFmatchedESDPt) ; | |
200 | //6 | |
201 | TH1F* hTOFmatchedESDtrkLength = new TH1F("hTOFmatchedESDtrkLength", "Matched ESDs tracks length; Track length [cm];Counts", 1600, -800., 800) ; | |
202 | hTOFmatchedESDtrkLength->SetLineWidth(1); | |
203 | hTOFmatchedESDtrkLength->SetLineColor(kBlue); | |
204 | fHlist->AddLast(hTOFmatchedESDtrkLength) ; | |
205 | //7 | |
206 | TH2F* hTOFmatchedESDpVsBeta = new TH2F("hTOFmatchedESDpVsBeta", "Matched ESDs tracks p vs. beta; p(GeV/c); beta", 500, 0., 5.,500, 0., 5.) ; | |
207 | fHlist->AddLast(hTOFmatchedESDpVsBeta); | |
208 | ||
209 | //8 | |
210 | TH1F* hESDprimaryTrackP = new TH1F("hESDprimaryTrackP", "All ESDs tracks Pt distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0., 5.0) ; | |
211 | hESDprimaryTrackP->SetLineWidth(1); | |
212 | hESDprimaryTrackP->SetMarkerStyle(8); | |
213 | hESDprimaryTrackP->SetMarkerSize(0.6); | |
214 | hESDprimaryTrackP->SetLineColor(kGray+1); | |
215 | fHlist->AddLast(hESDprimaryTrackP); | |
216 | //9 | |
217 | TH1F* hESDprimaryTrackPt = new TH1F("hESDprimaryTrackPt", "ESDs primary tracks Pt distribution (GeV/c); p_{T}(GeV/c);tracks", 500, 0.0, 5.0) ; | |
218 | hESDprimaryTrackPt->SetLineWidth(1); | |
219 | hESDprimaryTrackPt->SetMarkerStyle(4); | |
220 | hESDprimaryTrackPt->SetMarkerSize(0.6); | |
221 | hESDprimaryTrackPt->SetLineColor(kBlack); | |
222 | fHlist->AddLast(hESDprimaryTrackPt); | |
223 | //10 | |
224 | TH1F* hTOFmatchedESDeta = new TH1F("hTOFmatchedESDeta", "Matched ESDtracks eta; eta;Counts", 500, -2.5, 2.5) ; | |
225 | fHlist->AddLast(hTOFmatchedESDeta) ; | |
226 | //11 | |
227 | TH1F* hTOFprimaryESDeta = new TH1F("hTOFprimaryESDeta", "Primary ESDtracks eta; eta;Counts", 500, -2.5, 2.5) ; | |
228 | fHlist->AddLast(hTOFprimaryESDeta) ; | |
229 | //12 | |
230 | TH1F* hTOFmatchedESDphi = new TH1F("hTOFmatchedESDphi", "Matched ESDtracks Phi; Phi (rad);Counts", 65, 0., 6.5) ; | |
231 | fHlist->AddLast(hTOFmatchedESDphi) ; | |
232 | //13 | |
233 | TH1F* hTOFprimaryESDphi = new TH1F("hTOFprimaryESDphi", "Primary ESDtracks Phi;Phi (rad);Counts", 65, 0., 6.5) ; | |
234 | fHlist->AddLast(hTOFprimaryESDphi) ; | |
235 | ||
236 | //Experts 0 | |
237 | TH1F* hTOFESDsMatchingProb = new TH1F("hTOFESDsMatchingProb", "TPC-TOF track-matching probability per event(|eta|<0.9 && pt>0.5GeV/c);TPC-TOF track-matching probability (%) ;Counts",21, 0., 110.) ; | |
238 | hTOFESDsMatchingProb->SetLineColor(kRed); | |
239 | fHlistExperts->AddLast(hTOFESDsMatchingProb) ; | |
240 | ||
241 | //Experts 1 | |
242 | TH1F* hTOFmatchedESDdiffTime = new TH1F("hTOFmatchedESDdiffTime", "ESDs t_{TOF}-t_{pi,exp} spectrum in TOF (ps); t_{TOF}-t_{pi,exp} [ps];Counts", 4000, -50000., 50000.) ; | |
243 | hTOFmatchedESDdiffTime->SetLineWidth(1); | |
244 | hTOFmatchedESDdiffTime->SetLineColor(kBlack); | |
245 | hTOFmatchedESDdiffTime->SetMarkerStyle(8); | |
246 | hTOFmatchedESDdiffTime->SetMarkerSize(0.8); | |
247 | hTOFmatchedESDdiffTime->SetMarkerColor(kAzure+7); | |
248 | hTOFmatchedESDdiffTime->SetFillColor(kAzure-2); | |
249 | fHlistExperts->AddLast(hTOFmatchedESDdiffTime) ; | |
250 | ||
251 | //Experts 2 | |
252 | TH2F* hTOFmatchedESDdiffTimeVsStrip = new TH2F("hTOFmatchedESDdiffTimeVsStrip", "ESDs t_{TOF}-t_{pi,exp} vs strip number; strip (Eta); t_{TOF}-t_{pi,exp} [ps]", 92,0.,92,400, -5000., 5000.) ; | |
253 | fHlistExperts->AddLast(hTOFmatchedESDdiffTimeVsStrip) ; | |
254 | ||
255 | //Experts 3 | |
256 | TH2F* hTOFmatchedESDdxVsEta = new TH2F("hTOFmatchedESDdxVsEta", "Matched ESD tracks Dx vs eta; strip(eta); Dx (cm)", 92,0.,92., 200,-10.,10.) ; | |
257 | fHlistExperts->AddLast(hTOFmatchedESDdxVsEta) ; | |
258 | ||
259 | //Experts 4 | |
260 | TH2F* hTOFmatchedESDdzVsEta = new TH2F("hTOFmatchedESDdzVsEta", "Matched ESDtracks Dz vs eta; strip(eta); Dz (cm)", 92,0.,92., 200,-10.,10.) ; | |
261 | fHlistExperts->AddLast(hTOFmatchedESDdzVsEta) ; | |
262 | ||
263 | //Experts 5 | |
264 | TH1F* hTOFmatchedMass= new TH1F("hTOFmatchedMass","Matched ESD tracks mass distribution; M (GeV/c^{2}); entries", 500,0., 5. ); | |
265 | hTOFmatchedMass->SetLineWidth(2); | |
266 | hTOFmatchedMass->SetLineColor(kBlue); | |
267 | hTOFmatchedMass->SetLineColor(kBlue); | |
268 | fHlistExperts->AddLast(hTOFmatchedMass); | |
269 | ||
270 | //Experts 6 | |
271 | TH1D* hEventT0DetAND = new TH1D("hEventT0DetAND", "Event T0 from T0 detector (A&C); t [ps];Counts", 4000, -50000., 50000. ) ; | |
272 | hEventT0DetAND->SetLineWidth(2); | |
273 | hEventT0DetAND->SetLineColor(kRed); | |
274 | hEventT0DetAND->SetFillColor(kRed); | |
275 | fHlistExperts->AddLast(hEventT0DetAND) ; | |
276 | ||
277 | //Experts 7 | |
278 | TH1D* hEventT0DetA = new TH1D("hEventT0DetA", "Event T0 from T0 detector (A side); t [ps];Counts", 4000, -50000., 50000. ) ; | |
279 | hEventT0DetA->SetLineWidth(2); | |
280 | hEventT0DetA->SetLineColor(kBlue); | |
281 | hEventT0DetA->SetFillColor(kBlue); | |
282 | fHlistExperts->AddLast(hEventT0DetA) ; | |
283 | ||
284 | //Experts 8 | |
285 | TH1D* hEventT0DetC = new TH1D("hEventT0DetC", "Event T0 from T0 detector (C side); t [ps];Counts", 4000, -50000., 50000. ) ; | |
286 | hEventT0DetC->SetLineWidth(2); | |
287 | hEventT0DetC->SetLineColor(kGreen); | |
288 | hEventT0DetC->SetFillColor(kGreen); | |
289 | fHlistExperts->AddLast(hEventT0DetC); | |
290 | ||
291 | //Experts 9 | |
292 | TH1F* hTOFmatchedExpTime = new TH1F("hTOFmatchedExpTime", "Matched ESDs tracks - pions expected time; t [ns];Counts", 4000, -50000., 50000. ) ; | |
293 | hTOFmatchedExpTime->SetLineWidth(1); | |
294 | hTOFmatchedExpTime->SetLineColor(kBlack); | |
295 | hTOFmatchedExpTime->SetMarkerStyle(8); | |
296 | hTOFmatchedExpTime->SetMarkerSize(0.8); | |
297 | hTOFmatchedExpTime->SetMarkerColor(kRed); | |
298 | fHlistExperts->AddLast(hTOFmatchedExpTime) ; | |
299 | ||
300 | } | |
301 | //________________________________________________________________________ | |
302 | void AliAnalysisTaskTOFqa::UserExec(Option_t *) | |
303 | { | |
304 | /* Main - executed for each event. | |
305 | It extracts event information and track information after selecting | |
306 | primary tracks via standard cuts. */ | |
307 | ||
308 | const Double_t speedOfLight = TMath::C()*1E2*1E-12; // cm/ps | |
309 | if (!fESD) { | |
310 | Printf("ERROR: fESD not available"); | |
311 | return; | |
312 | } | |
313 | ||
314 | // loop over ESD tracks | |
315 | fNTOFtracks=0; | |
316 | fNPrimaryTracks=0; | |
317 | ||
318 | //info from To detector | |
319 | fT0= fESD->GetT0TOF(0);//ps | |
320 | ((TH1D*)fHlistExperts->At(6))->Fill(fT0);//ps | |
321 | ((TH1D*)fHlistExperts->At(7))->Fill((Double_t)fESD->GetT0TOF(1)); //ps | |
322 | ((TH1D*)fHlistExperts->At(8))->Fill((Double_t)fESD->GetT0TOF(2));//ps | |
323 | ||
324 | for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) { | |
325 | AliESDtrack* track = fESD->GetTrack(iTracks); | |
326 | if (!track) { | |
327 | Printf("ERROR: Could not receive track %d", iTracks); | |
328 | continue; | |
329 | } | |
330 | ||
331 | //primary tracks selection: kTPCrefit and std cuts | |
332 | if(!fTrackFilter->IsSelected(track)) continue; | |
333 | ||
334 | Double_t tofTime=track->GetTOFsignal();//in ps | |
335 | Double_t tofTimeRaw=track->GetTOFsignalRaw();//in ps | |
336 | Double_t tofToT=track->GetTOFsignalToT(); //in ps | |
337 | Double_t expTimes[5]; | |
338 | track->GetIntegratedTimes(expTimes); | |
339 | Double_t length =track->GetIntegratedLength(); | |
340 | Double_t ptot[3]; | |
341 | track->GetConstrainedPxPyPz(ptot); | |
342 | Double_t pT = TMath::Sqrt(ptot[0]*ptot[0] + ptot[1]*ptot[1]); | |
343 | Double_t P2 = pT*pT + ptot[2]*ptot[2]; | |
344 | Double_t eta=track->Eta(); | |
345 | Int_t channel=track->GetTOFCalChannel(); | |
346 | Int_t volId[5]; //(sector, plate,strip,padZ,padX) | |
347 | AliTOFGeometry::GetVolumeIndices(channel,volId); | |
348 | ||
349 | if (TMath::Abs(eta)<0.9) { //cut for acceptance | |
350 | if (P2>=0) | |
351 | ((TH1F*)fHlist->At(8))->Fill(TMath::Sqrt(P2)); | |
352 | ((TH1F*)fHlist->At(9))->Fill(track->Pt()); //all esd tracks within acceptance | |
353 | ((TH1F*)fHlist->At(11))->Fill(eta); | |
354 | ((TH1F*)fHlist->At(13))->Fill(track->Phi()); | |
355 | if ((TMath::Abs(track->Eta())<0.9)&&(track->Pt()>0.5)) fNPrimaryTracks++; | |
356 | ||
357 | //matched tracks selection: kTOFout and kTIME | |
358 | if ((track->GetStatus() & AliESDtrack::kTOFout) && | |
359 | (track->GetStatus() & AliESDtrack::kTIME)) { | |
360 | ||
361 | if ((TMath::Abs(track->Eta())<0.9)&&(track->Pt()>0.5)) fNTOFtracks++; //matched counter | |
362 | ||
363 | ((TH1F*)fHlist->At(1))->Fill(tofTime*1E-3); //ns | |
364 | ((TH1F*)fHlist->At(2))->Fill(tofTimeRaw*1E-3); //ns | |
365 | ((TH1F*)fHlist->At(3))->Fill(tofToT); | |
366 | if (P2>=0) | |
367 | ((TH1F*)fHlist->At(4))->Fill(TMath::Sqrt(P2)); | |
368 | ((TH1F*)fHlist->At(5))->Fill(track->Pt()); | |
369 | ((TH1F*)fHlist->At(6))->Fill(length); | |
370 | ((TH1F*)fHlist->At(10))->Fill(eta); | |
371 | ((TH1F*)fHlist->At(12))->Fill(track->Phi()); | |
372 | ||
373 | ((TH1F*)fHlistExperts->At(1))->Fill(tofTime-expTimes[2]);//ps | |
374 | ((TH1F*)fHlistExperts->At(2))->Fill((Int_t)GetStripIndex(volId),tofTime-expTimes[2]); //ps | |
375 | ((TH1F*)fHlistExperts->At(3))->Fill((Int_t)GetStripIndex(volId),track->GetTOFsignalDx()); | |
376 | ((TH1F*)fHlistExperts->At(4))->Fill((Int_t)GetStripIndex(volId),track->GetTOFsignalDz()); | |
377 | ((TH1F*)fHlistExperts->At(9))->Fill(expTimes[2]);//ps | |
378 | ||
379 | //basic PID performance check | |
380 | Double_t tof= tofTime; //average T0 fill subtracted, no info from T0detector | |
381 | if (length>350){ | |
382 | Double_t beta= length/(tof*speedOfLight); | |
383 | //Double_t mass2=P2*((tof/length)*(tof/length)-(1/(speedOfLight*speedOfLight))); | |
384 | ((TH1F*)fHlist->At(7))->Fill(TMath::Sqrt(P2),beta); | |
385 | //if (mass2>=0)((TH1F*)fHlistExperts->At(5))->Fill(TMath::Sqrt(mass2)); | |
386 | } | |
387 | }//matched | |
388 | }//acceptance cut | |
389 | }//end loop on tracks | |
390 | ((TH1F*)fHlist->At(0))->Fill(fNTOFtracks) ; | |
391 | //if (fNTOFtracks>fNPrimaryTracks) printf("Something strange!!!\n"); | |
392 | if(fNPrimaryTracks>0){ | |
393 | ((TH1F*)fHlistExperts->At(0))->Fill((fNTOFtracks/(Float_t)fNPrimaryTracks)*100) ; | |
394 | } | |
395 | ||
396 | ||
397 | PostData(1, fHlist); | |
398 | PostData(2, fHlistExperts); | |
399 | ||
400 | } | |
401 | ||
402 | //________________________________________________________________________ | |
403 | void AliAnalysisTaskTOFqa::Terminate(Option_t *) | |
404 | { | |
405 | //check on output validity | |
406 | fHlist = dynamic_cast<TList*> (GetOutputData(1)); | |
407 | if (!fHlist || !fHlistExperts) { | |
408 | Printf("ERROR: lists not available"); | |
409 | return; | |
410 | } | |
411 | ||
412 | } | |
413 | ||
414 | //--------------------------------------------------------------- | |
415 | Int_t AliAnalysisTaskTOFqa::GetStripIndex(const Int_t * const in) | |
416 | { | |
417 | /* return tof strip index between 0 and 91 */ | |
418 | ||
419 | Int_t nStripA = AliTOFGeometry::NStripA(); | |
420 | Int_t nStripB = AliTOFGeometry::NStripB(); | |
421 | Int_t nStripC = AliTOFGeometry::NStripC(); | |
422 | ||
423 | Int_t iplate = in[1]; | |
424 | Int_t istrip = in[2]; | |
425 | ||
426 | Int_t stripOffset = 0; | |
427 | switch (iplate) { | |
428 | case 0: | |
429 | stripOffset = 0; | |
430 | break; | |
431 | case 1: | |
432 | stripOffset = nStripC; | |
433 | break; | |
434 | case 2: | |
435 | stripOffset = nStripC+nStripB; | |
436 | break; | |
437 | case 3: | |
438 | stripOffset = nStripC+nStripB+nStripA; | |
439 | break; | |
440 | case 4: | |
441 | stripOffset = nStripC+nStripB+nStripA+nStripB; | |
442 | break; | |
443 | default: | |
444 | stripOffset=-1; | |
445 | break; | |
446 | }; | |
447 | ||
448 | if (stripOffset<0 || stripOffset>92) return -1; | |
449 | else | |
450 | return (stripOffset+istrip); | |
451 | } | |
452 | ||
453 | #endif |