Skip to content

Commit 2e523ea

Browse files
mpucciodavidrohr
authored andcommitted
Re-introduce multiplicity cuts for sync processing
1 parent ddb531b commit 2e523ea

3 files changed

Lines changed: 56 additions & 9 deletions

File tree

Detectors/ITSMFT/ITS/tracking/include/ITStracking/TimeFrame.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ class TimeFrame final
117117
const unsigned long long& getRoadLabel(int i) const;
118118
bool isRoadFake(int i) const;
119119

120+
void setMultiplicityCutMask(std::vector<bool> cutMask) { mMultiplicityCutMask.swap(cutMask); }
121+
120122
/// Debug and printing
121123
void checkTrackletLUTs();
122124
void printROFoffsets();
@@ -140,6 +142,7 @@ class TimeFrame final
140142
float mBeamPos[2] = {0.f, 0.f};
141143
std::vector<float> mMinR;
142144
std::vector<float> mMaxR;
145+
std::vector<bool> mMultiplicityCutMask;
143146
std::vector<int> mROframesPV = {0};
144147
std::vector<std::vector<int>> mROframesClusters;
145148
std::vector<Vertex> mPrimaryVertices;

Detectors/ITSMFT/ITS/tracking/src/TimeFrame.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ void TimeFrame::initialise(const int iteration, const MemoryParameters& memParam
196196
std::vector<int> clsPerBin(trkParam.PhiBins * trkParam.ZBins, 0);
197197
for (int rof{0}; rof < mNrof; ++rof) {
198198
mIndexTables[rof].resize(trkParam.TrackletsPerRoad(), std::vector<int>(trkParam.ZBins * trkParam.PhiBins + 1, 0));
199+
if (mMultiplicityCutMask.size() == mNrof && !mMultiplicityCutMask[rof]) {
200+
continue;
201+
}
199202
for (int iLayer{0}; iLayer < trkParam.NLayers; ++iLayer) {
200203
std::fill(clsPerBin.begin(), clsPerBin.end(), 0);
201204
const auto unsortedClusters{getUnsortedClustersOnLayer(rof, iLayer)};

Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,17 @@ void TrackerDPL::init(InitContext& ic)
112112
memParams.resize(1);
113113
trackParams[0].MinTrackLength = 4;
114114
trackParams[0].TrackletMaxDeltaPhi = o2::its::constants::math::Pi * 0.5f;
115-
trackParams[0].CellMaxDeltaTanLambda = 0.3;
116-
trackParams[0].CellMaxDeltaPhi = 0.3;
115+
trackParams[0].CellMaxDeltaTanLambda *= 400;
116+
trackParams[0].CellMaxDeltaPhi = 1.;
117117
trackParams[0].PhiBins = 4;
118118
trackParams[0].ZBins = 16;
119+
trackParams[0].FitIterationMaxChi2[0] = 1.e28;
120+
trackParams[0].FitIterationMaxChi2[1] = 1.e28;
121+
122+
for (int iLayer = 0; iLayer < 4; ++iLayer) {
123+
trackParams[0].NeighbourMaxDeltaCurvature[iLayer] *= 400;
124+
trackParams[0].NeighbourMaxDeltaN[iLayer] *= 400;
125+
}
119126
for (int iLayer = 0; iLayer < o2::its::constants::its2::TrackletsPerRoad; iLayer++) {
120127
trackParams[0].TrackletMaxDeltaZ[iLayer] = o2::its::constants::its2::LayersZCoordinate()[iLayer + 1];
121128
memParams[0].TrackletsMemoryCoefficients[iLayer] = 0.5f;
@@ -212,6 +219,9 @@ void TrackerDPL::run(ProcessingContext& pc)
212219
auto logger = [&](std::string s) { LOG(info) << s; };
213220
float vertexerElapsedTime{0.f};
214221
int nclUsed = 0;
222+
223+
std::vector<bool> processingMask;
224+
int cutClusterMult{0}, cutVertexMult{0}, cutTotalMult{0};
215225
for (auto& rof : rofspan) {
216226
nclUsed += ioutils::loadROFrameData(rof, event, compClusters, pattIt, mDict, labels);
217227
// prepare in advance output ROFRecords, even if this ROF to be rejected
@@ -222,14 +232,39 @@ void TrackerDPL::run(ProcessingContext& pc)
222232
vtxROF.setFirstEntry(vertices.size()); // dedicated ROFRecord
223233
vtxROF.setNEntries(0);
224234

235+
bool multCut = (multEstConf.cutMultClusLow <= 0 && multEstConf.cutMultClusHigh <= 0); // cut was requested
236+
if (!multCut) {
237+
float mult = multEst.process(rof.getROFData(compClusters));
238+
multCut = mult >= multEstConf.cutMultClusLow && mult <= multEstConf.cutMultClusHigh;
239+
LOG(debug) << fmt::format("ROF {} rejected by the cluster multiplicity selection [{},{}]", processingMask.size(), multEstConf.cutMultClusLow, multEstConf.cutMultClusHigh);
240+
cutClusterMult += !multCut;
241+
}
242+
225243
std::vector<Vertex> vtxVecLoc;
226-
if (mRunVertexer) {
227-
vertexerElapsedTime += mVertexer->clustersToVertices(event, false, logger);
228-
vtxVecLoc = mVertexer->exportVertices();
229-
} else {
230-
vtxVecLoc.emplace_back(Vertex());
231-
vtxVecLoc.back().setNContributors(1);
244+
if (multCut) {
245+
if (mRunVertexer) {
246+
vertexerElapsedTime += mVertexer->clustersToVertices(event, false, logger);
247+
auto allVerts = mVertexer->exportVertices();
248+
multCut = allVerts.size() == 0;
249+
for (const auto& vtx : allVerts) {
250+
if (vtx.getNContributors() < multEstConf.cutMultVtxLow || (multEstConf.cutMultVtxHigh > 0 && vtx.getNContributors() > multEstConf.cutMultVtxHigh)) {
251+
continue; // skip vertex of unwanted multiplicity
252+
}
253+
multCut = true; // At least one passes the selection
254+
vtxVecLoc.push_back(vtx);
255+
}
256+
} else {
257+
vtxVecLoc.emplace_back(Vertex());
258+
vtxVecLoc.back().setNContributors(1);
259+
}
260+
261+
if (!multCut) {
262+
LOG(debug) << fmt::format("ROF {} rejected by the vertex multiplicity selection [{},{}]", processingMask.size(), multEstConf.cutMultVtxLow, multEstConf.cutMultVtxHigh);
263+
cutVertexMult++;
264+
}
232265
}
266+
cutTotalMult += !multCut;
267+
processingMask.push_back(multCut);
233268
mTimeFrame.addPrimaryVertices(vtxVecLoc);
234269

235270
vtxROF.setNEntries(vtxVecLoc.size());
@@ -239,7 +274,13 @@ void TrackerDPL::run(ProcessingContext& pc)
239274
savedROF.push_back(roFrame);
240275
roFrame++;
241276
}
242-
LOG(info) << " - Vertex seeding total elapsed time: " << vertexerElapsedTime << " ms for " << nclUsed << " clusters in " << rofspan.size() << " ROFs";
277+
278+
LOG(info) << fmt::format(" - In total, multiplicity selection rejected {}/{} ROFs", cutTotalMult, rofspan.size());
279+
LOG(info) << fmt::format("\t - Cluster multiplicity selection rejected {}/{} ROFs", cutClusterMult, rofspan.size());
280+
LOG(info) << fmt::format("\t - Vertex multiplicity selection rejected {}/{} ROFs", cutVertexMult, rofspan.size());
281+
LOG(info) << fmt::format(" - Vertex seeding total elapsed time: {} ms for {} clusters in {} ROFs", vertexerElapsedTime, nclUsed, rofspan.size());
282+
283+
mTimeFrame.setMultiplicityCutMask(processingMask);
243284
mTracker->clustersToTracks(logger);
244285

245286
for (unsigned int iROF{0}; iROF < rofs.size(); ++iROF) {

0 commit comments

Comments
 (0)