CbmRoot
PairAnalysisObjectCuts.h
Go to the documentation of this file.
1 #ifndef PAIRANALYSISOBJECTCUTS_H
2 #define PAIRANALYSISOBJECTCUTS_H
3 
4 //#############################################################
5 //# #
6 //# Class PairAnalysisObjectCuts #
7 //# Provide cuts for using objects #
8 //# #
9 //# Authors: #
10 //# Julian Book, Uni Ffm / Julian.Book@cern.ch #
11 //# #
12 //#############################################################
13 
14 #include <Rtypes.h>
15 #include <TBits.h>
16 
17 #include "AnalysisCuts.h"
18 #include "PairAnalysisVarManager.h"
19 
20 class TGraph;
21 class THnBase;
23 public:
24  // Whether all cut criteria have to be fulfilled of just any
25  enum CutType { kAll = 0, kAny };
26  enum { kNMaxCuts = 10 };
27 
29  PairAnalysisObjectCuts(const char* name, const char* title);
30  virtual ~PairAnalysisObjectCuts();
31  //TODO: make copy constructor and assignment operator public
33  const char* formulaMin,
34  const char* formulaMax,
35  Bool_t excludeRange = kFALSE);
36  void AddCut(const char* formula,
37  const char* formulaMin,
38  const char* formulaMax,
39  Bool_t excludeRange = kFALSE);
40 
42  TGraph* const graphMin,
43  TGraph* const graphMax,
44  Bool_t excludeRange = kFALSE);
45  void AddCut(const char* formula,
46  TGraph* const graphMin,
47  TGraph* const graphMax,
48  Bool_t excludeRange = kFALSE);
49 
51  THnBase* const histMin,
52  THnBase* const histMax,
53  Bool_t excludeRange = kFALSE);
54  void AddCut(const char* formula,
55  THnBase* const histMin,
56  THnBase* const histMax,
57  Bool_t excludeRange = kFALSE);
58 
59  // setters
60  void SetCutType(CutType type) { fCutType = type; }
61 
62  // getters
63  CutType GetCutType() const { return fCutType; }
64 
65  Int_t GetNCuts() { return fNActiveCuts; }
66 
67  //
68  //Analysis cuts interface
69  //
70  virtual Bool_t IsSelected(Double_t* const values);
71  virtual Bool_t IsSelected(TObject* track);
72  virtual Bool_t IsSelected(TList* /* list */) { return kFALSE; }
73 
74  //
75  // Cut information
76  //
77  virtual UInt_t GetSelectedCutsMask() const { return fSelectedCutsMask; }
78 
79  virtual void Print(const Option_t* option = "") const;
80 
81 
82 private:
83  TBits* fUsedVars; // list of used variables
84  UShort_t
85  fActiveCuts[PairAnalysisObjectCuts::kNMaxCuts]; // list of activated cuts
86  UShort_t fNActiveCuts = 0; // number of acive cuts
87  UInt_t fActiveCutsMask = 0; // mask of active cuts
88 
90  0; // Maks of selected cuts, is available after calling IsSelected
91  CutType fCutType = kAll; // type of the cut: any, all
92 
93  Bool_t fCutExclude[PairAnalysisObjectCuts::kNMaxCuts]; // inverse cut logic?
94  TObject*
95  fCutMin[PairAnalysisObjectCuts::kNMaxCuts]; // use object as lower cut
96  TObject*
97  fCutMax[PairAnalysisObjectCuts::kNMaxCuts]; // use object as upper cut
98  TFormula* fVarFormula
99  [PairAnalysisObjectCuts::kNMaxCuts]; // use a formula for the variable
100 
103 
105  1) // Cut class for special cuts (formulas, graphs, histograms)
106 };
107 
108 
109 #endif
PairAnalysisObjectCuts::fCutMax
TObject * fCutMax[PairAnalysisObjectCuts::kNMaxCuts]
Definition: PairAnalysisObjectCuts.h:97
PairAnalysisObjectCuts::fSelectedCutsMask
UInt_t fSelectedCutsMask
Definition: PairAnalysisObjectCuts.h:89
PairAnalysisObjectCuts::IsSelected
virtual Bool_t IsSelected(Double_t *const values)
Definition: PairAnalysisObjectCuts.cxx:71
PairAnalysisObjectCuts::fVarFormula
TFormula * fVarFormula[PairAnalysisObjectCuts::kNMaxCuts]
Definition: PairAnalysisObjectCuts.h:99
PairAnalysisObjectCuts::PairAnalysisObjectCuts
PairAnalysisObjectCuts(const PairAnalysisObjectCuts &c)
PairAnalysisObjectCuts::kAll
@ kAll
Definition: PairAnalysisObjectCuts.h:25
AnalysisCuts::ClassDef
ClassDef(AnalysisCuts, 1)
PairAnalysisObjectCuts::fCutExclude
Bool_t fCutExclude[PairAnalysisObjectCuts::kNMaxCuts]
Definition: PairAnalysisObjectCuts.h:93
PairAnalysisObjectCuts::~PairAnalysisObjectCuts
virtual ~PairAnalysisObjectCuts()
Definition: PairAnalysisObjectCuts.cxx:57
PairAnalysisObjectCuts::CutType
CutType
Definition: PairAnalysisObjectCuts.h:25
PairAnalysisVarManager.h
PairAnalysisObjectCuts::fActiveCutsMask
UInt_t fActiveCutsMask
Definition: PairAnalysisObjectCuts.h:87
PairAnalysisObjectCuts::kAny
@ kAny
Definition: PairAnalysisObjectCuts.h:25
PairAnalysisObjectCuts::fCutMin
TObject * fCutMin[PairAnalysisObjectCuts::kNMaxCuts]
Definition: PairAnalysisObjectCuts.h:95
PairAnalysisObjectCuts::GetNCuts
Int_t GetNCuts()
Definition: PairAnalysisObjectCuts.h:65
PairAnalysisObjectCuts
Definition: PairAnalysisObjectCuts.h:22
PairAnalysisObjectCuts::fUsedVars
TBits * fUsedVars
Definition: PairAnalysisObjectCuts.h:83
PairAnalysisObjectCuts::SetCutType
void SetCutType(CutType type)
Definition: PairAnalysisObjectCuts.h:60
PairAnalysisObjectCuts::GetSelectedCutsMask
virtual UInt_t GetSelectedCutsMask() const
Definition: PairAnalysisObjectCuts.h:77
PairAnalysisObjectCuts::fActiveCuts
UShort_t fActiveCuts[PairAnalysisObjectCuts::kNMaxCuts]
Definition: PairAnalysisObjectCuts.h:85
PairAnalysisObjectCuts::GetCutType
CutType GetCutType() const
Definition: PairAnalysisObjectCuts.h:63
PairAnalysisObjectCuts::PairAnalysisObjectCuts
PairAnalysisObjectCuts()
PairAnalysisObjectCuts::fCutType
CutType fCutType
Definition: PairAnalysisObjectCuts.h:91
PairAnalysisVarManager::ValueTypes
ValueTypes
Definition: PairAnalysisVarManager.h:71
PairAnalysisObjectCuts::Print
virtual void Print(const Option_t *option="") const
Definition: PairAnalysisObjectCuts.cxx:346
PairAnalysisObjectCuts::AddCut
void AddCut(PairAnalysisVarManager::ValueTypes type, const char *formulaMin, const char *formulaMax, Bool_t excludeRange=kFALSE)
Definition: PairAnalysisObjectCuts.cxx:224
AnalysisCuts
Definition: AnalysisCuts.h:12
PairAnalysisObjectCuts::fNActiveCuts
UShort_t fNActiveCuts
Definition: PairAnalysisObjectCuts.h:86
AnalysisCuts.h
PairAnalysisObjectCuts::IsSelected
virtual Bool_t IsSelected(TList *)
Definition: PairAnalysisObjectCuts.h:72
PairAnalysisObjectCuts::operator=
PairAnalysisObjectCuts & operator=(const PairAnalysisObjectCuts &c)
PairAnalysisObjectCuts::kNMaxCuts
@ kNMaxCuts
Definition: PairAnalysisObjectCuts.h:26