ATLAS Offline Software
DetStatus.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // DetStatus.cxx - class to hold status of one detector
6 // Richard Hawkings, started 19/12/06
8 
10  m_code(0),
11  m_deadfrac(0),
12  m_deadthrust(0)
13 {}
14 
15 DetStatus::DetStatus(const int fullcode, const float deadfrac,
16  const float deadthrust) :
17  m_code(fullcode), m_deadfrac(deadfrac), m_deadthrust(deadthrust) {}
18 
19 std::string DetStatus::colour() const {
20  // endcoding of colours here 0=unknown, 1=RED, 2=YELLOW, 3=GREEN
21  // only lowest two bits are used - rest is free for subdetector use
22  // unless code is -1, indicating BLACK (absent)
23  if (m_code<0) return "BLACK";
24  int code=m_code & 3;
25  if (code==1) return "RED";
26  if (code==2) return "YELLOW";
27  if (code==3) return "GREEN";
28  return "UNKNOWN";
29 }
DetStatus::DetStatus
DetStatus()
Definition: DetStatus.cxx:9
DetStatus::m_code
int m_code
Definition: DetStatus.h:29
DetStatus.h
DetStatus::colour
std::string colour() const
Definition: DetStatus.cxx:19
DetStatus::code
int code() const
Definition: DetStatus.h:34