]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/QA/tasks/AliAnalysisTaskHLT.cxx
- include a series of HLT histograms with cuts for selecting primary tracks
[u/mrichter/AliRoot.git] / HLT / QA / tasks / AliAnalysisTaskHLT.cxx
CommitLineData
fb5b189b 1// $Id$
2//**************************************************************************
3//* This file is property of and copyright by the ALICE HLT Project *
4//* ALICE Experiment at CERN, All rights reserved. *
5//* *
6//* Primary Authors: Zhongbao Yin <zbyin@mail.ccnu.edu.cn>, *
7//* Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> *
8//* for The ALICE HLT Project. *
9//* *
10//* Permission to use, copy, modify and distribute this software and its *
11//* documentation strictly for non-commercial purposes is hereby granted *
12//* without fee, provided that the above copyright notice appears in all *
13//* copies and that both the copyright notice and this permission notice *
14//* appear in the supporting documentation. The authors make no claims *
15//* about the suitability of this software for any purpose. It is *
16//* provided "as is" without express or implied warranty. *
17//**************************************************************************
18
fb5b189b 19/** @file AliAnalysisTaskHLT.cxx
20 @author Kalliopi Kanaki, Hege Erdal
21 @date
22 @brief An analysis task containing
23 loops over HLT and offline ESD trees for comparing
24 AliESDtrack properties.
25*/
26
27//#include <iostream>
28
29class AliAnalysisTask;
30class AliAnalysisManager;
31
be66aae0 32#include "AliAnalysisTaskHLT.h"
4b621d9c 33#include "AliHLTGlobalTriggerDecision.h"
fb5b189b 34#include "TH1F.h"
35#include "TH2F.h"
36#include "TString.h"
37#include "AliESDEvent.h"
e9fe1336 38#include "AliESDtrackCuts.h"
fb5b189b 39#include "AliESDInputHandler.h"
1175b105 40#include "AliTracker.h"
b2642c4c 41#include "AliCentrality.h"
fb5b189b 42
be66aae0 43#include "TText.h"
44#include "TTimeStamp.h"
fb5b189b 45
46ClassImp(AliAnalysisTaskHLT)
47
b2642c4c 48//===============================================================//
fb5b189b 49
50AliAnalysisTaskHLT::AliAnalysisTaskHLT()
51:
52AliAnalysisTaskSE()
4b621d9c 53 ,fUseHLTTrigger(kFALSE)
be66aae0 54 //,fESDOfftrackCuts(0)
55 //,fESDHLTtrackCuts(0)
fb5b189b 56 ,fOutputList(0)
57 ,fHistTrigger(0)
5ab64231 58 ,fChargeOff(0)
1647e83b 59 ,fMomentumOff(0)
1175b105 60 ,fDCArOff(0)
61 ,fDCAzOff(0)
5ab64231 62 ,fNclusterOff(0)
1281a832 63 ,fNITSclusterOff(0)
fb5b189b 64 ,fPhiOff(0)
c0fbe8ec 65 ,fEtaOff(0)
fb5b189b 66 ,fMultOff(0)
fb5b189b 67 ,fXvertexOff(0)
68 ,fYvertexOff(0)
69 ,fZvertexOff(0)
1281a832 70 ,fSPDXvertexOff(0)
71 ,fSPDYvertexOff(0)
72 ,fSPDZvertexOff(0)
5ab64231 73 ,fEventSpecieOff(0)
b2642c4c 74 ,fV0cent(0)
fb5b189b 75
5ab64231 76 ,fChargeHLT(0)
fb5b189b 77 ,fMomentumHLT(0)
1175b105 78 ,fDCArHLT(0)
79 ,fDCAzHLT(0)
fb5b189b 80 ,fNclusterHLT(0)
1281a832 81 ,fNITSclusterHLT(0)
fb5b189b 82 ,fPhiHLT(0)
c0fbe8ec 83 ,fEtaHLT(0)
84 ,fChargeHLTcut(0)
85 ,fMomentumHLTcut(0)
86 ,fDCArHLTcut(0)
87 ,fDCAzHLTcut(0)
88 ,fNclusterHLTcut(0)
89 ,fNITSclusterHLTcut(0)
90 ,fPhiHLTcut(0)
91 ,fEtaHLTcut(0)
5ab64231 92 ,fMultHLT(0)
fb5b189b 93 ,fXvertexHLT(0)
94 ,fYvertexHLT(0)
95 ,fZvertexHLT(0)
1281a832 96 ,fSPDXvertexHLT(0)
97 ,fSPDYvertexHLT(0)
98 ,fSPDZvertexHLT(0)
5ab64231 99 ,fEventSpecieHLT(0)
b2642c4c 100
be66aae0 101 ,fBeamType()
102 ,fTextBox(0)
103 ,fSwitch(kTRUE)
b2642c4c 104 ,fCentrality()
fb5b189b 105{
106 // Constructor
107 // Define input and output slots here
108 // Input slot #0 works with a TChain
109 // DefineInput(0, TChain::Class());
110 // Output slot #0 writes into a TH1 container
fb5b189b 111}
112
113AliAnalysisTaskHLT::AliAnalysisTaskHLT(const char *name)
114 :
4b621d9c 115 AliAnalysisTaskSE(name)
116 ,fUseHLTTrigger(kFALSE)
be66aae0 117 //,fESDOfftrackCuts(0)
118 //,fESDHLTtrackCuts(0)
fb5b189b 119 ,fOutputList(0)
120 ,fHistTrigger(0)
5ab64231 121 ,fChargeOff(0)
1647e83b 122 ,fMomentumOff(0)
1175b105 123 ,fDCArOff(0)
124 ,fDCAzOff(0)
5ab64231 125 ,fNclusterOff(0)
1281a832 126 ,fNITSclusterOff(0)
fb5b189b 127 ,fPhiOff(0)
c0fbe8ec 128 ,fEtaOff(0)
fb5b189b 129 ,fMultOff(0)
fb5b189b 130 ,fXvertexOff(0)
131 ,fYvertexOff(0)
132 ,fZvertexOff(0)
5ab64231 133 ,fEventSpecieOff(0)
b2642c4c 134 ,fV0cent(0)
1281a832 135 ,fNcontOff(0)
136
5ab64231 137 ,fChargeHLT(0)
fb5b189b 138 ,fMomentumHLT(0)
fb5b189b 139 ,fNclusterHLT(0)
1281a832 140 ,fNITSclusterHLT(0)
fb5b189b 141 ,fPhiHLT(0)
c0fbe8ec 142 ,fEtaHLT(0)
143 ,fChargeHLTcut(0)
144 ,fMomentumHLTcut(0)
145 ,fNclusterHLTcut(0)
146 ,fNITSclusterHLTcut(0)
147 ,fPhiHLTcut(0)
148 ,fEtaHLTcut(0)
5ab64231 149 ,fMultHLT(0)
fb5b189b 150 ,fXvertexHLT(0)
151 ,fYvertexHLT(0)
152 ,fZvertexHLT(0)
5ab64231 153 ,fEventSpecieHLT(0)
1281a832 154 ,fNcontHLT(0)
b2642c4c 155
be66aae0 156 ,fBeamType()
157 ,fTextBox(0)
158 ,fSwitch(kTRUE)
b2642c4c 159 ,fCentrality()
be66aae0 160{
1647e83b 161 // Constructor
fb5b189b 162 // Define input and output slots here
163 // Input slot #0 works with a TChain
164 // DefineInput(0, TChain::Class());
165 // Output slot #0 writes into a TH1 container
fb5b189b 166 DefineOutput(1, TList::Class());
167}
168
b2642c4c 169//------------------------------------------------------------------------//
fb5b189b 170
171void AliAnalysisTaskHLT::UserCreateOutputObjects(){
172 // Create histograms
173
174 OpenFile(1);
fb5b189b 175 fOutputList = new TList();
2476901d 176 fOutputList->SetOwner();
fb5b189b 177 fOutputList->SetName(GetName());
178
179 /*
180 //0 mistriggered, 1 Good triggered, 2, triggered, 3 fake trigger,
181 //4 events with offline track, 5 total events processed,
182 //6 offline track thru CE, 7 online track to CE
183 fHistTrigger = new TH1F("fHistTrigger", "Trigger Status", 8, -0.5, 7.5);
184 fHistTrigger->GetXaxis()->SetTitle("");
185 fHistTrigger->GetYaxis()->SetTitle("Events");
186 fHistTrigger->SetMarkerStyle(kFullCircle);
187 fHistTrigger->SetStats(0);
188 fHistTrigger->SetFillColor(2);
189 //fHistTrigger->SetDrawOption("B TEXT60");
190
191 //Set bin labels
192 (fHistTrigger->GetXaxis())->SetBinLabel(1,"missed");
193 (fHistTrigger->GetXaxis())->SetBinLabel(2,"triggerWofflTrk");
194 (fHistTrigger->GetXaxis())->SetBinLabel(3,"triggered");
195 (fHistTrigger->GetXaxis())->SetBinLabel(4,"triggerWOofflTrk");
196 (fHistTrigger->GetXaxis())->SetBinLabel(5,"NevWofflTrk");
197 (fHistTrigger->GetXaxis())->SetBinLabel(6,"Nevt");
198 (fHistTrigger->GetXaxis())->SetBinLabel(7,"offlTrkThruCE");
199 (fHistTrigger->GetXaxis())->SetBinLabel(8,"onlTrkThruCE");
200 */
201
be66aae0 202 fHistTrigger = new TH1F("fHistTrigger", "CTP trigger counter", 24, 0, 24);
fb5b189b 203 fHistTrigger->GetXaxis()->SetTitle("");
204 fHistTrigger->GetYaxis()->SetTitle("#Events");
205
be66aae0 206 //=========== event properties =================//
1647e83b 207
be66aae0 208 if(fBeamType.Contains("Pb")){
c0fbe8ec 209 fMultOff = new TH1F("fMult_off", "",200,0,2000);
210 fMultHLT = new TH1F("fMult_hlt", "TPC track multiplicity",200,0,2000);
211 fNcontOff = new TH1F("fNcont_off","",200,0,2000);
212 fNcontHLT = new TH1F("fNcont_hlt","# of contributors",200,0,2000);
213 fV0cent = new TH1F("fV0cent", "V0 centrality", 100,0, 100);
be66aae0 214 }
215 else {
c0fbe8ec 216 fMultOff = new TH1F("fMult_off","",200,0,200);
217 fMultHLT = new TH1F("fMult_hlt","TPC track multiplicity",200,0,200);
218 fNcontOff = new TH1F("fNcont_off","",200,0,200);
219 fNcontHLT = new TH1F("fNcont_hlt","# of contributors",200,0,200);
be66aae0 220 }
c0fbe8ec 221
222 fXvertexOff = new TH1F("fXvertex_off","",200,-0.5,0.5);
223 fXvertexHLT = new TH1F("fXvertex_hlt","X primary vertex",200,-0.5,0.5);
fb5b189b 224
c0fbe8ec 225 fYvertexOff = new TH1F("fYvertex_off","",200,-0.5,0.5);
226 fYvertexHLT = new TH1F("fYvertex_hlt","Y primary vertex",200,-0.5,0.5);
fb5b189b 227
c0fbe8ec 228 fZvertexOff = new TH1F("fZvertex_off","",100,-20,20);
229 fZvertexHLT = new TH1F("fZvertex_hlt","Z primary vertex",100,-20,20);
1281a832 230
c0fbe8ec 231 fSPDXvertexOff = new TH1F("fSPDXvertex_off","",200,-0.5,0.5);
232 fSPDXvertexHLT = new TH1F("fSPDXvertex_hlt","X SPD primary vertex",200,-0.5,0.5);
1281a832 233
c0fbe8ec 234 fSPDYvertexOff = new TH1F("fSPDYvertex_off","",200,-0.5,0.5);
235 fSPDYvertexHLT = new TH1F("fSPDYvertex_hlt","Y SPD primary vertex",200,-0.5,0.5);
1281a832 236
c0fbe8ec 237 fSPDZvertexOff = new TH1F("fSPDZvertex_off","",100,-20,20);
238 fSPDZvertexHLT = new TH1F("fSPDZvertex_hlt","Z SPD primary vertex",100,-20,20);
be66aae0 239
c0fbe8ec 240 fEventSpecieOff = new TH1F("fEventSpecie_off","",18, 0, 18);
241 fEventSpecieHLT = new TH1F("fEventSpecie_hlt","event species",18, 0, 18);
fb5b189b 242
b2642c4c 243 //============== track properties =================//
be66aae0 244
c0fbe8ec 245 fChargeOff = new TH1F("fCharge_off", "", 3, -1.5, 1.5);
246 fChargeHLT = new TH1F("fCharge_hlt", "charge distribution", 3, -1.5, 1.5);
fb5b189b 247
c0fbe8ec 248 fMomentumOff = new TH1F("fMomentum_off", "", 100, 0, 10);
249 fMomentumHLT = new TH1F("fMomentum_hlt", "transverse momentum", 100, 0, 10);
fb5b189b 250
c0fbe8ec 251 fDCArOff = new TH1F("fDCAr_off", "", 200, -15, 15);
252 fDCArHLT = new TH1F("fDCAr_hlt", "DCAr", 200, -15, 15);
1281a832 253
c0fbe8ec 254 fDCAzOff = new TH1F("fDCAz_off", "", 200, -15, 15);
255 fDCAzHLT = new TH1F("fDCAz_hlt", "DCAz", 200, -15, 15);
fb5b189b 256
c0fbe8ec 257 fNclusterOff = new TH1F("fNcluster_off","", 200, 0, 200);
258 fNclusterHLT = new TH1F("fNcluster_hlt","TPC clusters/track", 200, 0, 200);
be66aae0 259
c0fbe8ec 260 fNITSclusterOff = new TH1F("fNITScluster_off","", 10, 0, 10);
261 fNITSclusterHLT = new TH1F("fNITScluster_hlt","ITS clusters/track", 10, 0, 10);
fb5b189b 262
c0fbe8ec 263 fPhiOff = new TH1F("fPhi_off","",90,0,360);
264 fPhiHLT = new TH1F("fPhi_hlt","azimuthal angle",90,0,360);
be66aae0 265
c0fbe8ec 266 fEtaOff = new TH1F("fEta_off","",100,-2,2);
267 fEtaHLT = new TH1F("fEta_hlt","pseudorapidity",100,-2,2);
fb5b189b 268
c0fbe8ec 269 fChargeHLTcut = new TH1F("fCharge_hltcut", "", 3, -1.5, 1.5);
270 fMomentumHLTcut = new TH1F("fMomentum_hltcut", "",100, 0, 10);
271 fDCArHLTcut = new TH1F("fDCAr_hltcut", "",200, -15, 15);
272 fDCAzHLTcut = new TH1F("fDCAz_hltcut", "",200, -15, 15);
273 fNclusterHLTcut = new TH1F("fNcluster_hltcut", "",200, 0, 200);
274 fNITSclusterHLTcut = new TH1F("fNITScluster_hltcut","", 10, 0, 10);
275 fPhiHLTcut = new TH1F("fPhi_hltcut", "", 90, 0, 360);
276 fEtaHLTcut = new TH1F("fEta_hltcut", "",100, -2, 2);
277
be66aae0 278 //--------------------------------------------------//
fb5b189b 279
be66aae0 280 fTextBox = new TText();
fb5b189b 281
282 fOutputList->Add(fHistTrigger);
be66aae0 283
c0fbe8ec 284 fOutputList->Add(fChargeOff); fOutputList->Add(fChargeHLT); fOutputList->Add(fChargeHLTcut);
285 fOutputList->Add(fMomentumOff); fOutputList->Add(fMomentumHLT); fOutputList->Add(fMomentumHLTcut);
286 fOutputList->Add(fDCArOff); fOutputList->Add(fDCArHLT); fOutputList->Add(fDCArHLTcut);
287 fOutputList->Add(fDCAzOff); fOutputList->Add(fDCAzHLT); fOutputList->Add(fDCAzHLTcut);
288 fOutputList->Add(fNclusterOff); fOutputList->Add(fNclusterHLT); fOutputList->Add(fNclusterHLTcut);
289 fOutputList->Add(fNITSclusterOff); fOutputList->Add(fNITSclusterHLT); fOutputList->Add(fNITSclusterHLTcut);
290 fOutputList->Add(fPhiOff); fOutputList->Add(fPhiHLT); fOutputList->Add(fPhiHLTcut);
291 fOutputList->Add(fEtaOff); fOutputList->Add(fEtaHLT); fOutputList->Add(fEtaHLTcut);
292
be66aae0 293 fOutputList->Add(fMultOff); fOutputList->Add(fMultHLT);
be66aae0 294 fOutputList->Add(fXvertexOff); fOutputList->Add(fXvertexHLT);
295 fOutputList->Add(fYvertexOff); fOutputList->Add(fYvertexHLT);
296 fOutputList->Add(fZvertexOff); fOutputList->Add(fZvertexHLT);
1281a832 297 fOutputList->Add(fSPDXvertexOff); fOutputList->Add(fSPDXvertexHLT);
298 fOutputList->Add(fSPDYvertexOff); fOutputList->Add(fSPDYvertexHLT);
299 fOutputList->Add(fSPDZvertexOff); fOutputList->Add(fSPDZvertexHLT);
be66aae0 300 fOutputList->Add(fEventSpecieOff); fOutputList->Add(fEventSpecieHLT);
1281a832 301 fOutputList->Add(fNcontOff); fOutputList->Add(fNcontHLT);
2476901d 302
b2642c4c 303 fOutputList->Add(fTextBox);
304 if(fBeamType.Contains("Pb")) fOutputList->Add(fV0cent);
305
be66aae0 306 //SetupESDtrackCuts();
2476901d 307 PostData(1, fOutputList);
fb5b189b 308}
309
fb5b189b 310void AliAnalysisTaskHLT::UserExec(Option_t *){
311 // see header file of AliAnalysisTask for documentation
312
be66aae0 313 AliESDEvent *esdOFF = dynamic_cast<AliESDEvent*>(InputEvent());
fb5b189b 314 if(!esdOFF){
be66aae0 315 printf("Error:UserExec OFF esd not available\n");
316 return;
fb5b189b 317 }
be66aae0 318
319 if(esdOFF->GetEventSpecie()==16) return; // skip calibration events, HLT doesn't set this flag yet
320
fb5b189b 321 AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*>(fInputHandler);
be66aae0 322 if(!esdH){
323 printf("The ESD input handler is empty\n");
324 return;
325 }
326
fb5b189b 327 AliESDEvent *esdHLT = NULL;
be66aae0 328 if(esdH) esdHLT = esdH->GetHLTEvent();
d132ef8c 329 if(!esdHLT){
be66aae0 330 printf("Error:UserExec HLT esd not available\n");
331 return;
fb5b189b 332 }
1647e83b 333
be66aae0 334 if(fSwitch==kTRUE){
335 TTimeStamp *timestamp = new TTimeStamp(esdHLT->GetTimeStamp());
336 fTextBox->SetName("text");
337 TString s = Form("Run %d, Date %d", esdHLT->GetRunNumber(), timestamp->GetDate());
338 printf("You are analyzing run %d from date %d\n\n", esdHLT->GetRunNumber(), timestamp->GetDate());
339 fTextBox->SetTitle(s);
340 fSwitch=kFALSE;
4b621d9c 341 }
fb5b189b 342
fb5b189b 343 Double_t bfield = esdOFF->GetMagneticField();
344
be66aae0 345// UInt_t Statusnames[12]={AliESDtrack::kTPCin,
346// AliESDtrack::kITSin,
347// AliESDtrack::kTPCout,
348// AliESDtrack::kITSout,
349// AliESDtrack::kITSrefit,
350// AliESDtrack::kTPCrefit,
351// AliESDtrack::kTRDin,
352// AliESDtrack::kTRDout,
353// AliESDtrack::kTRDrefit,
354// AliESDtrack::kTOFin,
355// AliESDtrack::kTOFout,
356// AliESDtrack::kTOFrefit};
fb5b189b 357
e9fe1336 358
359
360 //---------------- HLT ESD tree -----------------------//
e9fe1336 361
be66aae0 362 Int_t nr_tracksHLT = 0;
363 const AliESDVertex *vertHLT = esdHLT->GetPrimaryVertexTracks();
1647e83b 364
1281a832 365
be66aae0 366 if(vertHLT->GetStatus()==kTRUE){
e9fe1336 367 fXvertexHLT->Fill( vertHLT->GetX() );
368 fYvertexHLT->Fill( vertHLT->GetY() );
369 fZvertexHLT->Fill( vertHLT->GetZ() );
1281a832 370
371 fSPDXvertexHLT->Fill(esdHLT->GetPrimaryVertexSPD()->GetX());
372 fSPDYvertexHLT->Fill(esdHLT->GetPrimaryVertexSPD()->GetY());
373 fSPDZvertexHLT->Fill(esdHLT->GetPrimaryVertexSPD()->GetZ());
374
375 fNcontHLT->Fill(vertHLT->GetNContributors());
1647e83b 376 }
377 //At the moment no constrains on vertex before filling histograms
378 //Should be changed.
5ab64231 379
4b621d9c 380 fEventSpecieHLT->Fill(esdHLT->GetEventSpecie());
381
382 for(Int_t i=0; i<esdHLT->GetNumberOfTracks(); i++){
e9fe1336 383
4b621d9c 384 AliESDtrack *esdtrackHLT = esdHLT->GetTrack(i);
385 if(!esdtrackHLT) continue;
386
387 //Fill which status flags that are set for an event
be66aae0 388 //for(int jjj=0;jjj<12;jjj++){
389 // if(esdtrackHLT->GetStatus()&Statusnames[jjj]) fStatusHLT->Fill(jjj);
390 //}
4b621d9c 391
be66aae0 392 if(!(esdtrackHLT->GetStatus()&AliESDtrack::kTPCin)) continue; // only interested in tracks with kTPCin flag
393 if(esdtrackHLT->GetTPCNcls()<=0) continue;
394 nr_tracksHLT++;
b2642c4c 395
4b621d9c 396 //Calculating DCA "old" fashion
397 Float_t dca[2];
398 esdtrackHLT->GetDZ(esdHLT->GetPrimaryVertex()->GetXv(), esdHLT->GetPrimaryVertex()->GetYv(), esdHLT->GetPrimaryVertex()->GetZv(), bfield, dca);
399
4b621d9c 400 fDCArHLT->Fill(dca[0]);
401 fDCAzHLT->Fill(dca[1]);
402
403 fChargeHLT->Fill(esdtrackHLT->Charge());
be66aae0 404 fNclusterHLT->Fill(esdtrackHLT->GetTPCNcls());
1281a832 405 fNITSclusterHLT->Fill(esdtrackHLT->GetNcls(0));
4b621d9c 406 fEtaHLT->Fill(esdtrackHLT->Eta());
4b621d9c 407 fPhiHLT->Fill(esdtrackHLT->Phi()*TMath::RadToDeg());
be66aae0 408 fMomentumHLT->Fill(TMath::Abs(esdtrackHLT->Pt()));
c0fbe8ec 409
410 if(TMath::Abs(esdtrackHLT->Eta())<0.9 && TMath::Abs(esdtrackHLT->Pt())>0.3 && TMath::Abs(dca[0])<5 && TMath::Abs(dca[1])<5){
411 fChargeHLTcut->Fill(esdtrackHLT->Charge());
412 fNclusterHLTcut->Fill(esdtrackHLT->GetTPCNcls());
413 fNITSclusterHLTcut->Fill(esdtrackHLT->GetNcls(0));
414 fEtaHLTcut->Fill(esdtrackHLT->Eta());
415 fPhiHLTcut->Fill(esdtrackHLT->Phi()*TMath::RadToDeg());
416 fMomentumHLTcut->Fill(TMath::Abs(esdtrackHLT->Pt()));
417 }
4b621d9c 418 } // end of loop over hlt tracks
419
420 if(nr_tracksHLT>0) fMultHLT->Fill(nr_tracksHLT);
e9fe1336 421
fb5b189b 422 //----------------- OFFLINE ESD tree ----------------//
423
be66aae0 424 Int_t nr_tracksOff = 0;
1281a832 425 const AliESDVertex *vertOFF = esdOFF->GetPrimaryVertexTracks();
b2642c4c 426
427 if(fBeamType.Contains("Pb")){
428 fCentrality = esdOFF->GetCentrality();
429 // this information is only available from the offline ESD for 2010 PbPb data, the V0 info was not stored in the HLTesd (17.04.11, Kelly)
430 if(!fCentrality){
431 printf("Centrality pointer is empty\n");
432 return;
433 }
434 else fV0cent->Fill(fCentrality->GetCentralityPercentile("V0M"));
435 }
5ab64231 436
1281a832 437 if(vertOFF->GetStatus()==kTRUE){
c0fbe8ec 438 fXvertexOff->Fill( vertOFF->GetX() );
439 fYvertexOff->Fill( vertOFF->GetY() );
440 fZvertexOff->Fill( vertOFF->GetZ() );
1281a832 441
c0fbe8ec 442 fSPDXvertexOff->Fill(esdOFF->GetPrimaryVertexSPD()->GetX());
443 fSPDYvertexOff->Fill(esdOFF->GetPrimaryVertexSPD()->GetY());
444 fSPDZvertexOff->Fill(esdOFF->GetPrimaryVertexSPD()->GetZ());
1281a832 445
c0fbe8ec 446 fNcontOff->Fill(vertOFF->GetNContributors());
1647e83b 447 }
e9fe1336 448
4b621d9c 449 fEventSpecieOff->Fill(esdOFF->GetEventSpecie());
450
451 for(Int_t i=0; i<esdOFF->GetNumberOfTracks(); i++){
452
453 AliESDtrack *esdtrackOFF = esdOFF->GetTrack(i);
454 if (!esdtrackOFF) continue;
455
be66aae0 456 if(!(esdtrackOFF->GetStatus()&AliESDtrack::kTPCin)) continue;
457 if(esdtrackOFF->GetTPCNcls()<=0) continue;
4b621d9c 458 nr_tracksOff++;
459
4b621d9c 460 Double_t x[3];
461 esdtrackOFF->GetXYZ(x);
462 Double_t b[3];
463 AliTracker::GetBxByBz(x,b);
1281a832 464 Bool_t isOK = esdtrackOFF->RelateToVertexTPCBxByBz(vertOFF, b, kVeryBig);
4b621d9c 465 if(!isOK) return;
466
467 const AliExternalTrackParam *track = esdtrackOFF->GetTPCInnerParam();
468 if(!track) return;
469
470 Float_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
471 esdtrackOFF->GetImpactParametersTPC(dca,cov);
5ab64231 472
4b621d9c 473 fDCArOff->Fill(dca[0]);
474 fDCAzOff->Fill(dca[1]);
be66aae0 475
4b621d9c 476 fChargeOff->Fill(esdtrackOFF->Charge());
be66aae0 477 fNclusterOff->Fill(esdtrackOFF->GetTPCNcls());
1281a832 478 fNITSclusterOff->Fill(esdtrackOFF->GetNcls(0));
4b621d9c 479 fEtaOff->Fill(esdtrackOFF->Eta());
4b621d9c 480 fPhiOff->Fill(esdtrackOFF->Phi()*TMath::RadToDeg());
4b621d9c 481 fMomentumOff->Fill( TMath::Abs(esdtrackOFF->Pt()) );
482
4b621d9c 483 } // end of loop over offline tracks
5ab64231 484
4b621d9c 485 if(nr_tracksOff>0) fMultOff->Fill(nr_tracksOff);
be66aae0 486
fb5b189b 487 PostData(1, fOutputList);
488}
489
490void AliAnalysisTaskHLT::Terminate(Option_t *){
b2642c4c 491// see header file of AliAnalysisTask for documentation
5ab64231 492}
e9fe1336 493
be66aae0 494// void AliAnalysisTaskHLT::SetupESDtrackCuts(){ // not called
495// // Setup ESD cuts
496// // NB! Work in progress!
497//
498// Bool_t selPrimaries = kTRUE;
499//
500// fESDOfftrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2009(selPrimaries);
501// //To make Offline cuts = HLT cuts
502// fESDOfftrackCuts->SetRequireITSRefit(kFALSE);
503// fESDOfftrackCuts->SetEtaRange(-0.9,+0.9);
504//
505//
506// //HLT
507// //NB! Need to understand this a bit more! Which cuts should we keep?
508// fESDHLTtrackCuts = new AliESDtrackCuts;
509//
510// // TPC
511// fESDHLTtrackCuts->SetRequireTPCStandAlone(kTRUE); // to get chi2 and ncls of kTPCin
512// fESDHLTtrackCuts->SetMinNClustersTPC(70);
513// fESDHLTtrackCuts->SetMaxChi2PerClusterTPC(4);
514// fESDHLTtrackCuts->SetAcceptKinkDaughters(kFALSE);
515//
516// fESDHLTtrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
517// AliESDtrackCuts::kAny);
518//
519// if(selPrimaries) { // 7*(0.0050+0.0060/pt^0.9)
520// fESDHLTtrackCuts->SetMaxDCAToVertexXYPtDep("0.0350+0.0420/pt^0.9");
521// }
522//
523// fESDHLTtrackCuts->SetMaxDCAToVertexZ(1.e6);
524// fESDHLTtrackCuts->SetDCAToVertex2D(kFALSE);
525// fESDHLTtrackCuts->SetRequireSigmaToVertex(kFALSE);
526// fESDHLTtrackCuts->SetEtaRange(-0.9,+0.9);
527//
528// return;
529// }