CbmRoot
PairAnalysisVarCuts.h
Go to the documentation of this file.
1 #ifndef PAIRANALYSISVARCUTS_H
2 #define PAIRANALYSISVARCUTS_H
3 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 //#############################################################
7 //# #
8 //# Class PairAnalysisVarCuts #
9 //# Provide cuts for all variables handled in #
10 //# PairAnalysisVarManager #
11 //# #
12 //# Authors: #
13 //# Julian Book, Uni Ffm / Julian.Book@cern.ch #
14 //# #
15 //#############################################################
16 
17 #include <Rtypes.h>
18 #include <TBits.h>
19 
20 #include "AnalysisCuts.h"
21 #include "PairAnalysisVarManager.h"
22 
24 public:
25  // Whether all cut criteria have to be fulfilled of just any
26  enum CutType { kAll = 0, kAny };
27 
29  PairAnalysisVarCuts(const char* name, const char* title);
30  virtual ~PairAnalysisVarCuts();
31  //TODO: make copy constructor and assignment operator public
32 
34  Double_t min,
35  Double_t max,
36  Bool_t excludeRange = kFALSE);
37  void AddCut(const char* formula,
38  Double_t min,
39  Double_t max,
40  Bool_t excludeRange = kFALSE);
42  Double_t value,
43  Bool_t excludeRange = kFALSE);
45  UInt_t bit,
46  Bool_t excludeRange = kFALSE);
47 
48  // setters
49  void SetCutType(CutType type) { fCutType = type; }
50 
51  // getters
52  CutType GetCutType() const { return fCutType; }
53 
54  Int_t GetNCuts() { return fNActiveCuts; }
55 
56  //
57  //Analysis cuts interface
58  //
59  virtual Bool_t IsSelected(Double_t* const values);
60  virtual Bool_t IsSelected(TObject* track);
61  virtual Bool_t IsSelected(TList* /* list */) { return kFALSE; }
62 
63  // virtual Bool_t IsSelected(TObject* track, TObject */*event*/=0);
64  // virtual Long64_t Merge(TCollection* /* list */) { return 0; }
65 
66  //
67  // Cut information
68  //
69  virtual UInt_t GetSelectedCutsMask() const { return fSelectedCutsMask; }
70 
71  virtual void Print(const Option_t* option = "") const;
72 
73 
74 private:
75  TBits* fUsedVars; // list of used variables
76  UShort_t fActiveCuts
77  [PairAnalysisVarManager::kNMaxValuesMC]; // list of activated cuts
78  UShort_t fNActiveCuts; // number of acive cuts
79  UInt_t fActiveCutsMask; // mask of active cuts
80 
81  UInt_t
82  fSelectedCutsMask; // Maks of selected cuts, is available after calling IsSelected
83  CutType fCutType; // type of the cut: any, all
84 
85  Double_t fCutMin
86  [PairAnalysisVarManager::kNMaxValuesMC]; // minimum values for the cuts
87  Double_t fCutMax
88  [PairAnalysisVarManager::kNMaxValuesMC]; // maximum values for the cuts
89  Bool_t
92  TObject* fCutVar
93  [PairAnalysisVarManager::kNMaxValuesMC]; // used formula for variable
94 
97 
99  8) //Cut class providing cuts based on all kind of variables
100 };
101 
102 
103 //
104 //Inline functions
105 //
107  Double_t value,
108  Bool_t excludeRange) {
109  //
110  // Set cut in a small delta around value
111  //
112  const Double_t kDelta = 1e-20;
113  AddCut(type, value - kDelta, value + kDelta, excludeRange);
114 }
115 
116 #endif
PairAnalysisVarManager::kNMaxValuesMC
@ kNMaxValuesMC
Definition: PairAnalysisVarManager.h:343
PairAnalysisVarCuts::SetCutType
void SetCutType(CutType type)
Definition: PairAnalysisVarCuts.h:49
PairAnalysisVarCuts::AddCut
void AddCut(PairAnalysisVarManager::ValueTypes type, Double_t min, Double_t max, Bool_t excludeRange=kFALSE)
Definition: PairAnalysisVarCuts.cxx:157
PairAnalysisVarCuts::fBitCut
Bool_t fBitCut[PairAnalysisVarManager::kNMaxValuesMC]
Definition: PairAnalysisVarCuts.h:91
PairAnalysisVarCuts::kAll
@ kAll
Definition: PairAnalysisVarCuts.h:26
PairAnalysisVarCuts::PairAnalysisVarCuts
PairAnalysisVarCuts(const PairAnalysisVarCuts &c)
PairAnalysisVarCuts::fCutExclude
Bool_t fCutExclude[PairAnalysisVarManager::kNMaxValuesMC]
Definition: PairAnalysisVarCuts.h:90
PairAnalysisVarCuts::fCutVar
TObject * fCutVar[PairAnalysisVarManager::kNMaxValuesMC]
Definition: PairAnalysisVarCuts.h:93
PairAnalysisVarCuts::fActiveCuts
UShort_t fActiveCuts[PairAnalysisVarManager::kNMaxValuesMC]
Definition: PairAnalysisVarCuts.h:77
PairAnalysisVarCuts::fActiveCutsMask
UInt_t fActiveCutsMask
Definition: PairAnalysisVarCuts.h:79
PairAnalysisVarCuts::CutType
CutType
Definition: PairAnalysisVarCuts.h:26
PairAnalysisVarCuts::fCutMax
Double_t fCutMax[PairAnalysisVarManager::kNMaxValuesMC]
Definition: PairAnalysisVarCuts.h:88
AnalysisCuts::ClassDef
ClassDef(AnalysisCuts, 1)
PairAnalysisVarCuts::Print
virtual void Print(const Option_t *option="") const
Definition: PairAnalysisVarCuts.cxx:229
PairAnalysisVarCuts::~PairAnalysisVarCuts
virtual ~PairAnalysisVarCuts()
Definition: PairAnalysisVarCuts.cxx:79
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
PairAnalysisVarCuts::fCutType
CutType fCutType
Definition: PairAnalysisVarCuts.h:83
PairAnalysisVarCuts::fUsedVars
TBits * fUsedVars
Definition: PairAnalysisVarCuts.h:75
PairAnalysisVarCuts::GetSelectedCutsMask
virtual UInt_t GetSelectedCutsMask() const
Definition: PairAnalysisVarCuts.h:69
PairAnalysisVarManager.h
PairAnalysisVarCuts::GetNCuts
Int_t GetNCuts()
Definition: PairAnalysisVarCuts.h:54
PairAnalysisVarCuts
Definition: PairAnalysisVarCuts.h:23
PairAnalysisVarCuts::AddBitCut
void AddBitCut(PairAnalysisVarManager::ValueTypes type, UInt_t bit, Bool_t excludeRange=kFALSE)
Definition: PairAnalysisVarCuts.cxx:213
PairAnalysisVarCuts::GetCutType
CutType GetCutType() const
Definition: PairAnalysisVarCuts.h:52
PairAnalysisVarCuts::IsSelected
virtual Bool_t IsSelected(Double_t *const values)
Definition: PairAnalysisVarCuts.cxx:90
PairAnalysisVarCuts::fCutMin
Double_t fCutMin[PairAnalysisVarManager::kNMaxValuesMC]
Definition: PairAnalysisVarCuts.h:86
PairAnalysisVarCuts::fNActiveCuts
UShort_t fNActiveCuts
Definition: PairAnalysisVarCuts.h:78
PairAnalysisVarCuts::PairAnalysisVarCuts
PairAnalysisVarCuts()
PairAnalysisVarCuts::fSelectedCutsMask
UInt_t fSelectedCutsMask
Definition: PairAnalysisVarCuts.h:82
PairAnalysisVarCuts::IsSelected
virtual Bool_t IsSelected(TList *)
Definition: PairAnalysisVarCuts.h:61
PairAnalysisVarCuts::operator=
PairAnalysisVarCuts & operator=(const PairAnalysisVarCuts &c)
PairAnalysisVarManager::ValueTypes
ValueTypes
Definition: PairAnalysisVarManager.h:71
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
PairAnalysisVarCuts::kAny
@ kAny
Definition: PairAnalysisVarCuts.h:26
AnalysisCuts
Definition: AnalysisCuts.h:12
AnalysisCuts.h