ATLAS Offline Software
IndexRange.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <iostream>
8 using std::cout;
9 using std::endl;
10 
11 using namespace LArSamples;
12 
13 
14 bool IndexRange::checkRange(int& l, int& h) const
15 {
16  if (l < 0)
17  l = lwb();
18  else if (!isInRange(l)) {
19  cout << "IndexRange::checkRange : lower bound " << l << " is out of bounds" << endl;
20  return false;
21  }
22 
23  if (h < 0)
24  h = upb();
25  else if (!isInRange(h)) {
26  cout << "IndexRange::checkRange : upper bound " << h << " is out of bounds" << endl;
27  return false;
28  }
29 
30  return true;
31 }
LArSamples::IndexRange::upb
virtual int upb() const =0
IndexRange.h
LArSamples::IndexRange::checkRange
bool checkRange(int &l, int &h) const
Definition: IndexRange.cxx:14
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
LArSamples
Definition: AbsShape.h:24
LArSamples::IndexRange::isInRange
bool isInRange(int i) const
Definition: IndexRange.h:27
h
LArSamples::IndexRange::lwb
virtual int lwb() const =0