Skip to content

Commit 831cf1f

Browse files
committed
Fix ITS L2G matrix generation
Account for the difference between ITS chip and epitaxial layer matrices
1 parent 3d639dd commit 831cf1f

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

Detectors/Align/include/Align/AlignableSensorITS.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ class AlignableSensorITS final : public AlignableSensor
3636
AlignableSensorITS(const char* name, int vid, int iid, Controller* ctr);
3737
~AlignableSensorITS() final = default;
3838
void prepareMatrixT2L() final;
39+
void prepareMatrixL2G(bool reco = false) final;
40+
void prepareMatrixL2GIdeal() final;
3941
//
4042
protected:
4143
//

Detectors/Align/include/Align/Controller.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ class Controller final : public TObject
282282
int getDebugOutputLevel() const { return mDebugOutputLevel; }
283283
void setDebugOutputLevel(int i) { mDebugOutputLevel = i; }
284284
void setDebugStream(o2::utils::TreeStreamRedirector* d) { mDBGOut = d; }
285+
o2::utils::TreeStreamRedirector* getDebugStream() { return mDBGOut; }
285286

286287
void setTPCParam(const o2::gpu::GPUParam* par) { mTPCParam = par; }
287288
const o2::gpu::GPUParam* getTPCParam() const { return mTPCParam; }

Detectors/Align/src/AlignableSensorITS.cxx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,40 @@ void AlignableSensorITS::prepareMatrixT2L()
6666
setMatrixT2L(t2l);
6767
}
6868

69+
void AlignableSensorITS::prepareMatrixL2G(bool reco)
70+
{
71+
// Note that for ITS2 it is NOT the same as GeometryManager::getMatrix() (i.e. that of the alignable volule)
72+
// since we need the matrix of epitaxial layer and not the whole chip
73+
auto geom = o2::its::GeometryTGeo::Instance();
74+
const auto* m = geom->extractMatrixSensor(getVolID());
75+
if (!m) {
76+
LOGP(fatal, "Failed on :GeometryTGeo::extractMatrixSensor({})", getVolID());
77+
}
78+
reco ? setMatrixL2GReco(*m) : setMatrixL2G(*m);
79+
}
80+
81+
void AlignableSensorITS::prepareMatrixL2GIdeal()
82+
{
83+
// Note that for ITS2 it is NOT the same as GeometryManager::getOriginalMatrix (i.e. that of the alignable volule)
84+
// since we need the matrix of epitaxial layer and not the whole chip
85+
auto geom = o2::its::GeometryTGeo::Instance();
86+
TGeoHMatrix mtmp;
87+
if (!base::GeometryManager::getOriginalMatrix(getSymName(), mtmp)) { // this is chip ideal matrix, not that of the epitaxial layer
88+
LOG(fatal) << "Failed to find ideal L2G matrix for " << getSymName();
89+
}
90+
// we have to apply to it the difference between the aligner epitaxial layer matrix and that of the chip
91+
const auto* malgSens = geom->extractMatrixSensor(getVolID());
92+
if (!malgSens) {
93+
LOGP(fatal, "Failed on :GeometryTGeo::extractMatrixSensor({})", getVolID());
94+
}
95+
const auto* malgChip = geom->getMatrix(getVolID());
96+
// correct chip original matrix by the difference between aligneg chip and sensor matrices
97+
// Sens_ideal = Chip_ideal * Chip_aligned^-1 * Sens_aligned
98+
auto chAlignInv = malgChip->Inverse();
99+
chAlignInv.Multiply(*malgSens);
100+
mtmp.Multiply(chAlignInv);
101+
setMatrixL2GIdeal(mtmp);
102+
}
103+
69104
} // namespace align
70105
} // namespace o2

Detectors/ITSMFT/ITS/base/include/ITSBase/GeometryTGeo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
338338

339339
TString getMatrixPath(int index) const;
340340

341-
protected:
342341
/// Get the transformation matrix of the SENSOR (not necessary the same as the chip)
343342
/// for a given chip 'index' by quering the TGeoManager
344343
TGeoHMatrix* extractMatrixSensor(int index) const;
@@ -349,6 +348,7 @@ class GeometryTGeo : public o2::itsmft::GeometryTGeo
349348
// get sensor tracking frame alpha and x
350349
void extractSensorXAlpha(int isn, float& x, float& alp);
351350

351+
protected:
352352
/// This routine computes the layer number a given the chip index
353353
/// \param int index The chip index number, starting from zero.
354354
/// \param int indexInLr The chip index inside a layer, starting from zero.

0 commit comments

Comments
 (0)