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