ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonConditions
MuonCondGeneral
MuonCondData
src
DigitEffiData.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
MuonCondData/DigitEffiData.h
"
5
#include "GeoModelKernel/throwExcept.h"
6
7
namespace
Muon
{
8
DigitEffiData::DigitEffiData
(
const
Muon::IMuonIdHelperSvc
* idHelperSvc,
double
defaultEffi):
9
AthMessaging
{
"DigitEffiData"
},
10
m_idHelperSvc
{idHelperSvc},
11
m_defaultEffi
{defaultEffi}{}
12
13
Identifier
DigitEffiData::getLookUpId
(
const
Identifier
& channelId,
bool
isInnerQ1
/*=false*/
)
const
{
14
Identifier
lookUpId{};
15
using
TechIndex =
Muon::MuonStationIndex::TechnologyIndex
;
16
switch
(
m_idHelperSvc
->technologyIndex(channelId)){
17
case
TechIndex::MDT:
18
lookUpId = channelId;
19
break
;
20
case
TechIndex::RPC:
21
lookUpId =
m_idHelperSvc
->layerId(channelId);
22
break
;
23
case
TechIndex::TGC:
24
case
TechIndex::CSC:
25
lookUpId =
m_idHelperSvc
->gasGapId(channelId);
26
break
;
27
case
TechIndex::MM:
28
lookUpId =
m_idHelperSvc
->mmIdHelper().febID(channelId);
29
break
;
30
case
TechIndex::STGC:
31
lookUpId =
m_idHelperSvc
->stgcIdHelper().hvID(channelId, isInnerQ1);
32
break
;
33
default
:
34
THROW_EXCEPTION
(
"Invalid muon technology"
);
35
};
36
return
lookUpId;
37
}
38
double
DigitEffiData::getEfficiency
(
const
Identifier
& channelId,
bool
isInnerQ1
/*=false*/
)
const
{
39
EffiMap::const_iterator effi_itr =
m_effiData
.find(
getLookUpId
(channelId, isInnerQ1));
40
if
(effi_itr !=
m_effiData
.end()) {
41
ATH_MSG_VERBOSE
(
"Channel "
<<
m_idHelperSvc
->toString(channelId) <<
" has an efficiency of "
<<effi_itr->second);
42
return
effi_itr->second;
43
}
44
ATH_MSG_VERBOSE
(
"Efficiency of channel "
<<
m_idHelperSvc
->toString(channelId)<<
" is unknown. Return 1."
);
45
return
m_defaultEffi
;
46
}
47
48
StatusCode
DigitEffiData::setEfficiency
(
const
Identifier
& channelId,
const
double
effi,
bool
isInnerQ1
/*=false*/
){
49
const
Identifier
gasGapId =
getLookUpId
(channelId, isInnerQ1);
50
auto
insert_itr =
m_effiData
.insert(std::make_pair(gasGapId, effi));
51
if
(!insert_itr.second) {
52
ATH_MSG_ERROR
(
"An efficiency for gasGap "
<<
m_idHelperSvc
->toString(gasGapId)
53
<<
" has already been stored "
<<
m_effiData
[gasGapId]<<
" vs. "
<<effi);
54
return
StatusCode::FAILURE;
55
}
56
return
StatusCode::SUCCESS;
57
}
58
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
DigitEffiData.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
Muon::DigitEffiData::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition
DigitEffiData.h:34
Muon::DigitEffiData::getLookUpId
Identifier getLookUpId(const Identifier &channelId, bool isInnerQ1=false) const
Definition
DigitEffiData.cxx:13
Muon::DigitEffiData::m_effiData
EffiMap m_effiData
Definition
DigitEffiData.h:36
Muon::DigitEffiData::setEfficiency
StatusCode setEfficiency(const Identifier §ionId, const double effi, bool isInnerQ1=false)
Sets the efficiency for a given minimal section of the dector.
Definition
DigitEffiData.cxx:48
Muon::DigitEffiData::DigitEffiData
DigitEffiData(const Muon::IMuonIdHelperSvc *idHelperSvc, double defaultEffi)
Constructor taking the pointer to the IdHelperSvc & defining a default efficiency for cases wher the ...
Definition
DigitEffiData.cxx:8
Muon::DigitEffiData::m_defaultEffi
double m_defaultEffi
Definition
DigitEffiData.h:37
Muon::DigitEffiData::getEfficiency
double getEfficiency(const Identifier &channelId, bool isInnerQ1=false) const
Returns the signal generation efficiency of the sTgc channel.
Definition
DigitEffiData.cxx:38
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition
IMuonIdHelperSvc.h:27
Identifier
Definition
IdentifierFieldParser.cxx:14
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition
MuonStationIndex.h:55
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0