]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGDQ/dielectron/AliDielectronEventCuts.h
o small fixes and coding violation corrections
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronEventCuts.h
1 #ifndef ALIDIELECTRONEVENTCUTS_H
2 #define ALIDIELECTRONEVENTCUTS_H
3
4 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 //#############################################################
8 //#                                                           # 
9 //#         Class AliDielectronEventCuts                     #
10 //#                                                           #
11 //#  Authors:                                                 #
12 //#   Anton     Andronic, GSI / A.Andronic@gsi.de             #
13 //#   Ionut C.  Arsene,   GSI / I.C.Arsene@gsi.de             #
14 //#   Julian    Book,     Uni Ffm / Julian.Book@cern.ch       #
15 //#   Frederick Kramer,   Uni Ffm, / Frederick.Kramer@cern.ch #
16 //#   Magnus    Mager,    CERN / Magnus.Mager@cern.ch         #
17 //#   WooJin J. Park,     GSI / W.J.Park@gsi.de               #
18 //#   Jens      Wiechula, Uni HD / Jens.Wiechula@cern.ch      #
19 //#                                                           #
20 //#############################################################
21
22 #include <AliAnalysisCuts.h>
23
24 class AliTriggerAnalysis;
25 class AliESDVertex;
26 class AliAODVertex;
27
28 class AliDielectronEventCuts : public AliAnalysisCuts {
29 public:
30   enum EVtxType { kVtxTracks=0, kVtxSPD, kVtxTPC, kVtxAny, kVtxTracksOrSPD };
31   
32   AliDielectronEventCuts();
33   AliDielectronEventCuts(const char*name, const char* title);
34
35   virtual ~AliDielectronEventCuts();
36
37
38   void SetVertexType(EVtxType type)             { fVtxType=type;                }
39   void SetVertexZ(Double_t zmin, Double_t zmax) { fVtxZmin=zmin; fVtxZmax=zmax; }
40   void SetRequireVertex(Bool_t req=kTRUE)       { fRequireVtx=req;              }
41   void SetRequireV0and(UChar_t type=1)          { fRequireV0and=type;           }
42   void SetMinVtxContributors(Int_t min=1)       { fMinVtxContributors=min;      }
43   void SetCutOnMultipicityITSTPC(Bool_t mult=kTRUE) { fMultITSTPC=mult;         }
44   void SetCentralityRange(Double_t min, Double_t max) { fCentMin=min; fCentMax=max; }
45   //
46   //Analysis cuts interface
47   //
48   virtual Bool_t IsSelected(TObject* event);
49   Bool_t IsSelectedESD(TObject* event);
50   Bool_t IsSelectedAOD(TObject* event);
51   virtual Bool_t IsSelected(TList*   /* list */ ) {return kFALSE;}
52   
53
54 private:
55
56   Double_t fVtxZmin;                // minimum z vertex position
57   Double_t fVtxZmax;                // maximum z vertex position
58   Bool_t   fRequireVtx;             // require a vertex
59   Int_t    fMinVtxContributors;     // min number of vertex contributors
60   Bool_t   fMultITSTPC;             // if to cut on the ITS TPC multiplicity correlation (Pb-Pb)
61   Double_t fCentMin;               // minimum multiplity percentile
62   Double_t fCentMax;               // maximum multiplity percentile
63   EVtxType fVtxType;                // vertex type
64
65   UChar_t fRequireV0and;             // use V0and triggered events only
66
67   AliTriggerAnalysis *fTriggerAnalysis; //! trigger analysis class
68   const AliESDVertex *fkVertex;         //! current vertex
69   const AliAODVertex *fkVertexAOD;      //! current vertex AOD
70
71   const AliAODVertex* GetPrimaryVertexTPC(const AliAODEvent *ev);
72
73   AliDielectronEventCuts(const AliDielectronEventCuts &c);
74   AliDielectronEventCuts &operator=(const AliDielectronEventCuts &c);
75
76   
77   ClassDef(AliDielectronEventCuts,1)         // Dielectron EventCuts
78 };
79
80 //______________________________________________________________________________
81 inline const AliAODVertex* GetPrimaryVertexTPC(const AliAODEvent *ev) {
82   // Get TPC primary vertex
83   Int_t nVertices=ev->GetNumberOfVertices();
84   for(Int_t iVert=0; iVert<nVertices; iVert++){
85     AliAODVertex *v=ev->GetVertex(iVert);
86     if(v->GetType()==AliAODVertex::kMainSPD) return v;
87   }
88   return 0;
89 }
90
91 #endif