ROOT logo
#ifndef ALIPERFORMANCEOBJECT_H
#define ALIPERFORMANCEOBJECT_H

//------------------------------------------------------------------------------
// Base class to keep information from comparison of 
// reconstructed and MC particle tracks.   
// 
// Author: J.Otwinowski 04/14/2008 
// Changes by M.Knichel 15/10/2010
//------------------------------------------------------------------------------

#include "TNamed.h"
#include "TFolder.h"
#include "THnSparse.h"

class TTree;
class AliMCEvent;
class AliESDEvent;
class AliRecInfoCuts;
class AliMCInfoCuts;
class AliESDfriend;
class AliESDVertex;

class AliPerformanceObject : public TNamed {
public :
  AliPerformanceObject(); 
  AliPerformanceObject(const char* name="AliPerformanceObject", const char* title="AliPerformanceObject", Int_t run=-1, Bool_t highMult=kFALSE); 
  virtual ~AliPerformanceObject();

  // Init data members
  // call once before event loop
  virtual void Init() = 0;
  
  // init for high multiplicity (PbPb) 
  // to be called instead of Init()
  virtual void InitHighMult();
  
  // Execute analysis
  // call in the event loop 
  virtual void Exec(AliMCEvent* const infoMC=0, AliESDEvent* const infoRC=0, AliESDfriend* const infoFriend=0, const Bool_t bUseMC=kFALSE, const Bool_t bUseESDfriend=kFALSE) = 0;

  // Merge output objects (needed by PROOF) 
  virtual Long64_t Merge(TCollection* const list=0) = 0;

  // project to 1d,2d,3d
  // is called from FinishTaskOuput() in AliPerformanceTask
  virtual void Analyse() = 0;

  // Get output folder for analysed histograms
  virtual TFolder* GetAnalysisFolder() const = 0;
  
  // create a summary stored in a ttree 
  // has to be implented
  virtual TTree* CreateSummary() { return 0; }
  
  // project to 1d,2d,3d
  // is called from Terminate() in AliPerformanceTask
  // final spectra calculation
  virtual void AnalyseFinal() { ; }

  // 
  virtual void SetAliRecInfoCuts(AliRecInfoCuts* const cuts=0) = 0;
  virtual void SetAliMCInfoCuts(AliMCInfoCuts* const cuts=0) = 0; 

  // set and get analysisMode
  void SetAnalysisMode(const Int_t analysisMode=0) {fAnalysisMode = analysisMode;} 
  Int_t GetAnalysisMode() const {return fAnalysisMode;}

  // set and get hpt generator 
  void SetHptGenerator(const Bool_t hptGenerator=kFALSE) {fHptGenerator = hptGenerator;}
  Bool_t IsHptGenerator() const {return fHptGenerator;}

  // draw all histograms from the folder
  void PrintHisto(Bool_t logz = kTRUE, const Char_t * outFileName = "PerformanceQAHisto.ps"); 

  // create log axis 
  Double_t *CreateLogAxis(Int_t nbins, Double_t xmin, Double_t xmax); 

  // trigger class selection
  void SetTriggerClass(const Char_t *triggerClass) { fTriggerClass = triggerClass; }
  const Char_t* GetTriggerClass() const { return fTriggerClass; }

  // use track vertex
  void SetUseTrackVertex(Bool_t trackVtx = kTRUE) { fUseTrackVertex = trackVtx; }
  Bool_t IsUseTrackVertex() { return fUseTrackVertex; }
  
  Bool_t IsHighMultiplicity() { return fHighMultiplicity; }  
  
  // merging of thnsparse
  Bool_t GetMergeTHnSparseObj() { return fMergeTHnSparseObj; }
  void SetMergeTHnSparseObj(Bool_t merge) {fMergeTHnSparseObj = merge; }  
  
  void SetRunNumber(Int_t run) { fRunNumber = run; }
  Int_t GetRunNumber() const { return fRunNumber; }

