ATLAS Offline Software
Loading...
Searching...
No Matches
IndexRange.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#ifndef LArSamples_IndexRange_H
11#define LArSamples_IndexRange_H
12
13#include "TString.h"
14#include "TVectorD.h"
15
16namespace LArSamples {
17
19 {
20 public:
21
22 virtual ~IndexRange() { }
23
24 virtual int lwb() const = 0;
25 virtual int upb() const = 0;
26
27 bool isInRange(int i) const { return (i >= lwb() && i <= upb()); }
28
29 bool hasSameRange(int lw, int up) const { return (lwb() == lw && upb() == up); }
30 bool hasSameRange(const IndexRange& other) const { return hasSameRange(other.lwb(), other.upb()); }
31 bool hasSameRange(const TVectorD& v) const { return hasSameRange(v.GetLwb(), v.GetUpb()); }
32
33 bool providesRange(int lw, int up) const { return (lwb() <= lw && upb() >= up); }
34 bool providesRange(const IndexRange& other) const { return providesRange(other.lwb(), other.upb()); }
35 bool providesRange(const TVectorD& v) const { return providesRange(v.GetLwb(), v.GetUpb()); }
36
37 TString rangeStr() const { return Form("[%d, %d]", lwb(), upb()); }
38
39 int commonLwb(const IndexRange& other) const { return (other.lwb() > lwb() ? other.lwb() : lwb()); }
40 int commonUpb(const IndexRange& other) const { return (other.upb() < upb() ? other.upb() : upb()); }
41
42 bool checkRange(int& l, int& h) const;
43 };
44}
45
46#endif
Header file for AthHistogramAlgorithm.
storage of the time histories of all the cells
Definition IndexRange.h:19
virtual int lwb() const =0
bool isInRange(int i) const
Definition IndexRange.h:27
bool providesRange(const TVectorD &v) const
Definition IndexRange.h:35
bool hasSameRange(int lw, int up) const
Definition IndexRange.h:29
bool providesRange(int lw, int up) const
Definition IndexRange.h:33
int commonLwb(const IndexRange &other) const
Definition IndexRange.h:39
bool providesRange(const IndexRange &other) const
Definition IndexRange.h:34
bool hasSameRange(const IndexRange &other) const
Definition IndexRange.h:30
int commonUpb(const IndexRange &other) const
Definition IndexRange.h:40
bool checkRange(int &l, int &h) const
virtual int upb() const =0
bool hasSameRange(const TVectorD &v) const
Definition IndexRange.h:31
TString rangeStr() const
Definition IndexRange.h:37