16#define _USE_MATH_DEFINES
25 const std::string&
name)
60 values[0]=translation.x();
61 values[1]=translation.y();
62 values[2]=translation.z();
66 double sinbeta = rotation(2,0);
67 if(fabs(sinbeta) < 0.99999 ){
76 values[3]=-std::atan2( -rotation(2,1), rotation(2,2) );
77 values[4]=-std::asin(sinbeta);
78 values[5]=-std::atan2( -rotation(1,0), rotation(0,0) ) ;
79 if (values[3] == 0) values[3] = 0;
80 if (values[5] == 0) values[5] = 0;
83 double alphaPlusGamma = std::asin( rotation(0,1) );
84 values[3] = alphaPlusGamma;
87 values[4] =
M_PI * 0.5;
89 values[4] = -
M_PI * 0.5;
99 double sumx(0),sumy(0),sumz(0);
101 for (
auto *detelements : detelementsVec) {
105 for(
const auto *detelement : *detelements) {
106 sumx += detelement->surface().center().x();
107 sumy += detelement->surface().center().y();
108 sumz += detelement->surface().center().z();
110 n += detelements->size();
131 ATH_MSG_DEBUG(
"adding detElement "<<det->identify()<<
", detType "<<detType);
160 for (
int i=0;i<(int)alignModToDetElemTransform->size();i++)
162 return &(*alignModToDetElemTransform)[i];
168 for (
int i=0;i<(int)alignModToDetElemTransform->size();i++)
169 if ((*detElements)[i]==det)
170 return &(*alignModToDetElemTransform)[i];
182 typeStr=
"none";
break;
184 typeStr=
"Pixel";
break;
186 typeStr=
"SCT";
break;
188 typeStr=
"TRT";
break;
190 typeStr=
"MDT";
break;
192 typeStr=
"CSC";
break;
194 typeStr=
"RPC";
break;
196 typeStr=
"TGC";
break;
198 typeStr=
"NDetectorTypes";
break;
206 sl <<
"AlignModule \'"<<alignModule.
name()<<
"\' ID: "<<alignModule.
identify()
218 double sumx(0),sumy(0),sumz(0);
219 double sumRx(0),sumRy(0),sumRz(0);
226 for(
const auto *detelement : *detelements) {
234 ATH_MSG_DEBUG(n <<
" " << trans[0] <<
" "<< trans[1] <<
" " << trans[2]
235 <<
" "<< trans[3] <<
" " << trans[4] <<
" "<< trans[5]);
264 return Amg::Transform3D::Identity();
266 double oneOnN = 1./(double)n;
268 ATH_MSG_DEBUG(
" SUM " << oneOnN <<
" " << sumx*oneOnN <<
" "<< sumy*oneOnN
269 <<
" " << sumz*oneOnN <<
" "<< sumRx*oneOnN <<
" " << sumRy*oneOnN <<
" "<< sumRz*oneOnN);
273 Amg::Transform3D newtrans = surfaceCentre * Amg::RotationMatrix3D::Identity();
297 for(DetElementCollection::const_iterator it = detelements->begin() ;
298 it != detelements->end(); ++it, ++j ) {
304 ATH_MSG_DEBUG(j <<
" " << trans[0] <<
" "<< trans[1] <<
" " << trans[2]
305 <<
" "<< trans[3] <<
" " << trans[4] <<
" "<< trans[5]);
Eigen::Affine3d Transform3D
static const Attributes_t empty
void setLevel(MSG::Level lvl)
Change the current logging level.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
AlignModule(const AlgTool *algtool, const Amg::Transform3D &globalToAlignXform=Amg::Transform3D::Identity(), const std::string &name="")
constructor creates MsgStream with output level of parent tool and AlignModule for name.
double ** m_chi2VAlignParamX
std::vector< const TrkDetElementBase * > DetElementCollection
typedefs to contain detector element pointers and transforms
Identifier identify() const
void setGlobalFrameToAlignFrameTransform(const Amg::Transform3D &t)
set global to alignment frame transforms
const std::string & name() const
double ** m_chi2VAlignParam
Amg::Transform3D m_globalToAlignFrameTransform
void resetAlignModuleToDetElementTransforms()
Reset align module to detector element transforms based on the AlignModuleToGlobal transform and the ...
std::vector< IdentifierCollection * > m_detIdentifiers
Amg::Transform3D calculateAlignModuleToGlobal() const
Calculates Align to Global transform based on the TrkDetElementBase in the alignmodule.
void addDetElement(AlignModule::DetectorType detType, const TrkDetElementBase *det, const Amg::Transform3D &transform, Identifier id=Identifier())
used to add a detector element to the align module with a align frame to detector element local frame...
std::vector< Identifier > IdentifierCollection
IdentifierHash identifyHash() const
Set and return index of module, used by alignment classes to keep track of order of align module.
std::vector< std::vector< Amg::Transform3D > * > m_alignModuleToDetElementTransforms
std::vector< DetElementCollection * > m_detelements
Amg::Vector3D centerOfGravity() const
double *** m_chi2VAlignParamMeasType
This is the base class for all tracking detector elements with read-out relevant information.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::AngleAxisd AngleAxis3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D
@ NumberOfMeasurementTypes
Ensure that the ATLAS eigen extensions are properly loaded.
std::string detTypeStr(AlignModule::DetectorType detType)
returns the detector type
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
void decomposeTransform(const Amg::Transform3D &transform, double *values)