  // use kink daughters
  void SetUseKinkDaughters(Bool_t kinkDaughters = kTRUE) { fUseKinkDaughters = kinkDaughters; }
  Bool_t IsUseKinkDaughters() { return fUseKinkDaughters; }

  // Centrality bin to be used
  void  SetUseCentralityBin(Int_t bin) { fUseCentralityBin = bin; }
  Int_t GetUseCentralityBin()          { return fUseCentralityBin; }

  // use tof bunch crossing
  void SetUseTOFBunchCrossing(Bool_t tofBunching = kTRUE) { fUseTOFBunchCrossing = tofBunching; }
  Bool_t IsUseTOFBunchCrossing() { return fUseTOFBunchCrossing; }

protected: 

  void AddProjection(TObjArray* aFolderObj, TString nameSparse, THnSparse *hSparse, Int_t xDim, TString* selString = 0);
  void AddProjection(TObjArray* aFolderObj, TString nameSparse, THnSparse *hSparse, Int_t xDim, Int_t yDim, TString* selString = 0);
  void AddProjection(TObjArray* aFolderObj, TString nameSparse, THnSparse *hSparse, Int_t xDim, Int_t yDim, Int_t zDim, TString* selString = 0);

  // merge THnSparse
  Bool_t fMergeTHnSparseObj;
  
  // analysis mode
  Int_t fAnalysisMode;  // 0-TPC, 1-TPCITS, 2-Constrained, 3-TPC inner wall, 4-TPC outer wall

  Int_t fRunNumber;

  // hpt generator
  Bool_t fHptGenerator; // hpt event generator

  // trigger class
  const Char_t * fTriggerClass;

  // use track vertex
  Bool_t fUseTrackVertex; // use track vertex
  
  // PbPb mode?
  Bool_t fHighMultiplicity; // flag to switch between pp and PbPb  

  Bool_t fUseKinkDaughters; // use kink daughthers, default is yes

  Int_t  fUseCentralityBin;  // centrality bin to be used 

  Bool_t fUseTOFBunchCrossing; // use TOFBunchCrossing, default is yes

  AliPerformanceObject(const AliPerformanceObject&); // not implemented
  AliPerformanceObject& operator=(const AliPerformanceObject&); // not implemented

  ClassDef(AliPerformanceObject,7);
};

