Added possibility to do cut on TPCnSigma and rapidity in the task.
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TPCTOF / AliAnalysisCombinedHadronSpectra.h
1 #ifndef ALIANALYSISTASKCHARGEDHADRONSPECTRA_H
2 #define ALIANALYSISTASKCHARGEDHADRONSPECTRA_H
3
4 //////////////////////////////////////////////////////////////////////////////
5 //                                                                          //
6 // This analysis extracts pT-spectra of charged kaons, protons, and pions.  //
7 // It is based on particles identifation via the dE/dx signal of the TPC.   //
8 //                                                                          //
9 //////////////////////////////////////////////////////////////////////////////
10
11 class TH1;
12 class TH1F;
13 class TH2D;
14 class TH3D;
15 class TList;
16 class TObjArray;
17 class AliESDEvent;
18 class AliESDtrack;
19 class AliESDtrackCuts;
20 class AliHeader;
21 class AliESDpid;
22
23
24 #include "AliAnalysisTaskSE.h"
25 #include "THnSparse.h"
26
27 class AliAnalysisCombinedHadronSpectra : public AliAnalysisTaskSE {
28  public:
29   AliAnalysisCombinedHadronSpectra(const char *name);
30   AliAnalysisCombinedHadronSpectra();
31   virtual ~AliAnalysisCombinedHadronSpectra() {}
32   //
33   virtual void   UserCreateOutputObjects();
34   virtual void   UserExec(Option_t *option);
35   virtual void   Terminate(Option_t *);
36   //
37   Bool_t         SelectOnImpPar(AliESDtrack* t);
38   //
39   void           SetESDtrackCuts(AliESDtrackCuts * trackCuts){fESDtrackCuts = trackCuts;};
40   void           SetAlephParameters(const Double_t * parameters){for(Int_t j=0;j<5;j++) fAlephParameters[j] = parameters[j]; Initialize();};
41   void           SetIsMCtrue(Bool_t isMCdata = kTRUE){fMCtrue = isMCdata;};
42   void           SetUseHBTmultiplicity(Bool_t useHBTmultiplicity = kTRUE){fUseHBTmultiplicity = useHBTmultiplicity;};
43   void           SetUseTPConlyTracks(Bool_t useTPConlyTracks = kTRUE){fUseTPConlyTracks = useTPConlyTracks;};
44   void           SetSaveMotherPDG(Bool_t saveMotherPDG =kTRUE){fSaveMotherPDG = saveMotherPDG;};
45   void           SetSmallTHnSparse(Bool_t smallTHnSparse = kFALSE) {fSmallTHnSparse = smallTHnSparse;};
46   void           SetTPCnSigmaCuts(Double_t nSigmaTPCLow = -3., Double_t nSigmaTPCHigh = 3.){fTPCnSigmaCutLow = nSigmaTPCLow; fTPCnSigmaCutHigh = nSigmaTPCHigh;};
47   void           SetRapidityCuts(Double_t rapidityLow = -0.2, Double_t rapidityHigh = 0.2){fRapidityCutLow = rapidityLow; fRapidityCutHigh = rapidityHigh;};
48   void           Initialize();
49   //
50   
51  private:
52   //
53   void  BinLogAxis(const TH1 *h);
54   Int_t GetPythiaEventProcessType(const AliHeader* aHeader, const Bool_t adebug = kFALSE) const;
55   //
56   AliESDEvent *fESD;                   //! ESD object
57   TList       *fListHist;              //! list for histograms
58   //
59   AliESDtrackCuts * fESDtrackCuts;     // basic cut variables
60   AliESDtrackCuts * fESDTrackCutsMult; // cuts for the MULTIPLICITY DETERMINATION
61   AliESDpid       * fESDpid;           // basic TPC object for n-sigma cuts
62   Bool_t        fMCtrue;               // flag if real data or MC is processed
63   Bool_t        fOnlyQA;               // flag if only QA histograms should be filled
64   Bool_t        fUseHBTmultiplicity;   // flag if multiplicity determination should be done as in the HBT paper
65   Bool_t        fUseTPConlyTracks;     // flag if TPConly-track should be used
66   Bool_t        fSaveMotherPDG;        // flag if PDG of mother should be saved (weak decays)
67   Bool_t        fSmallTHnSparse;       // flag if to do cuts on TPC n-sigma and rapidity in task or not
68   Double_t      fTPCnSigmaCutLow;      // low border for TPC n-sigma cut
69   Double_t      fTPCnSigmaCutHigh;     // high border for TPC n-sigma cut
70   Double_t      fRapidityCutLow;       // low border for rapidity cut
71   Double_t      fRapidityCutHigh;      // high border for rapidity cut
72   Double_t      fAlephParameters[5];   // Aleph Parameters for Bethe-Bloch
73
74   //
75   //
76   //
77   THnSparseF * fHistRealTracks;        //! histogram with all necessary information for real tracks
78   THnSparseF * fHistMCparticles;       //! histogram with all necessary information for MC particles
79   //
80   TH3D       * fHistPidQA;             //! histogram for the QA of the PID
81   TH2D       * fHistMult;              //! control histogram for multiplicity
82   TH1D       * fHistCentrality;        //! control histogram for centrality
83   //
84   AliAnalysisCombinedHadronSpectra(const AliAnalysisCombinedHadronSpectra&); 
85   AliAnalysisCombinedHadronSpectra& operator=(const AliAnalysisCombinedHadronSpectra&); 
86
87   ClassDef(AliAnalysisCombinedHadronSpectra, 1); 
88 };
89
90 #endif