ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12//**********************************************************************
13
14CscAlignmentTool::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
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//**********************************************************************
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}
#define ATH_CHECK_RECOVERABLE
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
std::vector< double > m_phiposAlignconsts
CscAlignmentTool(const std::string &, const std::string &, const IInterface *)
double getAlignmentOffset(Identifier pstripId) const
std::vector< double > m_etaposAlignconsts
const CscIdHelper * m_phelper
StatusCode initialize()
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...