ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetConditions
SCT_ConditionsData
src
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
9
#include "
SCT_ConditionsData/SCT_MajorityCondData.h
"
10
11
//----------------------------------------------------------------------
12
// Constructor
13
SCT_MajorityCondData::SCT_MajorityCondData
():
14
m_majorityState
{},
15
m_hvFraction
{},
16
m_filled
{false}
17
{}
18
19
//----------------------------------------------------------------------
20
// Set majority state for a region
21
void
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
28
bool
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
37
void
SCT_MajorityCondData::clearMajorityStates
()
38
{
39
m_majorityState
.clear();
40
setFilled
(
false
);
41
}
42
43
//----------------------------------------------------------------------
44
// Set majority state for a region
45
void
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
52
float
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
61
void
SCT_MajorityCondData::clearHVFractions
()
62
{
63
m_hvFraction
.clear();
64
setFilled
(
false
);
65
}
66
67
//----------------------------------------------------------------------
68
// Set filled variable
69
void
SCT_MajorityCondData::setFilled
(
const
bool
& filled)
70
{
71
m_filled
= filled;
72
}
73
74
//----------------------------------------------------------------------
75
// Set filled variable
76
bool
SCT_MajorityCondData::isFilled
()
const
77
{
78
return
m_filled
;
79
}
SCT_MajorityCondData.h
header file for data object for SCT_MajorityCondAlg and SCT_MajorityConditionsTool.
SCT_MajorityCondData::m_filled
bool m_filled
Flag to check data are filled or not.
Definition
SCT_MajorityCondData.h:55
SCT_MajorityCondData::SCT_MajorityCondData
SCT_MajorityCondData()
Constructor.
Definition
SCT_MajorityCondData.cxx:13
SCT_MajorityCondData::getHVFraction
float getHVFraction(const int ®ion) const
Get HV fraction for a region.
Definition
SCT_MajorityCondData.cxx:52
SCT_MajorityCondData::clearHVFractions
void clearHVFractions()
Clear HV fractions.
Definition
SCT_MajorityCondData.cxx:61
SCT_MajorityCondData::setHVFraction
void setHVFraction(const int ®ion, const float &hvFraction)
Set HV fraction for a region.
Definition
SCT_MajorityCondData.cxx:45
SCT_MajorityCondData::m_majorityState
std::map< int, bool > m_majorityState
Map to store majority state.
Definition
SCT_MajorityCondData.h:51
SCT_MajorityCondData::getMajorityState
bool getMajorityState(const int ®ion) const
Get majority state for a region.
Definition
SCT_MajorityCondData.cxx:28
SCT_MajorityCondData::isFilled
bool isFilled() const
Get filled variable.
Definition
SCT_MajorityCondData.cxx:76
SCT_MajorityCondData::setFilled
void setFilled(const bool &filled)
Set filled variable.
Definition
SCT_MajorityCondData.cxx:69
SCT_MajorityCondData::setMajorityState
void setMajorityState(const int ®ion, const bool &majorityState)
Set majority state for a region.
Definition
SCT_MajorityCondData.cxx:21
SCT_MajorityCondData::m_hvFraction
std::map< int, float > m_hvFraction
Map to store HV fraction.
Definition
SCT_MajorityCondData.h:53
SCT_MajorityCondData::clearMajorityStates
void clearMajorityStates()
Clear majority state.
Definition
SCT_MajorityCondData.cxx:37
Generated on
for ATLAS Offline Software by
1.17.0