49#include <TGeoGlobalMagField.h>
58#include <unordered_map>
128 mVtxSens = std::make_unique<EventVertex>(
this);
131 if (algConf.MPRecOutFraction > 0. ||
mInstanceID == 0) {
134 if (algConf.controlFraction > 0. ||
mInstanceID == 0) {
145 throw std::invalid_argument(
"initialization of MCKinematicsReader failed");
148 auto timerStart = std::chrono::system_clock::now();
149 int nVtx = 0, nVtxAcc = 0, nTrc = 0, nTrcAcc = 0;
153 det->prepareDetectorData();
161 std::unordered_map<GIndex, bool> ambigTable;
162 int nvRefs = primVer2TRefs.size();
165 for (
int ivref = 0; ivref < nvRefs; ivref++) {
167 bool useVertexConstrain =
false;
169 auto nContrib = vtx->getNContributors();
171 if (vtx->getSigmaX2() < 0. || vtx->getSigmaY2() < 0. || vtx->getSigmaZ2() < 0.) {
174 useVertexConstrain = nContrib >= algConf.vtxMinCont && nContrib <= algConf.vtxMaxCont;
177 auto& trackRef = primVer2TRefs[ivref];
178 if (algConf.verbose > 1) {
179 LOGP(info,
"processing vtref {} of {} with {} tracks, {}", ivref, nvRefs, trackRef.getEntries(), vtx ? vtx->
asString() : std::string{});
184 if ((GIndex::getSourceDetectorsMask(
src) &
mDetMask).none()) {
187 int start = trackRef.getFirstEntryOfSource(
src),
end =
start + trackRef.getEntriesOfSource(
src);
188 for (
int ti =
start; ti <
end; ti++) {
189 auto trackIndex = primVerGIs[ti];
190 mAlgTrack->setCurrentTrackID(trackIndex);
192 if (trackIndex.isAmbiguous()) {
193 auto& ambSeen = ambigTable[trackIndex];
208 if (contributorsGID[ig].isIndexSet()) {
209 trComb +=
" " + contributorsGID[ig].asString();
212 if (algConf.verbose > 1) {
213 LOG(info) <<
"processing track " << trackIndex.asString() <<
" contributors: " << trComb;
222 int ndet = 0, npntDet = 0;
236 float t0 = 0, t0err = 0;
256 if (algConf.verbose > 1) {
257 LOGP(info,
"processing track {} {} of vtref {}, Ndets:{}, Npoints: {}, use vertex: {} | Kin: {} Kout: {}", ti, trackIndex.asString(), ivref, ndet, npnt, useVertexConstrain && trackIndex.isPVContributor(), trcIn.asString(), trcOut.asString());
259 if (ndet < algConf.minDetectors || (tpcIn && ndet == 1)) {
262 if (npnt < algConf.minPointTotal) {
263 if (algConf.verbose > 0) {
264 LOGP(info,
"too few points {} < {}", npnt, algConf.minPointTotal);
268 bool vtxCont =
false;
269 if (trackIndex.isPVContributor() && useVertexConstrain) {
280 int pntMeas =
mAlgTrack->getInnerPointID() - 1;
283 LOG(error) <<
"AliAlgTrack->GetInnerPointID() cannot be 0";
286 if (algConf.verbose > 0) {
287 LOGP(warn,
"iniFit failed");
294 std::array<double, 5> dpar{};
295 std::array<double, 15> dcov{};
296 for (
int i = 0;
i < 5;
i++) {
297 dpar[
i] = trcIn.getParam(
i);
299 for (
int i = 0;
i < 15;
i++) {
300 dcov[
i] = trcIn.getCov()[
i];
302 trackParam_t trcOrig(trcIn.getX(), trcIn.getAlpha(), dpar, dcov, trcIn.getCharge());
303 if (
PropagatorD::Instance()->propagateToAlphaX(trcOrig, trcAlgRef.getAlpha(), trcAlgRef.getX(),
true)) {
304 (*mDBGOut) <<
"trcomp"
305 <<
"orig=" << trcOrig <<
"fit=" << trcAlgRef <<
"\n";
323 if (algConf.verbose > 0) {
324 LOGP(warn,
"processMaterials failed");
330 if (algConf.verbose > 0) {
331 LOGP(warn,
"calcResidDeriv failed");
337 (*mDBGOut) <<
"algtrack"
347 std::vector<float> pntX, pntY, pntZ, trcX, trcY, trcZ, prpX, prpY, prpZ,
alpha, xsens, pntXTF, pntYTF, pntZTF, resY, resZ;
348 std::vector<int> detid, volid;
352 for (
int ip = 0; ip <
mAlgTrack->getNPoints(); ip++) {
353 double tmp[3], tmpg[3];
355 auto* sens = pnt->getSensor();
356 detid.emplace_back(pnt->getDetID());
357 volid.emplace_back(pnt->getVolID());
359 sens->getMatrixT2G(t2g);
360 t2g.LocalToMaster(pnt->getXYZTracking(), tmpg);
361 pntX.emplace_back(tmpg[0]);
362 pntY.emplace_back(tmpg[1]);
363 pntZ.emplace_back(tmpg[2]);
364 double xyz[3]{pnt->getXTracking(), pnt->getYTracking(), pnt->getZTracking()};
367 t2g.LocalToMaster(xyz, tmpg);
368 trcX.emplace_back(tmpg[0]);
369 trcY.emplace_back(tmpg[1]);
370 trcZ.emplace_back(tmpg[2]);
372 pntXTF.emplace_back(pnt->getXTracking());
373 pntYTF.emplace_back(pnt->getYTracking());
374 pntZTF.emplace_back(pnt->getZTracking());
375 resY.emplace_back(
mAlgTrack->getResidual(0, ip));
376 resZ.emplace_back(
mAlgTrack->getResidual(1, ip));
378 alpha.emplace_back(pnt->getAlphaSens());
379 xsens.emplace_back(pnt->getXSens());
381 (*mDBGOut) <<
"mccomp"
382 <<
"mcTr=" << mcTrack <<
"recTr=" << recTrack <<
"gid=" << trackIndex <<
"lbl=" << lbl <<
"vtxConst=" << vtxCont
383 <<
"pntX=" << pntX <<
"pntY=" << pntY <<
"pntZ=" << pntZ
384 <<
"trcX=" << trcX <<
"trcY=" << trcY <<
"trcZ=" << trcZ
385 <<
"alp=" <<
alpha <<
"xsens=" << xsens
386 <<
"pntXTF=" << pntXTF <<
"pntYTF=" << pntYTF <<
"pntZTF=" << pntZTF
387 <<
"resY=" << resY <<
"resZ=" << resZ
388 <<
"detid=" << detid <<
"volid=" << volid <<
"\n";
405 auto timerEnd = std::chrono::system_clock::now();
406 std::chrono::duration<float, std::milli> duration = timerEnd - timerStart;
407 LOGP(info,
"Processed TF {}: {} vertices ({} used), {} tracks ({} used) in {} ms",
mNTF, nVtx, nVtxAcc, nTrc, nTrcAcc, duration.count());
414 auto timerStart = std::chrono::system_clock::now();
416 if (!tracks.size()) {
417 LOGP(info,
"Skipping TF {}: No cosmic tracks",
mNTF);
421 int nTrc = 0, nTrcAcc = 0;
425 det->prepareDetectorData();
430 for (
const auto& track : tracks) {
435 bool hasTRD =
false, hasITS =
false, hasTPC =
false, hasTOF =
false;
450 int ndet = 0, npnt = 0;
451 bool accTrack =
true;
455 for (
int ibt = 0; ibt < 2; ibt++) {
457 mAlgTrack->setCurrentTrackID(ibt ? track.getRefBottom() : track.getRefTop());
462 npntDet += npntDetBT;
464 if (!accTrack || npntDet < algConf.minITSClustersCosm) {
476 for (
int ibt = 0; ibt < 2; ibt++) {
478 mAlgTrack->setCurrentTrackID(ibt ? track.getRefBottom() : track.getRefTop());
483 npntDet += npntDetBT;
485 if (!accTrack || npntDet < algConf.minTPCClustersCosm) {
497 for (
int ibt = 0; ibt < 2; ibt++) {
499 mAlgTrack->setCurrentTrackID(ibt ? track.getRefBottom() : track.getRefTop());
504 npntDet += npntDetBT;
506 if (!accTrack || npntDet < algConf.minTRDTrackletsCosm) {
517 for (
int ibt = 0; ibt < 2; ibt++) {
519 mAlgTrack->setCurrentTrackID(ibt ? track.getRefBottom() : track.getRefTop());
524 npntDet += npntDetBT;
526 if (!accTrack || npntDet < algConf.minTOFClustersCosm) {
534 if (algConf.verbose > 1) {
535 LOGP(info,
"processing cosmic track B-Leg:{} T-Leg:{}, Ndets:{}, Npoints: {}", track.getRefBottom().asString(), track.getRefTop().asString(), ndet, npnt);
537 if (ndet < algConf.minDetectorsCosm ) {
540 if (npnt < algConf.minPointTotalCosm) {
541 if (algConf.verbose > 0) {
542 LOGP(info,
"too few points {} < {}", npnt, algConf.minPointTotalCosm);
551 if (algConf.verbose > 0) {
552 LOGP(warn,
"iniFit failed");
557 if (algConf.verbose > 0) {
558 LOGP(warn,
"processMaterials failed");
564 if (algConf.verbose > 0) {
565 LOGP(warn,
"calcResidDeriv failed");
572 (*mDBGOut) <<
"algtrack"
583 auto timerEnd = std::chrono::system_clock::now();
584 std::chrono::duration<float, std::milli> duration = timerEnd - timerStart;
585 LOGP(info,
"Processed cosmic TF {}: {} tracks ({} used) in {} ms",
mNTF, nTrc, nTrcAcc, duration.count());
598 mAlgTrack = std::make_unique<AlignmentTrack>();
599 mRefPoint = std::make_unique<AlignmentPoint>();
611 dofCnt += det->initGeom();
615 LOG(fatal) <<
"No DOFs found";
621 if (!det || det->isDisabled()) {
624 det->cacheReferenceCCDB();
628 LOG(info) <<
"Booked " << dofCnt <<
" global parameters";
640 LOG(info) <<
"initDOFs was already done, just reassigning " <<
getNDOFs() <<
"DOFs arrays/labels";
660 if (nact < conf.minDetAcc[
i]) {
661 LOG(fatal) << nact <<
" detectors are active, while " << conf.minDetAcc[
i] <<
" in track are asked";
664 LOG(info) <<
mNDOFs <<
" global parameters " <<
mNDet <<
" detectors, " << ndfAct <<
" in " << nact <<
" active detectors";
707 LOG(info) <<
"Assigned parameters/labels arrays for " <<
mNDOFs <<
" DOFs";
708 if (ndfOld > 0 && ndfOld !=
mNDOFs) {
709 LOG(error) <<
"Recalculated NDOFs=" <<
mNDOFs <<
" not equal to saved NDOFs=" << ndfOld;
712 for (
int i = 0;
i < ndofTOT;
i++) {
715 LOGP(fatal,
"parameters {} and {} share the same label {}",
id - 1,
i,
mGloParLab[
i]);
768 float rnd = gRandom->Rndm();
777 LOGP(error,
"storeProcessedTrack failed");
792 LOG(error) <<
"Track derivatives are not yet evaluated";
795 int np =
mAlgTrack->getNPoints(), nDGloTot = 0;
796 int nParETP =
mAlgTrack->getNLocExtPar();
799 const int* gloParID =
mAlgTrack->getGloParID();
800 for (
int ip = 0; ip < np; ip++) {
808 int milleIBufferG[nDGlo];
809 float milleDBufferG[nDGlo];
810 float milleDBufferL[nVarLoc];
811 std::memset(milleIBufferG, 0,
sizeof(
int) * nDGlo);
812 std::memset(milleDBufferG, 0,
sizeof(
float) * nDGlo);
813 std::memset(milleDBufferL, 0,
sizeof(
float) * nVarLoc);
815 for (
int idim = 0; idim < 2; idim++) {
816 const double* deriv =
mAlgTrack->getDResDLoc(idim, ip);
818 for (
int j = 0;
j < nParETP;
j++) {
828 deriv =
mAlgTrack->getDResDGlo(idim, gloOffs);
829 const int* gloIDP(gloParID + gloOffs);
830 for (
int j = 0;
j < nDGlo;
j++) {
831 milleDBufferG[nGlo] =
isZeroAbs(deriv[
j]) ? 0. : deriv[
j];
844 float milleDBufferL[nVarLoc];
845 std::memset(milleDBufferL, 0,
sizeof(
float) * nVarLoc);
846 for (
int j = 0;
j < nmatpar;
j++) {
848 milleDBufferL[j1] = 1.0;
851 mMille->mille(nVarLoc, milleDBufferL, 0,
nullptr,
nullptr, 0,
Sqrt(expMatCov[
j]));
852 milleDBufferL[j1] = 0.0;
858 LOG(info) <<
"Track does not depend on free global parameters, discard";
892 nps = (!
mRefPoint->containsMeasurement()) ? np - 1 : np;
927 printf(
"%5d DOFs in %d detectors\n",
mNDOFs,
mNDet);
929 printf(
"ALIGNMENT FROM MILLEPEDE SOLUTION IS APPLIED\n");
939 if (!opts.IsNull()) {
940 printf(
"\nSpecial sensor for Vertex Constraint\n");
949 if (opts.Contains(
"stat")) {
980 double mat[nlocpar][nlocpar], rhs[nlocpar];
981 std::memset(mat, 0,
sizeof(
double) * nlocpar * nlocpar);
982 std::memset(rhs, 0,
sizeof(
double) * nlocpar);
983 for (
int ip = npnt; ip--;) {
986 for (
int idim = 2; idim--;) {
988 auto deriv =
mAlgTrack->getDResDLoc(idim, ip);
989 for (
int parI = 0; parI < nlocpar; parI++) {
990 rhs[parI] -= deriv[parI] * resid * sg2inv;
991 for (
int parJ = parI; parJ < nlocpar; parJ++) {
992 mat[parI][parJ] += deriv[parI] * deriv[parJ] * sg2inv;
1003 for (
int ipar = 0; ipar < npm; ipar++) {
1004 int parI = offs + ipar;
1007 mat[parI][parI] += 1. / expMatCov[ipar];
1013 for (
int i = 0;
i < nlocpar;
i++) {
1014 for (
int j =
i;
j < nlocpar;
j++) {
1015 solver.
A(
i,
j) = mat[
i][
j];
1017 solver.
B(
i, 0) = rhs[
i];
1022 for (
int i = 0;
i < nlocpar;
i++) {
1023 pars[
i] += solver.
B(
i, 0);
1034 mMPRecTree = std::make_unique<TTree>(
"mpTree",
"MPrecord Tree");
1043 mResidTree = std::make_unique<TTree>(
"res",
"Control Residuals");
1082 bool compress =
false;
1091 std::string cmd = fmt::format(
"sh -c \"gzip {}\"",
mMilleFileName);
1092 LOG(info) <<
"Compressing: " << cmd;
1093 const auto sysRet = gSystem->Exec(cmd.c_str());
1095 LOGP(alarm,
"non-zero exit code {} for cmd={}", sysRet, cmd);
1106 LOG(error) <<
"Detector " << detID <<
" is not defined";
1126 if (!prop->propagateToDCABxByBz(vtx, trcDCA, conf.maxStep,
MatCorrType(conf.matCorType), &dcaInfo)) {
1130 mVtxSens->setAlpha(trcDCA.getAlpha());
1131 const auto* addErr =
mVtxSens->getAddError();
1132 double xyz[3] = {vtx.getX(), vtx.getY(), vtx.getZ()}, xyzT[3];
1133 double c[3] = {0.5 * (vtx.getSigmaX2() + vtx.getSigmaY2()) + addErr[0] * addErr[0], 0., vtx.getSigmaZ2() + addErr[1] * addErr[1]};
1136 mVtxSens->getMatrixT2L().MasterToLocal(xyz, xyzT);
1143 mRefPoint->setContainsMeasurement(
true);
1194 const auto& ent =
mLbl2ID.find(lbl);
1228 return Form(
"%d_%s_%s",
getGloParLab(idf), det->GetName(),
1241 fprintf(parFl,
"parameters\n");
1243 mVtxSens->writeLabeledPedeResults(parFl);
1265 const char* cmt[3] = {
" ",
"! ",
"!!"};
1266 const char* kSolMeth[] = {
"inversion",
"diagonalization",
"fullGMRES",
"sparseMINRES",
"cholesky",
"HIP"};
1267 const int kDefNIter = 3;
1268 const float kDefDelta = 0.1;
1271 LOG(info) <<
"Generating MP2 templates:\n "
1280 fprintf(strFl,
"%-20s%s %s\n",
AlignConfig::Instance().mpParFileName.c_str(), cmt[kOnOn],
"parameters template");
1281 fprintf(strFl,
"%-20s%s %s\n",
AlignConfig::Instance().mpConFileName.c_str(), cmt[kOnOn],
"constraints template");
1283 fprintf(strFl,
"\n\n%s %s\n", cmt[kOnOn],
"MUST uncomment 1 solving methods and tune it");
1285 int nm =
sizeof(kSolMeth) /
sizeof(
char*);
1286 for (
int i = 0;
i < nm;
i++) {
1287 fprintf(strFl,
"%s%s %-20s %2d %.2f %s\n", cmt[kOn],
"method", kSolMeth[
i], kDefNIter, kDefDelta, cmt[kOnOn]);
1289 fprintf(strFl,
"\n%sskipemptycons\n", cmt[kOff]);
1290 fprintf(strFl,
"\n%sthreads 20 1\n", cmt[kOff]);
1292 const float kDefChi2F0 = 10., kDefChi2F = 3.;
1293 const float kDefDWFrac = 0.1;
1294 const int kDefOutlierDW = 4;
1295 const int kDefEntries = 25;
1297 fprintf(strFl,
"\n\n%s %s\n", cmt[kOnOn],
"Optional settings");
1298 fprintf(strFl,
"\n%s%-20s %.2f %.2f %s %s\n", cmt[kOff],
"chisqcut", kDefChi2F0, kDefChi2F,
1299 cmt[kOnOn],
"chi2 cut factors for 1st and next iterations");
1300 fprintf(strFl,
"%s%-20s %2d %s %s\n", cmt[kOff],
"outlierdownweighting", kDefOutlierDW,
1301 cmt[kOnOn],
"iteration for outliers downweighting with Cauchi factor");
1302 fprintf(strFl,
"%s%-20s %.3f %s %s\n", cmt[kOff],
"dwfractioncut", kDefDWFrac,
1303 cmt[kOnOn],
"cut outliers with downweighting above this factor");
1304 fprintf(strFl,
"%s%-20s %2d %s %s\n", cmt[kOff],
"entries", kDefEntries,
1305 cmt[kOnOn],
"min entries per DOF to allow its variation");
1307 fprintf(strFl,
"\n\n\n%s%-20s %s %s\n\n\n", cmt[kOff],
"CFiles", cmt[kOnOn],
"put below *.mille files list");
1310 mVtxSens->writePedeInfo(parFl, opt);
1334 LOG(error) <<
"Something is wrong in init, no DOFs found: mNDOFs=" <<
mNDOFs <<
" N GloParVal=" <<
mGloParVal.size() <<
" N GloParErr=" <<
mGloParErr.size();
1336 std::ifstream inpf(parfile);
1338 LOGP(fatal,
"Failed on input filename {}", parfile);
1346 while (fline.ReadLine(inpf)) {
1347 fline = fline.Strip(TString::kBoth,
' ');
1349 if (fline.Length() == 0 || fline.BeginsWith(
"!") || fline.BeginsWith(
"*")) {
1352 if (!fline.BeginsWith(
"parameter")) {
1353 LOGP(fatal,
"First line of {} is not parameter keyword: {}", parfile, fline.Data());
1358 int lab, asg = 0, asg0 = 0;
1359 while (fline.ReadLine(inpf)) {
1361 fline = fline.Strip(TString::kBoth,
' ');
1362 if (fline.BeginsWith(
"!") || fline.BeginsWith(
"*") || fline.BeginsWith(
"parameter")) {
1365 int nr = sscanf(fline.Data(),
"%d%lf%lf%lf", &lab, &
v0, &
v1, &
v2);
1367 LOG(error) <<
"Expected to read at least 3 numbers, got " << nr <<
", this is NOT milleped output";
1368 LOG(fatal) <<
"line (" << cnt <<
") was: " << fline.Data();
1374 if (parID < 0 || parID >=
mNDOFs) {
1375 LOG(fatal) <<
"Invalid label " << lab <<
" at line " << cnt <<
" -> ParID=" << parID;
1384 LOG(info) <<
"Read " << cnt <<
" lines, assigned " << asg <<
" values, " << asg0 <<
" dummy";
1395 LOG(error) <<
"Failed to load parameters from " <<
params;
1400 for (
int icon = 0; icon < ncon; icon++) {
1410 TFile* flmpr = TFile::Open(mprecfile.c_str());
1412 LOG(fatal) <<
"Failed to open MPRecord file " << mprecfile;
1415 TTree* mprTree = (TTree*)flmpr->Get(
"mpTree");
1417 LOG(fatal) <<
"No mpTree in xMPRecord file " << mprecfile;
1431 TBranch* br = mprTree->GetBranch(
"mprec");
1433 LOG(error) <<
"provided tree does not contain branch mprec";
1437 br->SetAddress(&
rec);
1438 int nent = mprTree->GetEntries();
1439 std::string mlname = millefile;
1440 if (mlname.empty()) {
1441 mlname =
"mpRec2mpData";
1446 Mille mille(mlname, bindata);
1447 std::vector<float> buffLoc;
1448 for (
int i = 0;
i < nent;
i++) {
1450 int nr =
rec->getNResid();
1451 int nloc =
rec->getNVarLoc();
1452 auto recDGlo =
rec->getArrGlo();
1453 auto recDLoc =
rec->getArrLoc();
1454 auto recLabLoc =
rec->getArrLabLoc();
1455 auto recLabGlo =
rec->getArrLabGlo();
1457 for (
int ir = 0;
ir < nr;
ir++) {
1459 buffLoc.resize(nloc);
1460 int ndglo =
rec->getNDGlo(
ir);
1461 int ndloc =
rec->getNDLoc(
ir);
1463 for (
int l = ndloc; l--;) {
1464 buffLoc[recLabLoc[l]] = recDLoc[l];
1467 mille.
mille(nloc, buffLoc.data(), ndglo, recDGlo, recLabGlo,
rec->getResid(
ir),
rec->getResErr(
ir));
1476 br->SetAddress(
nullptr);
1494 LOGP(fatal,
"Label {} is not mapped to any parameter", lab);
1496 return it->second - 1;
1520 for (
int icon = 0; icon < nconstr; icon++) {
1529 bool verbose,
bool loc,
const char* outName)
1534 TTree *trLG =
nullptr, *trL =
nullptr;
1535 TFile* outFile =
nullptr;
1537 TString outNS = outName;
1538 if (outNS.IsNull()) {
1541 if (!outNS.EndsWith(
".root")) {
1544 outFile = TFile::Open(outNS.Data(),
"recreate");
1545 trLG =
new TTree(
"resFLG",
"Fast residuals with LG correction");
1546 trLG->Branch(
"rLG",
"ResidualsControllerFast", &rLG);
1549 trL =
new TTree(
"resFL",
"Fast residuals with L correction");
1550 trL->Branch(
"rL",
"ResidualsControllerFast", &rL);
1555 mpRecTree->SetBranchAddress(
"mprec", &
rec);
1556 int nrec = mpRecTree->GetEntriesFast();
1557 for (
int irec = 0; irec < nrec; irec++) {
1558 mpRecTree->GetEntry(irec);
1589 bool verbose,
bool loc)
1591 LOG(fatal) << __PRETTY_FUNCTION__ <<
" is disabled";
1855 LOG(info) <<
"Applying alignment from Millepede solution";
Configuration file for global alignment.
Wrapper for TOF detector.
Base class for detector: wrapper for set of volumes.
Base class of alignable volume.
Meausered point in the sensor.
Definition of SymMatrixSolver class.
General auxilliary methods.
Steering class for the global alignment.
Collection of auxillary methods.
Special fake "sensor" for event vertex.
Header of the General Run Parameters object.
Descriptor of geometrical constraint.
Utility functions for MC particles.
Definition of the Names Generator class.
Container for control fast residuals evaluated via derivatives.
Extention of GlobalTrackID by flags relevant for verter-track association.
Referenc on track indices contributing to the vertex, with possibility chose tracks from specific sou...
Helper class to obtain TPC clusters / digits / labels from DPL.
virtual void applyAlignmentFromMPSol()
virtual int processPoints(GIndex gid, int npntCut=0, bool inv=false)
virtual void writeLabeledPedeResults(FILE *parOut) const
void setObligatory(int tp, bool v=true)
bool ownsDOFID(int id) const
AlignableVolume * getVolOfDOFID(int id) const
int getNPointsSel(int tp) const
virtual void writePedeInfo(FILE *parOut, const Option_t *opt="") const
bool isObligatory(int tp) const
void addAutoConstraints() const
void Print(const Option_t *opt="") const override
bool isDisabled(int tp) const
virtual void writeCalibrationResults() const
virtual const char * getCalibDOFName(int) const
const char * getSymName() const
virtual const char * getDOFName(int i) const
float * getMatCorrCov() const
double getErrDiag(int i) const
int getMaxLocVarID() const
int getMinLocVarID() const
bool containsMaterial() const
bool containsMeasurement() const
static const int sSkipLayers[kNLrSkip]
const GeometricalConstraint & getConstraint(int i) const
o2::tpc::VDriftCorrFact mTPCDrift
o2::gpu::CorrectionMapsHelper * mTPCCorrMapsHelper
void addAutoConstraints()
void writeCalibrationResults() const
std::unique_ptr< TTree > mMPRecTree
control residuals
bool readParameters(const std::string &parfile="millepede.res", bool useErrors=true)
ResidualsController mCResid
MP record.
AlignableDetector * getDetector(DetID id) const
bool fillControlData(o2::dataformats::GlobalTrackID tid)
void setObligatoryDetector(DetID id, int tp, bool v=true)
AlignableDetector * getDetOfDOFID(int id) const
void setTimingInfo(const o2::framework::TimingInfo &ti)
std::string mMilleFileName
file to store control residuals tree
bool checkDetectorPattern(DetID::mask_t patt) const
Char_t * getDOFLabelTxt(int idf) const
void expandGlobalsBy(int n)
std::unique_ptr< Mille > mMille
void checkSol(TTree *mpRecTree, bool store=true, bool verbose=false, bool loc=true, const char *outName="resFast")
void addDetector(AlignableDetector *det)
bool storeProcessedTrack(o2::dataformats::GlobalTrackID tid={})
static const Char_t * sDetectorName[kNDetectors]
std::array< DetID::mask_t, utils::NTrackTypes > mObligatoryDetPattern
void checkConstraints(const char *params=nullptr)
std::vector< float > mGloParErr
bool getInitDOFsDone() const
void writeLabeledPedeResults() const
std::unique_ptr< AlignmentPoint > mRefPoint
std::vector< int > mTrackSources
int label2ParID(int lab) const
bool getMPAlignDone() const
void genPedeSteerFile(const Option_t *opt="") const
Millepede2Record * mMPRecordPtr
MP record.
bool getInitGeomDone() const
void writePedeConstraints() const
const o2::globaltracking::RecoContainer * mRecoData
std::unique_ptr< AlignmentTrack > mAlgTrack
static const Char_t * sMPDataTxtExt
bool fillMPRecData(o2::dataformats::GlobalTrackID tid)
std::vector< float > mGloParVal
ResidualsController * mCResidPtr
control residuals
static const Char_t * sMPDataExt
int mDebugOutputLevel
reference point for track definition
void Print(const Option_t *opt="") const final
void applyAlignmentFromMPSol()
std::unique_ptr< EventVertex > mVtxSens
void setCosmic(bool v=true)
int getNConstraints() const
std::unique_ptr< TFile > mMPRecFile
tree to store control residuals
AlignableVolume * getVolOfLabel(int label) const
std::unique_ptr< TFile > mResidFile
file to store MP record tree
std::array< std::unique_ptr< AlignableDetector >, DetID::nDetectors > mDetectors
void printStatistics() const
bool addVertexConstraint(const o2::dataformats::PrimaryVertex &vtx)
static void MPRec2Mille(const std::string &mprecfile, const std::string &millefile="mpData.mille", bool bindata=true)
std::unique_ptr< TTree > mResidTree
tree to store MP record
bool mAllowAfterburnerTracks
std::unordered_map< int, int > mLbl2ID
AlignableVolume * getVolOfDOFID(int id) const
Millepede2Record mMPRecord
Mille interface.
o2::framework::TimingInfo mTimingInfo
void setTPCCorrMaps(o2::gpu::CorrectionMapsHelper *maph)
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
bool checkDetectorPoints(const int *npsel) const
std::vector< int > mGloParLab
int getFirstParGloID() const
void writeChildrenConstraints(FILE *conOut) const
void checkConstraint() const
void mille(int NLC, const float *derLc, int NGL, const float *derGl, const int *label, float rMeas, float sigma)
Add measurement to buffer.
int finalise()
Write buffer (set of derivatives with same local parameters) to file.
bool fillTrack(AlignmentTrack &trc, const std::vector< int > &id2Lab)
void setFirstTFOrbit(uint32_t v)
void setTrackID(o2::dataformats::GlobalTrackID t)
void setTrackID(o2::dataformats::GlobalTrackID t)
void setFirstTFOrbit(uint32_t v)
bool fillTrack(AlignmentTrack &trc, bool doKalman=kTRUE)
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
static const AlignConfig & Instance()
Static class with identifiers, bitmasks and names for ALICE detectors.
static constexpr ID First
static constexpr ID Last
if extra detectors added, update this !!!
static mask_t getMask(const std::string_view detList)
detector masks from any non-alpha-num delimiter-separated list (empty if NONE is supplied)
double & A(int i, int j)
access to A elements
double & B(int i, int j)
access to B elements
bool initFromDigitContext(std::string_view filename)
MCTrack const * getTrack(o2::MCCompLabel const &) const
GLfloat GLfloat GLfloat alpha
GLenum const GLfloat * params
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
GLfloat GLfloat GLfloat v2
constexpr bool isZeroAbs(double d) noexcept
typename track::TrackParametrizationWithError< double > trackParam_t
PropagatorImpl< double > PropagatorD
void align(gsl::span< ElinkEncoder< BareFormat, CHARGESUM > > elinks)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
bool setTrackParam(const AlignmentTrack *trc)
o2::dataformats::GlobalTrackID mGID
o2::dataformats::GlobalTrackID mGIDCosmUp
std::array< std::array< size_t, kMaxStat >, kNStatCl > data
uint32_t tfCounter
the orbit the TF begins
GlobalIDSet getSingleDetectorRefs(GTrackID gidx) const
auto getPrimaryVertices() const
auto getPrimaryVertexMatchedTracks() const
auto getPrimaryVertexMatchedTrackRefs() const
o2::MCCompLabel getTrackMCLabel(GTrackID id) const
const o2::track::TrackParCov & getTrackParam(GTrackID gidx) const
const o2::track::TrackParCov & getTrackParamOut(GTrackID gidx) const
void getTrackTime(GTrackID gid, float &t, float &tErr) const
auto getCosmicTracks() const
static bool endsWith(const std::string &s, const std::string &ending)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
o2::InteractionRecord ir(0, 0)