ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonReconstruction
MuonDataPrep
CscClusterization
src
CscAlignmentTool.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
// CscAlignmentTool.cxx
6
7
#include "
CscAlignmentTool.h
"
8
9
#include "
MuonIdHelpers/CscIdHelper.h
"
10
#include "
MuonReadoutGeometry/MuonDetectorManager.h
"
11
12
//**********************************************************************
13
14
CscAlignmentTool::CscAlignmentTool
(
const
std::string&
type
,
const
std::string& aname,
const
IInterface* parent) :
15
AthAlgTool
(
type
, aname, parent),
m_phelper
(nullptr) {
16
declareInterface<ICscAlignmentTool>(
this
);
17
declareProperty
(
"useAlignment"
,
m_useAlignment
=
false
);
// in strips
18
declareProperty
(
"etaposAlignConsts"
,
m_etaposAlignconsts
);
19
declareProperty
(
"phiposAlignConsts"
,
m_phiposAlignconsts
);
20
}
21
22
//**********************************************************************
23
24
StatusCode
CscAlignmentTool::initialize
() {
25
ATH_MSG_DEBUG
(
"Initializing "
<< name());
26
ATH_MSG_DEBUG
(
" useAlignment is "
<<
m_useAlignment
);
27
ATH_MSG_DEBUG
(
" EtaPos AlignConsts size :"
<<
m_etaposAlignconsts
.size());
28
ATH_MSG_DEBUG
(
" PhiPos AlignConsts size :"
<<
m_phiposAlignconsts
.size());
29
30
const
MuonGM::MuonDetectorManager
* muDetMgr =
nullptr
;
31
ATH_CHECK_RECOVERABLE
(
detStore
()->retrieve(muDetMgr));
32
ATH_MSG_DEBUG
(
"Retrieved geometry."
);
33
m_phelper
= muDetMgr->
cscIdHelper
();
34
35
return
StatusCode::SUCCESS;
36
}
37
38
//**********************************************************************
39
double
CscAlignmentTool::getAlignmentOffset
(
Identifier
pstripId)
const
{
40
if
(!
m_useAlignment
)
return
0.0;
41
42
int
zsec =
m_phelper
->stationEta(pstripId);
43
int
station =
m_phelper
->stationName(pstripId) - 49;
// 1=CSS, 2=CSL
44
int
phisec =
m_phelper
->stationPhi(pstripId);
45
46
int
sector = zsec * (2 * phisec - station + 1);
// -16 ~ 16
47
int
wlay =
m_phelper
->wireLayer(pstripId);
// 1 ~ 4
48
int
measphi =
m_phelper
->measuresPhi(pstripId);
// 0 for eta and 1 for phi
49
50
const
std::vector<double>* etaAlignTable = &
m_etaposAlignconsts
;
51
const
std::vector<double>* phiAlignTable = &
m_phiposAlignconsts
;
52
53
int
isec = (sector < 0) ? sector + 16 : sector + 15;
// convert -16 ~ 16 to 0 ~ 31...
54
int
lookupId = isec * 4 + wlay - 1;
// no info for 1st layer... so subtract 2....
55
56
double
offset = (measphi) ? (*phiAlignTable)[lookupId] : (*etaAlignTable)[lookupId];
57
58
return
offset;
59
}
ATH_CHECK_RECOVERABLE
#define ATH_CHECK_RECOVERABLE
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:48
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CscAlignmentTool.h
CscIdHelper.h
MuonDetectorManager.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
CscAlignmentTool::m_useAlignment
bool m_useAlignment
Definition
CscAlignmentTool.h:40
CscAlignmentTool::m_phiposAlignconsts
std::vector< double > m_phiposAlignconsts
Definition
CscAlignmentTool.h:42
CscAlignmentTool::CscAlignmentTool
CscAlignmentTool(const std::string &, const std::string &, const IInterface *)
Definition
CscAlignmentTool.cxx:14
CscAlignmentTool::getAlignmentOffset
double getAlignmentOffset(Identifier pstripId) const
Definition
CscAlignmentTool.cxx:39
CscAlignmentTool::m_etaposAlignconsts
std::vector< double > m_etaposAlignconsts
Definition
CscAlignmentTool.h:41
CscAlignmentTool::m_phelper
const CscIdHelper * m_phelper
Definition
CscAlignmentTool.h:37
CscAlignmentTool::initialize
StatusCode initialize()
Definition
CscAlignmentTool.cxx:24
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:51
MuonGM::MuonDetectorManager::cscIdHelper
const CscIdHelper * cscIdHelper() const
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:246
Identifier
Definition
IdentifierFieldParser.cxx:14
type
Generated on
for ATLAS Offline Software by
1.17.0