]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/muon/AliESDMuonTrackCuts.h
adding new sample component for RAW data analysis
[u/mrichter/AliRoot.git] / PWG3 / muon / AliESDMuonTrackCuts.h
1 //
2 //  Class for handling of ESD Muon track cuts 
3 //  (based on ANALYSIS/AliESDtrackCuts).
4 //
5 //  The class manages some kinematic cuts. Two methods
6 //  can be used to figure out if an ESD Muon track survives the cuts:
7 //  AcceptTrack which takes a single AliESDMuonTrack as argument and
8 //  returns kTRUE/kFALSE or GetAcceptedTracks which takes an AliESD
9 //  object and returns an TObjArray (of AliESDMuonTracks) with the tracks
10 //  in the ESD that survived the cuts.
11 //
12
13 #ifndef ALIESDMUONTRACKCUTS_H
14 #define ALIESDMUONTRACKCUTS_H
15
16 #include <TF1.h>
17 #include <TH2.h>
18 #include "AliAnalysisCuts.h"
19
20 class AliESD;
21 class AliESDEvent;
22 class AliESDMuonTrack;
23 class AliLog;
24 class TTree;
25
26 class AliESDMuonTrackCuts : public AliAnalysisCuts
27 {
28 public:
29   AliESDMuonTrackCuts(const Char_t* name = "AliESDMuonTrackCuts", const Char_t* title = "");
30   virtual ~AliESDMuonTrackCuts();
31   Bool_t IsSelected(TObject* obj)
32        {return AcceptTrack((AliESDMuonTrack*)obj);}
33   Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
34   Bool_t AcceptTrack(AliESDMuonTrack* esdMuTrack);
35   TObjArray* GetAcceptedTracks(AliESD* esd);
36   Int_t CountAcceptedTracks(AliESD* esd);
37   TObjArray* GetAcceptedTracks(AliESDEvent* esd);
38   Int_t CountAcceptedTracks(AliESDEvent* esd);
39
40   virtual Long64_t Merge(TCollection* list);
41   virtual void Copy(TObject &c) const;
42   AliESDMuonTrackCuts(const AliESDMuonTrackCuts& pd);  // Copy Constructor
43   AliESDMuonTrackCuts &operator=(const AliESDMuonTrackCuts &c);
44
45   //######################################################
46
47   // track kinematic cut setters
48   void SetPRange(Float_t r1=0, Float_t r2=1e10)       {fPMin=r1;   fPMax=r2;}
49   void SetPtRange(Float_t r1=0, Float_t r2=1e10)      {fPtMin=r1;  fPtMax=r2;}
50   void SetPxRange(Float_t r1=-1e10, Float_t r2=1e10)  {fPxMin=r1;  fPxMax=r2;}
51   void SetPyRange(Float_t r1=-1e10, Float_t r2=1e10)  {fPyMin=r1;  fPyMax=r2;}
52   void SetPzRange(Float_t r1=-1e10, Float_t r2=1e10)  {fPzMin=r1;  fPzMax=r2;}
53   void SetEtaRange(Float_t r1=-1e10, Float_t r2=1e10) {fEtaMin=r1; fEtaMax=r2;}
54   void SetRapRange(Float_t r1=-1e10, Float_t r2=1e10) {fRapMin=r1; fRapMax=r2;}
55
56   //######################################################
57   
58   void SetHistogramsOn(Bool_t b=kFALSE) {fHistogramsOn = b;}
59   void DefineHistograms(Int_t color=1);
60   virtual Bool_t LoadHistograms(const Char_t* dir = 0);
61   void SaveHistograms(const Char_t* dir = 0);
62   void DrawHistograms();
63
64   static void EnableNeededBranches(TTree* tree);
65
66 protected:
67   void Init(); // sets everything to 0
68
69   enum { kNCuts = 7 };
70
71   //######################################################
72   static const Char_t* fgkCutNames[kNCuts]; //! names of cuts (for internal use)
73
74   // esd kinematics cuts
75   Float_t fPMin,   fPMax;             // definition of the range of the P
76   Float_t fPtMin,  fPtMax;            // definition of the range of the Pt
77   Float_t fPxMin,  fPxMax;            // definition of the range of the Px
78   Float_t fPyMin,  fPyMax;            // definition of the range of the Py
79   Float_t fPzMin,  fPzMax;            // definition of the range of the Pz
80   Float_t fEtaMin, fEtaMax;           // definition of the range of the eta
81   Float_t fRapMin, fRapMax;           // definition of the range of the y
82
83   //######################################################
84   // diagnostics histograms
85   Bool_t fHistogramsOn;               // histograms on/off
86   
87   TH1F* fhPt[2];                      //-> pt of esd tracks
88   TH1F* fhEta[2];                     //-> eta of esd tracks
89
90   TH1F*  fhCutStatistics;             //-> statistics of what cuts the tracks did not survive
91   TH2F*  fhCutCorrelation;            //-> 2d statistics plot
92
93   ClassDef(AliESDMuonTrackCuts, 1)
94 };
95
96
97 #endif