Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "SimulationDataFormat/DigitizationContext.h"
#include "Steer/MCKinematicsReader.h"
#include "ITSMFTBase/DPLAlpideParam.h"
#include "DetectorsRaw/HBFUtils.h"

#ifdef VTX_DEBUG
#include "TTree.h"
Expand Down Expand Up @@ -574,16 +575,25 @@ void VertexerTraits::addTruthSeedingVertices()
int64_t roFrameBiasInBC = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance().roFrameBiasInBC;
int64_t roFrameLengthInBC = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance().roFrameLengthInBC;
o2::steer::MCKinematicsReader mcReader(dc);
std::map<int, bounded_vector<Vertex>> vertices;
struct VertInfo {
bounded_vector<Vertex> vertices;
bounded_vector<int> srcs;
bounded_vector<int> events;
};
std::map<int, VertInfo> vertices;
for (int iSrc{0}; iSrc < mcReader.getNSources(); ++iSrc) {
auto eveId2colId = dc->getCollisionIndicesForSource(iSrc);
for (int iEve{0}; iEve < mcReader.getNEvents(iSrc); ++iEve) {
const auto& ir = irs[eveId2colId[iEve]];
if (!ir.isDummy()) { // do we need this, is this for diffractive events?
const auto& eve = mcReader.getMCEventHeader(iSrc, iEve);
int rofId = (ir.toLong() - roFrameBiasInBC) / roFrameLengthInBC;
int rofId = ((ir - raw::HBFUtils::Instance().getFirstSampledTFIR()).toLong() - roFrameBiasInBC) / roFrameLengthInBC;
if (!vertices.contains(rofId)) {
vertices[rofId] = bounded_vector<Vertex>(mMemoryPool.get());
vertices[rofId] = {
.vertices = bounded_vector<Vertex>(mMemoryPool.get()),
.srcs = bounded_vector<int>(mMemoryPool.get()),
.events = bounded_vector<int>(mMemoryPool.get()),
};
}
Vertex vert;
vert.setTimeStamp(rofId);
Expand All @@ -594,7 +604,9 @@ void VertexerTraits::addTruthSeedingVertices()
vert.setChi2(1);
constexpr float cov = 50e-9;
vert.setCov(cov, cov, cov, cov, cov, cov);
vertices[rofId].push_back(vert);
vertices[rofId].vertices.push_back(vert);
vertices[rofId].srcs.push_back(iSrc);
vertices[rofId].events.push_back(iEve);
}
}
}
Expand All @@ -603,10 +615,11 @@ void VertexerTraits::addTruthSeedingVertices()
bounded_vector<Vertex> verts(mMemoryPool.get());
bounded_vector<std::pair<o2::MCCompLabel, float>> polls(mMemoryPool.get());
if (vertices.contains(iROF)) {
verts = vertices[iROF];
const auto& vertInfo = vertices[iROF];
verts = vertInfo.vertices;
nVerts += verts.size();
for (size_t i{0}; i < verts.size(); ++i) {
o2::MCCompLabel lbl; // unset label for now
o2::MCCompLabel lbl(o2::MCCompLabel::maxTrackID(), vertInfo.events[i], vertInfo.srcs[i], false);
polls.emplace_back(lbl, 1.f);
}
} else {
Expand Down
5 changes: 4 additions & 1 deletion Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "Framework/ConfigParamRegistry.h"
#include "Framework/CCDBParamSpec.h"
#include "ITSWorkflow/TrackerSpec.h"
#include "ITStracking/TrackingConfigParam.h"

namespace o2
{
Expand Down Expand Up @@ -120,10 +121,12 @@ DataProcessorSpec getTrackerSpec(bool useMC, bool useGeom, int trgType, Tracking
inputs.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe);
inputs.emplace_back("ITSMC2ROframes", "ITS", "CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
outputs.emplace_back("ITS", "VERTICESMCTR", 0, Lifetime::Timeframe);
outputs.emplace_back("ITS", "VERTICESMCTRCONT", 0, Lifetime::Timeframe);
outputs.emplace_back("ITS", "VERTICESMCPUR", 0, Lifetime::Timeframe);
outputs.emplace_back("ITS", "TRACKSMCTR", 0, Lifetime::Timeframe);
outputs.emplace_back("ITS", "ITSTrackMC2ROF", 0, Lifetime::Timeframe);
if (VertexerParamConfig::Instance().outputContLabels) {
outputs.emplace_back("ITS", "VERTICESMCTRCONT", 0, Lifetime::Timeframe);
}
}

return DataProcessorSpec{
Expand Down