AliPhysics  29d4213 (29d4213)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliCutValueRange.h
Go to the documentation of this file.
1 
8 #ifndef ALICUTVALUERANGE_H
9 #define ALICUTVALUERANGE_H
10 /* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
11  * See cxx source for full Copyright notice */
12 
13 #include <TObject.h>
14 
22 namespace EMCalTriggerPtAnalysis{
23 
34 template<typename t>
35 class AliCutValueRange : public TObject {
36 public:
38  AliCutValueRange(t min, t max);
39  AliCutValueRange(t limit, bool isUpper);
43  virtual ~AliCutValueRange() {}
44 
45  void SetLimits(t min, t max){
46  fLimits[0] = min;
47  fLimits[1] = max;
48  fHasLimit[0] = fHasLimit[1] = true;
49  }
50  void UnsetLimits(){ fHasLimit[0] = fHasLimit[1] = false; }
56  void SetLimit(t value, bool isUpper){
57  int bin = isUpper ? 1 : 0;
58  fLimits[bin] = value;
59  fHasLimit[bin] = true;
60  }
65  void UnsetLimit(bool isUpper){
66  int bin = isUpper ? 1 : 0;
67  fHasLimit[bin] = false;
68  }
72  void Negate() { fNegate = true; }
76  void SetPositive() { fNegate = false; }
81  void SetUseLargerEqual(Bool_t doUse = true) { fUseLargerEqual = doUse; }
86  void SetUseSmallerEqual(Bool_t doUse = true) { fUseSmallerEqual = doUse; }
87  bool IsInRange(t value) const;
88 
89 private:
90  t fLimits[2];
91  bool fHasLimit[2];
92  bool fNegate;
95 
97  ClassDef(AliCutValueRange, 1); // Value range for cuts
99 };
100 
101 }
102 
103 #endif
void SetLimit(t value, bool isUpper)
bool fUseSmallerEqual
Use smaller equal for upper bound (true by default)
bool fUseLargerEqual
Use larger equal for lower bound (true by default)
t fLimits[2]
Specifies the limit in either of the direction (not used unless fHasLimit of that direction is true) ...
bool fNegate
Defines whether result should be inverted.
Class containing a range for a value to cut on.
void SetUseSmallerEqual(Bool_t doUse=true)
bool fHasLimit[2]
Specifies whether limit in any of the two directions is set.