ATLAS Offline Software
AlignModuleTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKALIGNGENTOOLS_ALIGNMODULETOOL_H
6 #define TRKALIGNGENTOOLS_ALIGNMODULETOOL_H
7 
9 #include "GaudiKernel/ToolHandle.h"
11 
14 
28 class AtlasDetectorID;
29 class TRT_ID;
30 
31 namespace Trk {
32 
33  class TrkDetElementBase;
34  class RIO_OnTrack;
35 
36  class AlignModuleTool : public AthAlgTool, virtual public IAlignModuleTool {
37 
38  public:
41 
42  AlignModuleTool(const std::string& type, const std::string& name,
43  const IInterface* parent);
44  virtual ~AlignModuleTool();
45 
46  virtual StatusCode initialize();
47  virtual StatusCode finalize();
48 
49 
50  //
51  // GeometryManagerTool methods
52  //
53 
55  void setAlignModules(AlignModuleList* alignmods,
56  std::vector<AlignModuleList*>* idHashMaps);
57 
61 
64  bool subDetElement(AlignModule::DetectorType detType) const { return m_subDetElement[detType]; }
65 
66  //
67  // AlignTrackCreator methods
68  //
69 
71  virtual AlignModule * findAlignModule(const RIO_OnTrack * rio,
72  AlignModule::DetectorType detType) const;
73 
76  AlignModule::DetectorType detType) const;
77 
78  //
79  // MatrixTool methods
80  //
81 
83  int nAlignParameters() const { return m_alignParList1D.size(); }
84 
87 
90 
91 
92  //
93  // DerivCalcTool methods
94  //
95 
97  AlignParVec* getAlignPars(const AlignModule* alignModule) const;
98 
102  virtual void shiftModule(const AlignModule*, const Track*,
103  AlignModule::TransformParameters, double) const {}
104  virtual void restoreModule(const AlignModule*) const {}
105 
106 
107  //
108  // AlignDBTool methods
109  //
110 
114  DataVector<AlignPar>* apVec,
115  AlignModule::DetectorType detType) const;
116 
119  { return m_alignModules; }
120 
121  //
122  // FillNtuple methods
123  //
124 
126  AlignParVec* getFullAlignPars(const AlignModule* alignModule) const;
127 
128 
129  //
130  // miscellaneous methods
131  //
132 
135 
138  virtual int subDetElementIDHash(Identifier ) const { return 0; }
139 
142 
145 
146  protected:
148 
149  private:
150 
152  std::vector<const AlignModuleList*> m_alignModuleMaps;
153 
156 
157  std::vector<AlignModule*> m_alignModules1D;
159 
160  std::vector<bool> m_subDetElement;
161  };
162 
163  MsgStream& operator << ( MsgStream& sl, AlignModuleTool& alignModTool);
164 
165 }
166 
167 #endif // TRKALIGNGENTOOLS_ALIGNMODULETOOL_H
Trk::AlignModuleTool::setAlignParLists
void setAlignParLists(AlignPar2DVec *fullAlignParList, AlignPar2DVec *alignParList=0)
Sets the AlignParLists using boost::multi_array.
Definition: AlignModuleTool.cxx:96
Trk::AlignModuleTool::m_fullAlignParList
AlignPar2DVec * m_fullAlignParList
contains all parameters
Definition: AlignModuleTool.h:155
Trk::AlignModuleTool::alignParList1D
AlignParVec * alignParList1D()
Returns 1-D vector of all AlignPars for all detector types.
Definition: AlignModuleTool.h:89
Trk::IAlignModuleTool
Definition: IAlignModuleTool.h:42
Trk::AlignModuleTool::setAlignModules
void setAlignModules(AlignModuleList *alignmods, std::vector< AlignModuleList * > *idHashMaps)
sets alignModuleLists and idHash maps for a set of AlignModules.
Definition: AlignModuleTool.cxx:72
Trk::AlignModuleList
std::vector< AlignModule * > AlignModuleList
Definition: AlignModuleList.h:37
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
Trk::AlignModuleTool::m_alignModules
AlignModuleList * m_alignModules
list of AlignModules
Definition: AlignModuleTool.h:151
Trk::AlignModule
Definition: AlignModule.h:45
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
Trk::AlignModuleTool::m_subDetElement
std::vector< bool > m_subDetElement
identify detectors aligning structures smaller than TrkDetElementBase
Definition: AlignModuleTool.h:160
Trk::AlignModule::TransformParameters
TransformParameters
enum to keep track of transformation coordinates
Definition: AlignModule.h:54
Trk::AlignModuleTool::subDetElement
bool subDetElement(AlignModule::DetectorType detType) const
Definition: AlignModuleTool.h:64
Trk::AlignModuleTool::restoreModule
virtual void restoreModule(const AlignModule *) const
Definition: AlignModuleTool.h:104
Trk::AlignModuleTool
Definition: AlignModuleTool.h:36
Trk::AlignModuleTool::finalize
virtual StatusCode finalize()
Definition: AlignModuleTool.cxx:65
Trk::AlignModuleTool::getFullAlignPars
AlignParVec * getFullAlignPars(const AlignModule *alignModule) const
returns vector of full AlignPars for an AlignModule
Definition: AlignModuleTool.cxx:316
Trk::AlignModuleTool::subDetElementIDHash
virtual int subDetElementIDHash(Identifier) const
Returns identifier hash for sub-TrkDetElementBase structure based on detector type.
Definition: AlignModuleTool.h:138
Trk::AlignModuleTool::AlignParVec
DataVector< AlignPar > AlignParVec
Definition: AlignModuleTool.h:39
Trk::AlignModuleTool::setSubDetElement
void setSubDetElement(AlignModule::DetectorType detType, bool status)
set and retrieve flag whether or not the sub-TrkDetElementBase structures are aligned for a given det...
Definition: AlignModuleTool.h:63
Trk::AlignModuleTool::~AlignModuleTool
virtual ~AlignModuleTool()
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
Trk::AlignModuleTool::fillDetAlignmentParameters
virtual void fillDetAlignmentParameters(const TrkDetElementBase *det, DataVector< AlignPar > *apVec, AlignModule::DetectorType detType) const
fills values for alignment parameters for a detector element, applying AlignModule transforms if nece...
Definition: AlignModuleTool.cxx:208
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::AlignModuleTool::alignModules1D
const AlignModuleList * alignModules1D()
Returns 1-D vector of all AlignModules containing all detector types.
Definition: AlignModuleTool.h:86
Trk::AlignModuleTool::AlignModuleTool
AlignModuleTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AlignModuleTool.cxx:20
DataVector< AlignPar >
Trk::AlignModuleTool::getAlignPars
AlignParVec * getAlignPars(const AlignModule *alignModule) const
returns vector of AlignPars for an AlignModule
Definition: AlignModuleTool.cxx:197
Trk::AlignModuleTool::alignParList
AlignPar2DVec * alignParList() const
returns complete AlignParList (active parameters only)
Definition: AlignModuleTool.h:141
Trk::AlignModuleTool::m_alignModuleMaps
std::vector< const AlignModuleList * > m_alignModuleMaps
maps detector element idHash to AlignModule
Definition: AlignModuleTool.h:152
Trk::AlignModuleTool::m_idHelper
const AtlasDetectorID * m_idHelper
Used to identify type of detector.
Definition: AlignModuleTool.h:147
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::AlignModuleTool::m_alignParList
AlignPar2DVec * m_alignParList
contains active parameters
Definition: AlignModuleTool.h:154
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::AlignModule::DetectorType
DetectorType
Definition: AlignModule.h:57
AlignModule.h
Trk::AlignModuleTool::AlignPar2DVec
DataVector< AlignParVec > AlignPar2DVec
Definition: AlignModuleTool.h:40
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
Trk::AlignModuleTool::nAlignParameters
int nAlignParameters() const
Returns total number of alignment parameters.
Definition: AlignModuleTool.h:83
TRT_ID
Definition: TRT_ID.h:84
Trk::AlignModuleTool::fullAlignParList
AlignPar2DVec * fullAlignParList() const
returns complete AlignParList
Definition: AlignModuleTool.h:144
Trk::AlignModuleTool::getAlignModuleCollection
virtual const AlignModuleList * getAlignModuleCollection() const
Returns collection of AlignModules for a particular detector type.
Definition: AlignModuleTool.h:118
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::AlignModuleTool::initialize
virtual StatusCode initialize()
Definition: AlignModuleTool.cxx:44
Trk::AlignModuleTool::findAlignModule
virtual AlignModule * findAlignModule(const RIO_OnTrack *rio, AlignModule::DetectorType detType) const
Returns pointer to AlignModule containing RIO.
Definition: AlignModuleTool.cxx:153
IAlignModuleTool.h
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
Trk::AlignModuleTool::getDetectorType
AlignModule::DetectorType getDetectorType(const TrkDetElementBase *det) const
Returns detector type (AlignModule enum) for a detector element.
Definition: AlignModuleTool.cxx:296
merge.status
status
Definition: merge.py:17
Trk::AlignModuleTool::shiftModule
virtual void shiftModule(const AlignModule *, const Track *, AlignModule::TransformParameters, double) const
methods used for numerical derivative to shift module before refitting track and restore to normal po...
Definition: AlignModuleTool.h:102
AthAlgTool
Definition: AthAlgTool.h:26
Trk::AlignModuleTool::m_alignModules1D
std::vector< AlignModule * > m_alignModules1D
1-D vector of AlignModules
Definition: AlignModuleTool.h:157
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
Trk::AlignModuleTool::m_alignParList1D
AlignParVec m_alignParList1D
1-D vector of AlignPars
Definition: AlignModuleTool.h:158
Identifier
Definition: IdentifierFieldParser.cxx:14