]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/Tracks/AliCutValueRange.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / Tracks / AliCutValueRange.h
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
10 namespace EMCalTriggerPtAnalysis{
11
12 template<typename t>
13 class AliCutValueRange : public TObject {
14 public:
15         AliCutValueRange();
16         AliCutValueRange(t min, t max);
17         AliCutValueRange(t limit, bool isUpper);
18         virtual ~AliCutValueRange() {}
19
20         void SetLimits(t min, t max){
21                 fLimits[0] = min;
22                 fLimits[1] = max;
23                 fHasLimit[0] = fHasLimit[1] = true;
24         }
25         void UnsetLimits(){ fHasLimit[0] = fHasLimit[1] = false; }
26         void SetLimit(t value, bool isUpper){
27                 int bin = isUpper ? 1 : 0;
28                 fLimits[bin] = value;
29                 fHasLimit[bin] = true;
30         }
31         void UnsetLimit(bool isUpper){
32                 int bin = isUpper ? 1 : 0;
33                 fHasLimit[bin] = false;
34         }
35         void Negate() { fNegate = true; }
36         void SetPositive() { fNegate = false; }
37         bool IsInRange(t value) const;
38 private:
39         t       fLimits[2];
40         bool    fHasLimit[2];
41         bool    fNegate;
42
43         ClassDef(AliCutValueRange, 1);     // Value range for cuts
44 };
45
46 }
47
48 #endif