22#include <GblTrajectory.h>
25#include <GblMeasurement.h>
26#include <MilleBinary.h>
27#include <nlohmann/json.hpp>
76 .measAlpha = frame.
alpha,
89 Eigen::MatrixXd dyn(3, sRigidBodyBasis.
nDOFs());
104 : mDataRequest(dr), mGGCCDBRequest(gr), mTracksSrc(
src), mUseMC(useMC), mWithPV(withPV), mIsITS3(!withITS), mOutOpt(out)
116 void buildHierarchy();
121 bool getTransportJacobian(
const TrackD& track,
double xTo,
double alphaTo, gbl::Matrix5d& jac, gbl::Matrix5d& err);
128 void prepareMeasurments();
136 bool applyMisalignment(Eigen::Vector2d&
res,
const FrameInfoExt& frame,
const TrackD& wTrk,
size_t iTrk);
139 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
140 std::vector<dataformats::VertexBase> mPVs;
141 std::vector<int> mT2PV;
146 std::unique_ptr<steer::MCKinematicsReader> mcReader;
148 std::shared_ptr<DataRequest> mDataRequest;
149 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
150 std::unique_ptr<AlignableVolume> mHierarchy;
156 const AlignmentParams* mParams{
nullptr};
157 MisalignmentModel mMisalignment;
158 std::array<Eigen::Matrix<double, 6, 1>, 6> mRigidBodyParams;
164 mNThreads = ic.
options().
get<
int>(
"nthreads");
167 mDBGOut = std::make_unique<o2::utils::TreeStreamRedirector>(
"its3_debug_alg.root",
"recreate");
170 mcReader = std::make_unique<steer::MCKinematicsReader>(
"collisioncontext.root");
177 updateTimeDependentParams(pc);
181 mRecoData = &recoData;
183 updateTimeDependentParams(pc);
191 if (!mITSDict && !mIT3Dict) {
192 LOGP(fatal,
"ITS data is not loaded");
195 const auto bz = prop->getNominalBz();
198 std::span<const o2::MCCompLabel> mcLbls;
202 prepareMeasurments();
208 if (mNThreads > 1 && !(mParams->
misAlgJson.empty())) {
209 LOGP(warn,
"Applying misalignment works only single-threaded, forcing to 1");
212 LOGP(info,
"Starting fits with {} threads", mNThreads);
215 std::vector<std::vector<gbl::GblTrajectory>> gblTrajSlots(mNThreads);
216 std::vector<std::vector<Track>> resTrackSlots(mNThreads);
218 auto timeStart = std::chrono::high_resolution_clock::now();
219 int cFailedRefit{0}, cFailedProp{0}, cSelected{0}, cGBLFit{0}, cGBLFitFail{0}, cGBLChi2Rej{0}, cGBLConstruct{0};
220 double chi2Sum{0}, lostWeightSum{0};
223#pragma omp parallel num_threads(mNThreads) \
224 reduction(+ : cFailedRefit) \
225 reduction(+ : cFailedProp) \
226 reduction(+ : cSelected) \
227 reduction(+ : cGBLFit) \
228 reduction(+ : cGBLFitFail) \
229 reduction(+ : cGBLChi2Rej) \
230 reduction(+ : cGBLConstruct) \
231 reduction(+ : chi2Sum) \
232 reduction(+ : lostWeightSum) \
233 reduction(+ : ndfSum)
237 const int tid = omp_get_thread_num();
241 auto& gblTrajSlot = gblTrajSlots[tid];
242 auto& resTrackSlot = resTrackSlots[tid];
245#pragma omp for schedule(dynamic)
247 for (
size_t iTrk = 0; iTrk < (int)itsTracks.size(); ++iTrk) {
248 const auto& trk = itsTracks[iTrk];
249 if (trk.getNClusters() < mParams->
minITSCls ||
250 (trk.getChi2() / ((float)trk.getNClusters() * 2 - 5)) >= mParams->
maxITSChi2Ndf ||
251 trk.getPt() < mParams->
minPt ||
252 (mUseMC && (!mcLbls[iTrk].isValid() || !mcLbls[iTrk].isCorrect()))) {
256 Track& resTrack = resTrackSlot.emplace_back();
257 if (!prepareITSTrack((
int)iTrk, trk, resTrack)) {
259 resTrackSlot.pop_back();
265 refLin = &resTrack.
track;
269 auto wTrk = resTrack.
track;
270 const bool hasPV = resTrack.
info[0].lr == -1;
271 std::vector<gbl::GblPoint> points;
273 const int np = (int)resTrack.
points.size();
275 lt.setTimeNotNeeded();
276 constexpr int perm[5] = {4, 2, 3, 0, 1};
277 for (
int ip{0}; ip < np; ++ip) {
278 const auto& frame = resTrack.
info[ip];
279 gbl::Matrix5d err = gbl::Matrix5d::Identity(), jacALICE = gbl::Matrix5d::Identity(), jacGBL;
284 if (!getTransportJacobian(wTrk, frame.x, frame.alpha, jacALICE, err) ||
285 !prop->propagateToAlphaX(wTrk, refLin, frame.
alpha, frame.x,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType, <)) {
290 msErr = its::math_utils::MSangle(trk.getPID().getMass(), trk.getP(), lt.getX2X0());
292 for (
int i = 0;
i < 5;
i++) {
293 for (
int j = 0;
j < 5;
j++) {
294 jacGBL(
i,
j) = jacALICE(perm[
i], perm[
j]);
300 gbl::GblPoint point(jacGBL);
302 Eigen::Vector2d
res, prec;
303 res << frame.positionTrackingFrame[0] - wTrk.getY(), frame.positionTrackingFrame[1] - wTrk.getZ();
306 if (!applyMisalignment(
res, frame, wTrk, iTrk)) {
311 prec << 1. / resTrack.
points[ip].sig2y, 1. / resTrack.
points[ip].sig2z;
313 point.addMeasurement(
res, prec);
314 if (msErr > mParams->
minMS && ip < np - 1) {
315 Eigen::Vector2d scat(0., 0.), scatPrec = Eigen::Vector2d::Constant(1. / (msErr * msErr));
316 point.addScatterer(scat, scatPrec);
322 if (mChip2Hiearchy.find(lbl) == mChip2Hiearchy.end()) {
323 LOGP(fatal,
"Cannot find global label: {}", lbl.
asString());
329 const auto* tileVol = mChip2Hiearchy.at(lbl);
330 const auto derCtx = makeDerivativeContext(frame, wTrk);
331 Matrix36 der = getRigidBodyBaseDerivatives(derCtx);
335 for (
const auto*
v = tileVol;
v && !
v->isRoot();
v =
v->getParent()) {
336 if (
v->getRigidBody()) {
337 nColRB +=
v->getRigidBody()->nDOFs();
342 const auto* sensorVol = tileVol->getParent();
343 const auto* calibSet = sensorVol ? sensorVol->getCalib() :
nullptr;
344 const int nCalib = calibSet ? calibSet->nDOFs() : 0;
345 const int nCol = nColRB + nCalib;
347 std::vector<int> gLabels;
348 gLabels.reserve(nCol);
349 Eigen::MatrixXd gDer(3, nCol);
351 Eigen::Index curCol{0};
354 const double posTrk[3] = {frame.x, 0., 0.};
356 tileVol->getT2L().LocalToMaster(posTrk, posLoc);
358 tileVol->computeJacobianL2T(posLoc, jacL2T);
360 if (tileVol->getRigidBody()) {
361 const int nd = tileVol->getRigidBody()->nDOFs();
362 for (
int iDOF = 0; iDOF < nd; ++iDOF) {
363 gLabels.push_back(tileVol->getLabel().rawGBL(iDOF));
365 gDer.middleCols(curCol, nd) = der;
370 for (
const auto* child = tileVol; child->getParent() && !child->getParent()->isRoot(); child = child->getParent()) {
371 der *= child->getJL2P();
372 const auto* parent = child->getParent();
373 if (parent->getRigidBody()) {
374 const int nd = parent->getRigidBody()->nDOFs();
375 for (
int iDOF = 0; iDOF < nd; ++iDOF) {
376 gLabels.push_back(parent->getLabel().rawGBL(iDOF));
378 gDer.middleCols(curCol, nd) = der;
385 const int nd = calibSet->nDOFs();
386 Eigen::MatrixXd calDer(3, nd);
387 calibSet->fillDerivatives(derCtx, calDer);
388 for (
int iDOF = 0; iDOF < nd; ++iDOF) {
389 gLabels.push_back(sensorVol->getLabel().asCalib().rawGBL(iDOF));
391 gDer.middleCols(curCol, nd) = calDer;
394 point.addGlobals(gLabels, gDer);
398 static Eigen::IOFormat
fmt(4, 0,
", ",
"\n",
"[",
"]");
399 LOGP(info,
"WORKING-POINT {}", ip);
400 LOGP(info,
"Track: {}", wTrk.asString());
401 LOGP(info,
"FrameInfo: {}", frame.asString());
402 std::cout <<
"jacALICE:\n"
403 << jacALICE.format(
fmt) <<
'\n';
404 std::cout <<
"jacGBL:\n"
405 << jacGBL.format(
fmt) <<
'\n';
406 LOGP(info,
"Point {}: GBL res=({}, {}), KF stored res=({}, {})",
408 LOGP(info,
"residual: dy={} dz={}",
res[0],
res[1]);
409 LOGP(info,
"precision: precY={} precZ={}", prec[0], prec[1]);
412 points.push_back(point);
415 gbl::GblTrajectory traj(points, std::abs(bz) > 0.01);
416 if (traj.isValid()) {
417 double chi2 = NAN, lostWeight = NAN;
419 if (
auto ierr = traj.fit(
chi2, ndf, lostWeight); !ierr) {
421 LOGP(info,
"GBL FIT chi2 {} ndf {}",
chi2, ndf);
422 traj.printTrajectory(5);
425 LOGP(
error,
"GBL fit exceeded red chi2 {}",
chi2 / ndf);
427 LOGP(
error,
"\tGBL is far away from good KF fit!!!!");
433 lostWeightSum += lostWeight;
436 gblTrajSlot.push_back(traj);
440 fit.chi2 = (float)
chi2;
441 fit.chi2Ndf = (float)
chi2 / (
float)ndf;
453 auto timeEnd = std::chrono::high_resolution_clock::now();
454 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(timeEnd - timeStart);
455 LOGP(info,
"Fitted {} tracks out of {} (selected {}) in {} sec", cGBLFit, itsTracks.size(), cSelected, duration.count() / 1e3);
456 LOGP(info,
"\tRefit failed for {} tracks; Failed prop for {} tracks", cFailedRefit, cFailedProp);
457 LOGP(info,
"\tGBL SUMMARY:");
458 LOGP(info,
"\t\tGBL construction failed {}", cGBLConstruct);
459 LOGP(info,
"\t\tGBL fit failed {}", cGBLFitFail);
460 LOGP(info,
"\t\tGBL chi2Ndf rejected {}", cGBLChi2Rej);
462 LOGP(info,
"\t\tGBL Chi2/Ndf = NDF IS 0");
464 LOGP(info,
"\t\tGBL Chi2/Ndf = {}", chi2Sum / ndfSum);
466 LOGP(info,
"\t\tGBL LostWeight = {}", lostWeightSum);
467 LOGP(info,
"Streaming results to output");
470 for (
auto& slot : gblTrajSlots) {
471 for (
auto& traj : slot) {
472 traj.milleOut(mille);
477 for (
auto& slot : resTrackSlots) {
478 for (
auto&
res : slot) {
490 if (
static bool initOnce{
false}; !initOnce) {
501 for (
auto& rb : mRigidBodyParams) {
507 using json = nlohmann::json;
509 auto data = json::parse(
f);
510 for (
const auto& item :
data) {
511 int id = item[
"id"].get<
int>();
512 if (!item.contains(
"rigidBody")) {
515 auto rb = item[
"rigidBody"].get<std::vector<double>>();
516 for (
int k = 0; k < 6 && k < static_cast<int>(rb.size()); ++k) {
517 mRigidBodyParams[
id](k) = rb[k];
526void AlignmentSpec::buildHierarchy()
538 mHierarchy->finalise();
541 mHierarchy->writeTree(
tree);
543 mHierarchy->writeRigidBodyConstraints(cons);
545 mHierarchy->writeParameters(par);
549bool AlignmentSpec::getTransportJacobian(
const TrackD& track,
double xTo,
double alphaTo, gbl::Matrix5d& jac, gbl::Matrix5d& err)
552 const auto bz = prop->getNominalBz();
553 const auto minStep = std::sqrt(std::numeric_limits<double>::epsilon());
554 const gbl::Vector5d
x0(
track.getParams());
561 auto propagate = [&](gbl::Vector5d&
p) ->
bool {
563 for (
int i{0};
i < track::kNParams; ++
i) {
564 tmp.setParam(p[
i],
i);
566 if (!prop->propagateToAlphaX(tmp, refLin, alphaTo, xTo,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType)) {
569 p = gbl::Vector5d(tmp.getParams());
573 for (
int iPar{0}; iPar < track::kNParams; ++iPar) {
580 double normErr = std::numeric_limits<double>::max();
581 gbl::Vector5d bestDeriv = gbl::Vector5d::Constant(std::numeric_limits<double>::max());
583 gbl::Vector5d xPlus =
x0, xMinus =
x0;
586 if (!propagate(xPlus) || !propagate(xMinus)) {
589 cur.col(0) = (xPlus - xMinus) / (2.0 *
h);
591 bestDeriv = cur.col(0);
597 for (
int k{1}; k <= iExt; ++k) {
598 cur.col(k) = (fac * cur.col(k - 1) - pre.col(k - 1)) / (fac - 1.0);
600 double e = std::max((cur.col(k) - cur.col(k - 1)).norm(), (cur.col(k) - pre.col(k - 1)).norm());
603 bestDeriv = cur.col(k);
604 if (normErr < mParams->ridderEps) {
609 if (normErr < mParams->ridderEps) {
614 double tableauErr = (cur.col(iExt) - pre.col(iExt - 1)).
norm();
615 if (tableauErr >= 2.0 * normErr) {
621 if (bestDeriv.isApproxToConstant(std::numeric_limits<double>::max())) {
624 jac.col(iPar) = bestDeriv;
625 err.col(iPar) = gbl::Vector5d::Constant(normErr);
628 if (jac.isIdentity(1e-8)) {
629 LOGP(
error,
"Near jacobian idendity for taking track from {} to {}",
track.getX(), xTo);
636bool AlignmentSpec::prepareITSTrack(
int iTrk,
const o2::its::TrackITS& itsTrack, align::Track& resTrack)
639 auto trFit = convertTrack<double>(itsTrack.getParamOut());
642 const auto bz = prop->getNominalBz();
643 std::array<const FrameInfoExt*, 8> frameArr{};
646 refLin = &(trkOut = trFit);
651 if (!prop->propagateToAlphaX(tr, refLin, frameArr[
i]->alpha, frameArr[
i]->x,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType)) {
654 meas.dy = frameArr[
i]->positionTrackingFrame[0] - tr.getY();
655 meas.dz = frameArr[
i]->positionTrackingFrame[1] - tr.getZ();
656 meas.sig2y = frameArr[
i]->covarianceTrackingFrame[0];
657 meas.sig2z = frameArr[
i]->covarianceTrackingFrame[2];
659 meas.phi = tr.getPhi();
660 o2::math_utils::bringTo02Pid(meas.phi);
661 chi2 += (float)tr.getPredictedChi2Quiet(frameArr[
i]->positionTrackingFrame, frameArr[
i]->covarianceTrackingFrame);
662 if (!tr.update(frameArr[
i]->positionTrackingFrame, frameArr[
i]->covarianceTrackingFrame)) {
666 refLin->setY(frameArr[
i]->positionTrackingFrame[0]);
667 refLin->setZ(frameArr[
i]->positionTrackingFrame[1]);
676 const int iPV = mT2PV[iTrk];
680 const auto& pv = mPVs[iPV];
681 auto tmp = convertTrack<double>(itsTrack.getParamIn());
682 if (!prop->propagateToDCA(pv, tmp, bz)) {
685 pvInfo.alpha = (float)tmp.getAlpha();
688 o2::math_utils::sincosd(pvInfo.alpha, sa, ca);
689 pvInfo.x = tmp.getX();
690 pvInfo.positionTrackingFrame[0] = -pv.getX() * sa + pv.getY() * ca;
691 pvInfo.positionTrackingFrame[1] = pv.getZ();
692 pvInfo.covarianceTrackingFrame[0] = 0.5 * (pv.getSigmaX2() + pv.getSigmaY2());
693 pvInfo.covarianceTrackingFrame[2] = pv.getSigmaY2();
696 frameArr[0] = &pvInfo;
700 int nCl = itsTrack.getNClusters();
701 for (
int i = 0;
i <
nCl;
i++) {
702 const auto& curInfo = mITSTrackingInfo[itsClRefs[itsTrack.
getClusterEntry(
i)]];
703 frameArr[1 + curInfo.lr] = &curInfo;
707 resTrack.points.clear();
708 resTrack.info.clear();
709 trFit.resetCovariance();
710 trFit.setCov(trFit.getQ2Pt() * trFit.getQ2Pt() * trFit.getCov()[14], 14);
712 for (
int i{7};
i >= 0; --
i) {
714 int res = accountCluster(
i, trFit,
chi2, point, refLin);
717 }
else if (
res == 0) {
718 resTrack.points.push_back(point);
719 resTrack.info.push_back(*frameArr[
i]);
720 resTrack.track = trFit;
724 std::reverse(resTrack.info.begin(), resTrack.info.end());
725 std::reverse(resTrack.points.begin(), resTrack.points.end());
726 resTrack.kfFit.chi2 =
chi2;
727 resTrack.kfFit.ndf = (
int)resTrack.info.size() * 2 - 5;
728 resTrack.kfFit.chi2Ndf =
chi2 / (float)resTrack.kfFit.ndf;
733void AlignmentSpec::prepareMeasurments()
736 geom->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L, o2::math_utils::TransformType::L2G));
738 mITSTrackingInfo.init(nLr);
739 for (
int lr = 0; lr < nLr; lr++) {
740 mITSTrackingInfo.beginLayer(lr);
743 LOGP(info,
"Preparing {} measurments of the layer slot {}",
clusters.size(), lr);
744 mITSTrackingInfo.getClusters().reserve(mITSTrackingInfo.size() +
clusters.size());
745 auto pattIt = patterns.begin();
747 const auto sens = cls.getSensorID();
748 const auto lay = geom->getLayer(sens);
749 double sigmaY2{0}, sigmaZ2{0};
750 math_utils::Point3D<float> locXYZ;
759 const auto gloXYZ = geom->getMatrixL2G(sens) * locXYZ;
761 auto trkXYZf = geom->getMatrixT2L(sens) ^ locXYZ;
763 trkXYZ.SetCoordinates(trkXYZf.X(), trkXYZf.Y(), trkXYZf.Z());
768 double alpha = geom->getSensorRefAlpha(sens);
769 double x = trkXYZ.x();
773 x = std::hypot(gloXYZ.x(), gloXYZ.y());
775 alpha = std::atan2(gloXYZ.y(), gloXYZ.x());
780 math_utils::bringToPMPid(
alpha);
781 mITSTrackingInfo.getClusters().emplace_back(sens, lay,
x,
alpha,
782 std::array<double, 2>{trkXYZ.y(), trkXYZ.z()},
783 std::array<double, 3>{sigmaY2, 0., sigmaZ2});
786 mITSTrackingInfo.finalize();
789void AlignmentSpec::buildT2V()
793 mT2PV.resize(itsTracks.size(), -1);
795 mPVs.reserve(mcReader->getNEvents(0));
796 for (
int iEve{0}; iEve < mcReader->getNEvents(0); ++iEve) {
797 const auto& eve = mcReader->getMCEventHeader(0, iEve);
799 constexpr float err{22e-4f};
800 vtx.setX((
float)eve.GetX());
801 vtx.
setY((
float)eve.GetY());
802 vtx.
setZ((
float)eve.GetZ());
809 for (
size_t iTrk{0}; iTrk < mcLbls.size(); ++iTrk) {
810 const auto& lbl = mcLbls[iTrk];
811 if (!lbl.isValid() || !lbl.isCorrect()) {
814 const auto& mcTrk = mcReader->getTrack(lbl);
815 if (mcTrk->isPrimary()) {
816 mT2PV[iTrk] = lbl.getEventID();
820 LOGP(fatal,
"Data PV to track TODO");
824bool AlignmentSpec::applyMisalignment(Eigen::Vector2d&
res,
const FrameInfoExt& frame,
const TrackD& wTrk,
size_t iTrk)
832 const MisalignmentFrame misFrame{
833 .sensorID = sensorID,
836 .alpha = frame.alpha,
837 .z = frame.positionTrackingFrame[1]};
847 const auto mcTrk = mcReader->getTrack(lbl);
851 std::array<double, 3> xyz{mcTrk->GetStartVertexCoordinatesX(), mcTrk->GetStartVertexCoordinatesY(), mcTrk->GetStartVertexCoordinatesZ()};
852 std::array<double, 3> pxyz{mcTrk->GetStartVertexMomentumX(), mcTrk->GetStartVertexMomentumY(), mcTrk->GetStartVertexMomentumZ()};
853 TParticlePDG* pPDG = TDatabasePDG::Instance()->GetParticle(mcTrk->GetPdgCode());
860 if (!mcAtCl.rotate(frame.alpha) || !prop->PropagateToXBxByBz(mcAtCl, frame.x)) {
865 if (!shift.accepted) {
879 if (mChip2Hiearchy.find(lbl) == mChip2Hiearchy.end()) {
882 const auto* tileVol = mChip2Hiearchy.at(lbl);
885 Matrix36 der = getRigidBodyBaseDerivatives(makeDerivativeContext(frame, wTrk));
888 const double posTrk[3] = {frame.x, 0., 0.};
890 tileVol->getT2L().LocalToMaster(posTrk, posLoc);
892 tileVol->computeJacobianL2T(posLoc, jacL2T);
896 der *= tileVol->getJL2P();
899 Eigen::Vector3d shift = der * mRigidBodyParams[sensorID];
917 <<
"sens=" << sensorID
919 <<
"z=" << frame.positionTrackingFrame[1]
920 <<
"phi=" << frame.alpha
939 LOG(info) <<
"its cluster dictionary updated";
944 LOG(info) <<
"it3 cluster dictionary updated";
952 auto dataRequest = std::make_shared<DataRequest>();
953 dataRequest->setITSPerLayer(itsStag);
954 std::shared_ptr<o2::base::GRPGeomRequest> ggRequest{
nullptr};
956 dataRequest->requestTracks(srcTracks, useMC);
958 dataRequest->requestIT3Clusters(useMC);
960 dataRequest->requestClusters(srcClusters, useMC);
962 if (withPV && !useMC) {
963 dataRequest->requestPrimaryVertices(useMC);
965 ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
975 dataRequest->inputs.emplace_back(
"dummy",
"GLO",
"DUMMY_OUT", 0);
976 ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
982 dataRequest->inputs);
986 {
"nthreads", VariantType::Int, 1, {
"number of threads"}},
990 .
name =
"its3-alignment",
991 .inputs = dataRequest->inputs,
993 .algorithm =
AlgorithmSpec{adaptFromTask<AlignmentSpec>(dataRequest, ggRequest, srcTracks, useMC, withPV, withITS, out)},
Container of the ITS/MFT clusters addressed by the composed (layer,index) ID.
Definition of the BuildTopologyDictionary class for ITS3.
Helper for geometry and GRP related CCDB requests.
char error[CURL_ERROR_SIZE]
Definition of the GeometryTGeo class.
Referenc on track indices contributing to the vertex, with possibility chose tracks from specific sou...
std::string asString() const
Class for time synchronization of RawReader instances.
void fillDerivatives(const DerivativeContext &ctx, Eigen::Ref< Eigen::MatrixXd > out) const override
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
static GeometryTGeo * Instance()
void fillMatrixCache(int mask) override
int getClusterEntry(int i) const
std::string pstring(bool withNewline=false) const
GLfloat GLfloat GLfloat alpha
uint8_t int statusCode int
double norm(const Vec3 &vector)
Defining ITS Vertex explicitly as messageable.
constexpr int MaxITSLayers
o2::track::TrackParCovD TrackD
MisalignmentShift evaluateInextensionalShift(const SensorMisalignment &sensor, const MisalignmentFrame &frame, const TrackSlopes &slopes)
Eigen::Matrix< double, 3, 6 > Matrix36
AlignableVolume::Ptr buildHierarchyITS(AlignableVolume::SensorMapping &sensorMap)
MisalignmentModel loadMisalignmentModel(const std::string &jsonPath)
Eigen::Matrix< double, 6, 6 > Matrix66
MisalignmentShift evaluateLegendreShift(const SensorMisalignment &sensor, const MisalignmentFrame &frame, const TrackSlopes &slopes)
TrackSlopes computeTrackSlopes(double snp, double tgl)
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)
o2::framework::DataProcessorSpec getAlignmentSpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool useMC, bool withPV, bool withITS3, OutputEnum out, bool itsStag)
T getDetID2Layer(T detID)
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)
o2::track::TrackParCov int int int float int nCl
const bool const int TrackITSInternal< NLayers > & track
o2::track::TrackParametrization< float > par
const float const float const float bz
void bringToPMPid(double &phi)
TrackParametrizationWithError< double > TrackParCovD
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
auto getITSPerLayer() const
auto getITSTracks() const
auto getITSTracksClusterRefs() const
auto getITSClustersPatterns(int layer=0) const
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
auto getITSClusters(int layer=0) const
auto getITSTracksMCLabels() 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::array< double, 2 > positionTrackingFrame
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()))