CbmRoot
Loading...
Searching...
No Matches
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"
22
24public:
25 // Whether all cut criteria have to be fulfilled of just any
26 enum class ECutType
27 {
28 kAll = 0,
29 kAny
30 };
31
33 PairAnalysisVarCuts(const char* name, const char* title);
34 virtual ~PairAnalysisVarCuts();
35 //TODO: make copy constructor and assignment operator public
36
37 void AddCut(PairAnalysisVarManager::ValueTypes type, Double_t min, Double_t max, Bool_t excludeRange = kFALSE);
38 void AddCut(const char* formula, Double_t min, Double_t max, Bool_t excludeRange = kFALSE);
39 void AddCut(PairAnalysisVarManager::ValueTypes type, Double_t value, Bool_t excludeRange = kFALSE);
40 void AddBitCut(PairAnalysisVarManager::ValueTypes type, UInt_t bit, Bool_t excludeRange = kFALSE);
41
42 // setters
43 void SetCutType(ECutType type) { fCutType = type; }
44
45 // getters
46 ECutType GetCutType() const { return fCutType; }
47
48 Int_t GetNCuts() { return fNActiveCuts; }
49
50 //
51 //Analysis cuts interface
52 //
53 virtual Bool_t IsSelected(Double_t* const values);
54 virtual Bool_t IsSelected(TObject* track);
55 virtual Bool_t IsSelected(TList* /* list */) { return kFALSE; }
56
57 // virtual Bool_t IsSelected(TObject* track, TObject */*event*/=0);
58 // virtual Long64_t Merge(TCollection* /* list */) { return 0; }
59
60 //
61 // Cut information
62 //
63 virtual UInt_t GetSelectedCutsMask() const { return fSelectedCutsMask; }
64
65 virtual void Print(const Option_t* option = "") const;
66
67
68private:
69 TBits* fUsedVars; // list of used variables
70 UShort_t fActiveCuts[PairAnalysisVarManager::kNMaxValuesMC]; // list of activated cuts
71 UShort_t fNActiveCuts; // number of acive cuts
72 UInt_t fActiveCutsMask; // mask of active cuts
73
74 UInt_t fSelectedCutsMask; // Maks of selected cuts, is available after calling IsSelected
75 ECutType fCutType; // type of the cut: any, all
76
77 Double_t fCutMin[PairAnalysisVarManager::kNMaxValuesMC]; // minimum values for the cuts
78 Double_t fCutMax[PairAnalysisVarManager::kNMaxValuesMC]; // maximum values for the cuts
81 TObject* fCutVar[PairAnalysisVarManager::kNMaxValuesMC]; // used formula for variable
82
85
87 8) //Cut class providing cuts based on all kind of variables
88};
89
90
91//
92//Inline functions
93//
94inline void PairAnalysisVarCuts::AddCut(PairAnalysisVarManager::ValueTypes type, Double_t value, Bool_t excludeRange)
95{
96 //
97 // Set cut in a small delta around value
98 //
99 const Double_t kDelta = 1e-20;
100 AddCut(type, value - kDelta, value + kDelta, excludeRange);
101}
102
103#endif
ClassDef(AnalysisCuts, 1)
void AddBitCut(PairAnalysisVarManager::ValueTypes type, UInt_t bit, Bool_t excludeRange=kFALSE)
UShort_t fActiveCuts[PairAnalysisVarManager::kNMaxValuesMC]
virtual Bool_t IsSelected(Double_t *const values)
PairAnalysisVarCuts(const PairAnalysisVarCuts &c)
PairAnalysisVarCuts & operator=(const PairAnalysisVarCuts &c)
Double_t fCutMin[PairAnalysisVarManager::kNMaxValuesMC]
Bool_t fBitCut[PairAnalysisVarManager::kNMaxValuesMC]
ECutType GetCutType() const
Double_t fCutMax[PairAnalysisVarManager::kNMaxValuesMC]
void SetCutType(ECutType type)
virtual Bool_t IsSelected(TList *)
void AddCut(PairAnalysisVarManager::ValueTypes type, Double_t min, Double_t max, Bool_t excludeRange=kFALSE)
virtual void Print(const Option_t *option="") const
Bool_t fCutExclude[PairAnalysisVarManager::kNMaxValuesMC]
TObject * fCutVar[PairAnalysisVarManager::kNMaxValuesMC]
virtual UInt_t GetSelectedCutsMask() const