ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetAlignment
InDetAlignGeomTools
src
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
5
#include "
InDetIdentifier/TRT_ID.h
"
6
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
7
8
#include "
TrkRIO_OnTrack/RIO_OnTrack.h
"
9
10
#include "
TrkAlignEvent/AlignTSOS.h
"
11
#include "
InDetAlignGeomTools/InDetAlignModuleTool.h
"
12
13
namespace
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
//________________________________________________________________________
24
InDetAlignModuleTool::~InDetAlignModuleTool
() =
default
;
25
26
//________________________________________________________________________
27
StatusCode
InDetAlignModuleTool::initialize
()
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
//________________________________________________________________________
47
StatusCode
InDetAlignModuleTool::finalize
()
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
//________________________________________________________________________
59
int
InDetAlignModuleTool::subDetElementIDHash
(
Identifier
id
)
const
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
//________________________________________________________________________
70
void
InDetAlignModuleTool::setMeasurementProperties
(
Trk::AlignTSOS
* atsos)
const
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
}
AlignTSOS.h
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
InDetAlignModuleTool.h
RIO_OnTrack.h
SiDetectorElement.h
TRT_ID.h
This is an Identifier helper class for the TRT subdetector.
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
InDetDD::SiDetectorElement::isEndcap
bool isEndcap() const
InDetDD::SiDetectorElement::sinStereoLocal
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
Definition
SiDetectorElement.cxx:288
InDet::InDetAlignModuleTool::initialize
virtual StatusCode initialize() override
Definition
InDetAlignModuleTool.cxx:27
InDet::InDetAlignModuleTool::setMeasurementProperties
virtual void setMeasurementProperties(Trk::AlignTSOS *atsos) const override
allows to set detector specific properties of AlignTSOS.
Definition
InDetAlignModuleTool.cxx:70
InDet::InDetAlignModuleTool::~InDetAlignModuleTool
virtual ~InDetAlignModuleTool()
InDet::InDetAlignModuleTool::InDetAlignModuleTool
InDetAlignModuleTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
InDetAlignModuleTool.cxx:16
InDet::InDetAlignModuleTool::subDetElementIDHash
virtual int subDetElementIDHash(Identifier id) const override
Returns identifier hash for sub-TrkDetElementBase structure based on detector type.
Definition
InDetAlignModuleTool.cxx:59
InDet::InDetAlignModuleTool::finalize
virtual StatusCode finalize() override
Definition
InDetAlignModuleTool.cxx:47
InDet::InDetAlignModuleTool::m_trtHelper
const TRT_ID * m_trtHelper
TRT id helper.
Definition
InDetAlignModuleTool.h:50
Trk::AlignModuleTool::AlignModuleTool
AlignModuleTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
AlignModuleTool.cxx:20
Trk::AlignTSOS
Definition
AlignTSOS.h:37
Trk::AlignTSOS::rio
const RIO_OnTrack * rio() const
returns RIO_OnTrack or leading RIO of CompetingRIOsOnTrack (assigned by c'tor)
Definition
AlignTSOS.cxx:157
Trk::AlignTSOS::setAlphaStrip
void setAlphaStrip(double alpha)
returns strip angle for fan-out structured modules (SCT endcap)
Definition
AlignTSOS.h:119
Trk::AlignTSOS::detelement
const TrkDetElementBase * detelement(int i=0) const
method for retrieving detector elements (one if RIO, more if CRIO)
Definition
AlignTSOS.h:110
Trk::AlignTSOS::measType
TrackState::MeasurementType measType() const
returns measurement type enum
Definition
AlignTSOS.h:80
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition
MeasurementBase.h:132
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition
GeoPrimitives.h:48
Identifier
Definition
IdentifierFieldParser.cxx:14
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
Trk::TrackState::SCT
@ SCT
Definition
TrackStateDefs.h:29
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
Trk::locY
@ locY
local cartesian
Definition
ParamDefs.h:38
Trk::locX
@ locX
Definition
ParamDefs.h:37
type
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0