21#include <GblTrajectory.h>
24#include <GblMeasurement.h>
25#include <MilleBinary.h>
26#include <nlohmann/json.hpp>
67std::pair<double, double> computeUV(
double gloX,
double gloY,
double gloZ,
int sensorID,
double radius)
69 const bool isTop = sensorID % 2 == 0;
70 const double phi = o2::math_utils::to02Pid(std::atan2(gloY, gloX));
71 const double phiBorder1 = o2::math_utils::to02Pid(((isTop ? 0. : 1.) * TMath::Pi()) + std::asin(
constants::equatorialGap / 2. / radius));
72 const double phiBorder2 = o2::math_utils::to02Pid(((isTop ? 1. : 2.) * TMath::Pi()) - std::asin(
constants::equatorialGap / 2. / radius));
73 const double u = (((phi - phiBorder1) * 2.) / (phiBorder2 - phiBorder1)) - 1.;
74 const double v = ((2. * gloZ + constants::segment::lengthSensitive) / constants::segment::lengthSensitive) - 1.;
79std::vector<double> legendrePols(
int order,
double x)
81 std::vector<double> p(order + 1);
86 for (
int n = 1;
n < order; ++
n) {
87 p[
n + 1] = ((2 *
n + 1) *
x * p[
n] -
n * p[
n - 1]) / (
n + 1);
102 : mDataRequest(dr), mGGCCDBRequest(gr), mTracksSrc(
src), mUseMC(useMC), mWithPV(withPV), mIsITS3(!withITS), mOutOpt(out)
114 void buildHierarchy();
119 bool getTransportJacobian(
const TrackD& track,
double xTo,
double alphaTo, gbl::Matrix5d& jac, gbl::Matrix5d& err);
126 void prepareMeasurments(std::span<const itsmft::CompClusterExt>
clusters, std::span<const unsigned char> pattIt);
134 bool applyMisalignment(Eigen::Vector2d&
res,
const FrameInfoExt& frame,
const TrackD& wTrk,
size_t iTrk);
137 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
138 std::vector<dataformats::VertexBase> mPVs;
139 std::vector<int> mT2PV;
144 std::unique_ptr<steer::MCKinematicsReader> mcReader;
145 std::vector<FrameInfoExt> mITSTrackingInfo;
146 std::shared_ptr<DataRequest> mDataRequest;
147 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
148 std::unique_ptr<AlignableVolume> mHierarchy;
154 const AlignmentParams* mParams{
nullptr};
155 std::array<o2::math_utils::Legendre2DPolynominal, 6> mDeformations;
156 std::array<Eigen::Matrix<double, 6, 1>, 6> mRigidBodyParams;
162 mNThreads = ic.
options().
get<
int>(
"nthreads");
165 mDBGOut = std::make_unique<o2::utils::TreeStreamRedirector>(
"its3_debug_alg.root",
"recreate");
168 mcReader = std::make_unique<steer::MCKinematicsReader>(
"collisioncontext.root");
175 updateTimeDependentParams(pc);
179 mRecoData = &recoData;
181 updateTimeDependentParams(pc);
189 if (!mITSDict && !mIT3Dict) {
190 LOGP(fatal,
"ITS data is not loaded");
193 const auto bz = prop->getNominalBz();
198 std::span<const o2::MCCompLabel> mcLbls;
202 prepareMeasurments(clusITS, patterns);
208 LOGP(info,
"Starting fits with {} threads", mNThreads);
211 std::vector<std::vector<gbl::GblTrajectory>> gblTrajSlots(mNThreads);
212 std::vector<std::vector<Track>> resTrackSlots(mNThreads);
214 auto timeStart = std::chrono::high_resolution_clock::now();
215 int cFailedRefit{0}, cFailedProp{0}, cSelected{0}, cGBLFit{0}, cGBLFitFail{0}, cGBLChi2Rej{0}, cGBLConstruct{0};
216 double chi2Sum{0}, lostWeightSum{0};
219#pragma omp parallel num_threads(mNThreads) \
220 reduction(+ : cFailedRefit) \
221 reduction(+ : cFailedProp) \
222 reduction(+ : cSelected) \
223 reduction(+ : cGBLFit) \
224 reduction(+ : cGBLFitFail) \
225 reduction(+ : cGBLChi2Rej) \
226 reduction(+ : cGBLConstruct) \
227 reduction(+ : chi2Sum) \
228 reduction(+ : lostWeightSum) \
229 reduction(+ : ndfSum)
233 const int tid = omp_get_thread_num();
237 auto& gblTrajSlot = gblTrajSlots[tid];
238 auto& resTrackSlot = resTrackSlots[tid];
241#pragma omp for schedule(dynamic)
243 for (
size_t iTrk = 0; iTrk < (
int)itsTracks.size(); ++iTrk) {
244 const auto& trk = itsTracks[iTrk];
245 if (trk.getNClusters() < mParams->
minITSCls ||
246 (trk.getChi2() / ((float)trk.getNClusters() * 2 - 5)) >= mParams->
maxITSChi2Ndf ||
247 trk.getPt() < mParams->
minPt ||
248 (mUseMC && (!mcLbls[iTrk].isValid() || !mcLbls[iTrk].isCorrect()))) {
252 Track& resTrack = resTrackSlot.emplace_back();
253 if (!prepareITSTrack((
int)iTrk, trk, resTrack)) {
255 resTrackSlot.pop_back();
261 refLin = &resTrack.
track;
265 auto wTrk = resTrack.
track;
266 const bool hasPV = resTrack.
info[0].lr == -1;
267 std::vector<gbl::GblPoint> points;
269 const int np = (
int)resTrack.
points.size();
271 lt.setTimeNotNeeded();
272 constexpr int perm[5] = {4, 2, 3, 0, 1};
273 for (
int ip{0}; ip < np; ++ip) {
274 const auto& frame = resTrack.
info[ip];
275 gbl::Matrix5d err = gbl::Matrix5d::Identity(), jacALICE = gbl::Matrix5d::Identity(), jacGBL;
280 if (!getTransportJacobian(wTrk, frame.x, frame.alpha, jacALICE, err) ||
281 !prop->propagateToAlphaX(wTrk, refLin, frame.
alpha, frame.x,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType, <)) {
286 msErr = its::math_utils::MSangle(trk.getPID().getMass(), trk.getP(), lt.getX2X0());
288 for (
int i = 0;
i < 5;
i++) {
289 for (
int j = 0;
j < 5;
j++) {
290 jacGBL(
i,
j) = jacALICE(perm[
i], perm[
j]);
296 gbl::GblPoint point(jacGBL);
298 Eigen::Vector2d
res, prec;
299 res << frame.positionTrackingFrame[0] - wTrk.getY(), frame.positionTrackingFrame[1] - wTrk.getZ();
302 if (!applyMisalignment(
res, frame, wTrk, iTrk)) {
307 prec << 1. / resTrack.
points[ip].sig2y, 1. / resTrack.
points[ip].sig2z;
309 point.addMeasurement(
res, prec);
310 if (msErr > mParams->
minMS && ip < np - 1) {
311 Eigen::Vector2d scat(0., 0.), scatPrec = Eigen::Vector2d::Constant(1. / (msErr * msErr));
312 point.addScatterer(scat, scatPrec);
318 if (mChip2Hiearchy.find(lbl) == mChip2Hiearchy.end()) {
319 LOGP(fatal,
"Cannot find global label: {}", lbl.
asString());
325 const auto* tileVol = mChip2Hiearchy.at(lbl);
330 for (
const auto*
v = tileVol;
v && !
v->isRoot();
v =
v->getParent()) {
331 if (
v->getRigidBody()) {
332 nColRB +=
v->getRigidBody()->nDOFs();
337 const auto* sensorVol = tileVol->getParent();
338 const auto* calibSet = sensorVol ? sensorVol->getCalib() :
nullptr;
339 const int nCalib = calibSet ? calibSet->nDOFs() : 0;
340 const int nCol = nColRB + nCalib;
342 std::vector<int> gLabels;
343 gLabels.reserve(nCol);
344 Eigen::MatrixXd gDer(3, nCol);
346 Eigen::Index curCol{0};
349 const double posTrk[3] = {frame.x, 0., 0.};
351 tileVol->getT2L().LocalToMaster(posTrk, posLoc);
353 tileVol->computeJacobianL2T(posLoc, jacL2T);
355 if (tileVol->getRigidBody()) {
356 const int nd = tileVol->getRigidBody()->nDOFs();
357 for (
int iDOF = 0; iDOF < nd; ++iDOF) {
358 gLabels.push_back(tileVol->getLabel().rawGBL(iDOF));
360 gDer.middleCols(curCol, nd) = der;
365 for (
const auto* child = tileVol; child->getParent() && !child->getParent()->isRoot(); child = child->getParent()) {
366 der *= child->getJL2P();
367 const auto* parent = child->getParent();
368 if (parent->getRigidBody()) {
369 const int nd = parent->getRigidBody()->nDOFs();
370 for (
int iDOF = 0; iDOF < nd; ++iDOF) {
371 gLabels.push_back(parent->getLabel().rawGBL(iDOF));
373 gDer.middleCols(curCol, nd) = der;
380 const auto* legSet =
static_cast<const LegendreDOFSet*
>(calibSet);
381 const int N = legSet->
order();
385 const double r = frame.x;
386 const double gX =
r * std::cos(frame.alpha);
387 const double gY =
r * std::sin(frame.alpha);
388 const double gZ = frame.positionTrackingFrame[1];
391 const double snp = wTrk.getSnp();
392 const double tgl = wTrk.getTgl();
393 const double csci = 1. / std::sqrt(1. - (snp * snp));
394 const double dydx = snp * csci;
395 const double dzdx = tgl * csci;
397 auto pu = legendrePols(N, u);
398 auto pv = legendrePols(N,
v);
401 const int legColStart = nColRB;
402 for (
int i = 0;
i <= N; ++
i) {
403 for (
int j = 0;
j <=
i; ++
j) {
404 const double basis = pu[
j] * pv[
i -
j];
405 gLabels.push_back(sensorVol->getLabel().asCalib().rawGBL(legIdx));
406 gDer(0, legColStart + legIdx) = dydx * basis;
407 gDer(1, legColStart + legIdx) = dzdx * basis;
412 point.addGlobals(gLabels, gDer);
416 static Eigen::IOFormat
fmt(4, 0,
", ",
"\n",
"[",
"]");
417 LOGP(info,
"WORKING-POINT {}", ip);
418 LOGP(info,
"Track: {}", wTrk.asString());
419 LOGP(info,
"FrameInfo: {}", frame.asString());
420 std::cout <<
"jacALICE:\n"
421 << jacALICE.format(
fmt) <<
'\n';
422 std::cout <<
"jacGBL:\n"
423 << jacGBL.format(
fmt) <<
'\n';
424 LOGP(info,
"Point {}: GBL res=({}, {}), KF stored res=({}, {})",
426 LOGP(info,
"residual: dy={} dz={}",
res[0],
res[1]);
427 LOGP(info,
"precision: precY={} precZ={}", prec[0], prec[1]);
430 points.push_back(point);
433 gbl::GblTrajectory traj(points, std::abs(bz) > 0.01);
434 if (traj.isValid()) {
435 double chi2 = NAN, lostWeight = NAN;
437 if (
auto ierr = traj.fit(chi2, ndf, lostWeight); !ierr) {
439 LOGP(info,
"GBL FIT chi2 {} ndf {}", chi2, ndf);
440 traj.printTrajectory(5);
442 if (chi2 / ndf > mParams->
maxChi2Ndf && cGBLChi2Rej++ < 10) {
443 LOGP(error,
"GBL fit exceeded red chi2 {}", chi2 / ndf);
445 LOGP(error,
"\tGBL is far away from good KF fit!!!!");
451 lostWeightSum += lostWeight;
454 gblTrajSlot.push_back(traj);
458 fit.chi2 = (float)chi2;
459 fit.chi2Ndf = (float)chi2 / (
float)ndf;
471 auto timeEnd = std::chrono::high_resolution_clock::now();
472 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(timeEnd - timeStart);
473 LOGP(info,
"Fitted {} tracks out of {} (selected {}) in {} sec", cGBLFit, itsTracks.size(), cSelected, duration.count() / 1e3);
474 LOGP(info,
"\tRefit failed for {} tracks; Failed prop for {} tracks", cFailedRefit, cFailedProp);
475 LOGP(info,
"\tGBL SUMMARY:");
476 LOGP(info,
"\t\tGBL construction failed {}", cGBLConstruct);
477 LOGP(info,
"\t\tGBL fit failed {}", cGBLFitFail);
478 LOGP(info,
"\t\tGBL chi2Ndf rejected {}", cGBLChi2Rej);
480 LOGP(info,
"\t\tGBL Chi2/Ndf = NDF IS 0");
482 LOGP(info,
"\t\tGBL Chi2/Ndf = {}", chi2Sum / ndfSum);
484 LOGP(info,
"\t\tGBL LostWeight = {}", lostWeightSum);
485 LOGP(info,
"Streaming results to output");
488 for (
auto& slot : gblTrajSlots) {
489 for (
auto& traj : slot) {
490 traj.milleOut(mille);
495 for (
auto& slot : resTrackSlots) {
496 for (
auto&
res : slot) {
508 if (
static bool initOnce{
false}; !initOnce) {
520 for (
int i = 0;
i < 6; ++
i) {
522 mRigidBodyParams[
i].setZero();
525 using json = nlohmann::json;
527 auto data = json::parse(
f);
528 for (
const auto& item :
data) {
529 int id = item[
"id"].get<
int>();
531 auto v = item[
"matrix"].get<std::vector<std::vector<double>>>();
532 TMatrixD
m(
v.size(),
v[
v.size() - 1].size());
533 for (
size_t r{0};
r <
v.size(); ++
r) {
534 for (
size_t c{0};
c <
v[
r].size(); ++
c) {
541 auto rb = item[
"rigidBody"].get<std::vector<double>>();
542 for (
int k = 0; k < 6 && k < (
int)rb.size(); ++k) {
543 mRigidBodyParams[
id](k) = rb[k];
552void AlignmentSpec::buildHierarchy()
564 mHierarchy->finalise();
567 mHierarchy->writeTree(
tree);
569 mHierarchy->writeRigidBodyConstraints(cons);
571 mHierarchy->writeParameters(par);
575bool AlignmentSpec::getTransportJacobian(
const TrackD& track,
double xTo,
double alphaTo, gbl::Matrix5d& jac, gbl::Matrix5d& err)
578 const auto bz = prop->getNominalBz();
579 const auto minStep = std::sqrt(std::numeric_limits<double>::epsilon());
580 const gbl::Vector5d
x0(track.getParams());
587 auto propagate = [&](gbl::Vector5d&
p) ->
bool {
590 tmp.setParam(p[
i],
i);
592 if (!prop->propagateToAlphaX(tmp, refLin, alphaTo, xTo,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType)) {
595 p = gbl::Vector5d(tmp.getParams());
606 double normErr = std::numeric_limits<double>::max();
607 gbl::Vector5d bestDeriv = gbl::Vector5d::Constant(std::numeric_limits<double>::max());
609 gbl::Vector5d xPlus =
x0, xMinus =
x0;
612 if (!propagate(xPlus) || !propagate(xMinus)) {
615 cur.col(0) = (xPlus - xMinus) / (2.0 *
h);
617 bestDeriv = cur.col(0);
623 for (
int k{1}; k <= iExt; ++k) {
624 cur.col(k) = (fac * cur.col(k - 1) - pre.col(k - 1)) / (fac - 1.0);
626 double e = std::max((cur.col(k) - cur.col(k - 1)).norm(), (cur.col(k) - pre.col(k - 1)).norm());
629 bestDeriv = cur.col(k);
630 if (normErr < mParams->ridderEps) {
635 if (normErr < mParams->ridderEps) {
640 double tableauErr = (cur.col(iExt) - pre.col(iExt - 1)).norm();
641 if (tableauErr >= 2.0 * normErr) {
647 if (bestDeriv.isApproxToConstant(std::numeric_limits<double>::max())) {
650 jac.col(iPar) = bestDeriv;
651 err.col(iPar) = gbl::Vector5d::Constant(normErr);
654 if (jac.isIdentity(1e-8)) {
655 LOGP(error,
"Near jacobian idendity for taking track from {} to {}", track.getX(), xTo);
662bool AlignmentSpec::prepareITSTrack(
int iTrk,
const o2::its::TrackITS& itsTrack, align::Track& resTrack)
665 auto trFit = convertTrack<double>(itsTrack.getParamOut());
668 const auto bz = prop->getNominalBz();
669 std::array<const FrameInfoExt*, 8> frameArr{};
672 refLin = &(trkOut = trFit);
677 if (!prop->propagateToAlphaX(tr, refLin, frameArr[
i]->alpha, frameArr[
i]->x,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType)) {
680 meas.dy = frameArr[
i]->positionTrackingFrame[0] - tr.getY();
681 meas.dz = frameArr[
i]->positionTrackingFrame[1] - tr.getZ();
682 meas.sig2y = frameArr[
i]->covarianceTrackingFrame[0];
683 meas.sig2z = frameArr[
i]->covarianceTrackingFrame[2];
685 meas.phi = tr.getPhi();
686 o2::math_utils::bringTo02Pid(meas.phi);
687 chi2 += (float)tr.getPredictedChi2Quiet(frameArr[
i]->positionTrackingFrame, frameArr[
i]->covarianceTrackingFrame);
688 if (!tr.update(frameArr[
i]->positionTrackingFrame, frameArr[
i]->covarianceTrackingFrame)) {
692 refLin->setY(frameArr[
i]->positionTrackingFrame[0]);
693 refLin->setZ(frameArr[
i]->positionTrackingFrame[1]);
702 const int iPV = mT2PV[iTrk];
706 const auto& pv = mPVs[iPV];
707 auto tmp = convertTrack<double>(itsTrack.getParamIn());
708 if (!prop->propagateToDCA(pv, tmp, bz)) {
711 pvInfo.alpha = (float)tmp.getAlpha();
714 o2::math_utils::sincosd(pvInfo.alpha, sa, ca);
715 pvInfo.x = tmp.getX();
716 pvInfo.positionTrackingFrame[0] = -pv.getX() * sa + pv.getY() * ca;
717 pvInfo.positionTrackingFrame[1] = pv.getZ();
718 pvInfo.covarianceTrackingFrame[0] = 0.5 * (pv.getSigmaX2() + pv.getSigmaY2());
719 pvInfo.covarianceTrackingFrame[2] = pv.getSigmaY2();
722 frameArr[0] = &pvInfo;
726 int nCl = itsTrack.getNClusters();
727 for (
int i = 0;
i < nCl;
i++) {
728 const auto& curInfo = mITSTrackingInfo[itsClRefs[itsTrack.
getClusterEntry(
i)]];
729 frameArr[1 + curInfo.lr] = &curInfo;
733 resTrack.points.clear();
734 resTrack.info.clear();
735 trFit.resetCovariance();
736 trFit.setCov(trFit.getQ2Pt() * trFit.getQ2Pt() * trFit.getCov()[14], 14);
738 for (
int i{7};
i >= 0; --
i) {
740 int res = accountCluster(
i, trFit, chi2, point, refLin);
743 }
else if (
res == 0) {
744 resTrack.points.push_back(point);
745 resTrack.info.push_back(*frameArr[
i]);
746 resTrack.track = trFit;
750 std::reverse(resTrack.info.begin(), resTrack.info.end());
751 std::reverse(resTrack.points.begin(), resTrack.points.end());
752 resTrack.kfFit.chi2 = chi2;
753 resTrack.kfFit.ndf = (
int)resTrack.info.size() * 2 - 5;
754 resTrack.kfFit.chi2Ndf = chi2 / (float)resTrack.kfFit.ndf;
759void AlignmentSpec::prepareMeasurments(std::span<const itsmft::CompClusterExt>
clusters, std::span<const unsigned char> patterns)
761 LOGP(info,
"Preparing {} measurments",
clusters.size());
764 mITSTrackingInfo.clear();
765 mITSTrackingInfo.reserve(
clusters.size());
766 auto pattIt = patterns.begin();
768 const auto sens = cls.getSensorID();
769 const auto lay = geom->getLayer(sens);
770 double sigmaY2{0}, sigmaZ2{0};
780 const auto gloXYZ = geom->getMatrixL2G(sens) * locXYZ;
782 auto trkXYZf = geom->getMatrixT2L(sens) ^ locXYZ;
784 trkXYZ.SetCoordinates(trkXYZf.X(), trkXYZf.Y(), trkXYZf.Z());
789 double alpha = geom->getSensorRefAlpha(sens);
790 double x = trkXYZ.x();
794 x = std::hypot(gloXYZ.x(), gloXYZ.y());
796 alpha = std::atan2(gloXYZ.y(), gloXYZ.x());
802 mITSTrackingInfo.emplace_back(sens, lay,
x,
alpha,
803 std::array<double, 2>{trkXYZ.y(), trkXYZ.z()},
804 std::array<double, 3>{sigmaY2, 0., sigmaZ2});
808void AlignmentSpec::buildT2V()
812 mT2PV.resize(itsTracks.size(), -1);
814 mPVs.reserve(mcReader->getNEvents(0));
815 for (
int iEve{0}; iEve < mcReader->getNEvents(0); ++iEve) {
816 const auto& eve = mcReader->getMCEventHeader(0, iEve);
818 constexpr float err{22e-4f};
819 vtx.setX((
float)eve.GetX());
820 vtx.
setY((
float)eve.GetY());
821 vtx.
setZ((
float)eve.GetZ());
828 for (
size_t iTrk{0}; iTrk < mcLbls.size(); ++iTrk) {
829 const auto& lbl = mcLbls[iTrk];
830 if (!lbl.isValid() || !lbl.isCorrect()) {
833 const auto& mcTrk = mcReader->getTrack(lbl);
834 if (mcTrk->isPrimary()) {
835 mT2PV[iTrk] = lbl.getEventID();
839 LOGP(fatal,
"Data PV to track TODO");
843bool AlignmentSpec::applyMisalignment(Eigen::Vector2d&
res,
const FrameInfoExt& frame,
const TrackD& wTrk,
size_t iTrk)
857 const auto mcTrk = mcReader->getTrack(lbl);
861 std::array<double, 3> xyz{mcTrk->GetStartVertexCoordinatesX(), mcTrk->GetStartVertexCoordinatesY(), mcTrk->GetStartVertexCoordinatesZ()};
862 std::array<double, 3> pxyz{mcTrk->GetStartVertexMomentumX(), mcTrk->GetStartVertexMomentumY(), mcTrk->GetStartVertexMomentumZ()};
863 TParticlePDG* pPDG = TDatabasePDG::Instance()->GetParticle(mcTrk->GetPdgCode());
869 const double r = frame.x;
870 const double gloX =
r * std::cos(frame.alpha);
871 const double gloY =
r * std::sin(frame.alpha);
872 const double gloZ = frame.positionTrackingFrame[1];
874 const double h = mDeformations[sensorID](u,
v);
877 if (!mcAtCl.rotate(frame.alpha) || !prop->PropagateToXBxByBz(mcAtCl, frame.x)) {
881 const double snp = mcAtCl.getSnp();
882 const double tgl = mcAtCl.getTgl();
883 const double csci = 1. / std::sqrt(1. - (snp * snp));
884 const double dydx = snp * csci;
885 const double dzdx = tgl * csci;
886 const double dy = dydx *
h;
887 const double dz = dzdx *
h;
889 const double newGloY = (
r * std::sin(frame.alpha)) + (dy * std::cos(frame.alpha));
890 const double newGloX = (
r * std::cos(frame.alpha)) - (dy * std::sin(frame.alpha));
891 const double newGloZ = gloZ + dz;
892 auto [uNew, vNew] = computeUV(newGloX, newGloY, newGloZ, sensorID,
constants::radii[layerID]);
893 if (std::abs(uNew) > 1. || std::abs(vNew) > 1.) {
906 GlobalLabel lbl(0, frame.sens,
true);
907 if (mChip2Hiearchy.find(lbl) == mChip2Hiearchy.end()) {
910 const auto* tileVol = mChip2Hiearchy.at(lbl);
916 const double posTrk[3] = {frame.x, 0., 0.};
918 tileVol->getT2L().LocalToMaster(posTrk, posLoc);
920 tileVol->computeJacobianL2T(posLoc, jacL2T);
924 der *= tileVol->getJL2P();
927 Eigen::Vector3d shift = der * mRigidBodyParams[sensorID];
947 LOG(info) <<
"its cluster dictionary updated";
952 LOG(info) <<
"it3 cluster dictionary updated";
960 auto dataRequest = std::make_shared<DataRequest>();
961 std::shared_ptr<o2::base::GRPGeomRequest> ggRequest{
nullptr};
963 dataRequest->requestTracks(srcTracks, useMC);
965 dataRequest->requestIT3Clusters(useMC);
967 dataRequest->requestClusters(srcClusters, useMC);
969 if (withPV && !useMC) {
970 dataRequest->requestPrimaryVertices(useMC);
972 ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
982 dataRequest->inputs.emplace_back(
"dummy",
"GLO",
"DUMMY_OUT", 0);
983 ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
989 dataRequest->inputs);
993 {
"nthreads", VariantType::Int, 1, {
"number of threads"}},
997 .
name =
"its3-alignment",
998 .inputs = dataRequest->inputs,
1000 .algorithm =
AlgorithmSpec{adaptFromTask<AlignmentSpec>(dataRequest, ggRequest, srcTracks, useMC, withPV, withITS, out)},
Definition of the BuildTopologyDictionary class for ITS3.
Helper for geometry and GRP related CCDB requests.
Definition of the GeometryTGeo class.
Definition of the NDim Legendre Polynominals.
Referenc on track indices contributing to the vertex, with possibility chose tracks from specific sou...
Class for time synchronization of RawReader instances.
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)
void printKeyValues(bool showProv=true, bool useLogger=false, bool withPadding=true, bool showHash=true) const final
static const AlignmentParams & Instance()
Static class with identifiers, bitmasks and names for ALICE detectors.
T get(const char *key) const
ConfigParamRegistry const & options()
std::map< GlobalLabel, AlignableVolume * > SensorMapping
void endOfStream(EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(ProcessingContext &pc) final
~AlignmentSpec() final=default
void init(InitContext &ic) final
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
std::string asString() const
static GeometryTGeo * Instance()
void fillMatrixCache(int mask) override
int getClusterEntry(int i) const
std::string pstring(bool withNewline=false) const
GLfloat GLfloat GLfloat alpha
Node par(int index)
Parameters.
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
o2::track::TrackParCovD TrackD
Eigen::Matrix< double, 3, 6 > Matrix36
AlignableVolume::Ptr buildHierarchyITS(AlignableVolume::SensorMapping &sensorMap)
Eigen::Matrix< double, 6, 6 > Matrix66
o2::framework::DataProcessorSpec getAlignmentSpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool useMC, bool withPV, bool withITS3, OutputEnum out)
void writeMillepedeResults(AlignableVolume *root, const std::string &milleResPath, const std::string &outJsonPath, const std::string &injectedJsonPath="")
void applyDOFConfig(AlignableVolume *root, const std::string &jsonPath)
AlignableVolume::Ptr buildHierarchyIT3(AlignableVolume::SensorMapping &sensorMap)
auto getRigidBodyDerivatives(const auto &trk)
T getDetID2Layer(T detID)
constexpr std::array< double, nLayers > radii
constexpr double equatorialGap
o2::math_utils::Point3D< T > extractClusterData(const itsmft::CompClusterExt &c, iterator &iter, const o2::its3::TopologyDictionary *dict, T &sig2y, T &sig2z)
o2::math_utils::Point3D< T > extractClusterData(const itsmft::CompClusterExt &c, iterator &iter, const itsmft::TopologyDictionary *dict, T &sig2y, T &sig2z)
void bringToPMPid(double &phi)
TrackParametrizationWithError< double > TrackParCovD
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
auto getITSTracks() const
auto getITSTracksClusterRefs() const
auto getITSClustersPatterns() const
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
auto getITSTracksMCLabels() const
auto getITSClusters() const
std::string dofConfigJson
double ridderRelIniStep[5]
double ridderMaxIniStep[5]
std::string milleResOutJson
std::string milleTreeFile
std::string milleParamFile
o2::base::PropagatorD::MatCorrType corrType
std::vector< Measurement > points
o2::track::TrackParCovD track
std::vector< FrameInfoExt > info
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< Cluster > clusters
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))