]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGJE/EMCALJetTasks/Tracks/AliCutValueRange.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / Tracks / AliCutValueRange.h
CommitLineData
46f589c2 1#ifndef ALICUTVALUERANGE_H
2#define ALICUTVALUERANGE_H
08f5b3a3 3/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
46f589c2 4 * See cxx source for full Copyright notice */
5
6// Author: Markus Fasel
7
8#include <TObject.h>
9
10namespace EMCalTriggerPtAnalysis{
11
12template<typename t>
13class AliCutValueRange : public TObject {
14public:
15 AliCutValueRange();
16 AliCutValueRange(t min, t max);
17 AliCutValueRange(t limit, bool isUpper);
4c61ea4f 18 virtual ~AliCutValueRange() {}
46f589c2 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;
38private:
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