ATLAS Offline Software
Loading...
Searching...
No Matches
InDetAlignModuleTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
7
9
12
13namespace InDet {
14
15 //______________________________________________________________
16 InDetAlignModuleTool::InDetAlignModuleTool(const std::string& type, const std::string& name, const IInterface* parent)
17 : Trk::AlignModuleTool(type,name,parent)
18 , m_trtHelper(nullptr)
19 {
20 ATH_MSG_DEBUG("constructor of InDetAlignModuleTool");
21 }
22
23 //________________________________________________________________________
25
26 //________________________________________________________________________
28 {
29 ATH_MSG_DEBUG("Initialize of InDetAlignModuleTool");
30
31 // initialize AlignModuleTool
32 if(AlignModuleTool::initialize().isFailure()) {
33 msg(MSG::FATAL)<<"Error initializing AlignModuleTool"<<endmsg;
34 return StatusCode::FAILURE;
35 }
36
37 // Set up TRT ID helper
38 if (detStore()->retrieve(m_trtHelper, "TRT_ID").isFailure()) {
39 msg(MSG::FATAL)<<"Could not get TRT ID helper"<<endmsg;
40 return StatusCode::FAILURE;
41 }
42
43 return StatusCode::SUCCESS;
44 }
45
46 //________________________________________________________________________
48 {
49 ATH_MSG_DEBUG("Finalize of InDetAlignModuleTool");
50
51 if(AlignModuleTool::finalize().isFailure()) {
52 msg(MSG::FATAL)<<"Error finalizing AlignModuleTool"<<endmsg;
53 return StatusCode::FAILURE;
54 }
55 return StatusCode::SUCCESS;
56 }
57
58 //________________________________________________________________________
60 {
61 if (id.is_valid()) {
62 if (m_trtHelper->is_trt(id)) {
63 return m_trtHelper->straw_hash(id);
64 }
65 }
66 return 0;
67 }
68
69 //________________________________________________________________________
71 {
72 // for SCT endcaps set fan-out angle
73 if (atsos->measType() == Trk::TrackState::SCT) {
74 const InDetDD::SiDetectorElement * sidet = dynamic_cast<const InDetDD::SiDetectorElement *> (atsos->detelement());
75 if(sidet && sidet->isEndcap()) {
76 Amg::Vector2D localp = atsos->rio()->localParameters();
77 // the next check is probably not needed as a measurement in the
78 // SCT endcap element should always have both local x and local y
79 // track parameters (according to Thijs)
80// if(localp.contains(Trk::locX) && localp.contains(Trk::locY)) {
81 double sinLocal = sidet->sinStereoLocal( Amg::Vector2D(localp[Trk::locX],localp[Trk::locY]) );
82 if(sinLocal)
83 atsos->setAlphaStrip(asin(sinLocal));
84// }
85 }
86 }
87 }
88
89}
#define endmsg
#define ATH_MSG_DEBUG(x)
This is an Identifier helper class for the TRT subdetector.
const ServiceHandle< StoreGateSvc > & detStore() const
Class to hold geometrical description of a silicon detector element.
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
virtual StatusCode initialize() override
virtual void setMeasurementProperties(Trk::AlignTSOS *atsos) const override
allows to set detector specific properties of AlignTSOS.
InDetAlignModuleTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual int subDetElementIDHash(Identifier id) const override
Returns identifier hash for sub-TrkDetElementBase structure based on detector type.
virtual StatusCode finalize() override
const TRT_ID * m_trtHelper
TRT id helper.
AlignModuleTool(const std::string &type, const std::string &name, const IInterface *parent)
const RIO_OnTrack * rio() const
returns RIO_OnTrack or leading RIO of CompetingRIOsOnTrack (assigned by c'tor)
void setAlphaStrip(double alpha)
returns strip angle for fan-out structured modules (SCT endcap)
Definition AlignTSOS.h:119
const TrkDetElementBase * detelement(int i=0) const
method for retrieving detector elements (one if RIO, more if CRIO)
Definition AlignTSOS.h:110
TrackState::MeasurementType measType() const
returns measurement type enum
Definition AlignTSOS.h:80
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Eigen::Matrix< double, 2, 1 > Vector2D
Primary Vertex Finder.
Ensure that the ATLAS eigen extensions are properly loaded.
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
MsgStream & msg
Definition testRead.cxx:32