Added method to compare two cuts objects
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliRDHFCuts.h
CommitLineData
650b3ced 1#ifndef ALIRDHFCUTS_H
2#define ALIRDHFCUTS_H
3/* Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6//***********************************************************
7// Class AliRDHFCuts
8// base class for cuts on AOD reconstructed heavy-flavour decays
9// Author: A.Dainese, andrea.dainese@pd.infn.it
10//***********************************************************
11
12#include "AliAnalysisCuts.h"
13#include "AliESDtrackCuts.h"
fa144fd0 14#include "AliAODPidHF.h"
918b6831 15#include "AliAODEvent.h"
650b3ced 16#include "AliVEvent.h"
17
da6fefc3 18class AliAODTrack;
650b3ced 19class AliAODRecoDecayHF;
da6fefc3 20class AliESDVertex;
650b3ced 21
22class AliRDHFCuts : public AliAnalysisCuts
23{
24 public:
25
26 AliRDHFCuts(const Char_t* name="RDHFCuts", const Char_t* title="");
27
28 virtual ~AliRDHFCuts();
29
30 AliRDHFCuts(const AliRDHFCuts& source);
31 AliRDHFCuts& operator=(const AliRDHFCuts& source);
32
33 void SetMinVtxType(Int_t type=3) {fMinVtxType=type;}
34 void SetMinVtxContr(Int_t contr=1) {fMinVtxContr=contr;}
35 void SetMaxVtxRdChi2(Float_t chi2=1e6) {fMaxVtxRedChi2=chi2;}
36 void SetMinSPDMultiplicity(Int_t mult=0) {fMinSPDMultiplicity=mult;}
37 void SetTriggerMask(ULong64_t mask=0) {fTriggerMask=mask;}
38 void SetVarsForOpt(Int_t nVars,Bool_t *forOpt);
39 void SetGlobalIndex(){fGlobalIndex=fnVars*fnPtBins;}
40 void SetGlobalIndex(Int_t nVars,Int_t nptBins){fnVars=nVars; fnPtBins=nptBins; SetGlobalIndex();}
41 void SetVarNames(Int_t nVars,TString *varNames,Bool_t *isUpperCut);
42 void SetPtBins(Int_t nPtBinLimits,Float_t *ptBinLimits);
43 void SetCuts(Int_t nVars,Int_t nPtBins,Float_t** cutsRD);
44 void SetCuts(Int_t glIndex, Float_t* cutsRDGlob);
45 void AddTrackCuts(const AliESDtrackCuts *cuts)
46 {fTrackCuts=new AliESDtrackCuts(*cuts); return;}
c96634a2 47 void SetUsePID(Bool_t flag=kTRUE) {fUsePID=flag; return;}
fa144fd0 48 void SetPidHF(AliAODPidHF* pidObj) {
49 if(fPidHF) delete fPidHF;
50 fPidHF=new AliAODPidHF(*pidObj);
51 }
918b6831 52 void SetRemoveDaughtersFromPrim(Bool_t removeDaughtersPrim) {fRemoveDaughtersFromPrimary=removeDaughtersPrim;}
650b3ced 53
918b6831 54 AliAODPidHF* GetPidHF() const {return fPidHF;}
650b3ced 55 Float_t *GetPtBinLimits() const {return fPtBinLimits;}
56 Int_t GetNPtBins() const {return fnPtBins;}
57 Int_t GetNVars() const {return fnVars;}
58 TString *GetVarNames() const {return fVarNames;}
59 Bool_t *GetVarsForOpt() const {return fVarsForOpt;}
aaf4e30f 60 Int_t GetNVarsForOpt() const {return fnVarsForOpt;}
650b3ced 61 const Float_t *GetCuts() const {return fCutsRD;}
aaf4e30f 62 void GetCuts(Float_t**& cutsRD) const;
63 Float_t GetCutValue(Int_t iVar,Int_t iPtBin) const;
650b3ced 64 Bool_t *GetIsUpperCut() const {return fIsUpperCut;}
65 AliESDtrackCuts *GetTrackCuts() const {return fTrackCuts;}
66 virtual void GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) = 0;
67 Int_t GetGlobalIndex(Int_t iVar,Int_t iPtBin) const;
68 void GetVarPtIndex(Int_t iGlob, Int_t& iVar, Int_t& iPtBin) const;
e3360b26 69 Bool_t GetIsUsePID() const {return fUsePID;}
918b6831 70 Bool_t GetIsPrimaryWithoutDaughters() const {return fRemoveDaughtersFromPrimary;}
650b3ced 71
72 Bool_t IsSelected(TObject *obj) {return IsSelected(obj,AliRDHFCuts::kAll);}
73 Bool_t IsSelected(TList *list) {if(!list) return kTRUE; return kFALSE;}
74 Bool_t IsEventSelected(AliVEvent *event) const;
3cbc09cd 75 Bool_t AreDaughtersSelected(AliAODRecoDecayHF *rd) const;
da6fefc3 76 Bool_t IsDaughterSelected(AliAODTrack *track,const AliESDVertex *primary,AliESDtrackCuts *cuts) const;
bc116f28 77 virtual Int_t IsSelectedPID(AliAODRecoDecayHF * /*rd*/) {return 1;}
3cbc09cd 78
650b3ced 79 virtual Int_t IsSelected(TObject* obj,Int_t selectionLevel) = 0;
918b6831 80 virtual Int_t IsSelected(TObject* obj,Int_t selectionLevel,AliAODEvent* /*aod*/)
81 {return IsSelected(obj,selectionLevel);}
650b3ced 82 Int_t PtBin(Double_t pt) const;
83 void PrintAll()const;
84
c96634a2 85 virtual Bool_t IsInFiducialAcceptance(Double_t /*pt*/,Double_t /*y*/) const {return kTRUE;}
86
fa144fd0 87 void SetWhyRejection(Int_t why) {fWhyRejection=why; return;}
88 Int_t GetWhyRejection() const {return fWhyRejection;}
89
0198f78c 90 Bool_t CompareCuts(const AliRDHFCuts *obj) const;
91
c96634a2 92 enum{kAll,kTracks,kPID,kCandidate};
650b3ced 93
94 protected:
95
96 void SetNPtBins(Int_t nptBins){fnPtBins=nptBins;}
97 void SetNVars(Int_t nVars){fnVars=nVars;}
98
99 // cuts on the event
100 Int_t fMinVtxType; // 0: not cut; 1: SPDZ; 2: SPD3D; 3: Tracks
101 Int_t fMinVtxContr; // minimum vertex contributors
102 Float_t fMaxVtxRedChi2; // maximum chi2/ndf
103 Int_t fMinSPDMultiplicity; // SPD multiplicity
104 ULong64_t fTriggerMask; // trigger mask
105 // quality cuts on the daughter tracks
106 AliESDtrackCuts *fTrackCuts; // tracks for daughter tracks (AOD converted to ESD on the flight!)
107 // cuts on the candidate
108 Int_t fnPtBins; // number of pt bins for cuts
109 Int_t fnPtBinLimits; // "number of limits", that is fnPtBins+1
110 Float_t* fPtBinLimits; //[fnPtBinLimits] pt bins
111 Int_t fnVars; // number of cut vars for candidates
112 TString *fVarNames; //[fnVars] names of the variables
113 Int_t fnVarsForOpt; // number of cut vars to be optimized for candidates
114 Bool_t *fVarsForOpt; //[fnVars] kTRUE for vars to be used in optimization
115 Int_t fGlobalIndex; // fnVars*fnPtBins
116 Float_t *fCutsRD; //[fGlobalIndex] the cuts values
117 Bool_t *fIsUpperCut; //[fnVars] use > or < to select
c96634a2 118 Bool_t fUsePID; // enable PID usage (off by default)
fa144fd0 119 AliAODPidHF *fPidHF; // PID for heavy flavours manager
120 Int_t fWhyRejection; // used to code the step at which candidate was rejected
918b6831 121 Bool_t fRemoveDaughtersFromPrimary; // flag to switch on the removal of duaghters from the primary vertex computation
650b3ced 122
918b6831 123 ClassDef(AliRDHFCuts,5); // base class for cuts on AOD reconstructed heavy-flavour decays
650b3ced 124};
125
126#endif
aaf4e30f 127