Skip to content

Commit 36a7d63

Browse files
committed
ITS3: opt. staggering and fixes to alignment
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 877dc1f commit 36a7d63

29 files changed

Lines changed: 1004 additions & 634 deletions

Detectors/Upgrades/ITS3/alignment/src/alignment-workflow.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "GlobalTrackingWorkflowHelpers/InputHelper.h"
1616
#include "GlobalTrackingWorkflowHelpers/NoInpDummyOutSpec.h"
1717
#include "DetectorsRaw/HBFUtilsInitializer.h"
18+
#include "DataFormatsITSMFT/DPLAlpideParamInitializer.h"
1819
#include "ITS3Align/AlignmentSpec.h"
1920

2021
using namespace o2::framework;
@@ -38,6 +39,7 @@ void customize(std::vector<ConfigParamSpec>& workflowOptions)
3839
{"disable-root-input", VariantType::Bool, false, {"disable root-files input reader"}},
3940
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
4041
o2::raw::HBFUtilsInitializer::addConfigOption(options);
42+
o2::itsmft::DPLAlpideParamInitializer::addITSConfigOption(options);
4143
std::swap(workflowOptions, options);
4244
}
4345
#include "Framework/runDataProcessing.h"

Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/Clusterer.h

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// | *|
2121
#define _ALLOW_DIAGONAL_ALPIDE_CLUSTERS_
2222

23+
#include <algorithm>
2324
#include <utility>
2425
#include <vector>
2526
#include <cstring>
@@ -94,18 +95,10 @@ class Clusterer
9495
}
9596
void adjust(uint16_t row, uint16_t col)
9697
{
97-
if (row < rowMin) {
98-
rowMin = row;
99-
}
100-
if (row > rowMax) {
101-
rowMax = row;
102-
}
103-
if (col < colMin) {
104-
colMin = col;
105-
}
106-
if (col > colMax) {
107-
colMax = col;
108-
}
98+
rowMin = std::min(row, rowMin);
99+
rowMax = std::max(row, rowMax);
100+
colMin = std::min(col, colMin);
101+
colMax = std::max(col, colMax);
109102
}
110103
};
111104

@@ -121,6 +114,10 @@ class Clusterer
121114
};
122115

