Skip to content

Commit 0c3855e

Browse files
author
Marcello Di Costanzo
committed
Before ITS topology implementation
1 parent c0bab8f commit 0c3855e

8 files changed

Lines changed: 78 additions & 41 deletions

File tree

Detectors/Upgrades/ALICE3/IOTOF/base/include/IOTOFBase/Segmentation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Segmentation
5454
/// same but w/o check for row/column range
5555
void localToDetectorUnchecked(float xRow, float zCol, int& iRow, int& iCol, const int subDetectorID) const;
5656

57-
/// Transformation from Detector cell coordiantes to Geant detector centered
57+
/// Transformation from Detector cell coordinates to Geant detector centered
5858
/// local coordinates (cm)
5959
/// \param int iRow Detector x cell coordinate. Has the range 0 <= iRow < mNumberOfRows
6060
/// \param int iCol Detector z cell coordinate. Has the range 0 <= iCol < mNumberOfColumns

Detectors/Upgrades/ALICE3/IOTOF/base/src/GeometryTGeo.cxx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,35 @@ void GeometryTGeo::Build(int loadTrans)
313313
}
314314

315315
LOG(info) << "TF3 geometry: numberOfChipsITOF = " << mNumberOfChipsIOTOF[0] << ", numberOfChipsOTOF = "
316-
<< mNumberOfChipsIOTOF[1] << ", numberOfChips = " << numberOfChips << ", mNumberOfChipsPerStaveITOF"
316+
<< mNumberOfChipsIOTOF[1] << ", numberOfChips = " << numberOfChips << ", mNumberOfChipsPerStaveITOF = "
317317
<< mNumberOfChipsPerStaveIOTOF[0];
318318

319319
setSize(numberOfChips);
320320
defineSensors();
321321
fillTrackingFramesCache();
322322
fillMatrixCache(loadTrans);
323+
for (int j{0}; j < 2; ++j) {
324+
LOG(info) << "Geometry for layer " << j << ": numberOfStaves = " << mNumberOfStavesIOTOF[j] << ", numberOfSubStaves = " << mNumberOfSubStavesIOTOF[j]
325+
<< ", numberOfModules = " << mNumberOfModulesIOTOF[j] << ", numberOfChipsPerModule = " << mNumberOfChipsPerModuleIOTOF[j]
326+
<< ", numberOfChipsPerSubStave = " << mNumberOfChipsPerSubStaveIOTOF[j] << ", numberOfChipsPerStave = "
327+
<< mNumberOfChipsPerStaveIOTOF[j] << ", numberOfChips = " << mNumberOfChipsIOTOF[j];
328+
}
329+
const auto& specs = ChipSpecificsParam::Instance();
330+
LOG(info) << "specs.NCols = " << specs.NCols;
331+
LOG(info) << "specs.NRows = " << specs.NRows;
332+
LOG(info) << "specs.PitchCol = " << specs.PitchCol;
333+
LOG(info) << "specs.PitchRow = " << specs.PitchRow;
334+
LOG(info) << "specs.PassiveEdgeReadOut = " << specs.PassiveEdgeReadOut;
335+
LOG(info) << "specs.PassiveEdgeTop = " << specs.PassiveEdgeTop;
336+
LOG(info) << "specs.PassiveEdgeSide = " << specs.PassiveEdgeSide;
337+
LOG(info) << "specs.PixelPassiveEdgeX = " << specs.PixelPassiveEdgeX;
338+
LOG(info) << "specs.PixelPassiveEdgeZ = " << specs.PixelPassiveEdgeZ;
339+
LOG(info) << "specs.SensorLayerThicknessEff = " << specs.SensorLayerThicknessEff;
340+
LOG(info) << "specs.SensorLayerThickness = " << specs.SensorLayerThickness;
341+
LOG(info) << "specs.NPixels = " << specs.NPixels();
342+
LOG(info) << "SensorSizeCols = " << specs.SensorSizeCols();
343+
LOG(info) << "SensorSizeRows = " << specs.SensorSizeRows();
344+
323345
// fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G));
324346
}
325347

Detectors/Upgrades/ALICE3/IOTOF/macros/CheckDigitsIOTOF.C

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ void addTLines(float pitch)
7575
gPad->Update();
7676
}
7777

