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
5 #ifndef ALIANALYSISTASKFIRSTPHYSICS_H
6 #define ALIANALYSISTASKFIRSTPHYSICS_H
11 class AliESDtrackCuts;
14 #include "AliAnalysisTaskSE.h"
15 #include "AliTriggerAnalysis.h"
19 class AliAnalysisTaskFirstPhysics : public AliAnalysisTaskSE {
21 // indexing various track cuts
29 knTrackCuts}; // this must always the last
31 // recognised MC process types
33 kProcSD1, // single diffractive AB->XB
34 kProcSD2, // single diffractive AB->AX
35 kProcDD, // double diffractive
37 kProcCD, // central diffractive
38 kProcND, // non-diffractive
41 AliAnalysisTaskFirstPhysics(const char *name = "You should have given a name to this analysis");
42 virtual ~AliAnalysisTaskFirstPhysics();
44 virtual void UserCreateOutputObjects();
45 virtual void UserExec(Option_t *option);
46 virtual void Terminate(Option_t *);
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;}
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
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
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; //!
78 // simplest cut parameters
79 Double_t fCutTrackPtMin;
80 Double_t fCutTrackPtMax;
84 AliAnalysisTaskFirstPhysics(const AliAnalysisTaskFirstPhysics&); // not implemented
85 AliAnalysisTaskFirstPhysics& operator=(const AliAnalysisTaskFirstPhysics&); // not implemented
87 ClassDef(AliAnalysisTaskFirstPhysics, 1);