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 
27  }
28 
29  //________________________________________________________________________
31  {
32  ATH_MSG_DEBUG("Initialize of InDetAlignModuleTool");
33 
34  // initialize AlignModuleTool
35  if(AlignModuleTool::initialize().isFailure()) {
36  msg(MSG::FATAL)<<"Error initializing AlignModuleTool"<<endmsg;
37  return StatusCode::FAILURE;
38  }
39 
40  // Set up TRT ID helper
41  if (detStore()->retrieve(m_trtHelper, "TRT_ID").isFailure()) {
42  msg(MSG::FATAL)<<"Could not get TRT ID helper"<<endmsg;
43  return StatusCode::FAILURE;
44  }
45 
46  return StatusCode::SUCCESS;
47  }
48 
49  //________________________________________________________________________
51  {
52  ATH_MSG_DEBUG("Finalize of InDetAlignModuleTool");
53 
54  if(AlignModuleTool::finalize().isFailure()) {
55  msg(MSG::FATAL)<<"Error finalizing AlignModuleTool"<<endmsg;
56  return StatusCode::FAILURE;
57  }
58  return StatusCode::SUCCESS;
59  }
60 
61  //________________________________________________________________________
63  {
64  if (id.is_valid()) {
65  if (m_trtHelper->is_trt(id)) {
66  return m_trtHelper->straw_hash(id);
67  }
68  }
69  return 0;
70  }
71 
72  //________________________________________________________________________
74  {
75  // for SCT endcaps set fan-out angle
76  if (atsos->measType() == Trk::TrackState::SCT) {
77  const InDetDD::SiDetectorElement * sidet = dynamic_cast<const InDetDD::SiDetectorElement *> (atsos->detelement());
78  if(sidet && sidet->isEndcap()) {
79  Amg::Vector2D localp = atsos->rio()->localParameters();
80  // the next check is probably not needed as a measurement in the
81  // SCT endcap element should always have both local x and local y
82  // track parameters (according to Thijs)
83 // if(localp.contains(Trk::locX) && localp.contains(Trk::locY)) {
84  double sinLocal = sidet->sinStereoLocal( Amg::Vector2D(localp[Trk::locX],localp[Trk::locY]) );
85  if(sinLocal)
86  atsos->setAlphaStrip(asin(sinLocal));
87 // }
88  }
89  }
90  }
91 
92 }
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:53
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:19
Trk::locX
@ locX
Definition: ParamDefs.h:43
TRT_ID::straw_hash
IdentifierHash straw_hash(Identifier straw_id) const
straw hash from id - optimized
Definition: TRT_ID.h:768
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
initialize
void initialize()
Definition: run_EoverP.cxx:894
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:782
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::finalize
virtual StatusCode finalize()
Definition: InDetAlignModuleTool.cxx:50
InDet::InDetAlignModuleTool::~InDetAlignModuleTool
virtual ~InDetAlignModuleTool()
Definition: InDetAlignModuleTool.cxx:24
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:195
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
InDet::InDetAlignModuleTool::setMeasurementProperties
virtual void setMeasurementProperties(Trk::AlignTSOS *atsos) const
allows to set detector specific properties of AlignTSOS.
Definition: InDetAlignModuleTool.cxx:73
SiDetectorElement.h
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
InDet::InDetAlignModuleTool::initialize
virtual StatusCode initialize()
Definition: InDetAlignModuleTool.cxx:30
InDet::InDetAlignModuleTool::subDetElementIDHash
virtual int subDetElementIDHash(Identifier id) const
Returns identifier hash for sub-TrkDetElementBase structure based on detector type.
Definition: InDetAlignModuleTool.cxx:62
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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
Trk::TrackState::SCT
@ SCT
Definition: TrackStateDefs.h:29