]>
Commit | Line | Data |
---|---|---|
b2a297fa | 1 | #ifndef ALIDIELECTRONVARCUTS_H |
2 | #define ALIDIELECTRONVARCUTS_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 AliDielectronVarCuts # | |
10 | //# Provide cuts for all variables handled in # | |
11 | //# AliDielectronVarManager # | |
12 | //# # | |
13 | //# Authors: # | |
14 | //# Anton Andronic, GSI / A.Andronic@gsi.de # | |
15 | //# Ionut C. Arsene, GSI / I.C.Arsene@gsi.de # | |
16 | //# Julian Book, Uni Ffm / Julian.Book@cern.ch # | |
17 | //# Frederick Kramer, Uni Ffm, / Frederick.Kramer@cern.ch # | |
18 | //# Magnus Mager, CERN / Magnus.Mager@cern.ch # | |
19 | //# WooJin J. Park, GSI / W.J.Park@gsi.de # | |
20 | //# Jens Wiechula, Uni HD / Jens.Wiechula@cern.ch # | |
21 | //# # | |
22 | //############################################################# | |
23 | ||
24 | #include <Rtypes.h> | |
a94c2e7e | 25 | #include <TBits.h> |
572b0139 | 26 | |
b2a297fa | 27 | #include <AliAnalysisCuts.h> |
572b0139 | 28 | #include "AliDielectronVarManager.h" |
b2a297fa | 29 | |
af0f2f47 | 30 | class THnBase; |
b2a297fa | 31 | class AliDielectronVarCuts : public AliAnalysisCuts { |
32 | public: | |
e123f993 | 33 | // Whether all cut criteria have to be fulfilled of just any |
34 | enum CutType { kAll=0, kAny }; | |
0b35b573 | 35 | |
b2a297fa | 36 | AliDielectronVarCuts(); |
37 | AliDielectronVarCuts(const char* name, const char* title); | |
38 | virtual ~AliDielectronVarCuts(); | |
39 | //TODO: make copy constructor and assignment operator public | |
572b0139 | 40 | void AddCut(AliDielectronVarManager::ValueTypes type, Double_t min, Double_t max, Bool_t excludeRange=kFALSE); |
41 | void AddCut(AliDielectronVarManager::ValueTypes type, Double_t value, Bool_t excludeRange=kFALSE); | |
0b35b573 | 42 | void AddBitCut(AliDielectronVarManager::ValueTypes type, UInt_t bit, Bool_t excludeRange=kFALSE); |
af0f2f47 | 43 | void AddCut(AliDielectronVarManager::ValueTypes type, Double_t min, THnBase * const max, Bool_t excludeRange=kFALSE); |
0b35b573 | 44 | |
e123f993 | 45 | // setters |
46 | void SetCutOnMCtruth(Bool_t mc=kTRUE) { fCutOnMCtruth=mc; } | |
47 | void SetCutType(CutType type) { fCutType=type; } | |
0b35b573 | 48 | |
e123f993 | 49 | // getters |
50 | Bool_t GetCutOnMCtruth() const { return fCutOnMCtruth; } | |
51 | CutType GetCutType() const { return fCutType; } | |
a390cb66 | 52 | |
53 | Int_t GetNCuts() { return fNActiveCuts; } | |
54 | ||
b2a297fa | 55 | // |
56 | //Analysis cuts interface | |
57 | // | |
58 | virtual Bool_t IsSelected(TObject* track); | |
59 | virtual Bool_t IsSelected(TList* /* list */ ) {return kFALSE;} | |
0b35b573 | 60 | |
b2a297fa | 61 | // virtual Bool_t IsSelected(TObject* track, TObject */*event*/=0); |
62 | // virtual Long64_t Merge(TCollection* /* list */) { return 0; } | |
0b35b573 | 63 | |
b2a297fa | 64 | // |
65 | // Cut information | |
66 | // | |
67 | virtual UInt_t GetSelectedCutsMask() const { return fSelectedCutsMask; } | |
b2a297fa | 68 | |
78091935 | 69 | virtual void Print(const Option_t* option = "") const; |
5720c765 | 70 | |
0b35b573 | 71 | |
f2d9961b | 72 | private: |
b2a297fa | 73 | |
a94c2e7e | 74 | TBits *fUsedVars; // list of used variables |
e123f993 | 75 | UShort_t fActiveCuts[AliDielectronVarManager::kNMaxValues]; // list of activated cuts |
76 | UShort_t fNActiveCuts; // number of acive cuts | |
77 | UInt_t fActiveCutsMask; // mask of active cuts | |
0b35b573 | 78 | |
b2a297fa | 79 | UInt_t fSelectedCutsMask; // Maks of selected cuts, is available after calling IsSelected |
e123f993 | 80 | |
81 | Bool_t fCutOnMCtruth; // whether to cut on the MC truth of the particle | |
82 | ||
83 | CutType fCutType; // type of the cut: any, all | |
0b35b573 | 84 | |
b2a297fa | 85 | Double_t fCutMin[AliDielectronVarManager::kNMaxValues]; // minimum values for the cuts |
86 | Double_t fCutMax[AliDielectronVarManager::kNMaxValues]; // maximum values for the cuts | |
572b0139 | 87 | Bool_t fCutExclude[AliDielectronVarManager::kNMaxValues]; // inverse cut logic? |
0b35b573 | 88 | Bool_t fBitCut[AliDielectronVarManager::kNMaxValues]; // bit cut |
89 | THnBase *fUpperCut[AliDielectronVarManager::kNMaxValues]; // use object as upper cut | |
ee5e4fc5 | 90 | |
b2a297fa | 91 | AliDielectronVarCuts(const AliDielectronVarCuts &c); |
92 | AliDielectronVarCuts &operator=(const AliDielectronVarCuts &c); | |
0b35b573 | 93 | |
94 | ClassDef(AliDielectronVarCuts,6) //Cut class providing cuts to all infomation available for the AliVParticle interface | |
b2a297fa | 95 | }; |
96 | ||
97 | ||
98 | // | |
99 | //Inline functions | |
100 | // | |
572b0139 | 101 | inline void AliDielectronVarCuts::AddCut(AliDielectronVarManager::ValueTypes type, Double_t value, Bool_t excludeRange) |
a655b716 | 102 | { |
103 | // | |
104 | // Set cut in a small delta around value | |
105 | // | |
106 | const Double_t kDelta=1e-20; | |
572b0139 | 107 | AddCut(type,value-kDelta,value+kDelta, excludeRange); |
a655b716 | 108 | } |
b2a297fa | 109 | |
110 | #endif | |
111 |