]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGUD/FirstPhysics/AliAnalysisTaskFirstPhysics.h
Transition PWG0 -> PWGUD
[u/mrichter/AliRoot.git] / PWGUD / FirstPhysics / AliAnalysisTaskFirstPhysics.h
1 // This class contains common elements for the analysis in the First Physics Group.
2 // based on the code by Arvinder Palaha
3 // written by Andras Agocs and Anton Alkin
4
5 #ifndef ALIANALYSISTASKFIRSTPHYSICS_H
6 #define ALIANALYSISTASKFIRSTPHYSICS_H
7
8 class TH1D;
9 class TH2D;
10 class TList;
11 class AliESDtrackCuts;
12 class AliESDEvent;
13
14 #include "AliAnalysisTaskSE.h"
15 #include "AliTriggerAnalysis.h"
16
17 #include <string>
18
19 class AliAnalysisTaskFirstPhysics : public AliAnalysisTaskSE {
20  public:
21   // indexing various track cuts
22   enum {
23     kTrackCutQGlo,
24     kTrackCutQITS,
25     kTrackCutDCAwSPD,
26     kTrackCutDCAwoSPD,
27     kTrackCutNoSPD,
28     kTrackCutTPConly,
29     knTrackCuts}; // this must always the last
30
31   // recognised MC process types
32   enum ProcessType {
33     kProcSD1, // single diffractive AB->XB
34     kProcSD2, // single diffractive AB->AX
35     kProcDD, // double diffractive
36     kProcEL, // elastic
37     kProcCD, // central diffractive
38     kProcND, // non-diffractive
39     kProcIndef};
40
41   AliAnalysisTaskFirstPhysics(const char *name = "You should have given a name to this analysis");
42   virtual ~AliAnalysisTaskFirstPhysics();
43
44   virtual void UserCreateOutputObjects();
45   virtual void UserExec(Option_t *option);
46   virtual void Terminate(Option_t *);
47
48   void SetCutTrackPt(Double_t min, Double_t max) {fCutTrackPtMin = min; fCutTrackPtMax = max;}
49   Double_t GetCutTrackPtMin() const {return fCutTrackPtMin;}
50   Double_t GetCutTrackPtMax() const {return fCutTrackPtMax;}
51   void SetCutEta(Double_t x) {fCutEta = x;}
52   Double_t GetCutEta() const {return fCutEta;}
53   void SetCutVertexZ(Double_t x) {fCutVertexZ = x;}
54   Double_t GetCutVertexZ() const {return fCutVertexZ;}
55
56  protected:
57   void PrepareOutputList(); // create fOutput
58   void PrepareDefaultTrackCuts(); // create cut objects
59   bool PrepareMCInfo(); // check whether MC info is available and read process type
60   bool GetESDEvent(); // sets fESD to the current ESD
61   bool CheckVertex(); // checks for an appropriate vertex
62   bool CheckVertexMC(); // checks for an appropriate vertex in the MC truth
63
64   TH1D* UserHisto1d(const char *name, const char *title, const char *xlabel, Int_t nbinsx, Double_t xlow, Double_t xup);
65   TH2D* UserHisto2d(const char *name, const char *title, const char *xlabel, Int_t nbinsx, Double_t xlow, Double_t xup, const char *ylabel, Int_t nbinsy, Double_t ylow, Double_t yup);
66   bool GetHisto1FromOutput(const char *name, TH1D *&h) const; // read a histogram from fOutput; use this in Terminate()
67   bool GetHisto2FromOutput(const char *name, TH2D *&h) const; // read a 2d histogram from fOutput
68
69   AliESDEvent *fESD; //! the ESD information of the event
70   AliMCEvent *fMCEvent; //! the MC information is available
71   TList *fOutput; // Output list
72   bool fbReadMC; //! indicates if MC information could be read; see PrepareMCInfo()
73   ProcessType fMCProcessType; //! indicates the process type used in MC
74   AliESDtrackCuts *fTrackCuts[knTrackCuts]; // Track cuts
75   AliTriggerAnalysis* fTrigger; //!
76
77  private:
78   // simplest cut parameters
79   Double_t fCutTrackPtMin;
80   Double_t fCutTrackPtMax;
81   Double_t fCutEta;
82   Double_t fCutVertexZ;
83
84   AliAnalysisTaskFirstPhysics(const AliAnalysisTaskFirstPhysics&); // not implemented
85   AliAnalysisTaskFirstPhysics& operator=(const AliAnalysisTaskFirstPhysics&); // not implemented
86
87   ClassDef(AliAnalysisTaskFirstPhysics, 1);
88 };
89
90 #endif
91