Project
Loading...
Searching...
No Matches
AlignableSensorTRD.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
19#include "Align/utils.h"
20#include "Framework/Logger.h"
23
24namespace o2
25{
26namespace align
27{
28using namespace o2::align::utils;
29using namespace TMath;
30
31//_________________________________________________________
32AlignableSensorTRD::AlignableSensorTRD(const char* name, int vid, int iid, int isec, Controller* ctr) : AlignableSensor(name, vid, iid, ctr), mSector(isec)
33{
34 // def c-tor
35}
36
37//____________________________________________
39{
40 // prepare alignment matrix in the pseudo-LOCAL frame of TRD (account that the chamber has extra X,Y rotations
41 TGeoHMatrix ma = getMatrixL2GIdeal().Inverse();
42 ma *= getMatrixL2G();
44 //
45}
46
47//____________________________________________
49{
50 // prepare alignment matrix in the pseudo-LOCAL frame of TRD (account that the chamber has extra X,Y rotations
51 TGeoHMatrix ma = getMatrixL2GIdeal().Inverse();
52 ma *= getMatrixL2G();
54 //
55}
56
57//____________________________________________
59{
60 TGeoHMatrix Rxy;
61 Rxy.RotateX(-90);
62 Rxy.RotateY(-90);
63 TGeoHMatrix mtmp;
65 LOG(fatal) << "Failed to find ideal L2G matrix for " << getSymName();
66 }
67 mtmp *= Rxy;
69}
70
71//____________________________________________
73{
74 TGeoHMatrix Rxy;
75 Rxy.RotateX(-90);
76 Rxy.RotateY(-90);
77 const char* path = getSymName();
78 const TGeoHMatrix* l2g = nullptr;
79 if (!gGeoManager->GetAlignableEntry(path) || !(l2g = base::GeometryManager::getMatrix(path))) {
80 LOGP(fatal, "Failed to find L2G matrix for {}alignable {} -> {}", gGeoManager->GetAlignableEntry(path) ? "" : "non-", path, (void*)l2g);
81 }
82 TGeoHMatrix mtmp = *l2g;
83 mtmp *= Rxy;
84 reco ? setMatrixL2GReco(mtmp) : setMatrixL2G(mtmp);
85}
86
87//____________________________________________
89{
90 // extract from geometry T2L matrix
91 double alp = math_utils::detail::sector2Angle<float>(mSector);
92 mAlp = alp;
93 TGeoHMatrix Rs;
94 Rs.RotateZ(-alp * TMath::RadToDeg());
95 TGeoHMatrix m0 = getMatrixL2GIdeal();
96 m0.MultiplyLeft(Rs);
97 TGeoHMatrix t2l = m0.Inverse();
98 setMatrixT2L(t2l);
99 double loc[3] = {0, 0, 0}, glo[3];
100 t2l.MasterToLocal(loc, glo);
101 mX = glo[0];
102 //
103}
104
105//____________________________________________
106void AlignableSensorTRD::dPosTraDParCalib(const AlignmentPoint* pnt, double* deriv, int calibID, const AlignableVolume* parent) const
107{
108 // calculate point position X,Y,Z derivatives wrt calibration parameter calibID of given parent
109 // parent=0 means top detector object calibration
110 //
111 deriv[0] = deriv[1] = deriv[2] = 0;
112 //
113 if (!parent) { // TRD detector global calibration
114 //
115 switch (calibID) {
116 case AlignableDetectorTRD::CalibNRCCorrDzDtgl: // correction for Non-Crossing tracklets Z,Y shift: Z -> Z + calib*tgl, Y -> Y + calib*tgl*tilt*sign(tilt);
117 {
118 double sgYZ = pnt->getYZErrTracking()[1]; // makes sense only for nonRC tracklets
119 if (std::abs(sgYZ) > 0.01) {
120 const double kTilt = 2. * TMath::DegToRad();
121 deriv[2] = pnt->getTrParamWSA()[AlignmentPoint::kParTgl];
122 deriv[1] = deriv[2] * Sign(kTilt, sgYZ);
123 }
124 break;
125 }
126 case AlignableDetectorTRD::CalibDVT: // correction for bias in VdriftT
127 {
128 // error in VdriftT equivalent to shift in X at which Y measurement is evaluated
129 // Y -> Y + dVdriftT * tg_phi, where tg_phi is the slope of the track in YX plane
130 double snp = pnt->getTrParamWSA(AlignmentPoint::kParSnp), slpY = snp / std::sqrt((1.f - snp) * (1.f + snp));
131 deriv[1] = slpY;
132 break;
133 }
134 default:
135 break;
136 }
137 }
138}
139
140} // namespace align
141} // namespace o2
TRD detector wrapper.
Meausered point in the sensor.
Collection of auxillary methods.
Definition of the GeometryManager class.
void dPosTraDParCalib(const AlignmentPoint *pnt, double *deriv, int calibID, const AlignableVolume *parent=nullptr) const final
void prepareMatrixL2G(bool reco=false) final
void setMatrixClAlgReco(const TGeoHMatrix &m)
void setMatrixClAlg(const TGeoHMatrix &m)
void setMatrixL2GIdeal(const TGeoHMatrix &m)
const TGeoHMatrix & getMatrixL2G() const
void setMatrixL2GReco(const TGeoHMatrix &m)
void setMatrixL2G(const TGeoHMatrix &m)
const TGeoHMatrix & getMatrixL2GIdeal() const
void setMatrixT2L(const TGeoHMatrix &m)
const char * getSymName() const
double * getTrParamWSA() const
const double * getYZErrTracking() const
static Bool_t getOriginalMatrix(o2::detectors::DetID detid, int sensid, TGeoHMatrix &m)
static TGeoHMatrix * getMatrix(const char *symname)
GLuint const GLchar * name
Definition glcorearb.h:781
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
void align(gsl::span< ElinkEncoder< BareFormat, CHARGESUM > > elinks)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"