Project
Loading...
Searching...
No Matches
CheckResid.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15#include <vector>
17#include <TStopwatch.h>
34#include "ITStracking/IOUtils.h"
41
42#ifdef WITH_OPENMP
43#include <omp.h>
44#endif
45
46namespace o2::checkresid
47{
48
49using namespace o2::framework;
52
58
59class CheckResidSpec : public Task
60{
61 public:
62 CheckResidSpec(std::shared_ptr<DataRequest> dr, std::shared_ptr<o2::base::GRPGeomRequest> gr, GTrackID::mask_t src, bool useMC /*, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts*/)
63 : mDataRequest(dr), mGGCCDBRequest(gr), mTracksSrc(src), mUseMC(useMC)
64 {
65 /*
66 mTPCCorrMapsLoader.setLumiScaleType(sclOpts.lumiType);
67 mTPCCorrMapsLoader.setLumiScaleMode(sclOpts.lumiMode);
68 mTPCCorrMapsLoader.setCheckCTPIDCConsistency(sclOpts.checkCTPIDCconsistency);
69 */
70 }
71 ~CheckResidSpec() final = default;
72 void init(InitContext& ic) final;
73 void run(ProcessingContext& pc) final;
74 void endOfStream(EndOfStreamContext& ec) final;
75 void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) final;
76 void process();
77
78 private:
79 void updateTimeDependentParams(ProcessingContext& pc);
80 bool refitPV(o2::dataformats::PrimaryVertex& pv, int vid);
81 bool refitITStrack(o2::track::TrackParCov& track, GTrackID gid);
82 bool processITSTrack(const o2::its::TrackITS& iTrack, const o2::dataformats::PrimaryVertex& pv, o2::checkresid::Track& resTrack);
83
84 o2::globaltracking::RecoContainer* mRecoData = nullptr;
85 int mNThreads = 1;
86 float mITSROFrameLengthMUS = 0.f;
87 o2::dataformats::MeanVertexObject mMeanVtx{};
88 std::vector<o2::BaseCluster<float>> mITSClustersArray;
89 const o2::itsmft::TopologyDictionary* mITSDict = nullptr;
91 std::shared_ptr<DataRequest> mDataRequest;
92 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
93 bool mUseMC{false};
94 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
95 GTrackID::mask_t mTracksSrc{};
96};
97
99{
101 int lane = ic.services().get<const o2::framework::DeviceSpec>().inputTimesliceId;
102 int maxLanes = ic.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices;
103 std::string dbgnm = maxLanes == 1 ? "checkResid.root" : fmt::format("checkResid_t{}.root", lane);
104 mDBGOut = std::make_unique<o2::utils::TreeStreamRedirector>(dbgnm.c_str(), "recreate");
105 mNThreads = ic.options().get<int>("nthreads");
106#ifndef WITH_OPENMP
107 if (mNThreads > 1) {
108 LOGP(warn, "No OpenMP");
109 }
110 mNThreads = 1;
111#endif
112 // mTPCCorrMapsLoader.init(ic);
113}
114
116{
118 mRecoData = &recoData;
119 mRecoData->collectData(pc, *mDataRequest.get()); // select tracks of needed type, with minimal cuts, the real selected will be done in the vertexer
120 mRecoData = &recoData;
121 updateTimeDependentParams(pc); // Make sure this is called after recoData.collectData, which may load some conditions
122 process();
123 mRecoData = nullptr;
124}
125
126void CheckResidSpec::updateTimeDependentParams(ProcessingContext& pc)
127{
130 // mTPCVDriftHelper.extractCCDBInputs(pc);
131 // mTPCCorrMapsLoader.extractCCDBInputs(pc);
132 static bool initOnceDone = false;
133 if (!initOnceDone) { // this params need to be queried only once
134 initOnceDone = true;
135 // Note: reading of the ITS AlpideParam needed for ITS timing is done by the RecoContainer
138 if (!grp->isDetContinuousReadOut(DetID::ITS)) {
139 mITSROFrameLengthMUS = alpParams.roFrameLengthTrig / 1.e3; // ITS ROFrame duration in \mus
140 } else {
141 mITSROFrameLengthMUS = alpParams.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingNS * 1e-3; // ITS ROFrame duration in \mus
142 }
145 o2::conf::ConfigurableParam::updateFromString("pvertexer.useMeanVertexConstraint=false");
146 mVertexer.init();
147 }
148 bool updateMaps = false;
149 /*
150 if (mTPCCorrMapsLoader.isUpdated()) {
151 mTPCCorrMapsLoader.acknowledgeUpdate();
152 updateMaps = true;
153 }
154 if (mTPCVDriftHelper.isUpdated()) {
155 LOGP(info, "Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
156 mTPCVDriftHelper.getVDriftObject().corrFact, mTPCVDriftHelper.getVDriftObject().refVDrift,
157 mTPCVDriftHelper.getVDriftObject().timeOffsetCorr, mTPCVDriftHelper.getVDriftObject().refTimeOffset,
158 mTPCVDriftHelper.getSourceName());
159 mTPCVDriftHelper.acknowledgeUpdate();
160 updateMaps = true;
161 }
162 if (updateMaps) {
163 mTPCCorrMapsLoader.updateVDrift(mTPCVDriftHelper.getVDriftObject().corrFact, mTPCVDriftHelper.getVDriftObject().refVDrift, mTPCVDriftHelper.getVDriftObject().getTimeOffset());
164 }
165 */
166}
167
169{
170 if (!mITSDict) {
171 LOGP(fatal, "ITS data is not loaded");
172 }
173 const auto itsTracks = mRecoData->getITSTracks();
174 // const auto itsLbls = mRecoData->getITSTracksMCLabels();
175 const auto itsClRefs = mRecoData->getITSTracksClusterRefs();
176 const auto clusITS = mRecoData->getITSClusters();
177 const auto patterns = mRecoData->getITSClustersPatterns();
179 auto pattIt = patterns.begin();
180 mITSClustersArray.clear();
181 mITSClustersArray.reserve(clusITS.size());
182
183 o2::its::ioutils::convertCompactClusters(clusITS, pattIt, mITSClustersArray, mITSDict);
184
185 auto pvvec = mRecoData->getPrimaryVertices();
186 auto trackIndex = mRecoData->getPrimaryVertexMatchedTracks(); // Global ID's for associated tracks
187 auto vtxRefs = mRecoData->getPrimaryVertexMatchedTrackRefs(); // references from vertex to these track IDs
188 auto prop = o2::base::Propagator::Instance();
189 static int TFCount = 0;
190 int nv = vtxRefs.size() - 1;
191 std::vector<std::vector<checkresid::Track>> slots;
192 slots.resize(mNThreads);
193 int nvGood = 0, nvUse = 0, nvRefFail = 0;
194 long pvFitDuration{};
195 for (int iv = 0; iv < nv; iv++) {
196 const auto& vtref = vtxRefs[iv];
197 auto pve = pvvec[iv];
198 if (pve.getNContributors() < params.minPVContributors) {
199 continue;
200 }
201 nvGood++;
202 if (params.refitPV) {
203 auto tStartPVF = std::chrono::time_point_cast<std::chrono::microseconds>(std::chrono::system_clock::now()).time_since_epoch().count();
204 bool res = refitPV(pve, iv);
205 pvFitDuration += std::chrono::time_point_cast<std::chrono::microseconds>(std::chrono::system_clock::now()).time_since_epoch().count() - tStartPVF;
206 if (!res) {
207 nvRefFail++;
208 continue;
209 }
210 }
211 nvUse++;
212 for (int is = 0; is < GTrackID::NSources; is++) {
213 if (!mTracksSrc[is] || !mRecoData->isTrackSourceLoaded(is)) {
214 continue;
215 }
216 int idMin = vtref.getFirstEntryOfSource(is), idMax = idMin + vtref.getEntriesOfSource(is);
217 DetID::mask_t dm = GTrackID::getSourceDetectorsMask(is);
218 if (!dm[DetID::ITS]) {
219 continue;
220 }
221 if (dm[DetID::TPC] && params.minTPCCl > 0 && !mRecoData->isTrackSourceLoaded(GTrackID::TPC)) {
222 LOGP(fatal, "Cut on TPC tracks is requested by they are not loaded");
223 }
224#ifdef WITH_OPENMP
225#pragma omp parallel for schedule(dynamic) num_threads(mNThreads)
226#endif
227 for (int i = idMin; i < idMax; i++) {
228 auto vid = trackIndex[i];
229 bool pvCont = vid.isPVContributor();
230 if (!pvCont && params.pvcontribOnly) {
231 continue;
232 }
233 if (dm[DetID::TPC] && params.minTPCCl > 0 && mRecoData->getTPCTrack(mRecoData->getTPCContributorGID(vid)).getNClusters() < params.minTPCCl) {
234 continue;
235 }
236 auto gidITS = mRecoData->getITSContributorGID(vid);
237 if (gidITS.getSource() != GTrackID::ITS) {
238 continue;
239 }
240 const auto& trc = mRecoData->getTrackParam(vid);
241 auto pt = trc.getPt();
242 if (pt < params.minPt || pt > params.maxPt) {
243 continue;
244 }
245 const auto& itsTrack = mRecoData->getITSTrack(gidITS);
246 if (itsTrack.getNClusters() < params.minITSCl) {
247 continue;
248 }
249#ifdef WITH_OPENMP
250 auto& accum = slots[omp_get_thread_num()];
251#else
252 auto& accum = slots[0];
253#endif
254 auto& resTrack = accum.emplace_back();
255 if (!processITSTrack(itsTrack, pve, resTrack)) {
256 accum.pop_back();
257 continue;
258 }
259 }
260 }
261 }
262 // output
263 for (const auto& accum : slots) {
264 for (const auto& tr : accum) {
265 (*mDBGOut) << "res" << "tr=" << tr << "\n";
266 }
267 }
268 LOGP(info, "processed {} PVs out of {} good vertices (out of {} in total), PV refits took {} mus, {} refits failed", nvUse, nvGood, nv, pvFitDuration, nvRefFail);
269 TFCount++;
270}
271
272bool CheckResidSpec::processITSTrack(const o2::its::TrackITS& iTrack, const o2::dataformats::PrimaryVertex& pv, o2::checkresid::Track& resTrack)
273{
274 const auto itsClRefs = mRecoData->getITSTracksClusterRefs();
275 auto trFitInw = iTrack.getParamOut(); // seed for inward refit
276 auto trFitOut = iTrack.getParamIn(); // seed for outward refit
277 auto prop = o2::base::Propagator::Instance();
279 float pvAlpha = 0;
280 float bz = prop->getNominalBz();
281 std::array<const o2::BaseCluster<float>*, 8> clArr{};
282 const auto& params = CheckResidConfig::Instance();
283 std::array<o2::track::TrackParCov, 8> extrapOut, extrapInw; // 2-way Kalman extrapolations, vertex + 7 layers
284
285 auto rotateTrack = [bz](o2::track::TrackParCov& tr, float alpha, o2::track::TrackPar* refLin) {
286 return refLin ? tr.rotate(alpha, *refLin, bz) : tr.rotate(alpha);
287 };
288
289 auto accountCluster = [&](int i, std::array<o2::track::TrackParCov, 8>& extrapDest, o2::track::TrackParCov& tr, o2::track::TrackPar* refLin) {
290 if (clArr[i]) { // update with cluster
291 if (!rotateTrack(tr, i == 0 ? pvAlpha : geom->getSensorRefAlpha(clArr[i]->getSensorID()), refLin) ||
292 !prop->propagateTo(tr, refLin, clArr[i]->getX(), true)) {
293 return 0;
294 }
295 extrapDest[i] = tr; // before update
296 if (!tr.update(*clArr[i])) {
297 return 0;
298 }
299 } else {
300 extrapDest[i].invalidate();
301 return -1;
302 }
303 return 1;
304 };
305
306 auto inv2d = [](float s00, float s11, float s01) -> std::array<float, 3> {
307 auto det = s00 * s11 - s01 * s01;
308 if (det < 1e-16) {
309 return {0.f, 0.f, 0.f};
310 }
311 det = 1.f / det;
312 return {s11 * det, s00 * det, -s01 * det};
313 };
314
315 resTrack.points.clear();
316 if (!prop->propagateToDCA(pv, trFitOut, bz)) {
317 return false;
318 }
319 float cosAlp, sinAlp;
320 pvAlpha = trFitOut.getAlpha();
321 o2::math_utils::sincos(trFitOut.getAlpha(), sinAlp, cosAlp); // vertex position rotated to track frame
323 if (params.addPVAsCluster) {
324 bcPV.setXYZ(pv.getX() * cosAlp + pv.getY() * sinAlp, -pv.getX() * sinAlp + pv.getY() * cosAlp, pv.getZ());
325 bcPV.setSigmaY2(0.5 * (pv.getSigmaX2() + pv.getSigmaY2()));
326 bcPV.setSigmaZ2(pv.getSigmaZ2());
327 bcPV.setSensorID(-1);
328 clArr[0] = &bcPV;
329 }
330 // collect all track clusters to array, placing them to layer+1 slot
331 int nCl = iTrack.getNClusters();
332 for (int i = 0; i < nCl; i++) { // clusters are ordered from the outermost to the innermost
333 const auto& curClu = mITSClustersArray[itsClRefs[iTrack.getClusterEntry(i)]];
334
335 int llr = geom->getLayer(curClu.getSensorID());
336 if (clArr[1 + llr]) {
337 LOGP(error, "Cluster at lr {} was already assigned, old sens {}, new sens {}", llr, clArr[1 + llr]->getSensorID(), curClu.getSensorID());
338 }
339 clArr[1 + geom->getLayer(curClu.getSensorID())] = &curClu;
340 }
341 o2::track::TrackPar refLinInw0, refLinOut0, *refLinOut = nullptr, *refLinInw = nullptr;
342 o2::track::TrackPar refLinIBOut0, refLinOBInw0, *refLinOBInw = nullptr, *refLinIBOut = nullptr;
343 if (params.useStableRef) {
344 refLinOut = &(refLinOut0 = trFitOut);
345 refLinInw = &(refLinInw0 = trFitInw);
346 }
347 trFitOut.resetCovariance();
348 trFitOut.setCov(trFitOut.getQ2Pt() * trFitOut.getQ2Pt() * trFitOut.getCov()[14], 14);
349 trFitInw.resetCovariance();
350 trFitInw.setCov(trFitInw.getQ2Pt() * trFitInw.getQ2Pt() * trFitInw.getCov()[14], 14);
351 // fit in inward and outward direction
352 for (int i = 0; i <= 7; i++) {
353 int resOut, resInw;
354 // process resOut in ascending order (0-->7) and resInw in descending order (7-->0)
355 if (!(resOut = accountCluster(i, extrapOut, trFitOut, refLinOut)) || !(resInw = accountCluster(7 - i, extrapInw, trFitInw, refLinInw))) {
356 return false;
357 }
358 // at layer 3, find the IB track (trIBOut) and the OB track (trOBInw)
359 // propagate both trcaks to a common radius, RCompIBOB (12cm), and rotates
360 // them to the same reference frame for comparison
361 if (i == 3 && resOut == 1 && resInw == 1 && params.doIBOB && nCl == 7) {
362 resTrack.trIBOut = trFitOut; // outward track updated at outermost IB layer
363 resTrack.trOBInw = trFitInw; // inward track updated at innermost OB layer
364 o2::track::TrackPar refLinIBOut0, refLinIBIn0;
365 if (refLinOut) {
366 refLinIBOut = &(refLinIBOut0 = refLinOut0);
367 refLinOBInw = &(refLinOBInw0 = refLinInw0);
368 }
369 float xRref;
370 if (!resTrack.trOBInw.getXatLabR(params.rCompIBOB, xRref, bz) ||
371 !prop->propagateTo(resTrack.trOBInw, refLinOBInw, xRref, true) ||
372 !rotateTrack(resTrack.trOBInw, resTrack.trOBInw.getPhiPos(), refLinOBInw) || // propagate OB track to ref R and rotate
373 !rotateTrack(resTrack.trIBOut, resTrack.trOBInw.getAlpha(), refLinIBOut) ||
374 !prop->propagateTo(resTrack.trIBOut, refLinIBOut, resTrack.trOBInw.getX(), true)) { // rotate OB track to same frame and propagate to same X
375 // if any propagation or rotation steps fail, invalidate both tracks
376 return false;
377 }
378 }
379 }
380
381 bool innerDone = false;
382 if (params.doResid) {
383 for (int i = 0; i <= 7; i++) {
384 if (clArr[i]) {
385 // calculate interpolation as a weighted mean of inward/outward extrapolations to this layer
386 const auto &tInw = extrapInw[i], &tOut = extrapOut[i];
387 auto wInw = inv2d(tInw.getSigmaY2(), tInw.getSigmaZ2(), tInw.getSigmaZY());
388 auto wOut = inv2d(tOut.getSigmaY2(), tOut.getSigmaZ2(), tOut.getSigmaZY());
389 if (wInw[0] == 0.f || wOut[0] == 0.f) {
390 return -1;
391 }
392 std::array<float, 3> wTot = {wInw[0] + wOut[0], wInw[1] + wOut[1], wInw[2] + wOut[2]};
393 auto cTot = inv2d(wTot[0], wTot[1], wTot[2]);
394 auto ywi = wInw[0] * tInw.getY() + wInw[2] * tInw.getZ() + wOut[0] * tOut.getY() + wOut[2] * tOut.getZ();
395 auto zwi = wInw[2] * tInw.getY() + wInw[1] * tInw.getZ() + wOut[2] * tOut.getY() + wOut[1] * tOut.getZ();
396 auto yw = ywi * cTot[0] + zwi * cTot[2];
397 auto zw = ywi * cTot[2] + zwi * cTot[1];
398 // posCl.push_back(clArr[i]->getXYZGlo(*o2::its::GeometryTGeo::Instance()));
399 auto phi = i == 0 ? tInw.getPhi() : tInw.getPhiPos();
400 o2::math_utils::bringTo02Pi(phi);
401 resTrack.points.emplace_back(clArr[i]->getY() - yw, clArr[i]->getZ() - zw, cTot[0] + clArr[i]->getSigmaY2(), cTot[1] + clArr[i]->getSigmaZ2(), phi, clArr[i]->getZ(), clArr[i]->getSensorID(), i - 1);
402 if (!innerDone) {
403 resTrack.track = tInw;
404 innerDone = true;
405 }
406 } else {
407 LOGP(debug, "No cluster on lr {}", i);
408 }
409 }
410 }
411 return true;
412}
413
414bool CheckResidSpec::refitPV(o2::dataformats::PrimaryVertex& pv, int vid)
415{
417 std::vector<o2::track::TrackParCov> tracks;
418 std::vector<bool> useTrack;
419 std::vector<GTrackID> gidsITS;
420 int ntr = pv.getNContributors();
421 tracks.reserve(ntr);
422 useTrack.reserve(ntr);
423 gidsITS.reserve(ntr);
424 const auto& vtref = mRecoData->getPrimaryVertexMatchedTrackRefs()[vid];
425 auto trackIndex = mRecoData->getPrimaryVertexMatchedTracks();
426 int itr = vtref.getFirstEntry(), itLim = itr + vtref.getEntries();
427 for (; itr < itLim; itr++) {
428 auto vid = trackIndex[itr];
429 if (vid.isPVContributor()) {
430 tracks.emplace_back().setPID(mRecoData->getTrackParam(vid).getPID());
431 gidsITS.push_back(mRecoData->getITSContributorGID(vid));
432 }
433 }
434 ntr = tracks.size();
435 useTrack.resize(ntr);
436#ifdef WITH_OPENMP
437#pragma omp parallel for schedule(dynamic) num_threads(mNThreads)
438#endif
439 for (int itr = 0; itr < ntr; itr++) {
440 if (!(useTrack[itr] = refitITStrack(tracks[itr], gidsITS[itr]))) {
441 tracks[itr] = mRecoData->getTrackParam(gidsITS[itr]); // this track will not be used but participates in prepareVertexRefit
442 }
443 }
444 ntr = 0;
445 for (auto v : useTrack) {
446 ntr++;
447 }
448 if (ntr < params.minPVContributors || !mVertexer.prepareVertexRefit(tracks, pv)) {
449 return false;
450 }
451 // readjust vertexZ
452 const auto& pool = mVertexer.getTracksPool();
453 float zUpd = 0;
454 for (const auto& t : pool) {
455 zUpd += t.z;
456 }
457 if (pool.size()) {
458 pv.setZ(zUpd / pool.size());
459 mVertexer.prepareVertexRefit(tracks, pv);
460 }
461 pv = mVertexer.refitVertex(useTrack, pv);
462 return pv.getChi2() > 0.f;
463}
464
465bool CheckResidSpec::refitITStrack(o2::track::TrackParCov& track, GTrackID gid)
466{
467 // destination tack might have non-default PID assigned
468 const auto& trkITS = mRecoData->getITSTrack(gid);
469 const auto itsClRefs = mRecoData->getITSTracksClusterRefs();
470 const auto& params = CheckResidConfig::Instance();
471 auto pid = track.getPID();
472 track = trkITS.getParamOut();
473 track.setPID(pid);
474 auto nCl = trkITS.getNumberOfClusters();
476 auto prop = o2::base::Propagator::Instance();
477 float bz = prop->getNominalBz();
478 o2::track::TrackPar refLin{track};
479
480 for (int iCl = 0; iCl < nCl; iCl++) { // clusters are stored from outer to inner layers
481 const auto& cls = mITSClustersArray[itsClRefs[trkITS.getClusterEntry(iCl)]];
482 auto alpha = geom->getSensorRefAlpha(cls.getSensorID());
483 if (!(params.useStableRef ? track.rotate(alpha, refLin, bz) : track.rotate(alpha)) ||
484 !prop->propagateTo(track, params.useStableRef ? &refLin : nullptr, cls.getX(), true)) {
485 LOGP(debug, "refitITStrack failed on propagation to cl#{}, alpha={}, x={} | {}", iCl, alpha, cls.getX(), track.asString());
486 return false;
487 }
488 if (!track.update(cls)) {
489 LOGP(debug, "refitITStrack failed on update with cl#{}, | {}", iCl, track.asString());
490 return false;
491 }
492 }
493 return true;
494}
495
497{
498 mDBGOut.reset();
499}
500
502{
504 return;
505 }
506 /*
507 if (mTPCVDriftHelper.accountCCDBInputs(matcher, obj)) {
508 return;
509 }
510 if (mTPCCorrMapsLoader.accountCCDBInputs(matcher, obj)) {
511 return;
512 }
513 */
514 if (matcher == ConcreteDataMatcher("GLO", "MEANVERTEX", 0)) {
515 LOG(info) << "Imposing new MeanVertex: " << ((const o2::dataformats::MeanVertexObject*)obj)->asString();
516 mMeanVtx = *(const o2::dataformats::MeanVertexObject*)obj;
517 return;
518 }
519 if (matcher == ConcreteDataMatcher("ITS", "CLUSDICT", 0)) {
520 LOG(info) << "cluster dictionary updated";
521 mITSDict = (const o2::itsmft::TopologyDictionary*)obj;
522 return;
523 }
524}
525
526DataProcessorSpec getCheckResidSpec(GTrackID::mask_t srcTracks, GTrackID::mask_t srcClusters, bool useMC /*, const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts*/)
527{
528 std::vector<OutputSpec> outputs;
529 auto dataRequest = std::make_shared<DataRequest>();
530 dataRequest->requestTracks(srcTracks, useMC);
531 dataRequest->requestClusters(srcClusters, useMC);
532 dataRequest->requestPrimaryVertices(useMC);
533 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(false, // orbitResetTime
534 true, // GRPECS=true
535 true, // GRPLHCIF
536 true, // GRPMagField
537 true, // askMatLUT
539 dataRequest->inputs,
540 true);
541 dataRequest->inputs.emplace_back("meanvtx", "GLO", "MEANVERTEX", 0, Lifetime::Condition, ccdbParamSpec("GLO/Calib/MeanVertex", {}, 1));
542 Options opts{
543 {"nthreads", VariantType::Int, 1, {"number of threads"}},
544 };
545 // o2::tpc::VDriftHelper::requestCCDBInputs(dataRequest->inputs);
546 // o2::tpc::CorrectionMapsLoader::requestCCDBInputs(dataRequest->inputs, opts, sclOpts);
547
548 return DataProcessorSpec{
549 "check-resid",
550 dataRequest->inputs,
551 outputs,
552 AlgorithmSpec{adaptFromTask<CheckResidSpec>(dataRequest, ggRequest, srcTracks, useMC /*, sclOpts*/)},
553 opts};
554}
555
556} // namespace o2::checkresid
Wrapper container for different reconstructed object types.
Base track model for the Barrel, params only, w/o covariance.
Definition of the GeometryManager class.
std::ostringstream debug
int32_t i
Helper for geometry and GRP related CCDB requests.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Definition of the GeometryTGeo class.
Utility functions for MC particles.
Definition of the Names Generator class.
Primary vertex finder.
uint16_t pid
Definition RawData.h:2
uint32_t res
Definition RawData.h:0
Wrapper container for different reconstructed object types.
o2::track::TrackParCov TrackParCov
Definition Recon.h:39
Result of refitting TPC-ITS matched track.
Reference on ITS/MFT clusters set.
Referenc on track indices contributing to the vertex, with possibility chose tracks from specific sou...
void setSigmaZ2(T v)
void setSigmaY2(T v)
void setSensorID(std::int16_t sid)
Definition BaseCluster.h:92
void setXYZ(T x, T y, T z)
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
Definition Propagator.h:178
void endOfStream(EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
CheckResidSpec(std::shared_ptr< DataRequest > dr, std::shared_ptr< o2::base::GRPGeomRequest > gr, GTrackID::mask_t src, bool useMC)
void run(ProcessingContext &pc) final
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
void init(InitContext &ic) final
static void updateFromString(std::string const &)
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
static constexpr ID ITS
Definition DetID.h:63
static constexpr ID TPC
Definition DetID.h:64
ServiceRegistryRef services()
Definition InitContext.h:34
ConfigParamRegistry const & options()
Definition InitContext.h:33
decltype(auto) get(R binding, int part=0) const
InputRecord & inputs()
The inputs associated with this processing context.
static GeometryTGeo * Instance()
int getClusterEntry(int i) const
Definition TrackITS.h:67
auto & getTracksPool() const
Definition PVertexer.h:92
bool prepareVertexRefit(const TR &tracks, const o2d::VertexBase &vtxSeed)
Definition PVertexer.h:359
PVertex refitVertex(const std::vector< bool > useTrack, const o2d::VertexBase &vtxSeed)
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLenum src
Definition glcorearb.h:1767
const GLdouble * v
Definition glcorearb.h:832
GLdouble f
Definition glcorearb.h:310
GLenum const GLfloat * params
Definition glcorearb.h:272
o2::framework::DataProcessorSpec getCheckResidSpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool useMC)
create a processor spec
constexpr double LHCBunchSpacingNS
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
void convertCompactClusters(gsl::span< const itsmft::CompClusterExt > clusters, gsl::span< const unsigned char >::iterator &pattIt, std::vector< o2::BaseCluster< float > > &output, const itsmft::TopologyDictionary *dict)
convert compact clusters to 3D spacepoints
Definition IOUtils.cxx:35
double * getX(double *xyDxy, int N)
double * getY(double *xyDxy, int N)
TrackParCovF TrackParCov
Definition Track.h:33
struct o2::upgrades_utils::@454 tracks
structure to keep trigger-related info
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
o2::track::TrackPar track
o2::track::TrackParCov trIBOut
o2::track::TrackParCov trOBInw
std::vector< Point > points
GTrackID getITSContributorGID(GTrackID source) const
const o2::tpc::TrackTPC & getTPCTrack(GTrackID id) const
GTrackID getTPCContributorGID(GTrackID source) const
const o2::track::TrackParCov & getTrackParam(GTrackID gidx) const
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
const o2::its::TrackITS & getITSTrack(GTrackID gid) const
static constexpr int L2G
Definition Cartesian.h:54
static constexpr int T2L
Definition Cartesian.h:55
static constexpr int T2G
Definition Cartesian.h:56
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"