77 updateTimeDependentParams(pc);
78 auto compClusters = pc.
inputs().
get<gsl::span<o2::itsmft::CompClusterExt>>(
"compClusters");
79 gsl::span<const unsigned char> patterns = pc.
inputs().
get<gsl::span<unsigned char>>(
"patterns");
85 auto rofsinput = pc.
inputs().
get<gsl::span<o2::itsmft::ROFRecord>>(
"ROframes");
86 gsl::span<const o2::itsmft::PhysTrigger> physTriggers;
87 std::vector<o2::itsmft::PhysTrigger> fromTRD;
88 if (mUseTriggers == 2) {
90 auto trdTriggers = pc.
inputs().
get<gsl::span<o2::trd::TriggerRecord>>(
"phystrig");
91 for (
const auto& trig : trdTriggers) {
92 if (trig.getBCData() >=
ir && trig.getNumberOfTracklets()) {
93 ir = trig.getBCData();
97 physTriggers = gsl::span<const o2::itsmft::PhysTrigger>(fromTRD.data(), fromTRD.size());
98 }
else if (mUseTriggers == 1) {
99 physTriggers = pc.
inputs().
get<gsl::span<o2::itsmft::PhysTrigger>>(
"phystrig");
102 auto& rofs = pc.
outputs().
make<std::vector<o2::itsmft::ROFRecord>>(
Output{
"ITS",
"ITSTrackROF", 0}, rofsinput.begin(), rofsinput.end());
104 std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::MCCompLabel>> labels;
105 gsl::span<itsmft::MC2ROFRecord const> mc2rofs;
109 mc2rofs = pc.
inputs().
get<gsl::span<itsmft::MC2ROFRecord>>(
"MC2ROframes");
114 LOG(info) <<
"ITSCookedTracker pulled " << compClusters.size() <<
" clusters, in " << rofs.size() <<
" RO frames";
116 std::vector<o2::MCCompLabel> trackLabels;
121 mVertexerPtr->adoptTimeFrame(mTimeFrame);
123 auto& vertROFvec = pc.
outputs().
make<std::vector<o2::itsmft::ROFRecord>>(
Output{
"ITS",
"VERTICESROF", 0});
124 auto& vertices = pc.
outputs().
make<std::vector<Vertex>>(
Output{
"ITS",
"VERTICES", 0});
125 auto& tracks = pc.
outputs().
make<std::vector<o2::its::TrackITS>>(
Output{
"ITS",
"TRACKS", 0});
126 auto& clusIdx = pc.
outputs().
make<std::vector<int>>(
Output{
"ITS",
"TRACKCLSID", 0});
127 auto& irFrames = pc.
outputs().
make<std::vector<o2::dataformats::IRFrame>>(
Output{
"ITS",
"IRFRAMES", 0});
130 int nBCPerTF = mTracker.
getContinuousMode() ? alpParams.roFrameLengthInBC : alpParams.roFrameLengthTrig;
132 gsl::span<const unsigned char>::iterator pattIt_timeframe = patterns.begin();
133 gsl::span<const unsigned char>::iterator pattIt_tracker = patterns.begin();
134 gsl::span<itsmft::ROFRecord> rofspan(rofs);
135 mTimeFrame.
loadROFrameData(rofspan, compClusters, pattIt_timeframe, mDict, labels.get());
139 std::vector<uint8_t> processingMask;
140 int cutVertexMult{0}, cutRandomMult =
int(rofsinput.size()) - multEst.
selectROFs(rofsinput, compClusters, physTriggers, processingMask);
144 float vertexerElapsedTime;
146 vertexerElapsedTime = mVertexerPtr->clustersToVertices([&](std::string s) {
LOG(info) << s; });
148 LOG(info) << fmt::format(
" - Vertex seeding total elapsed time: {} ms in {} ROFs", vertexerElapsedTime, rofspan.size());
149 for (
size_t iRof{0}; iRof < rofspan.size(); ++iRof) {
150 auto& rof = rofspan[iRof];
152 auto& vtxROF = vertROFvec.emplace_back(rof);
153 vtxROF.setFirstEntry(vertices.size());
154 vtxROF.setNEntries(0);
155 if (!processingMask[iRof]) {
156 rof.setFirstEntry(tracks.size());
161 std::vector<o2::dataformats::Vertex<o2::dataformats::TimeStamp<int>>> vtxVecLoc;
163 vtxVecLoc.push_back(
v);
166 if (multEstConf.isVtxMultCutRequested()) {
167 std::vector<o2::dataformats::Vertex<o2::dataformats::TimeStamp<int>>> vtxVecSel;
168 vtxVecSel.swap(vtxVecLoc);
169 int nv = vtxVecSel.size(), nrej = 0;
170 for (
const auto& vtx : vtxVecSel) {
171 if (!multEstConf.isPassingVtxMultCut(vtx.getNContributors())) {
172 LOG(info) <<
"Found vertex mult. " << vtx.getNContributors() <<
" is outside of requested range " << multEstConf.cutMultVtxLow <<
" : " << multEstConf.cutMultVtxHigh <<
" | ROF " << rof.getBCData();
176 vtxVecLoc.push_back(vtx);
178 if (nv && (nrej == nv)) {
180 processingMask[iRof] =
false;
183 if (vtxVecLoc.empty()) {
184 if (multEstConf.cutMultVtxLow < 1) {
185 vtxVecLoc.emplace_back();
187 rof.setFirstEntry(tracks.size());
192 vtxROF.setNEntries(vtxVecLoc.size());
193 for (
const auto& vtx : vtxVecLoc) {
194 vertices.push_back(vtx);
199 mTracker.
process(compClusters, pattIt_tracker, mDict, tracks, clusIdx, rof);
200 if (processingMask[iRof]) {
201 irFrames.emplace_back(rof.getBCData(), rof.getBCData() + nBCPerTF - 1).info = tracks.size();
204 LOGP(info,
" - rejected {}/{} ROFs: random/mult.sel:{} (seed {}), vtx.sel:{}", cutRandomMult + cutVertexMult, rofspan.size(), cutRandomMult, multEst.
lastRandomSeed, cutVertexMult);
205 LOG(info) <<
"ITSCookedTracker pushed " << tracks.size() <<
" tracks and " << vertices.size() <<
" vertices";
278 std::vector<InputSpec> inputs;
279 inputs.emplace_back(
"compClusters",
"ITS",
"COMPCLUSTERS", 0, Lifetime::Timeframe);
280 inputs.emplace_back(
"patterns",
"ITS",
"PATTERNS", 0, Lifetime::Timeframe);
281 inputs.emplace_back(
"ROframes",
"ITS",
"CLUSTERSROF", 0, Lifetime::Timeframe);
282 inputs.emplace_back(
"cldict",
"ITS",
"CLUSDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Calib/ClusterDictionary"));
283 inputs.emplace_back(
"alppar",
"ITS",
"ALPIDEPARAM", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Config/AlpideParam"));
285 inputs.emplace_back(
"phystrig",
"ITS",
"PHYSTRIG", 0, Lifetime::Timeframe);
286 }
else if (trgType == 2) {
287 inputs.emplace_back(
"phystrig",
"TRD",
"TRKTRGRD", 0, Lifetime::Timeframe);
290 std::vector<OutputSpec> outputs;
291 outputs.emplace_back(
"ITS",
"TRACKS", 0, Lifetime::Timeframe);
292 outputs.emplace_back(
"ITS",
"TRACKCLSID", 0, Lifetime::Timeframe);
293 outputs.emplace_back(
"ITS",
"ITSTrackROF", 0, Lifetime::Timeframe);
294 outputs.emplace_back(
"ITS",
"VERTICES", 0, Lifetime::Timeframe);
295 outputs.emplace_back(
"ITS",
"VERTICESROF", 0, Lifetime::Timeframe);
296 outputs.emplace_back(
"ITS",
"IRFRAMES", 0, Lifetime::Timeframe);
299 inputs.emplace_back(
"labels",
"ITS",
"CLUSTERSMCTR", 0, Lifetime::Timeframe);
300 inputs.emplace_back(
"MC2ROframes",
"ITS",
"CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
301 outputs.emplace_back(
"ITS",
"TRACKSMCTR", 0, Lifetime::Timeframe);
302 outputs.emplace_back(
"ITS",
"ITSTrackMC2ROF", 0, Lifetime::Timeframe);
304 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
313 ggRequest->addInput({
"itsTGeo",
"ITS",
"GEOMTGEO", 0, Lifetime::Condition,
framework::ccdbParamSpec(
"ITS/Config/Geometry")}, inputs);
316 "its-cooked-tracker",
323 Options{{
"nthreads", VariantType::Int, 1, {
"Number of threads"}}}};
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.