AliPhysics  vAN-20150429 (ffa5c54)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliCutValueRange.h
Go to the documentation of this file.
1 #ifndef ALICUTVALUERANGE_H
2 #define ALICUTVALUERANGE_H
3 /* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 // Author: Markus Fasel
7 
8 #include <TObject.h>
9 
17 namespace EMCalTriggerPtAnalysis{
18 
19 template<typename t>
20 class AliCutValueRange : public TObject {
21 public:
23  AliCutValueRange(t min, t max);
24  AliCutValueRange(t limit, bool isUpper);
25  virtual ~AliCutValueRange() {}
26 
27  void SetLimits(t min, t max){
28  fLimits[0] = min;
29  fLimits[1] = max;
30  fHasLimit[0] = fHasLimit[1] = true;
31  }
32  void UnsetLimits(){ fHasLimit[0] = fHasLimit[1] = false; }
33  void SetLimit(t value, bool isUpper){
34  int bin = isUpper ? 1 : 0;
35  fLimits[bin] = value;
36  fHasLimit[bin] = true;
37  }
38  void UnsetLimit(bool isUpper){
39  int bin = isUpper ? 1 : 0;
40  fHasLimit[bin] = false;
41  }
42  void Negate() { fNegate = true; }
43  void SetPositive() { fNegate = false; }
44  bool IsInRange(t value) const;
45 private:
46  t fLimits[2];
47  bool fHasLimit[2];
48  bool fNegate;
49 
50  ClassDef(AliCutValueRange, 1); // Value range for cuts
51 };
52 
53 }
54 
55 #endif
void SetLimit(t value, bool isUpper)