Task AliHMPIDPerformanceTask (L. Molnar) for basic performance studies added
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDPerformanceTask.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
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 //==============================================================================
17 // AliHMPIDAnalysysTask - Class representing a basic analysis tool of HMPID data
18 // A set of histograms is created.
19 //==============================================================================
20 //
21 // By means of AliHMPIDPerformanceTask.C macro it is possible to use this class
22 // to perform the analysis on local data, on data on alien using local machine
23 // and on CAF.
24
25 #ifndef AliHMPIDPERFORMANCETASK_CXX
26 #define AliHMPIDPERFORMANCETASK_CXX
27
28 #include "TObject.h"
29 #include "TH1.h"
30 #include "TH2.h"
31 #include "TFile.h"
32 #include "TCanvas.h"
33 #include "TTree.h"
34 #include "TGraphErrors.h"
35 #include "AliAnalysisManager.h"
36 #include "AliESDInputHandler.h"
37 #include "AliMCEventHandler.h"
38 #include "AliMCEvent.h"
39 #include "AliESDtrack.h"
40 #include "AliESDEvent.h"
41 #include "AliESDVertex.h"
42 #include "AliESDfriend.h"
43 #include "AliHMPIDCluster.h"
44 #include "AliESDfriendTrack.h"
45 #include "AliPID.h"
46 #include "AliLog.h"
47 #include "AliESDtrackCuts.h"
48 #include "AliHMPIDPerformanceTask.h"
49 #include "AliCentrality.h"
50
51 ClassImp(AliHMPIDPerformanceTask)
52
53 //__________________________________________________________________________
54 AliHMPIDPerformanceTask::AliHMPIDPerformanceTask() :
55   fESD(0x0),fESDfriend(0x0),fEsdTrackCuts(0x0),fClu(0x0),fMC(0x0),fEsdVtx(0x0),fCentrality(0x0),fEsdTrack(0x0),fEsdFriendTrack(0x0),
56   fCalibObject(0x0),  fUseMC(kTRUE),  fHmpHistList(0x0),  fHmpNevents(0x0),fHmpNevPerTrigClass(0x0),
57   fGlobalEventNumber(0),
58   //tree stuff
59   fvType(0),
60   fvFiredTriggerClasses(0x0), fvRunNumber(0), fvBunchCrossNumber(0),fvOrbitNumber(0),  fvPeriodNumber(0), fvMagField(0),
61   fvVertexX(0),fvVertexY(0),fvVertexZ(0),fvVertexNContributors(0),  fvPesd(0),fvPhmpMag(0),fvCentrality(0),
62   fvAcceptedTracks(0),fvRefMultTpc(0),  fvHmpChi2(0),fvHmpCluIndx(0),fvHmpMipX(0),fvHmpMipY(0),fvHmpMipQ(0),fvHmpMipNPhots(0),fvHmpSignal(0),
63   fvHmpTrkX(0),fvHmpTrkY(0),fvHmpTrkTheta(0),fvHmpTrkPhi(0),  fvHmpCluQ(0), fvHmpCluX(0),fvHmpCluY(0),fvHmpCluCh(0),fvHmpCluSize(0),fvHmpCluBox(0),fvHmpCluStatus(0),
64   fvEsdTrackAccepted(0),  fvKinkIndex(0),fvTofSignal(0),
65   
66   fTree(0x0)
67 {
68   //Default ctor
69   //
70    for (Int_t i=0; i<3; i++) fvPhmp[i]=0;
71    for (Int_t i=0; i<5; i++) fvHmpPid[i] = 0;
72 }
73
74 //___________________________________________________________________________
75 AliHMPIDPerformanceTask::AliHMPIDPerformanceTask(const Char_t* name) :
76   AliAnalysisTaskSE(name),
77   fESD(0x0), fESDfriend(0x0), fEsdTrackCuts(0x0), fClu(0x0),fMC(0x0), fEsdVtx(0x0),fCentrality(0x0),
78   fEsdTrack(0x0),fEsdFriendTrack(0x0),  fCalibObject(0x0),   fUseMC(kTRUE),
79   fHmpHistList(0x0),  fHmpNevents(0x0),fHmpNevPerTrigClass(0x0),
80   fGlobalEventNumber(0),  fvType(0),  fvFiredTriggerClasses(0x0), fvRunNumber(0), fvBunchCrossNumber(0),fvOrbitNumber(0),
81   fvPeriodNumber(0),fvMagField(0),  fvVertexX(0),fvVertexY(0),fvVertexZ(0),fvVertexNContributors(0), 
82   fvPesd(0),fvPhmpMag(0),fvCentrality(0),  fvAcceptedTracks(0),fvRefMultTpc(0),
83   fvHmpChi2(0),fvHmpCluIndx(0),fvHmpMipX(0),fvHmpMipY(0),fvHmpMipQ(0),fvHmpMipNPhots(0),fvHmpSignal(0),
84   fvHmpTrkX(0),fvHmpTrkY(0),fvHmpTrkTheta(0),fvHmpTrkPhi(0),  fvHmpCluQ(0), fvHmpCluX(0),fvHmpCluY(0),fvHmpCluCh(0),fvHmpCluSize(0),fvHmpCluBox(0),fvHmpCluStatus(0),
85   fvEsdTrackAccepted(0),    fvKinkIndex(0),fvTofSignal(0),
86   
87   fTree(0x0)
88 {
89   //
90   // Constructor. Initialization of Inputs and Outputs
91   //
92   for (Int_t i=0; i<3; i++) fvPhmp[i]=0;
93   for (Int_t i=0; i<5; i++) fvHmpPid[i] = 0;
94   DefineOutput(1,TList::Class());
95   DefineOutput(2,TTree::Class());
96 }
97
98 //___________________________________________________________________________
99 AliHMPIDPerformanceTask& AliHMPIDPerformanceTask::operator=(const AliHMPIDPerformanceTask& c)
100 {
101   //
102   // Assignment operator
103   //
104   if (this!=&c) {
105     AliAnalysisTaskSE::operator=(c);
106     fESD             = c.fESD;
107     fESDfriend       = c.fESDfriend;
108     fEsdTrackCuts    = c.fEsdTrackCuts;
109     fClu             = c.fClu;
110     fMC              = c.fMC;
111     fEsdVtx                      = c.fEsdVtx;
112     fCentrality       = c.fCentrality;
113     fEsdTrack         = c.fEsdTrack;
114     fEsdFriendTrack   =c.fEsdFriendTrack;
115     fCalibObject      = c.fCalibObject;
116           
117     fUseMC           = c.fUseMC;
118     fHmpHistList     = c.fHmpHistList;
119     fHmpNevents      = c.fHmpNevents;
120     fHmpNevPerTrigClass = c.fHmpNevPerTrigClass;
121     fGlobalEventNumber = c.fGlobalEventNumber;
122     
123     fvFiredTriggerClasses =c.fvFiredTriggerClasses;
124     fvRunNumber = c.fvRunNumber;
125     fvBunchCrossNumber = c.fvBunchCrossNumber;
126     fvOrbitNumber = c.fvOrbitNumber;
127     fvPeriodNumber = c.fvPeriodNumber;
128     fvMagField    =c.fvMagField;    
129     fvVertexX     = c.fvVertexX;
130     fvVertexY     = c.fvVertexY;
131     fvVertexZ     = c.fvVertexZ;
132     fvVertexNContributors = c.fvVertexNContributors;
133     fvPesd = c.fvPesd;
134     fvPhmpMag = c.fvPhmpMag;
135     fvCentrality = c.fvCentrality;
136     fvAcceptedTracks = c.fvAcceptedTracks;
137     fvRefMultTpc = c.fvRefMultTpc;
138     
139     fvHmpChi2 = c.fvHmpChi2;
140     fvHmpCluIndx = c.fvHmpCluIndx;
141     fvHmpMipX = c.fvHmpMipX;
142     fvHmpMipY = c.fvHmpMipY;
143     fvHmpMipQ = c.fvHmpMipQ;
144     fvHmpMipNPhots = c.fvHmpMipNPhots;
145     fvHmpSignal = c.fvHmpSignal;
146     fvHmpTrkX = c.fvHmpTrkX;
147     fvHmpTrkY = c.fvHmpTrkY;
148     fvHmpTrkTheta = c.fvHmpTrkTheta;
149     fvHmpTrkPhi = c.fvHmpTrkPhi;
150     
151     fvHmpCluQ = c.fvHmpCluQ;
152     fvHmpCluX = c.fvHmpCluX;
153     fvHmpCluY = c.fvHmpCluY;
154     fvHmpCluCh = c.fvHmpCluCh;
155     fvHmpCluSize = c.fvHmpCluSize;
156     fvHmpCluBox = c.fvHmpCluBox;
157     fvHmpCluStatus = c.fvHmpCluStatus;
158     fvEsdTrackAccepted = c.fvEsdTrackAccepted;           
159     
160     fvKinkIndex = c.fvKinkIndex;
161     fvTofSignal = c.fvTofSignal;
162     
163     fTree            = c.fTree;
164
165     for (Int_t i=0; i<3; i++) fvPhmp[i] = c.fvPhmp[i];
166     for (Int_t i=0; i<5; i++) fvHmpPid[i] = c.fvHmpPid[i];
167   }
168   return *this;
169 }
170
171 //___________________________________________________________________________
172 AliHMPIDPerformanceTask::AliHMPIDPerformanceTask(const AliHMPIDPerformanceTask& c) :
173   AliAnalysisTaskSE(c),
174   fESD(c.fESD),fESDfriend(c.fESDfriend),fEsdTrackCuts(c.fEsdTrackCuts),fClu(c.fClu),
175   fMC(c.fMC),  fEsdVtx(c.fEsdVtx),    fCentrality(c.fCentrality),fEsdTrack(c.fEsdTrack),
176   fEsdFriendTrack(c.fEsdFriendTrack),
177   fCalibObject(c.fCalibObject),
178     
179   fUseMC(c.fUseMC),
180   fHmpHistList(c.fHmpHistList),
181   fHmpNevents(c.fHmpNevents),
182   fHmpNevPerTrigClass(c.fHmpNevPerTrigClass),
183   fGlobalEventNumber(c.fGlobalEventNumber),  
184   fvFiredTriggerClasses(c.fvFiredTriggerClasses),
185   fvRunNumber(c.fvRunNumber),
186   fvBunchCrossNumber(c.fvBunchCrossNumber),
187   fvOrbitNumber(c.fvOrbitNumber),
188   fvPeriodNumber(c.fvPeriodNumber),
189   fvMagField(c.fvMagField),  
190   fvVertexX(c.fvVertexX),
191   fvVertexY(c.fvVertexY),
192   fvVertexZ(c.fvVertexZ),
193   fvVertexNContributors(c.fvVertexNContributors),
194   fvPesd(c.fvPesd),
195   fvPhmpMag(c.fvPhmpMag), 
196   fvCentrality(c.fvCentrality),
197   fvAcceptedTracks(c.fvAcceptedTracks),
198   fvRefMultTpc(c.fvRefMultTpc),
199   fvHmpChi2 ( c.fvHmpChi2),
200   fvHmpCluIndx ( c.fvHmpCluIndx),
201   fvHmpMipX ( c.fvHmpMipX),
202   fvHmpMipY ( c.fvHmpMipY),
203   fvHmpMipQ ( c.fvHmpMipQ),
204   fvHmpMipNPhots ( c.fvHmpMipNPhots),
205   fvHmpSignal ( c.fvHmpSignal),
206   fvHmpTrkX ( c.fvHmpTrkX),
207   fvHmpTrkY ( c.fvHmpTrkY),
208   fvHmpTrkTheta ( c.fvHmpTrkTheta),
209   fvHmpTrkPhi ( c.fvHmpTrkPhi),
210   
211   fvHmpCluQ ( c.fvHmpCluQ),
212   fvHmpCluX ( c.fvHmpCluX),
213   fvHmpCluY ( c.fvHmpCluY),
214   fvHmpCluCh ( c.fvHmpCluCh),
215   fvHmpCluSize ( c.fvHmpCluSize),
216   fvHmpCluBox ( c.fvHmpCluBox),
217   fvHmpCluStatus ( c.fvHmpCluStatus),
218   
219   fvEsdTrackAccepted(c.fvEsdTrackAccepted),
220   fvKinkIndex(c.fvKinkIndex),
221   fvTofSignal(c.fvTofSignal),
222   
223   fTree(c.fTree)
224 {
225   //
226   // Copy Constructor
227   //
228   for (Int_t i=0; i<3; i++) fvPhmp[i] = c.fvPhmp[i];
229   for (Int_t i=0; i<5; i++) fvHmpPid[i] = c.fvHmpPid[i];
230 }
231
232 //___________________________________________________________________________
233 AliHMPIDPerformanceTask::~AliHMPIDPerformanceTask() {
234   //
235   //destructor
236   //
237   Info("~AliHMPIDPerformanceTask","Calling Destructor");
238   if (fHmpHistList && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) delete fHmpHistList;
239 }
240
241 //___________________________________________________________________________
242 void AliHMPIDPerformanceTask::ConnectInputData(Option_t *)
243 {
244   // Connect ESD here
245   
246   AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
247   if (!esdH) {
248     AliDebug(2,Form("ERROR: Could not get ESDInputHandler"));
249   } else
250     fESD = esdH->GetEvent();
251   
252   if (fUseMC){
253     // Connect MC
254     AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
255     if (!mcH) {
256       AliDebug(2,Form("ERROR: Could not get MCEventHandler"));
257       fUseMC = kFALSE;
258     } else
259       fMC = mcH->MCEvent();
260     if (!fMC) AliDebug(2,Form("ERROR: Could not get MCEvent"));
261   }
262   
263   //Init ESD track cuts
264   fEsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE); 
265   
266 }
267 //___________________________________________________________________________
268 void AliHMPIDPerformanceTask::UserExec(Option_t *)
269 {  
270   
271   if (!fESD) {
272     Printf("ERROR: fESD not available");
273     return;
274   }
275   
276   fHmpNevents->Fill(0);
277   
278   //fEsdVtx = fESD->GetPrimaryVertex();
279   
280   /* check which trigger is fired */          fHmpNevPerTrigClass->Fill(0);
281   if(fESD->IsTriggerClassFired("kMB"))        fHmpNevPerTrigClass->Fill(1);
282   if(fESD->IsTriggerClassFired("kINT7"))      fHmpNevPerTrigClass->Fill(2);
283   if(fESD->IsTriggerClassFired("kCINT5"))     fHmpNevPerTrigClass->Fill(3);
284   if(fESD->IsTriggerClassFired("kFastOnly"))  fHmpNevPerTrigClass->Fill(4);
285   if(fESD->IsTriggerClassFired("kHighMult"))  fHmpNevPerTrigClass->Fill(5);
286   if(fESD->IsTriggerClassFired("kAnyINT"))    fHmpNevPerTrigClass->Fill(6);
287   
288   fvFiredTriggerClasses = Form("%s",(fESD->GetFiredTriggerClasses()).Data());
289   
290   //___ check vertex
291   if(!fESD->GetPrimaryVertex() || !fESD->GetPrimaryVertex() || fESD->GetPrimaryVertex()->GetNContributors()<1) {     // SPD vertex
292     if(!fESD->GetPrimaryVertexSPD()) return;
293     if(!fESD->GetPrimaryVertexSPD()->GetStatus()) return;
294     if(fESD->GetPrimaryVertexSPD()->GetNContributors()<1) return; // no good vertex, skip event  
295   }
296   
297   fHmpNevents->Fill(1);
298   if(fESD->GetPrimaryVertex()) {
299     fvVertexX = fESD->GetPrimaryVertex()->GetX();
300     fvVertexY = fESD->GetPrimaryVertex()->GetY();
301     fvVertexZ = fESD->GetPrimaryVertex()->GetZ();
302     fvVertexNContributors = fESD->GetPrimaryVertex()->GetNContributors();
303     fvMagField = fESD->GetMagneticField();
304   }
305   
306   fCentrality = fESD->GetCentrality();
307   if(fCentrality)
308     {
309       fvCentrality = fCentrality->GetCentralityPercentile("V0M");
310     }
311   
312   // Exec function
313   // Loop over tracks and call  Process function
314   
315   
316   if(fEsdTrackCuts) 
317     {
318       fvAcceptedTracks  =  fEsdTrackCuts->CountAcceptedTracks(fESD);
319      fvRefMultTpc         =  fEsdTrackCuts->GetReferenceMultiplicity(fESD, kTRUE);
320     }
321   
322   
323   
324   fESDfriend=(AliESDfriend*)(((AliESDEvent*)fESD)->FindListObject("AliESDfriend"));
325   
326   //  if (!fESDfriend) { Printf("ERROR: fESDfriend not available");   }
327   
328   Double_t ktol = 0.001;
329   
330   fvRunNumber = fESD->GetRunNumber();
331   fvBunchCrossNumber = fESD->GetBunchCrossNumber();
332   fvOrbitNumber = fESD->GetOrbitNumber();
333   fvPeriodNumber = fESD->GetPeriodNumber();
334   
335   fGlobalEventNumber =   (ULong64_t)fESD->GetBunchCrossNumber()     + (ULong64_t)fESD->GetOrbitNumber()*3564+     (ULong64_t)fESD->GetPeriodNumber()*16777215*3564;
336   
337   fEsdTrackCuts -> CountAcceptedTracks(fESD);
338   
339   
340   for (Int_t iTrack=0; iTrack<fESD->GetNumberOfTracks(); iTrack++) { // tracks loop    
341     
342     fEsdTrack=fESD->GetTrack(iTrack);
343     if(!fEsdTrack) continue;
344     
345     if(fEsdTrackCuts && fEsdTrackCuts->AcceptTrack(fEsdTrack) == kTRUE ) fvEsdTrackAccepted = 1;
346     else fvEsdTrackAccepted = 0;
347     
348     
349     if(Equal(fEsdTrack->GetHMPIDsignal(),-20.,ktol)) continue;
350     if(fEsdTrack->GetHMPIDcluIdx() < 0) continue;
351     
352     fvPesd = fEsdTrack->P();
353
354     //fEsdTrack->GetOuterHmpPxPyPz(fvPhmp);     
355     fvPhmpMag = TMath::Sqrt(fvPhmp[0]*fvPhmp[0] +  fvPhmp[1]*fvPhmp[1] + fvPhmp[2]*fvPhmp[2] );
356
357     fvTofSignal = fEsdTrack->GetTOFsignal();
358     
359     fEsdFriendTrack=fESDfriend->GetTrack(iTrack);
360     
361     //___ fill HMP stuff
362     fvHmpChi2 = fEsdTrack -> GetHMPIDchi2();
363     fvHmpCluIndx = fEsdTrack -> GetHMPIDcluIdx();
364     fEsdTrack->GetHMPIDmip(fvHmpMipX,fvHmpMipY,fvHmpMipQ,fvHmpMipNPhots);
365     
366     //oid       GetHMPIDpid(Double_t* p) const
367     fvHmpSignal= fEsdTrack->GetHMPIDsignal();
368     fEsdTrack->GetHMPIDtrk(fvHmpTrkX,fvHmpTrkY,fvHmpTrkTheta, fvHmpTrkPhi);
369     fEsdTrack->GetHMPIDpid(fvHmpPid);  
370     
371     fvKinkIndex = fEsdTrack->GetKinkIndex(0);    
372     
373     fvType = 0;    fTree->Fill();
374     if(fEsdFriendTrack) {
375       for(Int_t j=0;(    fCalibObject=fEsdFriendTrack->GetCalibObject(j));++j){ // calib object loop
376         if((fClu=dynamic_cast<AliHMPIDCluster*>(fCalibObject))){ // if HMPID calib object
377           fvHmpCluQ = fClu->Q();
378           fvHmpCluX = fClu->X();
379           fvHmpCluY = fClu->Y();
380           fvHmpCluCh = fClu->Ch();         
381           fvHmpCluSize = fClu->Size();         
382           fvHmpCluBox = fClu->Box();         
383           fvHmpCluStatus = fClu->Status();
384           
385           fvType = 1;  fTree->Fill();
386           
387         } // if HMPID calib object 
388       } // calib object loop 
389     }//there is fEsdFriendTrack
390     
391     
392     
393   } // tracks loop
394   
395   /* PostData(0) is taken care of by AliAnalysisTaskSE */
396   PostData(1,fHmpHistList);
397   PostData(2,fTree);
398 }
399 //___________________________________________________________________________
400 void AliHMPIDPerformanceTask::Terminate(Option_t*)
401 {
402   // The Terminate() function is the last function to be called during
403   // a query. It always runs on the client, it can be used to present
404   // the results graphically or save the results to file.
405   
406   Info("Terminate"," ");
407   
408   if (!fUseMC) return;
409   
410   fHmpHistList = dynamic_cast<TList*> (GetOutputData(1));
411   
412   if (!fHmpHistList) {
413     AliError("Histogram List is not available");
414     return;
415   }
416   
417   AliAnalysisTaskSE::Terminate();
418   
419 }
420
421 //___________________________________________________________________________
422 void AliHMPIDPerformanceTask::UserCreateOutputObjects() {
423   //
424   //HERE ONE CAN CREATE OUTPUT OBJECTS
425   //TO BE SET BEFORE THE EXECUTION OF THE TASK
426   //
427
428   //slot #1
429 //   OpenFile(1);
430    fHmpHistList = new TList();
431    fHmpHistList->SetOwner();
432
433    fHmpNevents = new TH1F("fHmpNevents","Number of events",2,0,2);
434    fHmpHistList->Add(fHmpNevents);
435
436    fHmpNevPerTrigClass = new TH1I("fHmpNevPerTrigClass","Number of event per trigger class;Trigger class;Events",10,0,10);
437    fHmpNevPerTrigClass->GetXaxis()->SetBinLabel(1,"All coll.");
438    fHmpNevPerTrigClass->GetXaxis()->SetBinLabel(2,"MB");
439    fHmpNevPerTrigClass->GetXaxis()->SetBinLabel(3,"INT7");
440    fHmpNevPerTrigClass->GetXaxis()->SetBinLabel(4,"CINT5");
441    fHmpNevPerTrigClass->GetXaxis()->SetBinLabel(5,"FastOnly");
442    fHmpNevPerTrigClass->GetXaxis()->SetBinLabel(6,"HighMult");
443    fHmpNevPerTrigClass->GetXaxis()->SetBinLabel(7,"AnyINT");
444    fHmpHistList->Add(fHmpNevPerTrigClass);
445  
446    
447  //   OpenFile(2);
448    fTree = new TTree("TreePhot","Tree with photon clusters information");
449    fTree->Branch("fvFiredTriggerClasses",fvFiredTriggerClasses,"fvFiredTriggerClasses/C");
450    fTree->Branch("fvRunNumber",&fvRunNumber,"fvRunNumber/I");
451    fTree->Branch("fvBunchCrossNumber",&fvBunchCrossNumber,"fvBunchCrossNumber/I");
452    fTree->Branch("fvOrbitNumber",&fvOrbitNumber,"fvOrbitNumber/I");
453    fTree->Branch("fvPeriodNumber",&fvPeriodNumber,"fvPeriodNumber/I");
454    fTree->Branch("fvMagField",&fvMagField,"fvMagField/D");
455    fTree->Branch("fvVertexX",&fvVertexX,"fvVertexX/D");
456    fTree->Branch("fvVertexY",&fvVertexY,"fvVertexY/D");
457    fTree->Branch("fvVertexZ",&fvVertexZ,"fvVertexZ/D");
458    fTree->Branch("fvVertexNContributors",&fvVertexNContributors,"fvVertexNContributors/I");
459    fTree->Branch("fvCentrality",&fvCentrality,"fvCentrality/D");
460    fTree->Branch("fvAcceptedTracks",&fvAcceptedTracks,"fvAcceptedTracks/I");
461    fTree->Branch("fvRefMultTpc",&fvRefMultTpc,"fvRefMultTpc/I");
462    fTree->Branch("fvHmpChi2",&fvHmpChi2,"fvHmpChi2/D");
463    fTree->Branch("fvHmpCluIndx",&fvHmpCluIndx,"fvHmpCluIndx/I");
464    fTree->Branch("fvHmpMipX",&fvHmpMipX,"fvHmpMipX/F");
465    fTree->Branch("fvHmpMipY",&fvHmpMipY,"fvHmpMipY/F");
466    fTree->Branch("fvHmpMipQ",&fvHmpMipQ,"fvHmpMipQ/I");
467    fTree->Branch("fvHmpMipNPhots",&fvHmpMipNPhots,"fvHmpMipNPhots/I");
468    fTree->Branch("fvHmpSignal",&fvHmpSignal,"fvHmpSignal/D");
469    fTree->Branch("fvHmpTrkX",&fvHmpTrkX,"fvHmpTrkX/F");
470    fTree->Branch("fvHmpTrkY",&fvHmpTrkY,"fvHmpTrkY/F");
471    fTree->Branch("fvHmpTrkTheta",&fvHmpTrkTheta,"fvHmpTrkTheta/F");
472    fTree->Branch("fvHmpTrkPhi",&fvHmpTrkPhi,"fvHmpTrkPhi/F");
473    fTree->Branch("fvHmpPid",fvHmpPid,"fvHmpPid/D");
474    fTree->Branch("fvType",&fvType,"fvType/I");
475    fTree->Branch("fvHmpCluQ",&fvHmpCluQ,"fvHmpCluQ/D");
476    fTree->Branch("fvHmpCluX",&fvHmpCluX,"fvHmpCluX/D");
477    fTree->Branch("fvHmpCluY",&fvHmpCluY,"fvHmpCluY/D");
478    fTree->Branch("fvHmpCluCh",&fvHmpCluCh,"fvHmpCluCh/I");
479    fTree->Branch("fvHmpCluSize",&fvHmpCluSize,"fvHmpCluSize/I");
480    fTree->Branch("fvHmpCluBox",&fvHmpCluBox,"fvHmpCluBox/I");
481    fTree->Branch("fvHmpCluStatus",&fvHmpCluStatus,"fvHmpCluStatus/I");
482    fTree->Branch("fvEsdTrackAccepted",&fvEsdTrackAccepted,"fvEsdTrackAccepted/I");
483    fTree->Branch("fvKinkIndex",&fvKinkIndex,"fvKinkIndex/I");
484    fTree->Branch("fvTofSignal",&fvTofSignal,"fvTofSignal/D");  
485     
486    PostData(1,fHmpHistList);
487    PostData(2,fTree);
488 }
489 //____________________________________________________________________________________________________________________________________
490 Bool_t AliHMPIDPerformanceTask::Equal(Double_t x, Double_t y, Double_t tolerance)
491 {
492  return abs(x - y) <= tolerance ;
493 }
494 //____________________________________________________________________________________________________________________________________
495    
496 #endif