Fix for coverity (AdC)
[u/mrichter/AliRoot.git] / PWGPP / AliFilteredTreeEventCuts.h
CommitLineData
a65a7e70 1#ifndef ALIFILTEREDTREEEVENTCUTS_H
2#define ALIFILTEREDTREEEVENTCUTS_H
3
4//------------------------------------------------------------------------------
5// Class to keep event selection cuts for dNdPt analysis.
6//
7// Author: J.Otwinowski 01/11/2008
8//------------------------------------------------------------------------------
9
10#include "AliAnalysisCuts.h"
11
12class AliESDEvent;
13class AliESDVertex;
14class AliMCEvent;
15class AliHeader;
16class AliGenEventHeader;
17class AliStack;
18
19class AliFilteredTreeEventCuts : public AliAnalysisCuts
20{
21public:
22 AliFilteredTreeEventCuts(const Char_t* name ="AliFilteredTreeEventCuts", const Char_t *title ="");
23 virtual ~AliFilteredTreeEventCuts();
24
25 //TODO: copied from AliPWG0Helper, find a more central place for these
26 enum AnalysisMode { kInvalid = -1, kSPD = 0x1, kTPC = 0x2, kTPCITS = 0x4, kFieldOn = 0x8, kSPDOnlyL0 = 0x10, kTPCSPD = 0x20};
27 enum MCProcessType { kInvalidProcess = -1, kND = 0x1, kDD = 0x2, kSD = 0x4, kOnePart = 0x8 };
28 enum DiffTreatment { kMCFlags = 0, kUA5Cuts = 1, kE710Cuts, kALICEHadronLevel };
29
30 // setters
31 void SetTriggerRequired(Bool_t bFlag=kTRUE) {fTriggerRequired=bFlag;}
32 void SetRecVertexRequired(Bool_t bFlag=kTRUE) {fRecVertexRequired=bFlag;}
33 void SetEventProcessType(MCProcessType type=kInvalidProcess) {fEventProcessType=type;}
34 void SetNContributorsRange(Float_t min=0.,Float_t max=1e99) {fMinNContributors=min; fMaxNContributors=max;}
35 void SetMaxR(Float_t max=1e99) {fMaxR=max;}
36 void SetZvRange(Float_t min=-1e99, Float_t max=1e99) {fMinZv=min; fMaxZv=max;}
37
38 void SetMeanXYZv(Float_t xv=0.0, Float_t yv=0.0, Float_t zv=0.0) {
39 fMeanXv = xv; fMeanYv = yv; fMeanZv = zv;
40 }
41
42 void SetSigmaMeanXYZv(Float_t sxv=1.0, Float_t syv=1.0, Float_t szv=10.0) {
43 fSigmaMeanXv = sxv; fSigmaMeanYv = syv; fSigmaMeanZv = szv;
44 }
45
46
47 void SetRedoTPCVertex(Bool_t redo = kTRUE) {fRedoTPCVertex = redo;}
48 void SetUseBeamSpotConstraint(Bool_t useConstr = kTRUE) {fUseBeamSpotConstraint = useConstr;}
49 void SetEventSelectedRequired(Bool_t evtSel = kTRUE) {fEventSelectedRequired = evtSel;}
50
51
52 // getters
53 Bool_t IsEventSelectedRequired() const {return fEventSelectedRequired;}
54 Bool_t IsTriggerRequired() const {return fTriggerRequired;}
55 Bool_t IsRecVertexRequired() const {return fRecVertexRequired;}
56 Int_t GetEventProcessType() const {return fEventProcessType;}
57 Float_t GetMinNContributors() const {return fMinNContributors;}
58 Float_t GetMaxNContributors() const {return fMaxNContributors;}
59 Float_t GetMaxR() const {return fMaxR;}
60 Float_t GetMinZv() const {return fMinZv;}
61 Float_t GetMaxZv() const {return fMaxZv;}
62
63 Float_t GetMeanXv() const {return fMeanXv;}
64 Float_t GetMeanYv() const {return fMeanYv;}
65 Float_t GetMeanZv() const {return fMeanZv;}
66
67 Float_t GetSigmaMeanXv() const {return fSigmaMeanXv;}
68 Float_t GetSigmaMeanYv() const {return fSigmaMeanYv;}
69 Float_t GetSigmaMeanZv() const {return fSigmaMeanZv;}
70
71 Bool_t IsRedoTPCVertex() const {return fRedoTPCVertex;}
72 Bool_t IsUseBeamSpotConstraint() const {return fUseBeamSpotConstraint;}
73
74
75 // cuts init function
76 void Init();
77
78 // check MC tracks
79 Bool_t IsSelected(TObject *) {return kTRUE;}
80 Bool_t IsSelected(TList *) {return kTRUE;}
81
82 // accept event
83 Bool_t AcceptEvent(AliESDEvent *event=0, AliMCEvent *mcEvent=0, const AliESDVertex *vtx=0);
84 Bool_t AcceptMCEvent(AliMCEvent *mcEvent=0);
85
86 // Merge output objects (needed by PROOF)
87 virtual Long64_t Merge(TCollection* list);
88
89 //statics copied from AliPWG0Helper
90 static MCProcessType GetEventProcessType(AliESDEvent* esd, AliHeader* header, AliStack* stack, DiffTreatment diffTreatment);
91 static MCProcessType GetEventProcessType(AliHeader* aHeader, Bool_t adebug = kFALSE);
92 static MCProcessType GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
93 static MCProcessType GetDPMjetEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
94 static Bool_t IsHadronLevelSingleDiffractive(AliStack* stack, Float_t cms, Float_t xiMin, Float_t xiMax);
95 static Double_t Rapidity(Double_t pt, Double_t pz, Double_t m);
96protected:
97 static Int_t fgLastProcessType; // stores the raw value of the last process type extracted
98 //
99
100private:
101 Bool_t fTriggerRequired; // trigger required
102 Bool_t fRecVertexRequired; // reconstructed event vertex required
103 Int_t fEventProcessType; // select MC event process type (ND, SD, DD)
104 Float_t fMinNContributors; // min. number of contributing vertex tracks
105 Float_t fMaxNContributors; // max. number of contributing vertex tracks
106 Float_t fMaxR; // max. vertex radii (R = sqrt(Xv^2+Yv^2)
107 Float_t fMinZv; // min. Zv vertex
108 Float_t fMaxZv; // max. Zv vertex
109
110 // interaction spot constraint
111 Float_t fMeanXv; // mean Xv position
112 Float_t fMeanYv; // mean Yv position
113 Float_t fMeanZv; // mean Zv position
114
115 Float_t fSigmaMeanXv; // sigma mean Xv position
116 Float_t fSigmaMeanYv; // sigma mean Yv position
117 Float_t fSigmaMeanZv; // sigma mean Zv position
118
119 Bool_t fRedoTPCVertex; // redo vertex
120 Bool_t fUseBeamSpotConstraint; // use beam spot contraints
121
122 Bool_t fEventSelectedRequired; // event with at least one track (pT>0.5 GeV, |eta|<0.8) required
123
124 AliFilteredTreeEventCuts(const AliFilteredTreeEventCuts&); // not implemented
125 AliFilteredTreeEventCuts& operator=(const AliFilteredTreeEventCuts&); // not implemented
126
127 ClassDef(AliFilteredTreeEventCuts, 1)
128};
129
130#endif // ALIFILTEREDTREEEVENTCUTS_H