78-
void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfile = "o2sim_HitsTF3.root", std::string inputGeom = "o2sim_geometry.root")
78+
void CheckDigitsIOTOF(std::string digifile = "tf3digits.root",
79+
std::string hitfile = "o2sim_HitsTF3.root",
80+
std::string inputGeom = "o2sim_geometry.root",
81+
std::string geomCfgStr = "IOTOFBase.segmentedInnerTOF=true;IOTOFBase.segmentedOuterTOF=true;IOTOFBase.enableForwardTOF=false;IOTOFBase.enableBackwardTOF=false;")
7982
{
8083
gStyle->SetPalette(55);
8184

@@ -85,7 +88,7 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
8588
using o2::iotof::Digit;
8689
using o2::itsmft::Hit;
8790

88-
o2::conf::ConfigurableParam::updateFromString("IOTOFBase.segmentedInnerTOF=true;IOTOFBase.segmentedOuterTOF=true;IOTOFBase.enableForwardTOF=false;IOTOFBase.enableBackwardTOF=false");
91+
o2::conf::ConfigurableParam::updateFromString(geomCfgStr);
8992

9093
auto seg = o2::iotof::Segmentation::Instance();
9194

@@ -100,6 +103,8 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
100103
o2::base::GeometryManager::loadGeometry(inputGeom);
101104
auto* gman = o2::iotof::GeometryTGeo::Instance();
102105
gman->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G));
106+
std::cout << "Number of chips in ITOF: " << gman->getITOFNumberOfChips() << std::endl;
107+
std::cout << "Number of chips in OTOF: " << gman->getOTOFNumberOfChips() << std::endl;
103108

104109
// Hits
105110
TFile* hitFile = TFile::Open(hitfile.data());
@@ -250,13 +255,13 @@ void CheckDigitsIOTOF(std::string digifile = "tf3digits.root", std::string hitfi
250255
auto canvdXdZ = new TCanvas("canvdXdZ", "", 1600, 800);
251256
canvdXdZ->Divide(2, 1);
252257
canvdXdZ->cd(1);
253-
nt->Draw("dx:dz>>h_dx_vs_dz_ITOF(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 0 && id < 1920", "colz");
258+
nt->Draw("dx:dz>>h_dx_vs_dz_ITOF(1000, -0.05, 0.05, 1000, -0.05, 0.05)", "id >= 0 && id < 1920", "colz");
254259
addTLines(0.01);
255260
auto h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_ITOF");
256261
Info("ITOF", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4);
257262
Info("ITOF", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4);
258263
canvdXdZ->cd(2);
259-
nt->Draw("dx:dz>>h_dx_vs_dz_OTOF(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 1920 && id < 53568", "colz");
264+
nt->Draw("dx:dz>>h_dx_vs_dz_OTOF(1000, -0.05, 0.05, 1000, -0.05, 0.05)", "id >= 1920 && id < 53568", "colz");
260265
addTLines(0.01);
261266
h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_OTOF");
262267
Info("OTOF", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4);

Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/ClustererParam.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ struct ClustererParam : public o2::conf::ConfigurableParamHelper<ClustererParam>
3535

3636
// boilerplate stuff + make principal key
3737
O2ParamDef(ClustererParam, "TF3ClustererParam");
38-
39-
private:
40-
static constexpr float DEFNoisePerPixel()
41-
{
42-
return 1e-8; // ITS/MFT values here!!
43-
}
4438
};
4539

