Skip to content

Commit b25a4f3

Browse files
sawenzelclaude
andcommitted
Simplify the multithreaded TPC digitizer after the second review
This addresses the second review of the multithreaded TPC digitizer device. - Old lane files are found with o2::utils::listFiles, as in the chunked merger. - Unused includes and the SpaceCharge alias are removed from the device. - setSectorSeedingFrom fills the rings of the source digitizer, so initSectorSeeding is private. - The seeding documentation states that the sectors share the ring contents. https://its.cern.ch/jira/browse/O2-7309 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 48da7ab commit b25a4f3

3 files changed

Lines changed: 12 additions & 20 deletions

File tree

‎Detectors/TPC/simulation/include/TPCSimulation/Digitizer.h‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,24 @@ class Digitizer
147147
void setSCDistortionsFrom(const Digitizer& other);
148148

149149
/// Use digitizer-owned random rings filled from seed and positioned per sector and timeframe in init(),
150-
/// so that the digits of a sector do not depend on which sectors were processed before
150+
/// so that the digits of a sector do not depend on which sectors were processed before.
151+
/// All sectors share the ring contents and differ in the start positions, as with the singleton rings.
151152
/// \param seed base seed, typically DigiParams.seed
152153
void setUseSectorSeeding(ULong64_t seed);
153154

154155
/// Set the timeframe identifier that enters the sector seeding
155156
void setSeedingTimeframe(ULong64_t timeframe) { mSeedingTimeframe = timeframe; }
156157

157-
/// Fill the random rings of the sector seeding, if not done yet
158-
void initSectorSeeding();
159-
160-
/// Use copies of the sector-seeding random rings of another digitizer
161-
void setSectorSeedingFrom(const Digitizer& other);
158+
/// Use copies of the sector-seeding random rings of another digitizer, which fills them if needed
159+
void setSectorSeedingFrom(Digitizer& other);
162160

163161
/// Whether flush() also flushes the process-wide debug streamer
164162
void setFlushDebugStreamer(bool flush) { mFlushDebugStreamer = flush; }
165163

166164
private:
165+
/// Fill the random rings of the sector seeding, if not done yet
166+
void initSectorSeeding();
167+
167168
ElectronTransport& electronTransport();
168169
GEMAmplification& gemAmplification();
169170
SAMPAProcessing& sampaProcessing();

‎Detectors/TPC/simulation/src/Digitizer.cxx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ void Digitizer::initSectorSeeding()
100100
}
101101
}
102102

103-
void Digitizer::setSectorSeedingFrom(const Digitizer& other)
103+
void Digitizer::setSectorSeedingFrom(Digitizer& other)
104104
{
105+
other.initSectorSeeding();
105106
mUseSectorSeeding = other.mUseSectorSeeding;
106107
mSeed = other.mSeed;
107108
if (other.mGEMAmplification) {

‎Steer/DigitizerWorkflow/src/TPCDigitizerMTSpec.cxx‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "Framework/DataProcessorSpec.h"
1919
#include "Framework/DataRefUtils.h"
2020
#include "Framework/Lifetime.h"
21-
#include "Framework/CCDBParamSpec.h"
2221
#include "Framework/Task.h"
2322
#include "Framework/Logger.h"
2423
#include "Headers/DataHeader.h"
@@ -28,13 +27,9 @@
2827
#include "DetectorsBase/Detector.h"
2928
#include "SimConfig/DigiParams.h"
3029
#include "SimulationDataFormat/DigitizationContext.h"
31-
#include "TPCBaseRecSim/CDBInterface.h"
32-
#include "TPCBase/ParameterGEM.h"
33-
#include "TPCBase/ParameterGas.h"
34-
#include "TPCCalibration/VDriftHelper.h"
3530
#include "TPCSimulation/Digitizer.h"
36-
#include "TPCSpaceCharge/SpaceCharge.h"
3731
#include "CommonUtils/DebugStreamer.h"
32+
#include "CommonUtils/FileSystemUtils.h"
3833
#include <TChain.h>
3934
#include <TFile.h>
4035
#include <TROOT.h>
@@ -53,7 +48,6 @@
5348
#include <vector>
5449

5550
using namespace o2::framework;
56-
using SC = o2::tpc::SpaceCharge<float>;
5751

5852
namespace o2
5953
{
@@ -142,11 +136,8 @@ class TPCDPLDigitizerMTTask : public o2::base::BaseDPLDigitizer
142136
}
143137

144138
// the merger picks up every lane file in the directory, so files of an earlier run must not survive
145-
for (const auto& entry : std::filesystem::directory_iterator(".")) {
146-
const auto name = entry.path().filename().string();
147-
if (name.rfind("tpc_driftime_digits_lane", 0) == 0 && entry.path().extension() == ".root") {
148-
std::filesystem::remove(entry.path());
149-
}
139+
for (const auto& name : o2::utils::listFiles("tpc_driftime_digits_lane.*.root$")) {
140+
std::filesystem::remove(name);
150141
}
151142

152143
ROOT::EnableThreadSafety();
@@ -176,7 +167,6 @@ class TPCDPLDigitizerMTTask : public o2::base::BaseDPLDigitizer
176167
}
177168
if (!mSeedingShared) {
178169
// the rings depend only on the seed, so they are filled once and copied
179-
primary.initSectorSeeding();
180170
for (size_t i = 1; i < mWorkers.size(); ++i) {
181171
mWorkers[i]->digitizer.setSectorSeedingFrom(primary);
182172
}

0 commit comments

Comments
 (0)