ROOT logo
#ifndef ALIPERFORMANCETPC_H
#define ALIPERFORMANCETPC_H

//------------------------------------------------------------------------------
// Class to keep information from comparison of 
// reconstructed and MC particle tracks (TPC resolution).   
// 
// Author: J.Otwinowski 04/02/2008 
// Changes by M.Knichel 15/10/2010
//------------------------------------------------------------------------------

class TString;
class TNamed;
class TCanvas;
class TH1;
class TH2;
class TH3;

class AliESDVertex;
class AliESDtrack;
class AliMCEvent;
class AliStack;
class AliESDEvent; 
class AliESDfriend; 
class AliMCInfoCuts;
class AliRecInfoCuts;

#include "THnSparse.h"
#include "AliPerformanceObject.h"

class AliPerformanceTPC : public AliPerformanceObject {
public :
  //AliPerformanceTPC(); 
  AliPerformanceTPC(const Char_t* name="AliPerformanceTPC", const Char_t* title="AliPerformanceTPC",Int_t analysisMode=0,Bool_t hptGenerator=kFALSE, Int_t run=-1, Bool_t highMult = kFALSE);

  virtual ~AliPerformanceTPC();

  // Init data members
  virtual void  Init();

  // Execute analysis
  virtual void  Exec(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent, AliESDfriend *const esdFriend, const Bool_t bUseMC, const Bool_t bUseESDfriend);
  // Merge output objects (needed by PROOF) 
  virtual Long64_t Merge(TCollection* const list);

  // Analyse output histograms
  virtual void Analyse();

  // Get analysis folder
  virtual TFolder* GetAnalysisFolder() const {return fAnalysisFolder;}
  
  // produce summary
  virtual TTree* CreateSummary();

  // Process events
  void ProcessConstrained(AliStack* const stack, AliESDtrack *const esdTrack, AliESDEvent *const esdEvent);
  void ProcessTPC(AliStack* const stack, AliESDtrack *const esdTrack, AliESDEvent *const esdEvent, Bool_t vertStatus);
  void ProcessTPCITS(AliStack* const stack, AliESDtrack *const esdTrack, AliESDEvent *const esdEvent, Bool_t vertStatus);

  // Create folder for analysed histograms
  TFolder *CreateFolder(TString folder = "folderTPC",TString title = "Analysed TPC performance histograms");

  // Export objects to folder
  TFolder *ExportToFolder(TObjArray * array=0);

  // Selection cuts
  void SetAliRecInfoCuts(AliRecInfoCuts* const cuts=0) {fCutsRC = cuts;}   
  void SetAliMCInfoCuts(AliMCInfoCuts* const cuts=0) {fCutsMC = cuts;}  
   
  AliRecInfoCuts*  GetAliRecInfoCuts() const {return fCutsRC;}
  AliMCInfoCuts*   GetAliMCInfoCuts()  const {return fCutsMC;}

  // getters
  //
  THnSparse *GetTPCClustHisto() const  { return fTPCClustHisto; }
  THnSparse *GetTPCEventHisto() const  { return fTPCEventHisto; }
  THnSparse *GetTPCTrackHisto() const  { return fTPCTrackHisto; }
  
  TObjArray* GetHistos() const { return fFolderObj; }
  
  static Bool_t GetMergeTHnSparse() { return fgMergeTHnSparse; }
  static void SetMergeTHnSparse(Bool_t mergeTHnSparse) {fgUseMergeTHnSparse = kTRUE; fgMergeTHnSparse = mergeTHnSparse; }
  
  void SetUseHLT(Bool_t useHLT = kTRUE) {fUseHLT = useHLT;}
  Bool_t GetUseHLT() { return fUseHLT; }


private:

  static Bool_t fgMergeTHnSparse;
  static Bool_t fgUseMergeTHnSparse;  

  // TPC histogram
  THnSparseF *fTPCClustHisto; //-> padRow:phi:TPCside
  THnSparseF *fTPCEventHisto;  //-> Xv:Yv:Zv:mult:multP:multN:vertStatus
  THnSparseF *fTPCTrackHisto;  //-> nClust:chi2PerClust:nClust/nFindableClust:DCAr:DCAz:eta:phi:pt:charge:vertStatus
  TObjArray* fFolderObj; // array of analysed histograms

  // Global cuts objects
  AliRecInfoCuts* fCutsRC;  // selection cuts for reconstructed tracks
  AliMCInfoCuts*  fCutsMC;  // selection cuts for MC tracks

  // analysis folder 
  TFolder *fAnalysisFolder; // folder for analysed histograms

  Bool_t fUseHLT; // use HLT ESD

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