4640
} // namespace iotof

Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/TopologyClassifier.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ enum Topologies : uint8_t {
4040
kLineOnRow,
4141
kLineOnCol,
4242
kSquare,
43+
kRectangle,
4344
kDiagonal,
4445
kLowerTriangleLeft,
4546
kLowerTriangleRight,

Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/IOTOFReconstructionLinkDef.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#pragma link C++ class o2::iotof::Clusterer + ;
1919

20+
#pragma link C++ class o2::iotof::ClustererParam + ;
21+
2022
#pragma link C++ class o2::iotof::TopologyClassifier + ;
2123

2224
#pragma link C++ class o2::iotof::TopologyInfo+;

Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/TopologyClassifier.cxx

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,36 @@ void TopologyClassifier::accountTopology(uint16_t bitmask, uint16_t minRow, uint
107107
return;
108108
}
109109

110+
// Calculate total active digits in the cluster mask
111+
int firedDigits = 0;
112+
for (int r = minRow; r <= maxRow; ++r) {
113+
for (int c = minCol; c <= maxCol; ++c) {
114+
if (hasDigit(r, c)) firedDigits++;
115+
}
116+
}
117+
118+
// Square and rectangles: all pixels fired
119+
if (firedDigits == spanRow * spanCol && spanRow == spanCol) {
120+
newTopo.mTopology = Topologies::kSquare;
121+
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
122+
return;
123+
}
124+
if (firedDigits == spanRow * spanCol && spanRow != spanCol) {
125+
newTopo.mTopology = Topologies::kRectangle;
126+
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
127+
return;
128+
}
129+
110130
// Corner occupancy
111-
const bool hasTopLeft = hasDigit(minRow, minCol);
112-
const bool hasTopRight = hasDigit(minRow, maxCol);
113-
const bool hasBottomLeft = hasDigit(maxRow, minCol);
114-
const bool hasBottomRight = hasDigit(maxRow, maxCol);
131+
const bool hasBottomLeft = hasDigit(minRow, minCol);
132+
const bool hasBottomRight = hasDigit(minRow, maxCol);
133+
const bool hasTopLeft = hasDigit(maxRow, minCol);
134+
const bool hasTopRight = hasDigit(maxRow, maxCol);
115135

116-
// Diagonal and square
136+
// Diagonal and triangles
117137
if (spanRow == spanCol) {
118138

119-
if ((hasTopLeft && hasBottomRight && !hasTopRight && !hasBottomLeft) ||
120-
(!hasTopLeft && !hasBottomRight && hasTopRight && hasBottomLeft)) {
121-
newTopo.mTopology = Topologies::kDiagonal;
122-
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
123-
return;
124-
}
125-
126-
if (hasTopLeft && hasTopRight && hasBottomLeft && hasBottomRight) {
127-
newTopo.mTopology = Topologies::kSquare;
128-
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
129-
return;
130-
}
131-
132-
// Triangles (exactly one missing corner)
139+
// Triangles
133140
const int nCorners = hasTopLeft + hasTopRight + hasBottomLeft + hasBottomRight;
134141
if (nCorners == 3) {
135142
const int missing = !hasTopLeft ? 0 : !hasTopRight ? 1 : !hasBottomLeft ? 2 : 3;
@@ -143,21 +150,28 @@ void TopologyClassifier::accountTopology(uint16_t bitmask, uint16_t minRow, uint
143150
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
144151
return;
145152
}
153+
154+
if ((firedDigits == spanRow && hasTopLeft && hasBottomRight && !hasTopRight && !hasBottomLeft) ||
155+
(firedDigits == spanRow && hasTopRight && hasBottomLeft && !hasTopLeft && !hasBottomRight)) {
156+
newTopo.mTopology = Topologies::kDiagonal;
157+
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
158+
return;
159+
}
146160
}
147161

148162
// Snake: 3 x 2
149163
if (spanRow == 3 && spanCol == 2) {
150-
const bool hasMiddleMin = hasDigit(minRow + 1, minCol);
151-
const bool hasMiddleMax = hasDigit(minRow + 1, maxCol);
164+
const bool hasMiddleMin = hasDigit(minRow, minCol + 1);
165+
const bool hasMiddleMax = hasDigit(minRow, maxCol + 1);
152166

153167
if (hasMiddleMin && hasMiddleMax) {
154-
if (hasTopLeft && hasBottomRight) {
168+
if (!hasTopLeft && !hasBottomRight && hasTopRight && hasBottomLeft) {
155169
newTopo.mTopology = Topologies::kSnake;
156170
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
157171
return;
158172
}
159173

160-
if (!hasTopLeft && !hasBottomRight) {
174+
if (hasTopLeft && hasBottomRight && !hasTopRight && !hasBottomLeft) {
161175
newTopo.mTopology = Topologies::kSnakeRefl;
162176
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
163177
return;
@@ -167,17 +181,17 @@ void TopologyClassifier::accountTopology(uint16_t bitmask, uint16_t minRow, uint
167181

168182
// Snake rotated by 90 degrees: 2 x 3
169183
if (spanRow == 2 && spanCol == 3) {
170-
const bool hasMiddleLeft = hasDigit(minRow, minCol + 1);
171-
const bool hasMiddleRight = hasDigit(maxRow, minCol + 1);
184+
const bool hasMiddleLeft = hasDigit(minRow + 1, minCol);
185+
const bool hasMiddleRight = hasDigit(maxRow + 1, minCol);
172186

173187
if (hasMiddleLeft && hasMiddleRight) {
174-
if (hasTopLeft && hasBottomRight) {
188+
if (!hasTopLeft && !hasBottomRight && hasTopRight && hasBottomLeft) {
175189
newTopo.mTopology = Topologies::kSnakeRot90;
176190
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
177191
return;
178192
}
179193

180-
if (!hasTopLeft && !hasBottomRight) {
194+
if (hasTopLeft && hasBottomRight && !hasTopRight && !hasBottomLeft) {
181195
newTopo.mTopology = Topologies::kSnakeRot90Refl;
182196
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
183197
return;
@@ -190,7 +204,6 @@ void TopologyClassifier::accountTopology(uint16_t bitmask, uint16_t minRow, uint
190204
mTopologyCache[packKey(spanRow, spanCol, bitmask)] = newTopo;
191205
return;
192206
}
193-
// Insert in map
194207
}
195208

196209

Framework/Core/src/CommonServices.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ o2::framework::ServiceSpec CommonServices::monitoringSpec()
143143
// covers devices that quit themselves via readyToQuit().
144144
.stop = [](ServiceRegistryRef, void* service) {
145145
auto* monitoring = reinterpret_cast<Monitoring*>(service);
146-
monitoring->finalizeProcessMonitoring(); },
146+
monitoring->enableProcessMonitoring(); },
147147
.exit = [](ServiceRegistryRef registry, void* service) {
148148
auto* monitoring = reinterpret_cast<Monitoring*>(service);
149149
monitoring->flushBuffer();

0 commit comments

Comments
 (0)