73 updateTimeDependentParams(pc);
74 auto compClusters = pc.
inputs().
get<gsl::span<o2::itsmft::CompClusterExt>>(
"compClusters");
75 gsl::span<const unsigned char> patterns = pc.
inputs().
get<gsl::span<unsigned char>>(
"patterns");
81 auto rofsinput = pc.
inputs().
get<gsl::span<o2::itsmft::ROFRecord>>(
"ROframes");
82 gsl::span<const o2::itsmft::PhysTrigger> physTriggers;
83 std::vector<o2::itsmft::PhysTrigger> fromTRD;
84 if (mUseTriggers == 2) {
86 auto trdTriggers = pc.
inputs().
get<gsl::span<o2::trd::TriggerRecord>>(
"phystrig");
87 for (
const auto& trig : trdTriggers) {
88 if (trig.getBCData() >=
ir && trig.getNumberOfTracklets()) {
89 ir = trig.getBCData();
93 physTriggers = gsl::span<const o2::itsmft::PhysTrigger>(fromTRD.data(), fromTRD.size());
94 }
else if (mUseTriggers == 1) {
95 physTriggers = pc.
inputs().
get<gsl::span<o2::itsmft::PhysTrigger>>(
"phystrig");
98 auto& rofs = pc.
outputs().
make<std::vector<o2::itsmft::ROFRecord>>(
Output{
"ITS",
"ITSTrackROF", 0}, rofsinput.begin(), rofsinput.end());
100 std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::MCCompLabel>> labels;
101 gsl::span<itsmft::MC2ROFRecord const> mc2rofs;
105 mc2rofs = pc.
inputs().
get<gsl::span<itsmft::MC2ROFRecord>>(
"MC2ROframes");
109 LOG(info) <<
"ITSCookedTracker pulled " << compClusters.size() <<
" clusters, in " << rofs.size() <<
" RO frames";
111 std::vector<o2::MCCompLabel> trackLabels;
117 mVertexerPtr->adoptTimeFrame(mTimeFrame);
119 auto& vertROFvec = pc.
outputs().
make<std::vector<o2::itsmft::ROFRecord>>(
Output{
"ITS",
"VERTICESROF", 0});
120 auto& vertices = pc.
outputs().
make<std::vector<Vertex>>(
Output{
"ITS",
"VERTICES", 0});
121 auto& tracks = pc.
outputs().
make<std::vector<o2::its::TrackITS>>(
Output{
"ITS",
"TRACKS", 0});
122 auto& clusIdx = pc.
outputs().
make<std::vector<int>>(
Output{
"ITS",
"TRACKCLSID", 0});
123 auto& irFrames = pc.
outputs().
make<std::vector<o2::dataformats::IRFrame>>(
Output{
"ITS",
"IRFRAMES", 0});
126 int nBCPerTF = mTracker.
getContinuousMode() ? alpParams.roFrameLengthInBC : alpParams.roFrameLengthTrig;
128 gsl::span<const unsigned char>::iterator pattIt_timeframe = patterns.begin();
129 gsl::span<const unsigned char>::iterator pattIt_tracker = patterns.begin();
130 gsl::span<itsmft::ROFRecord> rofspan(rofs);
131 mTimeFrame.
loadROFrameData(rofspan, compClusters, pattIt_timeframe, mDict, labels.get());
135 std::vector<uint8_t> processingMask;
136 int cutVertexMult{0}, cutRandomMult =
int(rofsinput.size()) - multEst.
selectROFs(rofsinput, compClusters, physTriggers, processingMask);
140 float vertexerElapsedTime;
142 vertexerElapsedTime = mVertexerPtr->clustersToVertices([&](std::string s) {
LOG(info) << s; });
144 LOG(info) << fmt::format(
" - Vertex seeding total elapsed time: {} ms in {} ROFs", vertexerElapsedTime, rofspan.size());
145 for (
size_t iRof{0}; iRof < rofspan.size(); ++iRof) {
146 auto& rof = rofspan[iRof];
148 auto& vtxROF = vertROFvec.emplace_back(rof);
149 vtxROF.setFirstEntry(vertices.size());
150 vtxROF.setNEntries(0);
151 if (!processingMask[iRof]) {
152 rof.setFirstEntry(tracks.size());
157 std::vector<o2::dataformats::Vertex<o2::dataformats::TimeStamp<int>>> vtxVecLoc;
159 vtxVecLoc.push_back(
v);
162 if (multEstConf.isVtxMultCutRequested()) {
163 std::vector<o2::dataformats::Vertex<o2::dataformats::TimeStamp<int>>> vtxVecSel;
164 vtxVecSel.swap(vtxVecLoc);
165 int nv = vtxVecSel.size(), nrej = 0;
166 for (
const auto& vtx : vtxVecSel) {
167 if (!multEstConf.isPassingVtxMultCut(vtx.getNContributors())) {
168 LOG(info) <<
"Found vertex mult. " << vtx.getNContributors() <<
" is outside of requested range " << multEstConf.cutMultVtxLow <<
" : " << multEstConf.cutMultVtxHigh <<
" | ROF " << rof.getBCData();
172 vtxVecLoc.push_back(vtx);
174 if (nv && (nrej == nv)) {
176 processingMask[iRof] =
false;
179 if (vtxVecLoc.empty()) {
180 if (multEstConf.cutMultVtxLow < 1) {
181 vtxVecLoc.emplace_back();
183 rof.setFirstEntry(tracks.size());
188 vtxROF.setNEntries(vtxVecLoc.size());
189 for (
const auto& vtx : vtxVecLoc) {
190 vertices.push_back(vtx);
195 mTracker.
process(compClusters, pattIt_tracker, mDict, tracks, clusIdx, rof);
196 if (processingMask[iRof]) {
197 irFrames.emplace_back(rof.getBCData(), rof.getBCData() + nBCPerTF - 1).info = tracks.size();
200 LOGP(info,
" - rejected {}/{} ROFs: random/mult.sel:{} (seed {}), vtx.sel:{}", cutRandomMult + cutVertexMult, rofspan.size(), cutRandomMult, multEst.
lastRandomSeed, cutVertexMult);
201 LOG(info) <<
"ITSCookedTracker pushed " << tracks.size() <<
" tracks and " << vertices.size() <<
" vertices";
274 std::vector<InputSpec> inputs;
275 inputs.emplace_back(
"compClusters",
"ITS",
"COMPCLUSTERS", 0, Lifetime::Timeframe);
276 inputs.emplace_back(
"patterns",
"ITS",
"PATTERNS", 0, Lifetime::Timeframe);
277 inputs.emplace_back(
"ROframes",
"ITS",
"CLUSTERSROF", 0, Lifetime::Timeframe);
278 inputs.emplace_back(
"cldict",
"ITS",
"CLUSDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Calib/ClusterDictionary"));
279 inputs.emplace_back(
"alppar",
"ITS",
"ALPIDEPARAM", 0, Lifetime::Condition,
ccdbParamSpec(
"ITS/Config/AlpideParam"));
281 inputs.emplace_back(
"phystrig",
"ITS",
"PHYSTRIG", 0, Lifetime::Timeframe);
282 }
else if (trgType == 2) {
283 inputs.emplace_back(
"phystrig",
"TRD",
"TRKTRGRD", 0, Lifetime::Timeframe);
286 std::vector<OutputSpec> outputs;
287 outputs.emplace_back(
"ITS",
"TRACKS", 0, Lifetime::Timeframe);
288 outputs.emplace_back(
"ITS",
"TRACKCLSID", 0, Lifetime::Timeframe);
289 outputs.emplace_back(
"ITS",
"ITSTrackROF", 0, Lifetime::Timeframe);
290 outputs.emplace_back(
"ITS",
"VERTICES", 0, Lifetime::Timeframe);
291 outputs.emplace_back(
"ITS",
"VERTICESROF", 0, Lifetime::Timeframe);
292 outputs.emplace_back(
"ITS",
"IRFRAMES", 0, Lifetime::Timeframe);
295 inputs.emplace_back(
"labels",
"ITS",
"CLUSTERSMCTR", 0, Lifetime::Timeframe);
296 inputs.emplace_back(
"MC2ROframes",
"ITS",
"CLUSTERSMC2ROF", 0, Lifetime::Timeframe);
297 outputs.emplace_back(
"ITS",
"TRACKSMCTR", 0, Lifetime::Timeframe);
298 outputs.emplace_back(
"ITS",
"ITSTrackMC2ROF", 0, Lifetime::Timeframe);
300 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
309 ggRequest->addInput({
"itsTGeo",
"ITS",
"GEOMTGEO", 0, Lifetime::Condition,
framework::ccdbParamSpec(
"ITS/Config/Geometry")}, inputs);
312 "its-cooked-tracker",
320 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.