22#include <GblTrajectory.h>
25#include <GblMeasurement.h>
26#include <MilleBinary.h>
27#include <nlohmann/json.hpp>
75 .measAlpha = frame.
alpha,
88 Eigen::MatrixXd dyn(3, sRigidBodyBasis.
nDOFs());
103 : mDataRequest(dr), mGGCCDBRequest(gr), mTracksSrc(
src), mUseMC(useMC), mWithPV(withPV), mIsITS3(!withITS), mOutOpt(out)
115 void buildHierarchy();
120 bool getTransportJacobian(
const TrackD& track,
double xTo,
double alphaTo, gbl::Matrix5d& jac, gbl::Matrix5d& err);
127 void prepareMeasurments(std::span<const itsmft::CompClusterExt>
clusters, std::span<const unsigned char> pattIt);
135 bool applyMisalignment(Eigen::Vector2d&
res,
const FrameInfoExt& frame,
const TrackD& wTrk,
size_t iTrk);
138 std::unique_ptr<o2::utils::TreeStreamRedirector> mDBGOut;
139 std::vector<dataformats::VertexBase> mPVs;
140 std::vector<int> mT2PV;
145 std::unique_ptr<steer::MCKinematicsReader> mcReader;
146 std::vector<FrameInfoExt> mITSTrackingInfo;
147 std::shared_ptr<DataRequest> mDataRequest;
148 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
149 std::unique_ptr<AlignableVolume> mHierarchy;
155 const AlignmentParams* mParams{
nullptr};
156 MisalignmentModel mMisalignment;
157 std::array<Eigen::Matrix<double, 6, 1>, 6> mRigidBodyParams;
163 mNThreads = ic.
options().
get<
int>(
"nthreads");
166 mDBGOut = std::make_unique<o2::utils::TreeStreamRedirector>(
"its3_debug_alg.root",
"recreate");
169 mcReader = std::make_unique<steer::MCKinematicsReader>(
"collisioncontext.root");
176 updateTimeDependentParams(pc);
180 mRecoData = &recoData;
182 updateTimeDependentParams(pc);
190 if (!mITSDict && !mIT3Dict) {
191 LOGP(fatal,
"ITS data is not loaded");
194 const auto bz = prop->getNominalBz();
199 std::span<const o2::MCCompLabel> mcLbls;
203 prepareMeasurments(clusITS, patterns);
209 if (mNThreads > 1 && !(mParams->
misAlgJson.empty())) {
210 LOGP(warn,
"Applying misalignment works only single-threaded, forcing to 1");
213 LOGP(info,
"Starting fits with {} threads", mNThreads);
216 std::vector<std::vector<gbl::GblTrajectory>> gblTrajSlots(mNThreads);
217 std::vector<std::vector<Track>> resTrackSlots(mNThreads);
219 auto timeStart = std::chrono::high_resolution_clock::now();
220 int cFailedRefit{0}, cFailedProp{0}, cSelected{0}, cGBLFit{0}, cGBLFitFail{0}, cGBLChi2Rej{0}, cGBLConstruct{0};
221 double chi2Sum{0}, lostWeightSum{0};
224#pragma omp parallel num_threads(mNThreads) \
225 reduction(+ : cFailedRefit) \
226 reduction(+ : cFailedProp) \
227 reduction(+ : cSelected) \
228 reduction(+ : cGBLFit) \
229 reduction(+ : cGBLFitFail) \
230 reduction(+ : cGBLChi2Rej) \
231 reduction(+ : cGBLConstruct) \
232 reduction(+ : chi2Sum) \
233 reduction(+ : lostWeightSum) \
234 reduction(+ : ndfSum)
238 const int tid = omp_get_thread_num();
242 auto& gblTrajSlot = gblTrajSlots[tid];
243 auto& resTrackSlot = resTrackSlots[tid];
246#pragma omp for schedule(dynamic)
248 for (
size_t iTrk = 0; iTrk < (
int)itsTracks.size(); ++iTrk) {
249 const auto& trk = itsTracks[iTrk];
250 if (trk.getNClusters() < mParams->
minITSCls ||
251 (trk.getChi2() / ((float)trk.getNClusters() * 2 - 5)) >= mParams->
maxITSChi2Ndf ||
252 trk.getPt() < mParams->
minPt ||
253 (mUseMC && (!mcLbls[iTrk].isValid() || !mcLbls[iTrk].isCorrect()))) {
257 Track& resTrack = resTrackSlot.emplace_back();
258 if (!prepareITSTrack((
int)iTrk, trk, resTrack)) {
260 resTrackSlot.pop_back();
266 refLin = &resTrack.
track;
270 auto wTrk = resTrack.
track;
271 const bool hasPV = resTrack.
info[0].lr == -1;
272 std::vector<gbl::GblPoint> points;
274 const int np = (
int)resTrack.
points.size();
276 lt.setTimeNotNeeded();
277 constexpr int perm[5] = {4, 2, 3, 0, 1};
278 for (
int ip{0}; ip < np; ++ip) {
279 const auto& frame = resTrack.
info[ip];
280 gbl::Matrix5d err = gbl::Matrix5d::Identity(), jacALICE = gbl::Matrix5d::Identity(), jacGBL;
285 if (!getTransportJacobian(wTrk, frame.x, frame.alpha, jacALICE, err) ||
286 !prop->propagateToAlphaX(wTrk, refLin, frame.
alpha, frame.x,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType, <)) {
291 msErr = its::math_utils::MSangle(trk.getPID().getMass(), trk.getP(), lt.getX2X0());
293 for (
int i = 0;
i < 5;
i++) {
294 for (
int j = 0;
j < 5;
j++) {
295 jacGBL(
i,
j) = jacALICE(perm[
i], perm[
j]);
301 gbl::GblPoint point(jacGBL);
303 Eigen::Vector2d
res, prec;
304 res << frame.positionTrackingFrame[0] - wTrk.getY(), frame.positionTrackingFrame[1] - wTrk.getZ();
307 if (!applyMisalignment(
res, frame, wTrk, iTrk)) {
312 prec << 1. / resTrack.
points[ip].sig2y, 1. / resTrack.
points[ip].sig2z;
314 point.addMeasurement(
res, prec);
315 if (msErr > mParams->
minMS && ip < np - 1) {
316 Eigen::Vector2d scat(0., 0.), scatPrec = Eigen::Vector2d::Constant(1. / (msErr * msErr));
317 point.addScatterer(scat, scatPrec);
323 if (mChip2Hiearchy.find(lbl) == mChip2Hiearchy.end()) {
324 LOGP(fatal,
"Cannot find global label: {}", lbl.
asString());
330 const auto* tileVol = mChip2Hiearchy.at(lbl);
331 const auto derCtx = makeDerivativeContext(frame, wTrk);
332 Matrix36 der = getRigidBodyBaseDerivatives(derCtx);
336 for (
const auto*
v = tileVol;
v && !
v->isRoot();
v =
v->getParent()) {
337 if (
v->getRigidBody()) {
338 nColRB +=
v->getRigidBody()->nDOFs();
343 const auto* sensorVol = tileVol->getParent();
344 const auto* calibSet = sensorVol ? sensorVol->getCalib() :
nullptr;
345 const int nCalib = calibSet ? calibSet->nDOFs() : 0;
346 const int nCol = nColRB + nCalib;
348 std::vector<int> gLabels;
349 gLabels.reserve(nCol);
350 Eigen::MatrixXd gDer(3, nCol);
352 Eigen::Index curCol{0};
355 const double posTrk[3] = {frame.x, 0., 0.};
357 tileVol->getT2L().LocalToMaster(posTrk, posLoc);
359 tileVol->computeJacobianL2T(posLoc, jacL2T);
361 if (tileVol->getRigidBody()) {
362 const int nd = tileVol->getRigidBody()->nDOFs();
363 for (
int iDOF = 0; iDOF < nd; ++iDOF) {
364 gLabels.push_back(tileVol->getLabel().rawGBL(iDOF));
366 gDer.middleCols(curCol, nd) = der;
371 for (
const auto* child = tileVol; child->getParent() && !child->getParent()->isRoot(); child = child->getParent()) {
372 der *= child->getJL2P();
373 const auto* parent = child->getParent();
374 if (parent->getRigidBody()) {
375 const int nd = parent->getRigidBody()->nDOFs();
376 for (
int iDOF = 0; iDOF < nd; ++iDOF) {
377 gLabels.push_back(parent->getLabel().rawGBL(iDOF));
379 gDer.middleCols(curCol, nd) = der;
386 const int nd = calibSet->nDOFs();
387 Eigen::MatrixXd calDer(3, nd);
388 calibSet->fillDerivatives(derCtx, calDer);
389 for (
int iDOF = 0; iDOF < nd; ++iDOF) {
390 gLabels.push_back(sensorVol->getLabel().asCalib().rawGBL(iDOF));
392 gDer.middleCols(curCol, nd) = calDer;
395 point.addGlobals(gLabels, gDer);
399 static Eigen::IOFormat
fmt(4, 0,
", ",
"\n",
"[",
"]");
400 LOGP(info,
"WORKING-POINT {}", ip);
401 LOGP(info,
"Track: {}", wTrk.asString());
402 LOGP(info,
"FrameInfo: {}", frame.asString());
403 std::cout <<
"jacALICE:\n"
404 << jacALICE.format(
fmt) <<
'\n';
405 std::cout <<
"jacGBL:\n"
406 << jacGBL.format(
fmt) <<
'\n';
407 LOGP(info,
"Point {}: GBL res=({}, {}), KF stored res=({}, {})",
409 LOGP(info,
"residual: dy={} dz={}",
res[0],
res[1]);
410 LOGP(info,
"precision: precY={} precZ={}", prec[0], prec[1]);
413 points.push_back(point);
416 gbl::GblTrajectory traj(points, std::abs(bz) > 0.01);
417 if (traj.isValid()) {
418 double chi2 = NAN, lostWeight = NAN;
420 if (
auto ierr = traj.fit(chi2, ndf, lostWeight); !ierr) {
422 LOGP(info,
"GBL FIT chi2 {} ndf {}", chi2, ndf);
423 traj.printTrajectory(5);
425 if (chi2 / ndf > mParams->
maxChi2Ndf && cGBLChi2Rej++ < 10) {
426 LOGP(error,
"GBL fit exceeded red chi2 {}", chi2 / ndf);
428 LOGP(error,
"\tGBL is far away from good KF fit!!!!");
434 lostWeightSum += lostWeight;
437 gblTrajSlot.push_back(traj);
441 fit.chi2 = (float)chi2;
442 fit.chi2Ndf = (float)chi2 / (
float)ndf;
454 auto timeEnd = std::chrono::high_resolution_clock::now();
455 auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(timeEnd - timeStart);
456 LOGP(info,
"Fitted {} tracks out of {} (selected {}) in {} sec", cGBLFit, itsTracks.size(), cSelected, duration.count() / 1e3);
457 LOGP(info,
"\tRefit failed for {} tracks; Failed prop for {} tracks", cFailedRefit, cFailedProp);
458 LOGP(info,
"\tGBL SUMMARY:");
459 LOGP(info,
"\t\tGBL construction failed {}", cGBLConstruct);
460 LOGP(info,
"\t\tGBL fit failed {}", cGBLFitFail);
461 LOGP(info,
"\t\tGBL chi2Ndf rejected {}", cGBLChi2Rej);
463 LOGP(info,
"\t\tGBL Chi2/Ndf = NDF IS 0");
465 LOGP(info,
"\t\tGBL Chi2/Ndf = {}", chi2Sum / ndfSum);
467 LOGP(info,
"\t\tGBL LostWeight = {}", lostWeightSum);
468 LOGP(info,
"Streaming results to output");
471 for (
auto& slot : gblTrajSlots) {
472 for (
auto& traj : slot) {
473 traj.milleOut(mille);
478 for (
auto& slot : resTrackSlots) {
479 for (
auto&
res : slot) {
491 if (
static bool initOnce{
false}; !initOnce) {
502 for (
auto& rb : mRigidBodyParams) {
508 using json = nlohmann::json;
510 auto data = json::parse(
f);
511 for (
const auto& item :
data) {
512 int id = item[
"id"].get<
int>();
513 if (!item.contains(
"rigidBody")) {
516 auto rb = item[
"rigidBody"].get<std::vector<double>>();
517 for (
int k = 0; k < 6 && k < static_cast<int>(rb.size()); ++k) {
518 mRigidBodyParams[
id](k) = rb[k];
527void AlignmentSpec::buildHierarchy()
539 mHierarchy->finalise();
542 mHierarchy->writeTree(
tree);
544 mHierarchy->writeRigidBodyConstraints(cons);
546 mHierarchy->writeParameters(par);
550bool AlignmentSpec::getTransportJacobian(
const TrackD& track,
double xTo,
double alphaTo, gbl::Matrix5d& jac, gbl::Matrix5d& err)
553 const auto bz = prop->getNominalBz();
554 const auto minStep = std::sqrt(std::numeric_limits<double>::epsilon());
555 const gbl::Vector5d
x0(track.getParams());
562 auto propagate = [&](gbl::Vector5d&
p) ->
bool {
565 tmp.setParam(p[
i],
i);
567 if (!prop->propagateToAlphaX(tmp, refLin, alphaTo, xTo,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType)) {
570 p = gbl::Vector5d(tmp.getParams());
581 double normErr = std::numeric_limits<double>::max();
582 gbl::Vector5d bestDeriv = gbl::Vector5d::Constant(std::numeric_limits<double>::max());
584 gbl::Vector5d xPlus =
x0, xMinus =
x0;
587 if (!propagate(xPlus) || !propagate(xMinus)) {
590 cur.col(0) = (xPlus - xMinus) / (2.0 *
h);
592 bestDeriv = cur.col(0);
598 for (
int k{1}; k <= iExt; ++k) {
599 cur.col(k) = (fac * cur.col(k - 1) - pre.col(k - 1)) / (fac - 1.0);
601 double e = std::max((cur.col(k) - cur.col(k - 1)).norm(), (cur.col(k) - pre.col(k - 1)).norm());
604 bestDeriv = cur.col(k);
605 if (normErr < mParams->ridderEps) {
610 if (normErr < mParams->ridderEps) {
615 double tableauErr = (cur.col(iExt) - pre.col(iExt - 1)).norm();
616 if (tableauErr >= 2.0 * normErr) {
622 if (bestDeriv.isApproxToConstant(std::numeric_limits<double>::max())) {
625 jac.col(iPar) = bestDeriv;
626 err.col(iPar) = gbl::Vector5d::Constant(normErr);
629 if (jac.isIdentity(1e-8)) {
630 LOGP(error,
"Near jacobian idendity for taking track from {} to {}", track.getX(), xTo);
637bool AlignmentSpec::prepareITSTrack(
int iTrk,
const o2::its::TrackITS& itsTrack, align::Track& resTrack)
640 auto trFit = convertTrack<double>(itsTrack.getParamOut());
643 const auto bz = prop->getNominalBz();
644 std::array<const FrameInfoExt*, 8> frameArr{};
647 refLin = &(trkOut = trFit);
652 if (!prop->propagateToAlphaX(tr, refLin, frameArr[
i]->alpha, frameArr[
i]->x,
false, mParams->
maxSnp, mParams->
maxStep, 1, mParams->
corrType)) {
655 meas.dy = frameArr[
i]->positionTrackingFrame[0] - tr.getY();
656 meas.dz = frameArr[
i]->positionTrackingFrame[1] - tr.getZ();
657 meas.sig2y = frameArr[
i]->covarianceTrackingFrame[0];
658 meas.sig2z = frameArr[
i]->covarianceTrackingFrame[2];
660 meas.phi = tr.getPhi();
661 o2::math_utils::bringTo02Pid(meas.phi);
662 chi2 += (float)tr.getPredictedChi2Quiet(frameArr[
i]->positionTrackingFrame, frameArr[
i]->covarianceTrackingFrame);
663 if (!tr.update(frameArr[
i]->positionTrackingFrame, frameArr[
i]->covarianceTrackingFrame)) {
667 refLin->setY(frameArr[
i]->positionTrackingFrame[0]);
668 refLin->setZ(frameArr[
i]->positionTrackingFrame[1]);
677 const int iPV = mT2PV[iTrk];
681 const auto& pv = mPVs[iPV];
682 auto tmp = convertTrack<double>(itsTrack.getParamIn());
683 if (!prop->propagateToDCA(pv, tmp, bz)) {
686 pvInfo.alpha = (float)tmp.getAlpha();
689 o2::math_utils::sincosd(pvInfo.alpha, sa, ca);
690 pvInfo.x = tmp.getX();
691 pvInfo.positionTrackingFrame[0] = -pv.getX() * sa + pv.getY() * ca;
692 pvInfo.positionTrackingFrame[1] = pv.getZ();
693 pvInfo.covarianceTrackingFrame[0] = 0.5 * (pv.getSigmaX2() + pv.getSigmaY2());
694 pvInfo.covarianceTrackingFrame[2] = pv.getSigmaY2();
697 frameArr[0] = &pvInfo;
701 int nCl = itsTrack.getNClusters();
702 for (
int i = 0;
i <
nCl;
i++) {
703 const auto& curInfo = mITSTrackingInfo[itsClRefs[itsTrack.
getClusterEntry(
i)]];
704 frameArr[1 + curInfo.lr] = &curInfo;
708 resTrack.points.clear();
709 resTrack.info.clear();
710 trFit.resetCovariance();
711 trFit.setCov(trFit.getQ2Pt() * trFit.getQ2Pt() * trFit.getCov()[14], 14);
713 for (
int i{7};
i >= 0; --
i) {
715 int res = accountCluster(
i, trFit, chi2, point, refLin);
718 }
else if (
res == 0) {
719 resTrack.points.push_back(point);
720 resTrack.info.push_back(*frameArr[
i]);
721 resTrack.track = trFit;
725 std::reverse(resTrack.info.begin(), resTrack.info.end());
726 std::reverse(resTrack.points.begin(), resTrack.points.end());
727 resTrack.kfFit.chi2 = chi2;
728 resTrack.kfFit.ndf = (
int)resTrack.info.size() * 2 - 5;
729 resTrack.kfFit.chi2Ndf = chi2 / (float)resTrack.kfFit.ndf;
734void AlignmentSpec::prepareMeasurments(std::span<const itsmft::CompClusterExt>
clusters, std::span<const unsigned char> patterns)
736 LOGP(info,
"Preparing {} measurments",
clusters.size());
739 mITSTrackingInfo.clear();
740 mITSTrackingInfo.reserve(
clusters.size());
741 auto pattIt = patterns.begin();
743 const auto sens = cls.getSensorID();
744 const auto lay = geom->getLayer(sens);
745 double sigmaY2{0}, sigmaZ2{0};
755 const auto gloXYZ = geom->getMatrixL2G(sens) * locXYZ;
757 auto trkXYZf = geom->getMatrixT2L(sens) ^ locXYZ;
759 trkXYZ.SetCoordinates(trkXYZf.X(), trkXYZf.Y(), trkXYZf.Z());
764 double alpha = geom->getSensorRefAlpha(sens);
765 double x = trkXYZ.x();
769 x = std::hypot(gloXYZ.x(), gloXYZ.y());
771 alpha = std::atan2(gloXYZ.y(), gloXYZ.x());
777 mITSTrackingInfo.emplace_back(sens, lay,
x,
alpha,
778 std::array<double, 2>{trkXYZ.y(), trkXYZ.z()},
779 std::array<double, 3>{sigmaY2, 0., sigmaZ2});
783void AlignmentSpec::buildT2V()
787 mT2PV.resize(itsTracks.size(), -1);
789 mPVs.reserve(mcReader->getNEvents(0));
790 for (
int iEve{0}; iEve < mcReader->getNEvents(0); ++iEve) {
791 const auto& eve = mcReader->getMCEventHeader(0, iEve);
793 constexpr float err{22e-4f};
794 vtx.setX((
float)eve.GetX());
795 vtx.
setY((
float)eve.GetY());
796 vtx.
setZ((
float)eve.GetZ());
803 for (
size_t iTrk{0}; iTrk < mcLbls.size(); ++iTrk) {
804 const auto& lbl = mcLbls[iTrk];
805 if (!lbl.isValid() || !lbl.isCorrect()) {
808 const auto& mcTrk = mcReader->getTrack(lbl);
809 if (mcTrk->isPrimary()) {
810 mT2PV[iTrk] = lbl.getEventID();
814 LOGP(fatal,
"Data PV to track TODO");
818bool AlignmentSpec::applyMisalignment(Eigen::Vector2d&
res,
const FrameInfoExt& frame,
const TrackD& wTrk,
size_t iTrk)
826 const MisalignmentFrame misFrame{
827 .sensorID = sensorID,
830 .alpha = frame.alpha,
831 .z = frame.positionTrackingFrame[1]};
841 const auto mcTrk = mcReader->getTrack(lbl);
845 std::array<double, 3> xyz{mcTrk->GetStartVertexCoordinatesX(), mcTrk->GetStartVertexCoordinatesY(), mcTrk->GetStartVertexCoordinatesZ()};
846 std::array<double, 3> pxyz{mcTrk->GetStartVertexMomentumX(), mcTrk->GetStartVertexMomentumY(), mcTrk->GetStartVertexMomentumZ()};
847 TParticlePDG* pPDG = TDatabasePDG::Instance()->GetParticle(mcTrk->GetPdgCode());
854 if (!mcAtCl.rotate(frame.alpha) || !prop->PropagateToXBxByBz(mcAtCl, frame.x)) {
859 if (!shift.accepted) {
873 if (mChip2Hiearchy.find(lbl) == mChip2Hiearchy.end()) {
876 const auto* tileVol = mChip2Hiearchy.at(lbl);
879 Matrix36 der = getRigidBodyBaseDerivatives(makeDerivativeContext(frame, wTrk));
882 const double posTrk[3] = {frame.x, 0., 0.};
884 tileVol->getT2L().LocalToMaster(posTrk, posLoc);
886 tileVol->computeJacobianL2T(posLoc, jacL2T);
890 der *= tileVol->getJL2P();
893 Eigen::Vector3d shift = der * mRigidBodyParams[sensorID];
911 <<
"sens=" << sensorID
913 <<
"z=" << frame.positionTrackingFrame[1]
914 <<
"phi=" << frame.alpha
933 LOG(info) <<
"its cluster dictionary updated";
938 LOG(info) <<
"it3 cluster dictionary updated";
946 auto dataRequest = std::make_shared<DataRequest>();
947 std::shared_ptr<o2::base::GRPGeomRequest> ggRequest{
nullptr};
949 dataRequest->requestTracks(srcTracks, useMC);
951 dataRequest->requestIT3Clusters(useMC);
953 dataRequest->requestClusters(srcClusters, useMC);
955 if (withPV && !useMC) {
956 dataRequest->requestPrimaryVertices(useMC);
958 ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
968 dataRequest->inputs.emplace_back(
"dummy",
"GLO",
"DUMMY_OUT", 0);
969 ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
975 dataRequest->inputs);
979 {
"nthreads", VariantType::Int, 1, {
"number of threads"}},
983 .
name =
"its3-alignment",
984 .inputs = dataRequest->inputs,
986 .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.
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
Node par(int index)
Parameters.
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
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
o2::framework::DataProcessorSpec getAlignmentSpec(o2::dataformats::GlobalTrackID::mask_t srcTracks, o2::dataformats::GlobalTrackID::mask_t srcClus, bool useMC, bool withPV, bool withITS3, OutputEnum out)
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)
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)
int int int float float float int nCl
const TrackingFrameInfo *const const Cluster *const 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 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::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()))