ATLAS Offline Software
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 
13 namespace InDet {
14 
15  //______________________________________________________________
16  InDetAlignModuleTool::InDetAlignModuleTool(const std::string& type, const std::string& name, const IInterface* 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 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDetDD::SiDetectorElement::isEndcap
bool isEndcap() const
Trk::AlignTSOS::measType
TrackState::MeasurementType measType() const
returns measurement type enum
Definition: AlignTSOS.h:80
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
Trk::AlignTSOS::rio
const RIO_OnTrack * rio() const
returns RIO_OnTrack or leading RIO of CompetingRIOsOnTrack (assigned by c'tor)
Definition: AlignTSOS.cxx:157
InDet::InDetAlignModuleTool::InDetAlignModuleTool
InDetAlignModuleTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: InDetAlignModuleTool.cxx:16
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:18
Trk::locX
@ locX
Definition: ParamDefs.h:37
TRT_ID::straw_hash
IdentifierHash straw_hash(Identifier straw_id) const
straw hash from id - optimized
Definition: TRT_ID.h:762
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
initialize
void initialize()
Definition: run_EoverP.cxx:894
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
Trk::AlignTSOS
Definition: AlignTSOS.h:37
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:777
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AlignTSOS.h
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
InDet::InDetAlignModuleTool::~InDetAlignModuleTool
virtual ~InDetAlignModuleTool()
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::InDetAlignModuleTool::m_trtHelper
const TRT_ID * m_trtHelper
TRT id helper.
Definition: InDetAlignModuleTool.h:50
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
InDetAlignModuleTool.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
RIO_OnTrack.h
Trk::AlignTSOS::setAlphaStrip
void setAlphaStrip(double alpha)
returns strip angle for fan-out structured modules (SCT endcap)
Definition: AlignTSOS.h:119
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SiDetectorElement.h
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
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::initialize
virtual StatusCode initialize() override
Definition: InDetAlignModuleTool.cxx:27
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
AlignModuleTool
Tool for managing list of AlignModules, detector elements in AlignModules, and AlignPar for both....
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::finalize
virtual StatusCode finalize() override
Definition: InDetAlignModuleTool.cxx:47
Trk::TrackState::SCT
@ SCT
Definition: TrackStateDefs.h:29
Identifier
Definition: IdentifierFieldParser.cxx:14