Skip to content

Commit 32156f6

Browse files
author
Marcello Di Costanzo
committed
Remove subdetID and geometry instance from Clusterer class
1 parent 9d314dd commit 32156f6

8 files changed

Lines changed: 12 additions & 32 deletions

File tree

Detectors/Upgrades/ALICE3/IOTOF/DataFormatsIOTOF/include/DataFormatsIOTOF/Cluster.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ struct Cluster {
2424
uint16_t row = 0;
2525
uint16_t col = 0;
2626
uint16_t size = 1;
27-
int16_t subDetID = -1;
2827
double time = 0.0;
2928

3029
std::string asString() const;

Detectors/Upgrades/ALICE3/IOTOF/DataFormatsIOTOF/src/Cluster.cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ namespace o2::iotof
2020
std::string Cluster::asString() const
2121
{
2222
std::ostringstream stream;
23-
stream << "chip=" << chipID << " row=" << row << " col=" << col
24-
<< " size=" << size << " subDet=" << subDetID;
23+
stream << "chip=" << chipID << " row=" << row << " col=" << col << " size=" << size;
2524
return stream.str();
2625
}
2726

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void CheckClustersIOTOF(std::string digiFilePath = "tf3digits.root", std::string
9494
std::cout << "---> Number of clusters with MC label: " << clsLabels->getIndexedSize() << std::endl;
9595
std::cout << std::endl;
9696

97-
auto clsTuple = new TNtuple("clsTuple", "clsTuple", "chip_id:x:y:z:subdet_id:row:col:time");
97+
auto clsTuple = new TNtuple("clsTuple", "clsTuple", "chip_id:x:y:z:row:col:time");
9898
clsTuple->SetDirectory(nullptr);
9999

100100
TH1F* histXCoordCls = new TH1F("histXCoordCls", "histXCoordCls", 8000, -100, 100);
@@ -176,7 +176,6 @@ void CheckClustersIOTOF(std::string digiFilePath = "tf3digits.root", std::string
176176
globalClsCoords.x(),
177177
globalClsCoords.y(),
178178
globalClsCoords.z(),
179-
(*clsArray)[iCls].subDetID,
180179
(*clsArray)[iCls].row,
181180
(*clsArray)[iCls].col,
182181
(*clsArray)[iCls].time);

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ class Clusterer
6363

6464
void fetchMCLabels(uint32_t digID, const ConstDigitTruth* labelsDig, int& nfilled);
6565
void finishChipSingleHitFast(gsl::span<const Digit> digits, uint32_t digitIdx,
66-
const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr,
67-
GeometryTGeo* geom);
66+
const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr);
6867
void processChip(gsl::span<const Digit> digits, int chipFirst, int chipN,
6968
std::vector<Cluster>* clustersOut, std::vector<unsigned char>* patternsOut,
70-
const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr,
71-
GeometryTGeo* geom);
69+
const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr);
7270

7371
explicit ClustererThread(Clusterer* par = nullptr) : parent(par) {}
7472
ClustererThread(const ClustererThread&) = delete;

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

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
/// \file Clusterer.cxx
1313
/// \brief Implementation of the IOTOF cluster finder
1414

15+
#include "Framework/Logger.h"
16+
1517
#include "IOTOFReconstruction/Clusterer.h"
16-
#include "IOTOFBase/GeometryTGeo.h"
17-
#include "IOTOFSimulation/Segmentation.h"
1818

