ATLAS Offline Software
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 
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 
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;
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 }
CscIdHelper.h
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CscAlignmentTool::m_etaposAlignconsts
std::vector< double > m_etaposAlignconsts
Definition: CscAlignmentTool.h:41
ATH_CHECK_RECOVERABLE
#define ATH_CHECK_RECOVERABLE
Evaluate an expression and check for errors.
Definition: AthCheckMacros.h:48
MuonIdHelper::stationName
int stationName(const Identifier &id) const
Definition: MuonIdHelper.cxx:800
CscAlignmentTool::initialize
StatusCode initialize()
Definition: CscAlignmentTool.cxx:24
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
python.Dumpers.aname
string aname
Definition: Dumpers.py:5546
CscIdHelper::wireLayer
int wireLayer(const Identifier &id) const
Definition: CscIdHelper.cxx:772
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CscAlignmentTool.h
CscAlignmentTool::m_useAlignment
bool m_useAlignment
Definition: CscAlignmentTool.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CscAlignmentTool::CscAlignmentTool
CscAlignmentTool(const std::string &, const std::string &, const IInterface *)
Definition: CscAlignmentTool.cxx:14
MuonIdHelper::stationPhi
int stationPhi(const Identifier &id) const
Definition: MuonIdHelper.cxx:810
CscAlignmentTool::m_phiposAlignconsts
std::vector< double > m_phiposAlignconsts
Definition: CscAlignmentTool.h:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonIdHelper::stationEta
int stationEta(const Identifier &id) const
Definition: MuonIdHelper.cxx:805
MuonDetectorManager.h
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CscAlignmentTool::getAlignmentOffset
double getAlignmentOffset(Identifier pstripId) const
Definition: CscAlignmentTool.cxx:39
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
CscIdHelper::measuresPhi
bool measuresPhi(const Identifier &id) const override
Definition: CscIdHelper.cxx:774
MuonGM::MuonDetectorManager::cscIdHelper
const CscIdHelper * cscIdHelper() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:232
AthAlgTool
Definition: AthAlgTool.h:26
Identifier
Definition: IdentifierFieldParser.cxx:14
CscAlignmentTool::m_phelper
const CscIdHelper * m_phelper
Definition: CscAlignmentTool.h:37