123116
struct ClustererThread {
117+
struct PreCluster {
118+
int head = 0; // index of precluster head in the pixels
119+
int index = 0;
120+
};
124121
Clusterer* parent = nullptr; // parent clusterer
125122
int id = -1;
126123
// buffers for entries in preClusterIndices in 2 columns, to avoid boundary checks, we reserve
@@ -133,12 +130,11 @@ class Clusterer
133130
// pixels[].first is the index of the next pixel of the same precluster in the pixels
134131
// pixels[].second is the index of the referred pixel in the ChipPixelData (element of mChips)
135132
std::vector<std::pair<int, uint32_t>> pixels;
136-
std::vector<int> preClusterHeads; // index of precluster head in the pixels
137-
std::vector<int> preClusterIndices;
138133
uint16_t currCol = 0xffff; ///< Column being processed
139134
bool noLeftCol = true; ///< flag that there is no column on the left to check
140135
std::array<Label, MaxLabels> labelsBuff; //! temporary buffer for building cluster labels
141136
std::vector<PixelData> pixArrBuff; //! temporary buffer for pattern calc.
137+
std::vector<PreCluster> preClusters; //! preclusters info
142138
//
143139
/// temporary storage for the thread output
144140
CompClusCont compClusters;
@@ -152,10 +148,11 @@ class Clusterer
152148
///< swap current and previous column buffers
153149
void swapColumnBuffers() { std::swap(prev, curr); }
154150

151+
///< add cluster at row (entry ip in the ChipPixeData) to the precluster with given index
155152
///< add cluster at row (entry ip in the ChipPixeData) to the precluster with given index
156153
void expandPreCluster(uint32_t ip, uint16_t row, int preClusIndex)
157154
{
158-
auto& firstIndex = preClusterHeads[preClusterIndices[preClusIndex]];
155+
auto& firstIndex = preClusters[preClusters[preClusIndex].index].head;
159156
pixels.emplace_back(firstIndex, ip);
160157
firstIndex = pixels.size() - 1;
161158
curr[row] = preClusIndex;
@@ -164,11 +161,10 @@ class Clusterer
164161
///< add new precluster at given row of current column for the fired pixel with index ip in the ChipPixelData
165162
void addNewPrecluster(uint32_t ip, uint16_t row)
166163
{
167-
preClusterHeads.push_back(pixels.size());
164+
int lastIndex = preClusters.size();
165+
preClusters.emplace_back(pixels.size(), lastIndex);
168166
// new head does not point yet (-1) on other pixels, store just the entry of the pixel in the ChipPixelData
169167
pixels.emplace_back(-1, ip);
170-
int lastIndex = preClusterIndices.size();
171-
preClusterIndices.push_back(lastIndex);
172168
curr[row] = lastIndex; // store index of the new precluster in the current column buffer
173169
}
174170

@@ -212,19 +208,25 @@ class Clusterer
212208
bool isContinuousReadOut() const { return mContinuousReadout; }
213209
void setContinuousReadOut(bool v) { mContinuousReadout = v; }
214210

211+
bool isDropHugeClusters() const { return mDropHugeClusters; }
212+
void setDropHugeClusters(bool v) { mDropHugeClusters = v; }
213+
215214
int getMaxBCSeparationToMask() const { return mMaxBCSeparationToMask; }
216215
void setMaxBCSeparationToMask(int n) { mMaxBCSeparationToMask = n; }
217216

218217
int getMaxRowColDiffToMask() const { return mMaxRowColDiffToMask; }
219218
void setMaxRowColDiffToMask(int v) { mMaxRowColDiffToMask = v; }
220219

221-
int getMaxROFDepthToSquash() const { return mSquashingDepth; }
220+
int getMaxROFDepthToSquash(int layer = -1) const { return (layer < 0) ? mSquashingDepth : mSquashingLayerDepth[layer]; }
222221
void setMaxROFDepthToSquash(int v) { mSquashingDepth = v; }
222+
void addMaxROFDepthToSquash(int v) { mSquashingLayerDepth.push_back(v); }
223223

224-
int getMaxBCSeparationToSquash() const { return mMaxBCSeparationToSquash; }
224+
int getMaxBCSeparationToSquash(int layer = -1) const { return (layer < 0) ? mMaxBCSeparationToSquash : mMaxBCSeparationToSquashLayer[layer]; }
225225
void setMaxBCSeparationToSquash(int n) { mMaxBCSeparationToSquash = n; }
226+
void addMaxBCSeparationToSquash(int n) { mMaxBCSeparationToSquashLayer.push_back(n); }
226227

227-
void print() const;
228+
void print(bool showsTiming) const;
229+
void reset();
228230
void clear();
229231

230232
///< load the dictionary of cluster topologies
@@ -249,6 +251,7 @@ class Clusterer
249251

250252
// clusterization options
251253
bool mContinuousReadout = true; ///< flag continuous readout
254+
bool mDropHugeClusters = false; ///< don't include clusters that would be split in more than one
252255

253256
///< mask continuosly fired pixels in frames separated by less than this amount of BCs (fired from hit in prev. ROF)
254257
int mMaxBCSeparationToMask = static_cast<int>(6000. / o2::constants::lhc::LHCBunchSpacingNS + 10);
@@ -258,6 +261,8 @@ class Clusterer
258261
///< Squashing options
259262
int mSquashingDepth = 0; ///< squashing is applied to next N rofs
260263
int mMaxBCSeparationToSquash = 6000. / o2::constants::lhc::LHCBunchSpacingNS + 10;
264+
std::vector<int> mSquashingLayerDepth;
265+
std::vector<int> mMaxBCSeparationToSquashLayer;
261266

262267
std::vector<std::unique_ptr<ClustererThread>> mThreads; // buffers for threads
263268
std::vector<ChipPixelData> mChips; // currently processed ROF's chips data

Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ int loadROFrameDataITS3(its::TimeFrame<7>* tf,
8383
gsl::span<const itsmft::CompClusterExt> clusters,
8484
gsl::span<const unsigned char>::iterator& pattIt,
8585
const o2::its3::TopologyDictionary* dict,
86+
int layer,
8687
const dataformats::MCTruthContainer<MCCompLabel>* mcLabels = nullptr);
8788
} // namespace its3::ioutils
8889
} // namespace o2

Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/TrackingInterface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ class ITS3TrackingInterface final : public its::ITSTrackingInterface
2424
using its::ITSTrackingInterface::ITSTrackingInterface;
2525

2626
void setClusterDictionary(const o2::its3::TopologyDictionary* d) { mDict = d; }
27-
void updateTimeDependentParams(framework::ProcessingContext& pc) final;
2827
void finaliseCCDB(framework::ConcreteDataMatcher& matcher, void* obj) final;
2928

3029
protected:
30+
void overrideParameters(std::vector<o2::its::TrackingParameters>& t, std::vector<o2::its::VertexingParameters>& v) final;
31+
void requestTopologyDictionary(framework::ProcessingContext& pc) final;
3132
void loadROF(gsl::span<const itsmft::ROFRecord>& trackROFspan,
3233
gsl::span<const itsmft::CompClusterExt> clusters,
3334
gsl::span<const unsigned char>::iterator& pattIt,

0 commit comments

Comments
 (0)