1919
#include <algorithm>
2020
#include <numeric>
@@ -33,14 +33,12 @@ void Clusterer::process(gsl::span<const Digit> digits,
3333
gsl::span<const DigMC2ROFRecord> digMC2ROFs,
3434
std::vector<o2::itsmft::MC2ROFRecord>* clusterMC2ROFs)
3535
{
36-
LOG(info) << "Clusterizing " << digitROFs.size() << " ROFs, total digits: " << digits.size();
36+
LOG(info) << "Running clusterizer on " << digitROFs.size() << " ROFs, total digits: " << digits.size();
3737

3838
if (!mThread) {
3939
mThread = std::make_unique<ClustererThread>(this);
4040
}
4141

42-
auto* geom = o2::iotof::GeometryTGeo::Instance();
43-
4442
for (size_t iROF = 0; iROF < digitROFs.size(); ++iROF) {
4543
LOG(debug) << "Processing digit ROF " << iROF << "/" << digitROFs.size();
4644
const auto& inROF = digitROFs[iROF];
@@ -82,7 +80,7 @@ void Clusterer::process(gsl::span<const Digit> digits,
8280
const int chipN = sliceStart - chipFirst;
8381

8482
LOG(debug) << "Processing chip " << chipID << " with " << chipN << " digits, next chip start from index " << sliceStart;
85-
mThread->processChip(digits, chipFirst, chipN, &clusters, &patterns, digitLabels, clusterLabels, geom);
83+
mThread->processChip(digits, chipFirst, chipN, &clusters, &patterns, digitLabels, clusterLabels);
8684
}
8785

8886
LOG(debug) << "Finished processing digit ROF " << iROF << ", produced " << (clusters.size() - outFirst) << " clusters";
@@ -105,8 +103,7 @@ void Clusterer::ClustererThread::processChip(gsl::span<const Digit> digits,
105103
std::vector<Cluster>* clustersOut,
106104
std::vector<unsigned char>* patternsOut,
107105
const ConstDigitTruth* labelsDigPtr,
108-
ClusterTruth* labelsClusPtr,
109-
GeometryTGeo* geom)
106+
ClusterTruth* labelsClusPtr)
110107
{
111108
// chipFirst and chipN are relative to mSortIdx (i.e. mSortIdx[chipFirst..chipFirst+chipN-1]
112109
// are the global digit indices for this chip, already sorted by col then row).
@@ -117,13 +114,13 @@ void Clusterer::ClustererThread::processChip(gsl::span<const Digit> digits,
117114
// are handled with a preclusterer. TF3 still does not have per-ROF readout, so we
118115
// use finishChipSingleHitFast on all hits for now.
119116
for (auto i = 0; i < chipN; ++i) {
120-
finishChipSingleHitFast(digits, sortIdx[chipFirst + i], labelsDigPtr, labelsClusPtr, geom);
117+
finishChipSingleHitFast(digits, sortIdx[chipFirst + i], labelsDigPtr, labelsClusPtr);
121118
}
122119

123120
// // TRK logic for per-ROF readout, not used for TF3 yet.
124121
// if (chipN == 1) {
125122
// LOG(debug) << "Processing single hit chip";
126-
// finishChipSingleHitFast(digits, sortIdx[chipFirst], labelsDigPtr, labelsClusPtr, geom);
123+
// finishChipSingleHitFast(digits, sortIdx[chipFirst], labelsDigPtr, labelsClusPtr);
127124
// } else {
128125
// LOG(debug) << "Processing multi-hit chip with " << chipN << " hits";
129126
// // Call to initChip()
@@ -151,8 +148,7 @@ void Clusterer::ClustererThread::processChip(gsl::span<const Digit> digits,
151148
void Clusterer::ClustererThread::finishChipSingleHitFast(gsl::span<const Digit> digits,
152149
uint32_t digitIdx,
153150
const ConstDigitTruth* labelsDigPtr,
154-
ClusterTruth* labelsClusPtr,
155-
GeometryTGeo* geom)
151+
ClusterTruth* labelsClusPtr)
156152
{
157153
const auto& digit = digits[digitIdx];
158154
const uint16_t chipID = digit.getChipIndex();
@@ -179,9 +175,6 @@ void Clusterer::ClustererThread::finishChipSingleHitFast(gsl::span<const Digit>
179175
cluster.row = row;
180176
cluster.col = col;
181177
cluster.size = 1;
182-
if (geom) {
183-
cluster.subDetID = geom->getIOTOFLayer(chipID);
184-
}
185178
cluster.time = time;
186179
clusters.emplace_back(cluster);
187180
}

Detectors/Upgrades/ALICE3/IOTOF/workflow/src/ClustererSpec.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ o2::framework::DataProcessorSpec getClustererSpec(bool useMC)
9090
if (useMC) {
9191
inputs.emplace_back(std::format("labels_{}", iLayer), "TF3", "DIGITSMCTR", iLayer, o2::framework::Lifetime::Timeframe);
9292
}
93-
LOG(debug) << "Created " << inputs.size() << " input specifications for IOTOFClusterer";
9493

9594
std::vector<o2::framework::OutputSpec> outputs;
9695
outputs.emplace_back("TF3", "COMPCLUSTERS", iLayer, o2::framework::Lifetime::Timeframe);
@@ -99,7 +98,6 @@ o2::framework::DataProcessorSpec getClustererSpec(bool useMC)
9998
if (useMC) {
10099
outputs.emplace_back("TF3", "CLUSTERSMCTR", iLayer, o2::framework::Lifetime::Timeframe);
101100
}
102-
LOG(debug) << "Created " << outputs.size() << " output specifications for IOTOFClusterer";
103101

104102
return o2::framework::DataProcessorSpec{
105103
"iotof-clusterer",

Detectors/Upgrades/ALICE3/IOTOF/workflow/src/RecoWorkflow.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,16 @@ framework::WorkflowSpec getWorkflow(bool useMC,
2929
framework::WorkflowSpec specs;
3030

3131
if (!(upstreamDigits || upstreamClusters)) {
32-
LOG(debug) << "Adding DigitReaderSpec to workflow";
3332
specs.emplace_back(o2::iotof::getIOTOFDigitReaderSpec(useMC, false, "tf3digits.root"));
3433
}
3534
if (!upstreamClusters) {
36-
LOG(debug) << "Adding ClustererSpec to workflow";
3735
specs.emplace_back(o2::iotof::getIOTOFClustererSpec(useMC));
3836
}
3937

4038
if (!disableRootOutput) {
41-
LOG(debug) << "Adding ClusterWriterSpec to workflow";
4239
specs.emplace_back(o2::iotof::getIOTOFClusterWriterSpec(useMC, false));
4340
}
4441

45-
LOG(debug) << "Starting execution with " << specs.size() << " workflow specifications";
4642
return specs;
4743
}
4844

Detectors/Upgrades/ALICE3/IOTOF/workflow/src/iotof-reco-workflow.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
6464

6565
o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& configcontext)
6666
{
67-
LOG(debug) << "Entering iotof-reco-workflow";
6867
// Update the (declared) parameters if changed from the command line
6968
auto useMC = !configcontext.options().get<bool>("disable-mc");
7069
// auto hitRecoConfig = configcontext.options().get<std::string>("tracking-from-hits-config");
@@ -78,6 +77,5 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co
7877
// write the configuration used for the reco workflow
7978
o2::conf::ConfigurableParam::writeINI("o2tf3recoflow_configuration.ini");
8079

81-
LOG(debug) << "Calling o2::iotof::reco_workflow::getWorkflow";
8280
return o2::iotof::reco_workflow::getWorkflow(useMC, /*hitRecoConfig,*/ extDigits, extClusters, disableRootOutput /*, useGpuWF, gpuDevice*/);
8381
}

0 commit comments

Comments
 (0)