#endif
 AliPerformanceObject.h:1
 AliPerformanceObject.h:2
 AliPerformanceObject.h:3
 AliPerformanceObject.h:4
 AliPerformanceObject.h:5
 AliPerformanceObject.h:6
 AliPerformanceObject.h:7
 AliPerformanceObject.h:8
 AliPerformanceObject.h:9
 AliPerformanceObject.h:10
 AliPerformanceObject.h:11
 AliPerformanceObject.h:12
 AliPerformanceObject.h:13
 AliPerformanceObject.h:14
 AliPerformanceObject.h:15
 AliPerformanceObject.h:16
 AliPerformanceObject.h:17
 AliPerformanceObject.h:18
 AliPerformanceObject.h:19
 AliPerformanceObject.h:20
 AliPerformanceObject.h:21
 AliPerformanceObject.h:22
 AliPerformanceObject.h:23
 AliPerformanceObject.h:24
 AliPerformanceObject.h:25
 AliPerformanceObject.h:26
 AliPerformanceObject.h:27
 AliPerformanceObject.h:28
 AliPerformanceObject.h:29
 AliPerformanceObject.h:30
 AliPerformanceObject.h:31
 AliPerformanceObject.h:32
 AliPerformanceObject.h:33
 AliPerformanceObject.h:34
 AliPerformanceObject.h:35
 AliPerformanceObject.h:36
 AliPerformanceObject.h:37
 AliPerformanceObject.h:38
 AliPerformanceObject.h:39
 AliPerformanceObject.h:40
 AliPerformanceObject.h:41
 AliPerformanceObject.h:42
 AliPerformanceObject.h:43
 AliPerformanceObject.h:44
 AliPerformanceObject.h:45
 AliPerformanceObject.h:46
 AliPerformanceObject.h:47
 AliPerformanceObject.h:48
 AliPerformanceObject.h:49
 AliPerformanceObject.h:50
 AliPerformanceObject.h:51
 AliPerformanceObject.h:52
 AliPerformanceObject.h:53
 AliPerformanceObject.h:54
 AliPerformanceObject.h:55
 AliPerformanceObject.h:56
 AliPerformanceObject.h:57
 AliPerformanceObject.h:58
 AliPerformanceObject.h:59
 AliPerformanceObject.h:60
 AliPerformanceObject.h:61
 AliPerformanceObject.h:62
 AliPerformanceObject.h:63
 AliPerformanceObject.h:64
 AliPerformanceObject.h:65
 AliPerformanceObject.h:66
 AliPerformanceObject.h:67
 AliPerformanceObject.h:68
 AliPerformanceObject.h:69
 AliPerformanceObject.h:70
 AliPerformanceObject.h:71
 AliPerformanceObject.h:72
 AliPerformanceObject.h:73
 AliPerformanceObject.h:74
 AliPerformanceObject.h:75
 AliPerformanceObject.h:76
 AliPerformanceObject.h:77
 AliPerformanceObject.h:78
 AliPerformanceObject.h:79
 AliPerformanceObject.h:80
 AliPerformanceObject.h:81
 AliPerformanceObject.h:82
 AliPerformanceObject.h:83
 AliPerformanceObject.h:84
 AliPerformanceObject.h:85
 AliPerformanceObject.h:86
 AliPerformanceObject.h:87
 AliPerformanceObject.h:88
 AliPerformanceObject.h:89
 AliPerformanceObject.h:90
 AliPerformanceObject.h:91
 AliPerformanceObject.h:92
 AliPerformanceObject.h:93
 AliPerformanceObject.h:94
 AliPerformanceObject.h:95
 AliPerformanceObject.h:96
 AliPerformanceObject.h:97
 AliPerformanceObject.h:98
 AliPerformanceObject.h:99
 AliPerformanceObject.h:100
 AliPerformanceObject.h:101
 AliPerformanceObject.h:102
 AliPerformanceObject.h:103
 AliPerformanceObject.h:104
 AliPerformanceObject.h:105
 AliPerformanceObject.h:106
 AliPerformanceObject.h:107
 AliPerformanceObject.h:108
 AliPerformanceObject.h:109
 AliPerformanceObject.h:110
 AliPerformanceObject.h:111
 AliPerformanceObject.h:112
 AliPerformanceObject.h:113
 AliPerformanceObject.h:114
 AliPerformanceObject.h:115
 AliPerformanceObject.h:116
 AliPerformanceObject.h:117
 AliPerformanceObject.h:118
 AliPerformanceObject.h:119
 AliPerformanceObject.h:120
 AliPerformanceObject.h:121
 AliPerformanceObject.h:122
 AliPerformanceObject.h:123
 AliPerformanceObject.h:124
 AliPerformanceObject.h:125
 AliPerformanceObject.h:126
 AliPerformanceObject.h:127
 AliPerformanceObject.h:128
 AliPerformanceObject.h:129
 AliPerformanceObject.h:130
 AliPerformanceObject.h:131
 AliPerformanceObject.h:132
 AliPerformanceObject.h:133
 AliPerformanceObject.h:134
 AliPerformanceObject.h:135
 AliPerformanceObject.h:136
 AliPerformanceObject.h:137
 AliPerformanceObject.h:138
 AliPerformanceObject.h:139
 AliPerformanceObject.h:140
 AliPerformanceObject.h:141
 AliPerformanceObject.h:142
 AliPerformanceObject.h:143
 AliPerformanceObject.h:144
 AliPerformanceObject.h:145
 AliPerformanceObject.h:146