Skip to content

Commit dbe199c

Browse files
committed
Please consider the following formatting changes
1 parent 30f6b2d commit dbe199c

9 files changed

Lines changed: 206 additions & 209 deletions

File tree

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/AlmiraParam.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ struct AlmiraParam : public o2::conf::ConfigurableParamHelper<AlmiraParam> {
3131
int roFrameLengthInBCPerLayer[kNLayers] = {0}; ///< ROF length in BC per layer
3232
float strobeDelayPerLayer[kNLayers] = {0}; ///< strobe delay in ns per layer
3333
float strobeLengthContPerLayer[kNLayers] = {0}; ///< strobe length in ns per layer
34-
int roFrameBiasInBCPerLayer[kNLayers] = {0}; ///< ROF start bias in BC per layer
35-
int roFrameDelayInBCPerLayer[kNLayers] = {0}; ///< extra ROF delay in BC per layer
34+
int roFrameBiasInBCPerLayer[kNLayers] = {0}; ///< ROF start bias in BC per layer
35+
int roFrameDelayInBCPerLayer[kNLayers] = {0}; ///< extra ROF delay in BC per layer
3636

37-
int getROFLengthInBC(int layer) const {
37+
int getROFLengthInBC(int layer) const
38+
{
3839
if (roFrameLengthInBCPerLayer[layer] > 0) {
3940
return roFrameLengthInBCPerLayer[layer];
4041
} else {
@@ -46,7 +47,6 @@ struct AlmiraParam : public o2::conf::ConfigurableParamHelper<AlmiraParam> {
4647
int getROFBiasInBC(int layer) const { return roFrameBiasInBCPerLayer[layer]; }
4748
int getROFDelayInBC(int layer) const { return roFrameDelayInBCPerLayer[layer]; }
4849

49-
5050
O2ParamDef(AlmiraParam, "TRKAlmiraParam");
5151
};
5252

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
8989
int getSubDetID(int index) const;
9090
int getPetalCase(int index) const;
9191
int getDisk(int index) const;
92-
int getLayer(int index) const; ///< local layer index within the sub-detector (0-based per VD/MLOT)
93-
int getLayerTRK(int index) const; ///< global layer index across the full TRK (VD layers 0..nVD-1, MLOT layers nVD..nTotal-1)
92+
int getLayer(int index) const; ///< local layer index within the sub-detector (0-based per VD/MLOT)
93+
int getLayerTRK(int index) const; ///< global layer index across the full TRK (VD layers 0..nVD-1, MLOT layers nVD..nTotal-1)
9494
int getStave(int index) const;
9595
int getHalfStave(int index) const;
9696
int getModule(int index) const;

Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/Specs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ constexpr int nCols{static_cast<int>(length / chip::pitchZ)};
100100

101101
namespace ML
102102
{
103-
constexpr int nLayers{3}; // number of layers in the ML
103+
constexpr int nLayers{3}; // number of layers in the ML
104104
constexpr double width{constants::moduleMLOT::width * 1}; // width of the stave
105105
// constexpr double length{constants::moduleMLOT::length * 10}; // length of the stave
106106
constexpr double length{124 * cm}; // length of the stave, hardcoded to fit the implemented geometry
@@ -118,7 +118,7 @@ constexpr double length{258 * cm}; // len
118118
constexpr int nRows{static_cast<int>(width / moduleMLOT::chip::pitchX)}; // number of rows in the halfstave
119119
constexpr int nCols{static_cast<int>(length / moduleMLOT::chip::pitchZ)}; // number of columns in the halfstave
120120
} // namespace halfstave
121-
constexpr int nLayers{5}; // number of layers in the OT
121+
constexpr int nLayers{5}; // number of layers in the OT
122122
constexpr double width{halfstave::width * 2}; // width of the stave
123123
constexpr double length{halfstave::length}; // length of the stave
124124
constexpr int nRows{static_cast<int>(width / moduleMLOT::chip::pitchX)}; // number of rows in the stave

Detectors/Upgrades/ALICE3/TRK/macros/test/CheckBandwidth.C

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ void CheckBandwidth(std::string digifile = "trkdigits.root", std::string inputGe
193193
rofLengthBC[iLayer] = (*rofRecords[iLayer])[1].getBCData().bc - (*rofRecords[iLayer])[0].getBCData().bc;
194194
}
195195

196-
197196
// --- Collision context ---
198197

199198
TFile* ccFile = TFile::Open(collContextFile.data());
@@ -229,7 +228,6 @@ void CheckBandwidth(std::string digifile = "trkdigits.root", std::string inputGe
229228

230229
// --- Accumulate per-chip digit counts across all ROFs ---
231230

232-
233231
std::vector<unsigned long long> digitsPerChip(nChips, 0ull);
234232
std::vector<unsigned int> maxDigitsPerROFPerChip(nChips, 0u);
235233
std::vector<unsigned int> digitsInCurrentROFPerChip(nChips, 0u);

Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -312,72 +312,72 @@ void CheckClusters(const std::string& clusfile = "o2clus_trk.root",
312312
continue;
313313
}
314314

315-
// ── MC label ───────────────────────────────────────────────────────
316-
const auto& labels = clusLabArr->getLabels(clEntry);
317-
if (labels.empty() || !labels[0].isValid()) {
318-
nInvalidLabel++;
319-
continue;
320-
}
321-
const auto& lab = labels[0];
322-
const int trID = lab.getTrackID();
323-
const int evID = lab.getEventID();
324-
325-
// ── Find matching MC hit ────────────────────────────────────────────
326-
const auto& mc2hit = mc2hitVec[evID];
327-
uint64_t key = (uint64_t(trID) << 32) + cluster.chipID;
328-
auto hitEntry = mc2hit.find(key);
329-
if (hitEntry == mc2hit.end()) {
330-
nNoMCHit++;
331-
continue;
332-
}
333-
const auto& hit = (*hitVecPool[evID])[hitEntry->second];
334-
const float pt = TMath::Hypot(hit.GetPx(), hit.GetPy());
335-
336-
// ── Hit global midpoint ────────────────────────────────────────────
337-
const auto& gloHend = hit.GetPos();
338-
const auto& gloHsta = hit.GetPosStart();
339-
o2::math_utils::Point3D<float> gloHmid(
340-
0.5f * (gloHend.X() + gloHsta.X()),
341-
0.5f * (gloHend.Y() + gloHsta.Y()),
342-
0.5f * (gloHend.Z() + gloHsta.Z()));
343-
344-
// ── Hit global → local ─────────────────────────────
345-
o2::math_utils::Point3D<float> locHsta = gman->getMatrixL2G(cluster.chipID) ^ (gloHsta); // inverse L2G
346-
o2::math_utils::Point3D<float> locHend = gman->getMatrixL2G(cluster.chipID) ^ (gloHend); // inverse L2G
347-
348-
// ── Propagate hit segment to the sensor response surface ───────────────
349-
// Rather than the geometric midpoint, find where the track segment crosses
350-
// the response plane (y = responseYShift in the flat local frame).
351-
// For VD (curved): convert both endpoints to flat frame first.
352-
// For ML/OT (flat): use local coordinates directly.
353-
float hitLocX{0.f}, hitLocZ{0.f};
354-
if (cluster.subDetID == 0) { // VD – curved sensor
355-
auto flatSta = o2::trk::SegmentationChip::curvedToFlat(cluster.layer, locHsta.X(), locHsta.Y());
356-
auto flatEnd = o2::trk::SegmentationChip::curvedToFlat(cluster.layer, locHend.X(), locHend.Y());
357-
float x0 = flatSta.X(), y0 = flatSta.Y(), z0 = locHsta.Z();
358-
float dltx = flatEnd.X() - x0, dlty = flatEnd.Y() - y0, dltz = locHend.Z() - z0;
359-
float r = (std::abs(dlty) > 1e-9f) ? (yPlaneVD - y0) / dlty : 0.5f;
360-
hitLocX = x0 + r * dltx;
361-
hitLocZ = z0 + r * dltz;
362-
} else { // ML/OT – flat sensor
363-
float x0 = locHsta.X(), y0 = locHsta.Y(), z0 = locHsta.Z();
364-
float dltx = locHend.X() - x0, dlty = locHend.Y() - y0, dltz = locHend.Z() - z0;
365-
float r = (std::abs(dlty) > 1e-9f) ? (yPlaneMLOT - y0) / dlty : 0.5f;
366-
hitLocX = x0 + r * dltx;
367-
hitLocZ = z0 + r * dltz;
368-
}
315+
// ── MC label ───────────────────────────────────────────────────────
316+
const auto& labels = clusLabArr->getLabels(clEntry);
317+
if (labels.empty() || !labels[0].isValid()) {
318+
nInvalidLabel++;
319+
continue;
320+
}
321+
const auto& lab = labels[0];
322+
const int trID = lab.getTrackID();
323+
const int evID = lab.getEventID();
324+
325+
// ── Find matching MC hit ────────────────────────────────────────────
326+
const auto& mc2hit = mc2hitVec[evID];
327+
uint64_t key = (uint64_t(trID) << 32) + cluster.chipID;
328+
auto hitEntry = mc2hit.find(key);
329+
if (hitEntry == mc2hit.end()) {
330+
nNoMCHit++;
331+
continue;
332+
}
333+
const auto& hit = (*hitVecPool[evID])[hitEntry->second];
334+
const float pt = TMath::Hypot(hit.GetPx(), hit.GetPy());
335+
336+
// ── Hit global midpoint ────────────────────────────────────────────
337+
const auto& gloHend = hit.GetPos();
338+
const auto& gloHsta = hit.GetPosStart();
339+
o2::math_utils::Point3D<float> gloHmid(
340+
0.5f * (gloHend.X() + gloHsta.X()),
341+
0.5f * (gloHend.Y() + gloHsta.Y()),
342+
0.5f * (gloHend.Z() + gloHsta.Z()));
343+
344+
// ── Hit global → local ─────────────────────────────
345+
o2::math_utils::Point3D<float> locHsta = gman->getMatrixL2G(cluster.chipID) ^ (gloHsta); // inverse L2G
346+
o2::math_utils::Point3D<float> locHend = gman->getMatrixL2G(cluster.chipID) ^ (gloHend); // inverse L2G
347+
348+
// ── Propagate hit segment to the sensor response surface ───────────────
349+
// Rather than the geometric midpoint, find where the track segment crosses
350+
// the response plane (y = responseYShift in the flat local frame).
351+
// For VD (curved): convert both endpoints to flat frame first.
352+
// For ML/OT (flat): use local coordinates directly.
353+
float hitLocX{0.f}, hitLocZ{0.f};
354+
if (cluster.subDetID == 0) { // VD – curved sensor
355+
auto flatSta = o2::trk::SegmentationChip::curvedToFlat(cluster.layer, locHsta.X(), locHsta.Y());
356+
auto flatEnd = o2::trk::SegmentationChip::curvedToFlat(cluster.layer, locHend.X(), locHend.Y());
357+
float x0 = flatSta.X(), y0 = flatSta.Y(), z0 = locHsta.Z();
358+
float dltx = flatEnd.X() - x0, dlty = flatEnd.Y() - y0, dltz = locHend.Z() - z0;
359+
float r = (std::abs(dlty) > 1e-9f) ? (yPlaneVD - y0) / dlty : 0.5f;
360+
hitLocX = x0 + r * dltx;
361+
hitLocZ = z0 + r * dltz;
362+
} else { // ML/OT – flat sensor
363+
float x0 = locHsta.X(), y0 = locHsta.Y(), z0 = locHsta.Z();
364+
float dltx = locHend.X() - x0, dlty = locHend.Y() - y0, dltz = locHend.Z() - z0;
365+
float r = (std::abs(dlty) > 1e-9f) ? (yPlaneMLOT - y0) / dlty : 0.5f;
366+
hitLocX = x0 + r * dltx;
367+
hitLocZ = z0 + r * dltz;
368+
}
369369

370-
nValid++;
371-
std::array<float, 21> data = {
372-
(float)evID, (float)trID,
373-
hitLocX, hitLocZ,
374-
(float)gloHmid.X(), (float)gloHmid.Y(), (float)gloHmid.Z(),
375-
(float)gloC.X(), (float)gloC.Y(), (float)gloC.Z(),
376-
clLocX, clLocZ,
377-
(float)rofRec.getROFrame(), (float)cluster.size, (float)cluster.chipID,
378-
(float)cluster.layer, (float)cluster.disk, (float)cluster.subDetID,
379-
(float)cluster.row, (float)cluster.col, pt};
380-
nt.Fill(data.data());
370+
nValid++;
371+
std::array<float, 21> data = {
372+
(float)evID, (float)trID,
373+
hitLocX, hitLocZ,
374+
(float)gloHmid.X(), (float)gloHmid.Y(), (float)gloHmid.Z(),
375+
(float)gloC.X(), (float)gloC.Y(), (float)gloC.Z(),
376+
clLocX, clLocZ,
377+
(float)rofRec.getROFrame(), (float)cluster.size, (float)cluster.chipID,
378+
(float)cluster.layer, (float)cluster.disk, (float)cluster.subDetID,
379+
(float)cluster.row, (float)cluster.col, pt};
380+
nt.Fill(data.data());
381381
}
382382
}
383383
}

0 commit comments

Comments
 (0)