Skip to content

Commit a430fb1

Browse files
authored
ITS: fix truth seeding for only signal (#14715)
1 parent 4e40ed1 commit a430fb1

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -514,34 +514,34 @@ void VertexerTraits<nLayers>::addTruthSeedingVertices()
514514
bounded_vector<int> events;
515515
};
516516
std::map<int, VertInfo> vertices;
517-
for (int iSrc{0}; iSrc < mcReader.getNSources(); ++iSrc) {
518-
auto eveId2colId = dc->getCollisionIndicesForSource(iSrc);
519-
for (int iEve{0}; iEve < mcReader.getNEvents(iSrc); ++iEve) {
520-
const auto& ir = irs[eveId2colId[iEve]];
521-
if (!ir.isDummy()) { // do we need this, is this for diffractive events?
522-
const auto& eve = mcReader.getMCEventHeader(iSrc, iEve);
523-
int rofId = ((ir - raw::HBFUtils::Instance().getFirstSampledTFIR()).toLong() - roFrameBiasInBC) / roFrameLengthInBC;
524-
if (!vertices.contains(rofId)) {
525-
vertices[rofId] = {
526-
.vertices = bounded_vector<Vertex>(mMemoryPool.get()),
527-
.srcs = bounded_vector<int>(mMemoryPool.get()),
528-
.events = bounded_vector<int>(mMemoryPool.get()),
529-
};
530-
}
531-
Vertex vert;
532-
vert.setTimeStamp(rofId);
533-
vert.setNContributors(std::ranges::count_if(mcReader.getTracks(iSrc, iEve), [](const auto& trk) {
534-
return trk.isPrimary() && trk.GetPt() > 0.2 && std::abs(trk.GetEta()) < 1.3;
535-
}));
536-
vert.setXYZ((float)eve.GetX(), (float)eve.GetY(), (float)eve.GetZ());
537-
vert.setChi2(1);
538-
constexpr float cov = 50e-9;
539-
vert.setCov(cov, cov, cov, cov, cov, cov);
540-
vertices[rofId].vertices.push_back(vert);
541-
vertices[rofId].srcs.push_back(iSrc);
542-
vertices[rofId].events.push_back(iEve);
517+
const int iSrc = 0; // take only events from collision generator
518+
auto eveId2colId = dc->getCollisionIndicesForSource(iSrc);
519+
for (int iEve{0}; iEve < mcReader.getNEvents(iSrc); ++iEve) {
520+
const auto& ir = irs[eveId2colId[iEve]];
521+
if (!ir.isDummy()) { // do we need this, is this for diffractive events?
522+
const auto& eve = mcReader.getMCEventHeader(iSrc, iEve);
523+
int rofId = ((ir - raw::HBFUtils::Instance().getFirstSampledTFIR()).toLong() - roFrameBiasInBC) / roFrameLengthInBC;
524+
if (!vertices.contains(rofId)) {
525+
vertices[rofId] = {
526+
.vertices = bounded_vector<Vertex>(mMemoryPool.get()),
527+
.srcs = bounded_vector<int>(mMemoryPool.get()),
528+
.events = bounded_vector<int>(mMemoryPool.get()),
529+
};
543530
}
531+
Vertex vert;
532+
vert.setTimeStamp(rofId);
533+
vert.setNContributors(std::ranges::count_if(mcReader.getTracks(iSrc, iEve), [](const auto& trk) {
534+
return trk.isPrimary() && trk.GetPt() > 0.2 && std::abs(trk.GetEta()) < 1.3;
535+
}));
536+
vert.setXYZ((float)eve.GetX(), (float)eve.GetY(), (float)eve.GetZ());
537+
vert.setChi2(1);
538+
constexpr float cov = 50e-9;
539+
vert.setCov(cov, cov, cov, cov, cov, cov);
540+
vertices[rofId].vertices.push_back(vert);
541+
vertices[rofId].srcs.push_back(iSrc);
542+
vertices[rofId].events.push_back(iEve);
544543
}
544+
mcReader.releaseTracksForSourceAndEvent(iSrc, iEve);
545545
}
546546
size_t nVerts{0};
547547
for (int iROF{0}; iROF < mTimeFrame->getNrof(); ++iROF) {

0 commit comments

Comments
 (0)