ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_MajorityCondData.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5//----------------------------------------------------------------------
6// Implementation file for the data object class for SCT_MajorityConditionsSvc
7//----------------------------------------------------------------------
8
10
11//----------------------------------------------------------------------
12// Constructor
18
19//----------------------------------------------------------------------
20// Set majority state for a region
21void SCT_MajorityCondData::setMajorityState(const int& region, const bool& majorityState)
22{
23 m_majorityState[region] = majorityState;
24}
25
26//----------------------------------------------------------------------
27// Get majority state for a region
28bool SCT_MajorityCondData::getMajorityState(const int& region) const
29{
30 std::map<int, bool>::const_iterator it{m_majorityState.find(region)};
31 if (it != m_majorityState.end()) return (*it).second;
32 return true; // If the region is not found, true is returned.
33}
34
35//----------------------------------------------------------------------
36// Clear majority states
42
43//----------------------------------------------------------------------
44// Set majority state for a region
45void SCT_MajorityCondData::setHVFraction(const int& region, const float& hvFraction)
46{
47 m_hvFraction[region] = hvFraction;
48}
49
50//----------------------------------------------------------------------
51// Get majority state for a region
52float SCT_MajorityCondData::getHVFraction(const int& region) const
53{
54 std::map<int, float>::const_iterator it{m_hvFraction.find(region)};
55 if (it != m_hvFraction.end()) return (*it).second;
56 return 1.; // If the region is not found, 1. is returned.
57}
58
59//----------------------------------------------------------------------
60// Clear majority states
66
67//----------------------------------------------------------------------
68// Set filled variable
69void SCT_MajorityCondData::setFilled(const bool& filled)
70{
71 m_filled = filled;
72}
73
74//----------------------------------------------------------------------
75// Set filled variable
77{
78 return m_filled;
79}
header file for data object for SCT_MajorityCondAlg and SCT_MajorityConditionsTool.
bool m_filled
Flag to check data are filled or not.
float getHVFraction(const int &region) const
Get HV fraction for a region.
void clearHVFractions()
Clear HV fractions.
void setHVFraction(const int &region, const float &hvFraction)
Set HV fraction for a region.
std::map< int, bool > m_majorityState
Map to store majority state.
bool getMajorityState(const int &region) const
Get majority state for a region.
bool isFilled() const
Get filled variable.
void setFilled(const bool &filled)
Set filled variable.
void setMajorityState(const int &region, const bool &majorityState)
Set majority state for a region.
std::map< int, float > m_hvFraction
Map to store HV fraction.
void clearMajorityStates()
Clear majority state.