96 theMode(this->decodeMode(theConfig.getUntrackedParameter<
std::
string>(
"mode"))),
97 theDir(theConfig.getUntrackedParameter<
std::
string>(
"fileDir")),
98 theAlignmentParameterStore(
nullptr),
100 theMinNumHits(cfg.getParameter<unsigned
int>(
"minNumHits")),
101 theMaximalCor2D(cfg.getParameter<double>(
"max2Dcorrelation")),
103 ignoreFirstIOVCheck_(cfg.getUntrackedParameter<bool>(
"ignoreFirstIOVCheck")),
104 enableAlignableUpdates_(cfg.getUntrackedParameter<bool>(
"enableAlignableUpdates")),
105 theLastWrittenIov(0),
106 theGblDoubleBinary(cfg.getParameter<bool>(
"doubleBinary")),
107 runAtPCL_(cfg.getParameter<bool>(
"runAtPCL")),
108 ignoreHitsWithoutGlobalDerivatives_(cfg.getParameter<bool>(
"ignoreHitsWithoutGlobalDerivatives")),
109 skipGlobalPositionRcdCheck_(cfg.getParameter<bool>(
"skipGlobalPositionRcdCheck")),
113 enforceSingleIOVInput_(!(enableAlignableUpdates_ && areIOVsSpecified())),
117 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm" <<
"Start in mode '" 119 <<
"' with output directory '" <<
theDir <<
"'.";
140 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::initialize" 141 <<
"Running with AlignabeMuon not yet tested.";
147 const auto& iov_alignments =
149 const auto& iov_surfaces =
151 const auto& iov_errors =
156 if (iov_alignments.first().eventID().run() !=
MIN_VAL ||
157 iov_alignments.last().eventID().run() !=
MAX_VAL) {
160 <<
" with multiple IOVs in tag without specifying 'RunRangeSelection'.\n" 161 <<
"Validity range is " 162 << iov_alignments.first().eventID().run() <<
" - " 163 << iov_alignments.last().eventID().run() <<
"\n";
166 if (iov_surfaces.first().eventID().run() !=
MIN_VAL ||
167 iov_surfaces.last().eventID().run() !=
MAX_VAL) {
169 <<
"\nTrying to apply " 171 <<
" with multiple IOVs in tag without specifying 'RunRangeSelection'.\n" 172 <<
"Validity range is " 173 << iov_surfaces.first().eventID().run() <<
" - " 174 << iov_surfaces.last().eventID().run() <<
"\n";
177 if (iov_errors.first().eventID().run() !=
MIN_VAL ||
178 iov_errors.last().eventID().run() !=
MAX_VAL) {
180 <<
"\nTrying to apply " 182 <<
" with multiple IOVs in tag without specifying 'RunRangeSelection'.\n" 183 <<
"Validity range is " 184 << iov_errors.first().eventID().run() <<
" - " 185 << iov_errors.last().eventID().run() <<
"\n";
190 <<
"@SUB=MillePedeAlignmentAlgorithm::initialize" << message.str();
204 auto th = thresholdHandle.
product();
216 RunRangeSelectionVPSet);
219 if (RunRangeSelectionVPSet.size()>0) {
220 labelerPlugin =
"RunRangeDependentPedeLabeler";
221 if (pedeLabelerCfg.
exists(
"plugin")) {
223 if ((labelerPluginCfg!=
"PedeLabeler" && labelerPluginCfg!=
"RunRangeDependentPedeLabeler") ||
226 <<
"MillePedeAlignmentAlgorithm::initialize" 227 <<
"both RunRangeSelection and generic labeler specified in config file. " 228 <<
"Please get rid of either one of them.\n";
232 if (pedeLabelerCfg.
exists(
"plugin")) {
237 if (!pedeLabelerCfg.
exists(
"plugin")) {
241 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::initialize" 242 <<
"Using plugin '" << labelerPlugin <<
"' to generate labels.";
245 ->create(labelerPlugin,
257 const std::vector<edm::ParameterSet> mprespset
259 if (!mprespset.empty()) {
260 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::initialize" 261 <<
"Apply " << mprespset.end() - mprespset.begin()
262 <<
" previous MillePede constants from 'pedeReaderInputs'.";
269 for (std::vector<edm::ParameterSet>::const_iterator iSet = mprespset.begin(), iE = mprespset.end();
270 iSet != iE; ++iSet) {
275 <<
"MillePedeAlignmentAlgorithm::initialize: Problems reading input constants of " 276 <<
"pedeReaderInputs entry " << iSet - mprespset.begin() <<
'.';
278 theAlignmentParameterStore->applyParameters();
280 theAlignmentParameterStore->resetParameters();
293 <<
"'vstring mergeTreeFiles' and 'vstring mergeBinaryFiles' must be empty for " 294 <<
"modes running mille.";
297 if (moniFile.size())
theMonitor = std::make_unique<MillePedeMonitor>(tTopo, (theDir + moniFile).c_str());
303 ->create(fctName, fctCfg));
381 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::setParametersForRunRange" 382 <<
"Problems reading pede result, but applying!";
404 std::vector<std::string>
files;
408 const std::vector<std::string> plainFiles(
theConfig.
getParameter<std::vector<std::string> >(
"mergeBinaryFiles"));
412 for (
const auto&
file: files) filesForLogOutput +=
" " +
file +
",";
413 if (filesForLogOutput.length() != 0) filesForLogOutput.pop_back();
415 <<
"Based on the config parameter mergeBinaryFiles, using the following " 416 <<
"files as input (assigned weights are indicated by ' -- <weight>'):" 417 << filesForLogOutput;
425 <<
"@SUB=MillePedeAlignmentAlgorithm::terminate\n" 426 <<
"Last IOV of 'RunRangeSelection' has not been processed. " 427 <<
"Please reconfigure your source to process the runs at least up to " 432 const auto run = runRange.first;
455 std::vector<std::string>
files;
456 for (
const auto& plainFile: plainFiles) {
462 char theNumberedInputFileName[200];
463 sprintf(theNumberedInputFileName, theInputFileName.c_str(), theNumber);
464 std::string theCompleteInputFileName = theDir + theNumberedInputFileName;
465 const auto endOfStrippedFileName = theCompleteInputFileName.rfind(
" --");
466 const auto strippedInputFileName = theCompleteInputFileName.substr(0, endOfStrippedFileName);
469 if (
stat (strippedInputFileName.c_str(), &
buffer) == 0) {
471 files.push_back(theCompleteInputFileName);
472 if (theNumberedInputFileName == theInputFileName) {
485 if (theNumber == 0 && (files.size() == 0 || files.back() != plainFile)) {
487 <<
"The input file '" << plainFile <<
"' does not exist.";
501 for (
const auto& iTrajTrack:
tracks) {
509 unsigned int refTrajCount = 0;
511 for (
auto iRefTraj = trajectories.cbegin(), iRefTrajE = trajectories.cend();
512 iRefTraj != iRefTrajE; ++iRefTraj, ++refTrajCount) {
519 if (
theMonitor && (nHitXy.first || nHitXy.second)) {
521 const auto offset = tracksPerTraj*refTrajCount;
522 for (
unsigned int iTrack = 0; iTrack < tracksPerTraj; ++iTrack) {
524 nHitXy.first, nHitXy.second);
532 std::pair<unsigned int, unsigned int>
537 std::pair<unsigned int, unsigned int> hitResultXy(0,0);
538 if (refTrajPtr->isValid()) {
542 if (refTrajPtr->gblInput().size() > 0) {
544 unsigned int iHit = 0;
545 unsigned int numPointsWithMeas = 0;
546 std::vector<GblPoint>::iterator itPoint;
547 auto theGblInput = refTrajPtr->gblInput();
548 for (
unsigned int iTraj = 0; iTraj < refTrajPtr->gblInput().size(); ++iTraj) {
549 for (itPoint = refTrajPtr->gblInput()[iTraj].first.begin(); itPoint < refTrajPtr->gblInput()[iTraj].first.end(); ++itPoint) {
550 if (this->
addGlobalData(setup, eventInfo, refTrajPtr, iHit++, *itPoint) < 0)
return hitResultXy;
551 if (itPoint->hasMeasurement() >= 1) ++numPointsWithMeas;
554 hitResultXy.first = numPointsWithMeas;
556 if (hitResultXy.first == 0 || hitResultXy.first <
theMinNumHits)
return hitResultXy;
558 if (refTrajPtr->gblInput().size() == 1) {
560 GblTrajectory aGblTrajectory( refTrajPtr->gblInput()[0].first, refTrajPtr->nominalField() != 0 );
570 if (refTrajPtr->gblInput().size() == 2) {
572 GblTrajectory aGblTrajectory( refTrajPtr->gblInput(), refTrajPtr->gblExtDerivatives(), refTrajPtr->gblExtMeasurements(), refTrajPtr->gblExtPrecisions() );
578 std::vector<AlignmentParameters*> parVec(refTrajPtr->recHits().size());
580 std::vector<bool> validHitVecY(refTrajPtr->recHits().size(),
false);
582 for (
unsigned int iHit = 0; iHit < refTrajPtr->recHits().size(); ++iHit) {
583 const int flagXY = this->
addMeasurementData(setup, eventInfo, refTrajPtr, iHit, parVec[iHit]);
586 hitResultXy.first = 0;
589 if (flagXY >= 1) ++hitResultXy.first;
590 validHitVecY[iHit] = (flagXY >= 2);
595 for (
unsigned int iVirtualMeas = 0; iVirtualMeas < refTrajPtr->numberOfVirtualMeas(); ++iVirtualMeas) {
600 if (hitResultXy.first == 0 || hitResultXy.first <
theMinNumHits) {
602 hitResultXy.first = hitResultXy.second = 0;
607 hitResultXy.second = this->
addHitCount(parVec, validHitVecY);
620 const std::vector<bool> &validHitVecY)
const 623 unsigned int nHitY = 0;
624 for (
unsigned int iHit = 0; iHit < validHitVecY.size(); ++iHit) {
625 Alignable *ali = (parVec[iHit] ? parVec[iHit]->alignable() : 0);
636 if (validHitVecY[iHit]) {
638 if (pars == parVec[iHit]) ++nHitY;
654 <<
"@SUB=MillePedeAlignmentAlgorithm::beginRun\n" 655 <<
"Using data (run = " << run.
run()
656 <<
") prior to the first defined IOV (" <<
firstIOV_ <<
").";
682 <<
"Trying to cache tracker alignment payloads for a run (" <<
runNumber 683 <<
") in an IOV (" <<
firstRun <<
") that was already cached.\n" 684 <<
"The following records in your input database tag have an IOV " 685 <<
"boundary that does not match your IOV definition:\n";
686 if (geometryRcd.validityInterval().first().eventID().run() >
firstRun) {
688 <<
" - IdealGeometryRecord '" << geometryRcd.key().name()
690 << geometryRcd.validityInterval().first().eventID().run() <<
")\n";
695 <<
" - GlobalPositionRecord '" << globalPosRcd.
key().
name()
699 message <<
" --> ignored\n";
707 <<
" - TrackerAlignmentRcd '" << alignmentRcd.
key().
name()
714 <<
" - TrackerSurfaceDeformationRcd '" << surfaceRcd.
key().
name()
721 <<
" - TrackerAlignmentErrorExtendedRcd '" << errorRcd.
key().
name()
729 <<
"@SUB=MillePedeAlignmentAlgorithm::beginRun\n" << message.str();
784 if (!recHitPtr->isValid())
return 0;
811 unsigned int iHit,
GblPoint &gblPoint)
814 std::vector<double> theDoubleBufferX, theDoubleBufferY;
815 theDoubleBufferX.clear();
816 theDoubleBufferY.clear();
823 if (!recHitPtr->isValid())
return 0;
829 tsos, alidet, alidet, theDoubleBufferX,
835 std::vector<IntegratedCalibrationBase::ValuesIndexPair> derivs;
838 (*iCalib)->derivatives(derivs, *recHitPtr, tsos, setup, eventInfo);
839 for (
auto iValuesInd = derivs.begin(); iValuesInd != derivs.end(); ++iValuesInd) {
841 globalLabel =
thePedeLabels->calibrationLabel(*iCalib, iValuesInd->second);
842 if (globalLabel > 0 && globalLabel <= 2147483647) {
844 theDoubleBufferX.push_back(iValuesInd->first.first);
845 theDoubleBufferY.push_back(iValuesInd->first.second);
848 <<
"@SUB=MillePedeAlignmentAlgorithm::addGlobalData" 849 <<
"Invalid label " << globalLabel <<
" <= 0 or > 2147483647";
856 Eigen::Matrix<double, 2, Eigen::Dynamic> globalDer{2, numGlobals};
857 for (
unsigned int i = 0;
i < numGlobals; ++
i) {
858 globalDer(0,
i) = theDoubleBufferX[
i];
859 globalDer(1,
i) = theDoubleBufferY[
i];
872 std::vector<float> &globalDerivativesX,
873 std::vector<float> &globalDerivativesY,
874 std::vector<int> &globalLabels,
878 if (!ali)
return true;
885 if (!lowestParams) lowestParams = params;
887 bool hasSplitParameters =
thePedeLabels->hasSplitParameters(ali);
888 const unsigned int alignableLabel =
thePedeLabels->alignableLabel(ali);
890 if (0 == alignableLabel) {
891 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::globalDerivativesHierarchy" 892 <<
"Label not found, skip Alignable.";
896 const std::vector<bool> &selPars = params->
selector();
900 for (
unsigned int iSel = 0; iSel < selPars.size(); ++iSel) {
902 globalDerivativesX.push_back(derivs[iSel][
kLocalX]
904 if (hasSplitParameters==
true) {
905 globalLabels.push_back(
thePedeLabels->parameterLabel(ali, iSel, eventInfo, tsos));
907 globalLabels.push_back(
thePedeLabels->parameterLabel(alignableLabel, iSel));
909 globalDerivativesY.push_back(derivs[iSel][
kLocalY]
918 tsos, ali->
mother(), alidet,
919 globalDerivativesX, globalDerivativesY,
920 globalLabels, lowestParams);
928 std::vector<double> &globalDerivativesX,
929 std::vector<double> &globalDerivativesY,
930 std::vector<int> &globalLabels,
934 if (!ali)
return true;
941 if (!lowestParams) lowestParams = params;
943 bool hasSplitParameters =
thePedeLabels->hasSplitParameters(ali);
944 const unsigned int alignableLabel =
thePedeLabels->alignableLabel(ali);
946 if (0 == alignableLabel) {
947 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::globalDerivativesHierarchy" 948 <<
"Label not found, skip Alignable.";
952 const std::vector<bool> &selPars = params->
selector();
957 for (
unsigned int iSel = 0; iSel < selPars.size(); ++iSel) {
959 if (hasSplitParameters==
true) {
960 globalLabel =
thePedeLabels->parameterLabel(ali, iSel, eventInfo, tsos);
962 globalLabel =
thePedeLabels->parameterLabel(alignableLabel, iSel);
964 if (globalLabel > 0 && globalLabel <= 2147483647) {
965 globalLabels.push_back(globalLabel);
970 <<
"@SUB=MillePedeAlignmentAlgorithm::globalDerivativesHierarchy" 971 <<
"Invalid label " << globalLabel <<
" <= 0 or > 2147483647";
980 tsos, ali->
mother(), alidet,
981 globalDerivativesX, globalDerivativesY,
982 globalLabels, lowestParams);
990 std::vector<float> &globalDerivativesX,
991 std::vector<float> &globalDerivativesY,
992 std::vector<int> &globalLabels)
const 994 std::vector<IntegratedCalibrationBase::ValuesIndexPair> derivs;
997 (*iCalib)->derivatives(derivs, *recHit, tsos, setup, eventInfo);
998 for (
auto iValuesInd = derivs.begin(); iValuesInd != derivs.end(); ++iValuesInd) {
1000 globalLabels.push_back(
thePedeLabels->calibrationLabel(*iCalib, iValuesInd->second));
1001 globalDerivativesX.push_back(iValuesInd->first.first);
1002 globalDerivativesY.push_back(iValuesInd->first.second);
1046 if (recHit->dimension() < 2) {
1048 }
else if (recHit->detUnit()) {
1049 return recHit->detUnit()->type().isTrackerPixel();
1051 if (dynamic_cast<const ProjectedSiStripRecHit2D*>(recHit->hit())) {
1067 std::vector<Alignable*> alis;
1068 bool okRead = reader.
read(alis, setUserVars);
1069 bool numMatch =
true;
1071 std::stringstream
out;
1072 out <<
"Read " << alis.size() <<
" alignables";
1077 if (!okRead) out <<
", but problems in reading";
1078 if (!allEmpty) out <<
", possibly overwriting previous settings";
1081 if (okRead && allEmpty) {
1083 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::readFromPede" << out.str();
1084 }
else if (alis.size()) {
1085 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::readFromPede" << out.str();
1087 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::readFromPede" << out.str();
1093 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::readFromPede" << out.str();
1101 for (std::vector<Alignable*>::const_iterator iAli = alignables.begin();
1102 iAli != alignables.end(); ++iAli) {
1107 for (
int i = 0;
i < parVec.num_row(); ++
i) {
1108 if (parVec[
i] != 0.)
return false;
1109 for (
int j =
i; j < parCov.num_col(); ++j) {
1110 if (parCov[
i][j] != 0.)
return false;
1125 if (outFilePlain.empty()) {
1126 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" 1127 <<
"treeFile parameter empty => skip writing for 'loop' " <<
loop;
1138 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" 1139 <<
"Problem " << ioerr <<
" in writeAlignableOriginalPositions";
1142 }
else if (loop == 1) {
1144 const std::vector<std::string> inFiles
1146 const std::vector<std::string> binFiles
1148 if (inFiles.size() != binFiles.size()) {
1149 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" 1150 <<
"'vstring mergeTreeFiles' and 'vstring mergeBinaryFiles' " 1151 <<
"differ in size";
1158 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" 1159 <<
"Problem " << ioerr <<
" writing MillePedeVariables";
1165 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" <<
"Problem " << ioerr
1166 <<
" in writeOrigRigidBodyAlignmentParameters, " <<
loop;
1171 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" <<
"Problem " << ioerr
1172 <<
" in writeAlignableAbsolutePositions, " <<
loop;
1182 for (
const auto& iAli: alis) {
1185 throw cms::Exception(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::buildUserVariables" 1186 <<
"No parameters for alignable";
1190 for (
unsigned int iPar = 0; iPar < userVars->
size(); ++iPar) {
1199 thePedeLabels->alignableTracker()->objectIdProvider().typeToName(iAli->alignableObjectId()));
1208 if (mode ==
"full") {
1210 }
else if (mode ==
"mille") {
1212 }
else if (mode ==
"pede") {
1214 }
else if (mode ==
"pedeSteer") {
1216 }
else if (mode ==
"pedeRun") {
1218 }
else if (mode ==
"pedeRead") {
1223 <<
"Unknown mode '" << mode
1224 <<
"', use 'full', 'mille', 'pede', 'pedeRun', 'pedeSteer' or 'pedeRead'.";
1231 const std::vector<std::string> &inFiles)
const 1236 for (std::vector<std::string>::const_iterator iFile = inFiles.begin();
1237 iFile != inFiles.end(); ++iFile) {
1239 const std::vector<AlignmentUserVariables*> mpVars =
1242 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addHitStatistics" 1243 <<
"Error " << ierr <<
" reading from " << inFile
1244 <<
", tree " << fromIov <<
", or problems in addHits";
1247 for (std::vector<AlignmentUserVariables*>::const_iterator
i = mpVars.begin();
1248 i != mpVars.end(); ++
i) {
1258 const std::vector<AlignmentUserVariables*> &mpVars)
const 1260 bool allOk = (mpVars.size() == alis.size());
1261 std::vector<AlignmentUserVariables*>::const_iterator iUser = mpVars.begin();
1262 for (std::vector<Alignable*>::const_iterator iAli = alis.begin();
1263 iAli != alis.end() && iUser != mpVars.end(); ++iAli, ++iUser) {
1267 if (!mpVarNew || !mpVarOld || mpVarOld->
size() != mpVarNew->
size()) {
1280 template <
typename GlobalDerivativeMatrix>
1282 const std::vector<float> &globalDerivativesy,
1283 Eigen::MatrixBase<GlobalDerivativeMatrix>& aGlobalDerivativesM)
1285 static_assert(GlobalDerivativeMatrix::RowsAtCompileTime == 2,
1286 "global derivative matrix must have two rows");
1288 for (
size_t i = 0;
i < globalDerivativesx.size(); ++
i) {
1289 aGlobalDerivativesM(0,
i) = globalDerivativesx[
i];
1290 aGlobalDerivativesM(1,
i) = globalDerivativesy[
i];
1296 typename LocalDerivativeMatrix,
1297 typename ResidualMatrix,
1298 typename GlobalDerivativeMatrix>
1300 (Eigen::MatrixBase<CovarianceMatrix>& aHitCovarianceM,
1301 Eigen::MatrixBase<LocalDerivativeMatrix>& aLocalDerivativesM,
1302 Eigen::MatrixBase<ResidualMatrix>& aHitResidualsM,
1303 Eigen::MatrixBase<GlobalDerivativeMatrix>& aGlobalDerivativesM)
const 1307 "'aLocalDerivativesM' and 'aHitResidualsM' must have the " 1308 "same underlying scalar type");
1311 "'aLocalDerivativesM' and 'aGlobalDerivativesM' must have the " 1312 "same underlying scalar type");
1314 Eigen::SelfAdjointEigenSolver<typename CovarianceMatrix::PlainObject> myDiag{aHitCovarianceM};
1316 auto aTranfoToDiagonalSystemInv =
1317 myDiag.eigenvectors().transpose().template cast<typename LocalDerivativeMatrix::Scalar>();
1319 aHitCovarianceM = myDiag.eigenvalues().asDiagonal();
1320 aLocalDerivativesM = aTranfoToDiagonalSystemInv * aLocalDerivativesM;
1321 aHitResidualsM = aTranfoToDiagonalSystemInv * aHitResidualsM;
1322 if (aGlobalDerivativesM.size() > 0) {
1324 aGlobalDerivativesM = aTranfoToDiagonalSystemInv * aGlobalDerivativesM;
1330 typename ResidualMatrix,
1331 typename LocalDerivativeMatrix>
1334 unsigned int iVirtualMeas,
1335 Eigen::MatrixBase<CovarianceMatrix>& aHitCovarianceM,
1336 Eigen::MatrixBase<ResidualMatrix>& aHitResidualsM,
1337 Eigen::MatrixBase<LocalDerivativeMatrix>& aLocalDerivativesM)
1341 const unsigned int xIndex = iVirtualMeas + refTrajPtr->numberOfHitMeas();
1343 aHitCovarianceM(0,0)=refTrajPtr->measurementErrors()[xIndex][xIndex];
1344 aHitResidualsM(0,0)= refTrajPtr->measurements()[xIndex];
1346 const auto& locDerivMatrix = refTrajPtr->derivatives();
1347 for (
int i = 0;
i < locDerivMatrix.num_col(); ++
i) {
1348 aLocalDerivativesM(0,
i) = locDerivMatrix[xIndex][
i];
1354 typename ResidualMatrix,
1355 typename LocalDerivativeMatrix>
1358 unsigned int iTrajHit,
1359 Eigen::MatrixBase<CovarianceMatrix>& aHitCovarianceM,
1360 Eigen::MatrixBase<ResidualMatrix>& aHitResidualsM,
1361 Eigen::MatrixBase<LocalDerivativeMatrix>& aLocalDerivativesM)
1365 const unsigned int xIndex = iTrajHit*2;
1366 const unsigned int yIndex = iTrajHit*2+1;
1368 aHitCovarianceM(0,0)=refTrajPtr->measurementErrors()[xIndex][xIndex];
1369 aHitCovarianceM(0,1)=refTrajPtr->measurementErrors()[xIndex][yIndex];
1370 aHitCovarianceM(1,0)=refTrajPtr->measurementErrors()[yIndex][xIndex];
1371 aHitCovarianceM(1,1)=refTrajPtr->measurementErrors()[yIndex][yIndex];
1373 aHitResidualsM(0,0)= refTrajPtr->measurements()[xIndex] - refTrajPtr->trajectoryPositions()[xIndex];
1374 aHitResidualsM(1,0)= refTrajPtr->measurements()[yIndex] - refTrajPtr->trajectoryPositions()[yIndex];
1376 const auto& locDerivMatrix = refTrajPtr->derivatives();
1377 for (
int i = 0;
i < locDerivMatrix.num_col(); ++
i) {
1378 aLocalDerivativesM(0,
i) = locDerivMatrix[xIndex][
i];
1379 aLocalDerivativesM(1,
i) = locDerivMatrix[yIndex][
i];
1386 unsigned int iTrajHit,
const std::vector<int> &globalLabels,
1387 const std::vector<float> &globalDerivativesX,
1388 const std::vector<float> &globalDerivativesY)
1392 if((aRecHit)->dimension() == 1) {
1393 return this->
callMille1D(refTrajPtr, iTrajHit, globalLabels, globalDerivativesX);
1395 return this->
callMille2D(refTrajPtr, iTrajHit, globalLabels,
1396 globalDerivativesX, globalDerivativesY);
1404 unsigned int iTrajHit,
const std::vector<int> &globalLabels,
1405 const std::vector<float> &globalDerivativesX)
1408 const unsigned int xIndex = iTrajHit*2;
1412 const int nLocal = locDerivMatrix.num_col();
1413 std::vector<float> localDerivatives(nLocal);
1414 for (
unsigned int i = 0;
i < localDerivatives.size(); ++
i) {
1415 localDerivatives[
i] = locDerivMatrix[xIndex][
i];
1419 float residX = refTrajPtr->measurements()[xIndex] - refTrajPtr->trajectoryPositions()[xIndex];
1420 float hitErrX = TMath::Sqrt(refTrajPtr->measurementErrors()[xIndex][xIndex]);
1423 const int nGlobal = globalDerivativesX.size();
1427 theMille->mille(nLocal, &(localDerivatives[0]), nGlobal, &(globalDerivativesX[0]),
1428 &(globalLabels[0]), residX, hitErrX);
1431 theMonitor->fillDerivatives(aRecHit, &(localDerivatives[0]), nLocal,
1432 &(globalDerivativesX[0]), nGlobal, &(globalLabels[0]));
1433 theMonitor->fillResiduals(aRecHit, refTrajPtr->trajectoryStates()[iTrajHit],
1434 iTrajHit, residX, hitErrX,
false);
1443 unsigned int iTrajHit,
const std::vector<int> &globalLabels,
1444 const std::vector<float> &globalDerivativesx,
1445 const std::vector<float> &globalDerivativesy)
1449 if((aRecHit)->dimension() != 2) {
1450 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::callMille2D" 1451 <<
"You try to call method for 2D hits for a " 1453 <<
"D Hit. Hit gets ignored!";
1457 Eigen::Matrix<double, 2, 2> aHitCovarianceM;
1458 Eigen::Matrix<float, 2, 1> aHitResidualsM;
1459 Eigen::Matrix<float, 2, Eigen::Dynamic>
1460 aLocalDerivativesM{2, refTrajPtr->derivatives().num_col()};
1462 this->
addRefTrackData2D(refTrajPtr, iTrajHit, aHitCovarianceM,aHitResidualsM,aLocalDerivativesM);
1463 Eigen::Matrix<float, 2, Eigen::Dynamic>
1464 aGlobalDerivativesM{2, globalDerivativesx.size()};
1470 const double corr = aHitCovarianceM(0,1) /
sqrt(aHitCovarianceM(0,0) * aHitCovarianceM(1,1));
1473 switch(aRecHit->geographicalId().subdetId()) {
1477 this->
diagonalize(aHitCovarianceM, aLocalDerivativesM, aHitResidualsM, aGlobalDerivativesM);
1484 float newResidX = aHitResidualsM(0,0);
1485 float newResidY = aHitResidualsM(1,0);
1486 float newHitErrX = TMath::Sqrt(aHitCovarianceM(0,0));
1487 float newHitErrY = TMath::Sqrt(aHitCovarianceM(1,1));
1491 std::vector<float> newLocalDerivs(aLocalDerivativesM.size());
1492 Eigen::Map<Eigen::Matrix<float, 2, Eigen::Dynamic, Eigen::RowMajor> >
1493 (newLocalDerivs.data(),
1494 aLocalDerivativesM.rows(),
1495 aLocalDerivativesM.cols()) = aLocalDerivativesM;
1496 float* newLocalDerivsX = &(newLocalDerivs[0]);
1497 float* newLocalDerivsY = &(newLocalDerivs[aLocalDerivativesM.cols()]);
1501 std::vector<float> newGlobDerivs(aGlobalDerivativesM.size());
1502 Eigen::Map<Eigen::Matrix<float, 2, Eigen::Dynamic, Eigen::RowMajor> >
1503 (newGlobDerivs.data(),
1504 aGlobalDerivativesM.rows(),
1505 aGlobalDerivativesM.cols()) = aGlobalDerivativesM;
1506 float* newGlobDerivsX = &(newGlobDerivs[0]);
1507 float* newGlobDerivsY = &(newGlobDerivs[aGlobalDerivativesM.cols()]);
1509 const int nLocal = aLocalDerivativesM.cols();
1510 const int nGlobal = aGlobalDerivativesM.cols();
1512 if (diag && (newHitErrX > newHitErrY)) {
1516 std::swap(newLocalDerivsX, newLocalDerivsY);
1517 std::swap(newGlobDerivsX, newGlobDerivsY);
1522 theMille->mille(nLocal, newLocalDerivsX, nGlobal, newGlobDerivsX,
1523 &(globalLabels[0]), newResidX, newHitErrX);
1526 theMonitor->fillDerivatives(aRecHit, newLocalDerivsX, nLocal, newGlobDerivsX,
1527 nGlobal, &(globalLabels[0]));
1528 theMonitor->fillResiduals(aRecHit, refTrajPtr->trajectoryStates()[iTrajHit],
1529 iTrajHit, newResidX, newHitErrX,
false);
1531 const bool isReal2DHit = this->
is2D(aRecHit);
1533 theMille->mille(nLocal, newLocalDerivsY, nGlobal, newGlobDerivsY,
1534 &(globalLabels[0]), newResidY, newHitErrY);
1536 theMonitor->fillDerivatives(aRecHit, newLocalDerivsY, nLocal, newGlobDerivsY,
1537 nGlobal, &(globalLabels[0]));
1538 theMonitor->fillResiduals(aRecHit, refTrajPtr->trajectoryStates()[iTrajHit],
1539 iTrajHit, newResidY, newHitErrY,
true);
1543 return (isReal2DHit ? 2 : 1);
1550 Eigen::Matrix<double, 1, 1> aHitCovarianceM;
1551 Eigen::Matrix<float, 1, 1> aHitResidualsM;
1552 Eigen::Matrix<float, 1, Eigen::Dynamic>
1553 aLocalDerivativesM{1, refTrajPtr->derivatives().num_col()};
1558 auto aGlobalDerivativesM = Eigen::Matrix<float, 1, 1>::Zero();
1560 float newResidX = aHitResidualsM(0,0);
1561 float newHitErrX = TMath::Sqrt(aHitCovarianceM(0,0));
1562 std::vector<float> newLocalDerivsX(aLocalDerivativesM.size());
1563 Eigen::Map<Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >
1564 (newLocalDerivsX.data(),
1565 aLocalDerivativesM.rows(),
1566 aLocalDerivativesM.cols()) = aLocalDerivativesM;
1568 std::vector<float> newGlobDerivsX(aGlobalDerivativesM.size());
1569 Eigen::Map<Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >
1570 (newGlobDerivsX.data(),
1571 aGlobalDerivativesM.rows(),
1572 aGlobalDerivativesM.cols()) = aGlobalDerivativesM;
1574 const int nLocal = aLocalDerivativesM.cols();
1575 const int nGlobal = 0;
1577 theMille->mille(nLocal, newLocalDerivsX.data(), nGlobal, newGlobDerivsX.data(),
1578 &nGlobal, newResidX, newHitErrX);
1586 TsosVectorCollection::const_iterator iTsoses = lasBeamTsoses.begin();
1587 for(TkFittedLasBeamCollection::const_iterator iBeam = lasBeams.begin(), iEnd = lasBeams.end();
1588 iBeam != iEnd; ++iBeam, ++iTsoses){
1590 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addLaserData" 1591 <<
"Beam " << iBeam->getBeamId() <<
" with " 1592 << iBeam->parameters().size() <<
" parameters and " 1593 << iBeam->getData().size() <<
" hits.\n There are " 1594 << iTsoses->size() <<
" TSOSes.";
1596 this->
addLasBeam(eventInfo, *iBeam, *iTsoses);
1603 const std::vector<TrajectoryStateOnSurface> &tsoses)
1606 std::vector<float> lasLocalDerivsX;
1609 for (
unsigned int iHit = 0; iHit < tsoses.size(); ++iHit) {
1610 if (!tsoses[iHit].isValid())
continue;
1615 lasLocalDerivsX.clear();
1620 tsoses[iHit], lasAli, lasAli,
1623 for (
unsigned int nFitParams = 0;
1624 nFitParams < static_cast<unsigned int>(lasBeam.
parameters().size());
1628 lasLocalDerivsX.push_back(derivative);
1636 const float residual = hit.
localPosition().x() - tsoses[iHit].localPosition().x();
1638 const float error = 0.003;
1650 const bool doOutputOnStdout(pxbSurveyCfg.
getParameter<
bool>(
"doOutputOnStdout"));
1651 if (doOutputOnStdout) {
1653 <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey" 1654 <<
"# Output from addPxbSurvey follows below because " 1655 <<
"doOutputOnStdout is set to True";
1663 std::vector<SurveyPxbImageLocalFit> measurements;
1670 if (doOutputOnStdout) {
1672 <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey" 1673 <<
"Module " <<
i <<
": ";
1698 fidpointvec.push_back(fidpoint0inSurf1frame);
1699 fidpointvec.push_back(fidpoint1inSurf1frame);
1700 fidpointvec.push_back(fidpoint2);
1701 fidpointvec.push_back(fidpoint3);
1712 a = measurements[
i].getLocalParameters();
1716 if (doOutputOnStdout)
1719 <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey" 1720 <<
"a: " << a[0] <<
", " << a[1] <<
", " << a[2] <<
", " << a[3]
1721 <<
" S= " <<
sqrt(a[2]*a[2]+a[3]*a[3])
1722 <<
" phi= " << atan(a[3]/a[2])
1723 <<
" chi2= " << chi2 << std::endl;
1728 theMonitor->fillPxbSurveyHistsLocalPars(a[0],a[1],
sqrt(a[2]*a[2]+a[3]*a[3]),atan(a[3]/a[2]));
1734 theMille->mille((
int)measurements[
i].getLocalDerivsSize(),
1735 measurements[
i].getLocalDerivsPtr(j),
1736 (
int)measurements[
i].getGlobalDerivsSize(),
1737 measurements[
i].getGlobalDerivsPtr(j),
1738 measurements[
i].getGlobalDerivsLabelPtr(j),
1739 measurements[
i].getResiduum(j),
1740 measurements[
i].getSigma(j));
1749 const auto runRangeSelection =
1752 if (runRangeSelection.empty())
return false;
1754 const auto runRanges =
1758 return !(runRanges.empty());
virtual bool processesEvents() override
Returns whether MP should process events in the current configuration.
unsigned int hitsX() const
get number of hits for x-measurement
const TimeTypeSpecs timeTypeSpecs[]
std::vector< int > theIntBuffer
T getParameter(std::string const &) const
unsigned int firstFixedParameter() const
void globalDerivativesCalibration(const TransientTrackingRecHit::ConstRecHitPointer &recHit, const TrajectoryStateOnSurface &tsos, const edm::EventSetup &setup, const EventInfo &eventInfo, std::vector< float > &globalDerivativesX, std::vector< float > &globalDerivativesY, std::vector< int > &globalLabels) const
adding derivatives from integrated calibrations
T getUntrackedParameter(std::string const &, T const &) const
std::vector< AlignmentUserVariables * > readMillePedeVariables(const std::vector< Alignable * > &alivec, const char *filename, int iter, int &ierr)
unsigned int size() const
number of parameters
void resetParameters(void)
reset parameters, correlations, user variables
const align::RunNumber firstIOV_
virtual bool supportsCalibrations() override
Returns whether MP supports calibrations.
std::unique_ptr< MillePedeMonitor > theMonitor
void increaseHitsX(unsigned int add=1)
increase hits for x-measurement
bool read(std::vector< Alignable * > &alignables, bool setUserVars)
virtual bool setParametersForRunRange(const RunRange &runrange) override
const bool enableAlignableUpdates_
Derivative< X, A >::type derivative(const A &_)
virtual void endRun(const EventInfo &, const EndRunInfo &, const edm::EventSetup &)
Run on run products, e.g. TkLAS.
std::vector< coord_t > fidpoint_t
std::shared_ptr< AlignPCLThresholds > theThresholds
void diagonalize(Eigen::MatrixBase< CovarianceMatrix > &aHitCovarianceM, Eigen::MatrixBase< LocalDerivativeMatrix > &aLocalDerivativesM, Eigen::MatrixBase< ResidualMatrix > &aHitResidualsM, Eigen::MatrixBase< GlobalDerivativeMatrix > &aGlobalDerivativesM) const
const EventID & eventID() const
void increaseHitsY(unsigned int add=1)
increase hits for y-measurement
std::vector< Alignable * > theAlignables
virtual void endLuminosityBlock(const edm::EventSetup &) override
called at end of luminosity block
TrajectoryFactoryBase::ReferenceTrajectoryCollection RefTrajColl
std::vector< ParameterSet > VParameterSet
std::unique_ptr< TrajectoryFactoryBase > theTrajectoryFactory
bool theDoSurveyPixelBarrel
void writeAlignableOriginalPositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
write Alignable original (before misalignment) absolute positions
std::unique_ptr< gbl::MilleBinary > theBinary
void addGlobals(const std::vector< int > &aLabels, const Eigen::MatrixBase< Derivative > &aDerivatives)
Add global derivatives to a point.
int addGlobalData(const edm::EventSetup &setup, const EventInfo &eventInfo, const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iHit, gbl::GblPoint &gblPoint)
align::RunNumber RunNumber
unsigned int theMinNumHits
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool globalDerivativesHierarchy(const EventInfo &eventInfo, const TrajectoryStateOnSurface &tsos, Alignable *ali, const AlignableDetOrUnitPtr &alidet, std::vector< float > &globalDerivativesX, std::vector< float > &globalDerivativesY, std::vector< int > &globalLabels, AlignmentParameters *&lowestParams) const
recursively adding derivatives and labels, false if problems
def setup(process, global_tag, zero_tesla=False)
void restoreCachedTransformations(void)
restore the previously cached position, rotation and other parameters
std::shared_ptr< PedeLabelerBase > thePedeLabels
void applyParameters(void)
Obsolete: Use AlignableNavigator::alignableDetFromDetId and alignableFromAlignableDet.
std::vector< std::string > getExistingFormattedFiles(const std::vector< std::string > &plainFiles, const std::string &theDir)
unsigned int addHitCount(const std::vector< AlignmentParameters * > &parVec, const std::vector< bool > &validHitVecY) const
virtual LocalPoint localPosition() const
virtual bool addCalibrations(const std::vector< IntegratedCalibrationBase * > &iCals) override
Pass integrated calibrations to Millepede (they are not owned by Millepede!)
const AlgebraicMatrix & derivatives() const
matrix of local derivatives: columns are parameters, rows are hits
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
int callMille2D(const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iTrajHit, const std::vector< int > &globalLabels, const std::vector< float > &globalDerivativesx, const std::vector< float > &globalDerivativesy)
math::Error< 5 >::type CovarianceMatrix
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const bool ignoreFirstIOVCheck_
const bool ignoreHitsWithoutGlobalDerivatives_
void addLasBeam(const EventInfo &eventInfo, const TkFittedLasBeam &lasBeam, const std::vector< TrajectoryStateOnSurface > &tsoses)
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
const ConstTrajTrackPairCollection & trajTrackPairs() const
define event information passed to algorithms
unsigned int doIO(int loop) const
int callMille(const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iTrajHit, const std::vector< int > &globalLabels, const std::vector< float > &globalDerivativesX, const std::vector< float > &globalDerivativesY)
calls callMille1D or callMille2D
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
U second(std::pair< T, U > const &p)
const AlgebraicVector & parameters(void) const
Get alignment parameters.
virtual void beginLuminosityBlock(const edm::EventSetup &) override
called at begin of luminosity block (resets Mille binary in mille mode)
std::vector< align::RunNumber > cachedRuns_
std::string doDice(const fidpoint_t &fidpointvec, const idPair_t &id, const bool rotate=false)
AlignmentUserVariables * userVariables(void) const
Get pointer to user variables.
int callMille1D(const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iTrajHit, const std::vector< int > &globalLabels, const std::vector< float > &globalDerivativesX)
calls Mille for 1D hits
void addLaserData(const EventInfo &eventInfo, const TkFittedLasBeamCollection &tkLasBeams, const TsosVectorCollection &tkLasBeamTsoses)
int addMeasurementData(const edm::EventSetup &setup, const EventInfo &eventInfo, const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iHit, AlignmentParameters *¶ms)
bool isMode(unsigned int testMode) const
Container::value_type value_type
virtual void beginRun(const edm::Run &run, const edm::EventSetup &setup, bool changed) override
called at begin of run
align::RotationType toLocal(const align::RotationType &) const
Return in local frame a rotation given in global frame.
CLHEP::HepMatrix AlgebraicMatrix
const std::vector< Scalar > & parameters() const
parallel to derivatives()
RunRanges makeNonOverlappingRunRanges(const edm::VParameterSet &runRanges, const RunNumber &defaultRun)
void makeGlobDerivMatrix(const std::vector< float > &globalDerivativesx, const std::vector< float > &globalDerivativesy, Eigen::MatrixBase< GlobalDerivativeMatrix > &aGlobalDerivativesM)
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
RunRanges makeUniqueRunRanges(const edm::VParameterSet &runRanges, const RunNumber &defaultRun)
unsigned int getBeamId(void) const
return the full beam identifier
AlignmentParameterStore * theAlignmentParameterStore
directory for all kind of files
unsigned int hitsY() const
get number of hits for y-measurement
bool is2D(const TransientTrackingRecHit::ConstRecHitPointer &recHit) const
true if hit belongs to 2D detector (currently tracker specific)
const char * name() const
edm::ParameterSet theConfig
void addRefTrackVirtualMeas1D(const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iVirtualMeas, Eigen::MatrixBase< CovarianceMatrix > &aHitCovarianceM, Eigen::MatrixBase< ResidualMatrix > &aHitResidualsM, Eigen::MatrixBase< LocalDerivativeMatrix > &aLocalDerivativesM)
adds data for a specific virtual measurement from reference trajectory
Namespace for the general broken lines package.
void addRefTrackData2D(const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iTrajHit, Eigen::MatrixBase< CovarianceMatrix > &aHitCovarianceM, Eigen::MatrixBase< ResidualMatrix > &aHitResidualsM, Eigen::MatrixBase< LocalDerivativeMatrix > &aLocalDerivativesM)
adds data from reference trajectory from a specific Hit
const TkFittedLasBeamCollection * tkLasBeams() const
std::unique_ptr< PedeSteerer > thePedeSteer
bool areIOVsSpecified() const
virtual bool storeAlignments() override
Returns whether MP produced results to be stored.
virtual void terminate() override
Called at end of job.
const bool skipGlobalPositionRcdCheck_
virtual void initialize(const edm::EventSetup &setup, AlignableTracker *tracker, AlignableMuon *muon, AlignableExtras *extras, AlignmentParameterStore *store) override
Called at beginning of job.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
bool addHits(const std::vector< Alignable * > &alis, const std::vector< AlignmentUserVariables * > &mpVars) const
std::vector< ConstRecHitPointer > ConstRecHitContainer
void writeMillePedeVariables(const std::vector< Alignable * > &alivec, const char *filename, int iter, bool validCheck, int &ierr)
bool addHitStatistics(int fromLoop, const std::string &outFile, const std::vector< std::string > &inFiles) const
bool areEmptyParams(const std::vector< Alignable * > &alignables) const
void addVirtualMeas(const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr, unsigned int iVirtualMeas)
adds data for virtual measurements from reference trajectory
bool readFromPede(const edm::ParameterSet &mprespset, bool setUserVars, const RunRange &runrange)
read pede input defined by 'psetName', flag to create/not create MillePedeVariables ...
std::pair< unsigned int, unsigned int > addReferenceTrajectory(const edm::EventSetup &setup, const EventInfo &eventInfo, const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr)
fill mille for a trajectory, returning number of x/y hits ([0,0] if 'bad' trajectory) ...
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
const SiStripDetId & getDetId(void) const
void milleOut(MilleBinary &aMille)
Write valid trajectory to Millepede-II binary file.
virtual bool storeThresholds(const int &nRecords, const AlignPCLThresholds::threshold_map &thresholdMap)
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
std::vector< IntegratedCalibrationBase * > theCalibrations
int size(void) const
Get number of parameters.
std::vector< float > theFloatBufferX
void addUntrackedParameter(std::string const &name, T const &value)
Class to hold one picture of the BPix survey.
std::vector< value_t > localpars_t
std::map< std::string, AlignPCLThreshold > threshold_map
virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo) override
Run the algorithm on trajectories and tracks.
void buildUserVariables(const std::vector< Alignable * > &alignables) const
add MillePedeVariables for each AlignmentParameters (exception if no parameters...)
align::RunNumber lastProcessedRun_
MillePedeAlignmentAlgorithm(const edm::ParameterSet &cfg)
Constructor.
const bool enforceSingleIOVInput_
virtual ~MillePedeAlignmentAlgorithm()
Destructor.
std::vector< TkFittedLasBeam > TkFittedLasBeamCollection
const reco::BeamSpot & beamSpot() const
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
void cacheTransformations(void)
cache the current position, rotation and other parameters
std::vector< float > theFloatBufferY
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
std::string fullPath() const
static const count_t nMsrmts
void writeAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
write Alignable current absolute positions
eventInfo
add run, event number and lumi section
void addPxbSurvey(const edm::ParameterSet &pxbSurveyCfg)
add measurement data from PXB survey
const IOVSyncValue & first() const
unsigned int decodeMode(const std::string &mode) const
std::unique_ptr< AlignableNavigator > theAlignableNavigator
const std::vector< SiStripLaserRecHit2D > & getData(void) const
access the collection of hits
const align::RunRanges uniqueRunRanges_
void writeOrigRigidBodyAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
write RigidBodyAlignmentParameters as applied on top of original positions
std::vector< std::vector< TrajectoryStateOnSurface > > TsosVectorCollection
define run information passed to algorithms (in endRun)
const TsosVectorCollection * tkLasBeamTsoses() const
might be null!
const AlgebraicSymMatrix & covariance(void) const
Get parameter covariance matrix.
Constructor of the full muon geometry.
uint32_t dimension(pat::CandKinResolution::Parametrization parametrization)
Returns the number of free parameters in a parametrization (3 or 4)
ValidityInterval const & validityInterval() const
virtual AlgebraicMatrix derivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const =0
Get derivatives of selected parameters.
T const * product() const
Alignable * mother() const
Return pointer to container alignable (if any)
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
void throwException(const std::string &message, const std::string &methodName)
T get(const Candidate &c)
bool setAllDefault(unsigned int nParam)
set default values for all data concerning nParam (false if nParam out of range)
std::unique_ptr< Mille > theMille
virtual EventSetupRecordKey key() const