  ClassDef(AliPerformanceTPC,11);
};

#endif
 AliPerformanceTPC.h:1
 AliPerformanceTPC.h:2
 AliPerformanceTPC.h:3
 AliPerformanceTPC.h:4
 AliPerformanceTPC.h:5
 AliPerformanceTPC.h:6
 AliPerformanceTPC.h:7
 AliPerformanceTPC.h:8
 AliPerformanceTPC.h:9
 AliPerformanceTPC.h:10
 AliPerformanceTPC.h:11
 AliPerformanceTPC.h:12
 AliPerformanceTPC.h:13
 AliPerformanceTPC.h:14
 AliPerformanceTPC.h:15
 AliPerformanceTPC.h:16
 AliPerformanceTPC.h:17
 AliPerformanceTPC.h:18
 AliPerformanceTPC.h:19
 AliPerformanceTPC.h:20
 AliPerformanceTPC.h:21
 AliPerformanceTPC.h:22
 AliPerformanceTPC.h:23
 AliPerformanceTPC.h:24
 AliPerformanceTPC.h:25
 AliPerformanceTPC.h:26
 AliPerformanceTPC.h:27
 AliPerformanceTPC.h:28
 AliPerformanceTPC.h:29
 AliPerformanceTPC.h:30
 AliPerformanceTPC.h:31
 AliPerformanceTPC.h:32
 AliPerformanceTPC.h:33
 AliPerformanceTPC.h:34
 AliPerformanceTPC.h:35
 AliPerformanceTPC.h:36
 AliPerformanceTPC.h:37
 AliPerformanceTPC.h:38
 AliPerformanceTPC.h:39
 AliPerformanceTPC.h:40
 AliPerformanceTPC.h:41
 AliPerformanceTPC.h:42
 AliPerformanceTPC.h:43
 AliPerformanceTPC.h:44
 AliPerformanceTPC.h:45
 AliPerformanceTPC.h:46
 AliPerformanceTPC.h:47
 AliPerformanceTPC.h:48
 AliPerformanceTPC.h:49
 AliPerformanceTPC.h:50
 AliPerformanceTPC.h:51
 AliPerformanceTPC.h:52
 AliPerformanceTPC.h:53
 AliPerformanceTPC.h:54
 AliPerformanceTPC.h:55
 AliPerformanceTPC.h:56
 AliPerformanceTPC.h:57
 AliPerformanceTPC.h:58
 AliPerformanceTPC.h:59
 AliPerformanceTPC.h:60
 AliPerformanceTPC.h:61
 AliPerformanceTPC.h:62
 AliPerformanceTPC.h:63
 AliPerformanceTPC.h:64
 AliPerformanceTPC.h:65
 AliPerformanceTPC.h:66
 AliPerformanceTPC.h:67
 AliPerformanceTPC.h:68
 AliPerformanceTPC.h:69
 AliPerformanceTPC.h:70
 AliPerformanceTPC.h:71
 AliPerformanceTPC.h:72
 AliPerformanceTPC.h:73
 AliPerformanceTPC.h:74
 AliPerformanceTPC.h:75
 AliPerformanceTPC.h:76
 AliPerformanceTPC.h:77
 AliPerformanceTPC.h:78
 AliPerformanceTPC.h:79
 AliPerformanceTPC.h:80
 AliPerformanceTPC.h:81
 AliPerformanceTPC.h:82
 AliPerformanceTPC.h:83
 AliPerformanceTPC.h:84
 AliPerformanceTPC.h:85
 AliPerformanceTPC.h:86
 AliPerformanceTPC.h:87
 AliPerformanceTPC.h:88
 AliPerformanceTPC.h:89
 AliPerformanceTPC.h:90
 AliPerformanceTPC.h:91
 AliPerformanceTPC.h:92
 AliPerformanceTPC.h:93
 AliPerformanceTPC.h:94
 AliPerformanceTPC.h:95
 AliPerformanceTPC.h:96
 AliPerformanceTPC.h:97
 AliPerformanceTPC.h:98
 AliPerformanceTPC.h:99
 AliPerformanceTPC.h:100
 AliPerformanceTPC.h:101
 AliPerformanceTPC.h:102
 AliPerformanceTPC.h:103
 AliPerformanceTPC.h:104
 AliPerformanceTPC.h:105
 AliPerformanceTPC.h:106
 AliPerformanceTPC.h:107
 AliPerformanceTPC.h:108
 AliPerformanceTPC.h:109
 AliPerformanceTPC.h:110
 AliPerformanceTPC.h:111
 AliPerformanceTPC.h:112
 AliPerformanceTPC.h:113
 AliPerformanceTPC.h:114