Skip to content

Commit 8ef0690

Browse files
committed
WIP: Fixes + doubts
1 parent 75c9142 commit 8ef0690

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

Detectors/Upgrades/IT3/base/include/ITS3Base/SegmentationSuperAlpide.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <Rtypes.h>
1919
#include "MathUtils/Cartesian.h"
2020
#include "CommonConstants/MathConstants.h"
21+
#include <Framework/Logger.h>
2122

2223
namespace o2
2324
{
@@ -29,12 +30,14 @@ class SegmentationSuperAlpide
2930
{
3031
public:
3132
SegmentationSuperAlpide(int layer = 0) : NPixels{NRows * NCols},
32-
NRows{static_cast<int>(double(Radii[layer]) * double(constants::math::TwoPI) / double(PitchRow) + 1)},
33+
NRows{static_cast<int>(double(Radii[layer]) * double(constants::math::PI) / double(PitchRow) + 1)},
3334
ActiveMatrixSizeRows{PitchRow * NRows},
3435
SensorSizeRows{ActiveMatrixSizeRows + PassiveEdgeTop + PassiveEdgeReadOut}
3536
{
37+
LOGP(info, "rows: {} cols: {} npixels: {}", NRows, NCols, NPixels);
38+
LOGP(info, "SegmentationSuperAlpide: layer {} ActiveMatrixSizeRows: {} ActiveMatrixSizeCols: {}", layer, ActiveMatrixSizeCols, ActiveMatrixSizeRows);
3639
}
37-
static constexpr std::array<float, 5> Radii = {1.8f, 2.4f, 3.0f, 7.0f, 10.f};
40+
static constexpr std::array<float, 10> Radii = {1.8f, 1.8f, 2.4f, 2.4f, 3.0f, 3.0f, 7.0f, 7.0f, 10.f, 10.f};
3841
static constexpr float Length = 27.15f;
3942
static constexpr float PitchCol = 20.e-4;
4043
static constexpr float PitchRow = 20.e-4;

Detectors/Upgrades/IT3/simulation/src/Digitizer.cxx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,18 +228,21 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
228228
int nSteps = mParams.getNSimSteps();
229229
short detID{hit.GetDetectorID()};
230230
const auto& matrix = mGeometry->getMatrixL2G(detID); // <<<< ?????
231-
bool innerBarrel{detID < mSuperSegmentations.size()};
231+
bool innerBarrel{detID < mSuperSegmentations.size()};
232232
float gap = 0.1; // FIXME: get this properly!
233233
auto startPos = hit.GetPosStart();
234-
float recenteredStartY = (startPos.Y() > 0) ? startPos.Y() - gap / 2 : startPos.Y() + gap / 2; // This is due to the gap between the ITS3 emispheres
235-
float startPhi{std::atan2(-recenteredStartY, -startPos.X())};
234+
// LOGP(info, "StartPos: {} {} {}", startPos.X(), startPos.Y(), startPos.Z());
235+
float reShiftedStartY = (startPos.Y() > 0) ? startPos.Y() - gap / 2 : startPos.Y() + gap / 2; // This is due to the gap between the ITS3 emispheres
236+
float startPhi{std::atan2(reShiftedStartY, startPos.X())};
237+
LOGP(info, "X: {}, Y: {}, startPhi: {}", startPos.X(), reShiftedStartY, startPhi);
236238
auto endPos = hit.GetPos();
237-
float recenteredEndY = (endPos.Y() > 0) ? endPos.Y() - gap / 2 : endPos.Y() + gap / 2; // This is due to the gap between the ITS3 emispheres
238-
float endPhi{std::atan2(-recenteredEndY, -endPos.X())};
239+
float reShiftedEndY = (endPos.Y() > 0) ? endPos.Y() - gap / 2 : endPos.Y() + gap / 2; // This is due to the gap between the ITS3 emispheres
240+
float endPhi{std::atan2(reShiftedEndY, endPos.X())};
241+
LOGP(info, "X: {}, Y: {}, endPhi: {}", endPos.X(), reShiftedEndY, endPhi);
239242
math_utils::Vector3D<float> xyzLocS, xyzLocE;
240243
if (innerBarrel) {
241-
xyzLocS = {SegmentationSuperAlpide::Radii[detID] * startPhi, 0.f, startPos.Z()};
242-
xyzLocE = {SegmentationSuperAlpide::Radii[detID] * endPhi, 0.f, endPos.Z()};
244+
xyzLocS = {SegmentationSuperAlpide::Radii[detID] * (startPhi), 0.f, startPos.Z()};
245+
xyzLocE = {SegmentationSuperAlpide::Radii[detID] * (endPhi), 0.f, endPos.Z()};
243246
} else {
244247
xyzLocS = matrix ^ (hit.GetPosStart());
245248
xyzLocE = matrix ^ (hit.GetPos());
@@ -250,7 +253,7 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
250253
step *= nStepsInv; // position increment at each step
251254
// the electrons will be injected in the middle of each step
252255
math_utils::Vector3D<float> stepH(step * 0.5);
253-
xyzLocS += stepH; // Adjust start position to the middle of the first step
256+
xyzLocS += stepH; // Adjust start position to the middle of the first step
254257
xyzLocE -= stepH; // Adjust end position to the middle of the last step
255258

256259
int rowS = -1, colS = -1, rowE = -1, colE = -1, nSkip = 0;
@@ -269,6 +272,7 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
269272
}
270273
xyzLocE -= step;
271274
}
275+
LOGP(info, "x: {}, z: {}, col: {}, row: {}, detID: {}", xyzLocS.X(), xyzLocS.Z(), colS, rowS, detID);
272276
} else {
273277
// get entrance pixel row and col
274278
while (!Segmentation::localToDetector(xyzLocS.X(), xyzLocS.Z(), rowS, colS)) { // guard-ring ?

0 commit comments

Comments
 (0)