ROOT logo
#ifndef ALIPERFORMANCEEFF_H
#define ALIPERFORMANCEEFF_H

//------------------------------------------------------------------------------
// Class to keep information from comparison of 
// reconstructed and MC particle tracks (TPC efficiency).   
// 
// Author: J.Otwinowski 04/02/2008 
//------------------------------------------------------------------------------

class TFile;
class TParticle;
class TString;
class TNamed;
class THnSparse;
class AliMCInfo;
class AliESDRecInfo;
class AliESDEvent; 
class AliESDfriend; 
class AliMCEvent; 
class AliESDEvent; 
class AliMCParticle; 
class AliESDtrack;
class AliESD;
class AliRecInfoCuts;
class AliMCInfoCuts;
class AliESDVertex;

#include "AliPerformanceObject.h"

class AliPerformanceEff : public AliPerformanceObject {
public :
  AliPerformanceEff(const Char_t* name="AliPerformanceEff",const Char_t*title="AliPerformanceEff",Int_t analysisMode=0, Bool_t hptGenerator=kFALSE);
  virtual ~AliPerformanceEff();

  // 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;}

  // Create folder for analysed histograms
  TFolder *CreateFolder(TString folder = "folderEff",TString title = "Analysed Efficiency histograms");

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

  // Process events
  void ProcessTPC(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent);
  void ProcessTPCITS(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent);
  void ProcessConstrained(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent);
  void ProcessTPCSec(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent);

  Bool_t IsRecTPC(AliESDtrack *track);
  Bool_t IsRecTPCITS(AliESDtrack *track);
  Bool_t IsRecConstrained(AliESDtrack *track);

  Bool_t IsFindable(const AliMCEvent *mcEvent, Int_t label);
  Int_t TransformToPID(TParticle *particle);

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

  THnSparseF* GetEffHisto() const {return fEffHisto;}
  THnSparseF* GetEffSecHisto() const {return fEffSecHisto;}

private:

  static const Int_t fgkMaxClones = 3, fgkMaxFakes = 3;
  
  // Helper Method
  TH1D* AddHistoEff(Int_t axis, const Char_t *name, const Char_t* vsTitle, const Int_t type, const Int_t secondary = 0);

  // Control histograms
  THnSparseF *fEffHisto; //-> mceta:mcphi:mcpt:pid:isPrim:recStatus:findable:charge
  THnSparseF *fEffSecHisto; //-> mceta:mcphi:mcpt:pid:isPrim:recStatus:findable:mcR:mother_phi:mother_eta:charge

  // 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

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

  ClassDef(AliPerformanceEff,2);
};

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