Skip to content

Commit 8d897a4

Browse files
Merge pull request #5 from alibuild/alibot-cleanup-15748
Please consider the following formatting changes to #15748
2 parents 90fb080 + 5d5f008 commit 8d897a4

7 files changed

Lines changed: 48 additions & 42 deletions

File tree

‎Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ void addTLines(float pitchRow, float pitchCol)
7070
while (xRow > xmin) {
7171
TLine* lineNeg = new TLine(xRow, ymin, xRow, ymax);
7272
lineNeg->SetLineStyle(2);
73-
lineNeg->SetLineColor(kGray+3);
73+
lineNeg->SetLineColor(kGray + 3);
7474
lineNeg->Draw("same");
7575
TLine* linePos = new TLine(std::abs(xRow), ymin, std::abs(xRow), ymax);
7676
linePos->SetLineStyle(2);
77-
linePos->SetLineColor(kGray+3);
77+
linePos->SetLineColor(kGray + 3);
7878
linePos->Draw("same");
7979
xRow -= pitchRow / 2;
8080
}
@@ -83,11 +83,11 @@ void addTLines(float pitchRow, float pitchCol)
8383
while (yCol > ymin) {
8484
TLine* lineNeg = new TLine(xmin, yCol, xmax, yCol);
8585
lineNeg->SetLineStyle(2);
86-
lineNeg->SetLineColor(kGray+3);
86+
lineNeg->SetLineColor(kGray + 3);
8787
lineNeg->Draw("same");
8888
TLine* linePos = new TLine(xmin, std::abs(yCol), xmax, std::abs(yCol));
8989
linePos->SetLineStyle(2);
90-
linePos->SetLineColor(kGray+3);
90+
linePos->SetLineColor(kGray + 3);
9191
linePos->Draw("same");
9292
yCol -= pitchCol / 2;
9393
}
@@ -260,7 +260,7 @@ void CheckClustersIOTOF(std::string clusfile = "tf3clusters.root",
260260
closestHitIdx = 0;
261261
} else {
262262
float maxDist = std::numeric_limits<float>::max();
263-
for (int iHitIdx=0; iHitIdx < hitEntry->second.size(); iHitIdx++) {
263+
for (int iHitIdx = 0; iHitIdx < hitEntry->second.size(); iHitIdx++) {
264264
const o2::itsmft::Hit* hit = &((*hitArray)[hitEntry->second[iHitIdx]]);
265265
if (!hit) {
266266
LOG(error) << "Failed to find matching hit for Track: " << trID << ", chipID: " << chipID << ", eventID: " << evID;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ void addTLines(float pitchRow, float pitchCol)
5959
while (xRow > xmin) {
6060
TLine* lineNeg = new TLine(xRow, ymin, xRow, ymax);
6161
lineNeg->SetLineStyle(2);
62-
lineNeg->SetLineColor(kGray+3);
62+
lineNeg->SetLineColor(kGray + 3);
6363
lineNeg->Draw("same");
6464
TLine* linePos = new TLine(std::abs(xRow), ymin, std::abs(xRow), ymax);
6565
linePos->SetLineStyle(2);
66-
linePos->SetLineColor(kGray+3);
66+
linePos->SetLineColor(kGray + 3);
6767
linePos->Draw("same");
6868
xRow -= pitchRow / 2;
6969
}
@@ -72,11 +72,11 @@ void addTLines(float pitchRow, float pitchCol)
7272
while (yCol > ymin) {
7373
TLine* lineNeg = new TLine(xmin, yCol, xmax, yCol);
7474
lineNeg->SetLineStyle(2);
75-
lineNeg->SetLineColor(kGray+3);
75+
lineNeg->SetLineColor(kGray + 3);
7676
lineNeg->Draw("same");
7777
TLine* linePos = new TLine(xmin, std::abs(yCol), xmax, std::abs(yCol));
7878
linePos->SetLineStyle(2);
79-
linePos->SetLineColor(kGray+3);
79+
linePos->SetLineColor(kGray + 3);
8080
linePos->Draw("same");
8181
yCol -= pitchCol / 2;
8282
}

‎Detectors/Upgrades/ALICE3/IOTOF/macros/CheckTopologiesIOTOF.C‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ void CheckTopologiesIOTOF(const char* topoFileName = "TF3ClusterTopologies.root"
5454
int nPixelsB = b.second.mNPixels;
5555
int frequencyA = a.second.mFrequency;
5656
int frequencyB = b.second.mFrequency;
57-
if (topoA != topoB) return topoA < topoB;
58-
if (frequencyA != frequencyB) return frequencyA > frequencyB;
59-
if (spanRowA != spanRowB) return spanRowA < spanRowB;
60-
if (spanColA != spanColB) return spanColA < spanColB;
61-
if (nPixelsA != nPixelsB) return nPixelsA < nPixelsB;
57+
if (topoA != topoB)
58+
return topoA < topoB;
59+
if (frequencyA != frequencyB)
60+
return frequencyA > frequencyB;
61+
if (spanRowA != spanRowB)
62+
return spanRowA < spanRowB;
63+
if (spanColA != spanColB)
64+
return spanColA < spanColB;
65+
if (nPixelsA != nPixelsB)
66+
return nPixelsA < nPixelsB;
6267
return a.first < b.first; // Finally sort by bitmask if spans are equal
6368
});
6469

@@ -81,9 +86,9 @@ void CheckTopologiesIOTOF(const char* topoFileName = "TF3ClusterTopologies.root"
8186

8287
// Topology names
8388
const std::array<std::string, kNTopologies> topologyNames = {
84-
"kSingleDigit", "kLineOnRow", "kLineOnCol", "kSquare", "kRectangle", "kDiagonal",
85-
"kLowerTriangleLeft", "kLowerTriangleRight", "kUpperTriangleLeft", "kUpperTriangleRight",
86-
"kSnake", "kSnakeRefl", "kSnakeRot90", "kSnakeRot90Refl", "kHuge", "kOther"};
89+
"kSingleDigit", "kLineOnRow", "kLineOnCol", "kSquare", "kRectangle", "kDiagonal",
90+
"kLowerTriangleLeft", "kLowerTriangleRight", "kUpperTriangleLeft", "kUpperTriangleRight",
91+
"kSnake", "kSnakeRefl", "kSnakeRot90", "kSnakeRot90Refl", "kHuge", "kOther"};
8792

8893
// Create output ROOT file
8994
auto* outFile = TFile::Open(outFileName, "RECREATE");
@@ -113,7 +118,7 @@ void CheckTopologiesIOTOF(const char* topoFileName = "TF3ClusterTopologies.root"
113118
float maxRowCoord = chipInfo.PitchRow * (spanRow + 0.5);
114119
float minColCoord = -1.5 * chipInfo.PitchCol;
115120
float maxColCoord = chipInfo.PitchCol * (spanCol + 0.5);
116-
TH2F* hTopoDisplay = new TH2F(Form("spanRow_%i_spanCol_%i_key_%i_all", spanRow, spanCol, topoKey), Form("Cluster Topology %s;Row;Column", topoName.c_str()),
121+
TH2F* hTopoDisplay = new TH2F(Form("spanRow_%i_spanCol_%i_key_%i_all", spanRow, spanCol, topoKey), Form("Cluster Topology %s;Row;Column", topoName.c_str()),
117122
spanRow + 2, minRowCoord, maxRowCoord, spanCol + 2, minColCoord, maxColCoord);
118123

119124
// One-point TGraph for COG
@@ -125,12 +130,12 @@ void CheckTopologiesIOTOF(const char* topoFileName = "TF3ClusterTopologies.root"
125130
gTopoCOG->SetMarkerStyle(20);
126131
gTopoCOG->SetMarkerColor(kBlue);
127132

128-
// Loop over the bits of bitmask and fill the histogram
133+
// Loop over the bits of bitmask and fill the histogram
129134
for (int row = 0; row < spanRow; ++row) {
130135
for (int col = 0; col < spanCol; ++col) {
131136
int bitIndex = row * spanCol + col;
132137
if (bitmask & (1 << bitIndex)) {
133-
hTopoDisplay->SetBinContent(row+2, col+2, frequency);
138+
hTopoDisplay->SetBinContent(row + 2, col + 2, frequency);
134139
}
135140
}
136141
}

‎Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/Clusterer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Clusterer
7070
const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr);
7171
void findClustersMultipleHits(gsl::span<const Digit> digits, gsl::span<const uint32_t> digitIdxs,
7272
const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr);
73-
std::vector<std::vector<uint32_t>> buildPreclusters(gsl::span<const Digit> digits,
73+
std::vector<std::vector<uint32_t>> buildPreclusters(gsl::span<const Digit> digits,
7474
gsl::span<const uint32_t> digitIdxs,
7575
int maxTimeDiffNSigma,
7676
float timeResolution);

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ class TopologyClassifier
9595
static constexpr uint8_t MaxColSpan = 255;
9696
static constexpr uint16_t MaxBitmask = 65535;
9797

98-
TopologyClassifier() {
98+
TopologyClassifier()
99+
{
99100
sSegmentation = o2::iotof::Segmentation::Instance();
100101
}
101-
TopologyClassifier(std::unordered_map<uint32_t, TopologyInfo> map) : mTopologyCache(std::move(map)) {
102+
TopologyClassifier(std::unordered_map<uint32_t, TopologyInfo> map) : mTopologyCache(std::move(map))
103+
{
102104
sSegmentation = o2::iotof::Segmentation::Instance();
103105
}
104106

@@ -113,16 +115,17 @@ class TopologyClassifier
113115
void saveCacheToFile(const char* filename);
114116
void print();
115117

116-
float getErrX(uint32_t pattID) {return std::sqrt(getTopologyFeatures(pattID).mXSigma2);};
117-
float getErrZ(uint32_t pattID) {return std::sqrt(getTopologyFeatures(pattID).mZSigma2);};
118-
float getNPixels(uint32_t pattID) {return getTopologyFeatures(pattID).mNPixels;};
119-
float getMeanX(uint32_t pattID) {return getTopologyFeatures(pattID).mXMean;};
120-
float getMeanZ(uint32_t pattID) {return getTopologyFeatures(pattID).mZMean;};
118+
float getErrX(uint32_t pattID) { return std::sqrt(getTopologyFeatures(pattID).mXSigma2); };
119+
float getErrZ(uint32_t pattID) { return std::sqrt(getTopologyFeatures(pattID).mZSigma2); };
120+
float getNPixels(uint32_t pattID) { return getTopologyFeatures(pattID).mNPixels; };
121+
float getMeanX(uint32_t pattID) { return getTopologyFeatures(pattID).mXMean; };
122+
float getMeanZ(uint32_t pattID) { return getTopologyFeatures(pattID).mZMean; };
121123

122124
// Provide the common iotof::GeometryTGeo to access matrices and segmentation
123125
void setGeometry(const o2::iotof::GeometryTGeo* gm) { mGeometry = gm; }
124126

125-
static uint32_t makeKey(uint8_t spanRow, uint8_t spanCol, uint16_t bitmask) {
127+
static uint32_t makeKey(uint8_t spanRow, uint8_t spanCol, uint16_t bitmask)
128+
{
126129
return (static_cast<uint32_t>(spanRow) << 24) |
127130
(static_cast<uint32_t>(spanCol) << 16) |
128131
static_cast<uint32_t>(bitmask);
@@ -139,8 +142,7 @@ class TopologyClassifier
139142

140143
std::unordered_map<uint32_t, TopologyInfo> mTopologyCache;
141144
const o2::iotof::GeometryTGeo* mGeometry = nullptr; ///< IOTOF geometry
142-
static o2::iotof::Segmentation* sSegmentation; ///< IOTOF segmentation instance (singleton)
143-
145+
static o2::iotof::Segmentation* sSegmentation; ///< IOTOF segmentation instance (singleton)
144146
};
145147

146148
} // namespace iotof

‎Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/Clusterer.cxx‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,22 @@ void Clusterer::ClustererThread::processChip(gsl::span<const Digit> digits,
127127
}
128128

129129
findClustersMultipleHits(
130-
digits,
131-
gsl::span<const uint32_t>(digitIdxs),
132-
labelsDigPtr,
133-
labelsClusPtr);
130+
digits,
131+
gsl::span<const uint32_t>(digitIdxs),
132+
labelsDigPtr,
133+
labelsClusPtr);
134134
}
135135

136136
// Flush per-thread output into the caller's containers
137137

138-
// Push-back cluster labels, dummy labels for clusters with
138+
// Push-back cluster labels, dummy labels for clusters with
139139
// empty labels, to ensure that the clusterLabels container
140-
// WWhas the same size as the clustersOut container.
140+
// WWhas the same size as the clustersOut container.
141141
if (labelsClusPtr) {
142-
const size_t base = clustersOut->size(); // before inserting this chip's clusters
142+
const size_t base = clustersOut->size(); // before inserting this chip's clusters
143143
// and store labels as you go, or copy from mLabels:
144144
for (size_t i = 0; i < mClusters.size(); ++i) {
145-
auto labels = mLabels.getLabels(i); // empty span if none
145+
auto labels = mLabels.getLabels(i); // empty span if none
146146
if (labels.empty()) {
147147
labelsClusPtr->addNoLabelIndex(base + i);
148148
} else {
@@ -210,8 +210,8 @@ std::vector<std::vector<uint32_t>> Clusterer::ClustererThread::buildPreclusters(
210210

211211
auto areNeighbours = [&](const Digit& a, const Digit& b) {
212212
return std::abs(static_cast<int>(a.getRow()) - static_cast<int>(b.getRow())) <= 1 &&
213-
std::abs(static_cast<int>(a.getColumn()) - static_cast<int>(b.getColumn())) <= 1 &&
214-
std::abs(a.getTime() - b.getTime()) <= maxTimeDiffNSigma * timeResolution;
213+
std::abs(static_cast<int>(a.getColumn()) - static_cast<int>(b.getColumn())) <= 1 &&
214+
std::abs(a.getTime() - b.getTime()) <= maxTimeDiffNSigma * timeResolution;
215215
};
216216

217217
for (size_t i = 0; i < digitIdxs.size(); ++i) {

‎Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <TKey.h>
2626
#include <TRandom.h>
2727

28-
2928
#include <set>
3029
#include <vector>
3130
#include <iostream>

0 commit comments

Comments
 (0)