92 theMode(this->decodeMode(theConfig.getUntrackedParameter<std::
string>(
"mode"))),
93 theDir(theConfig.getUntrackedParameter<std::
string>(
"fileDir")),
94 theAlignmentParameterStore(nullptr),
98 .getParameter<std::
string>(
"TrajectoryFactoryName"),
99 theConfig.getParameter<edm::
ParameterSet>(
"TrajectoryFactory"),
101 theMinNumHits(cfg.getParameter<unsigned int>(
"minNumHits")),
102 theMaximalCor2D(cfg.getParameter<double>(
"max2Dcorrelation")),
104 ignoreFirstIOVCheck_(cfg.getUntrackedParameter<bool>(
"ignoreFirstIOVCheck")),
105 enableAlignableUpdates_(cfg.getUntrackedParameter<bool>(
"enableAlignableUpdates")),
106 theLastWrittenIov(0),
107 theGblDoubleBinary(cfg.getParameter<bool>(
"doubleBinary")),
108 runAtPCL_(cfg.getParameter<bool>(
"runAtPCL")),
109 ignoreHitsWithoutGlobalDerivatives_(cfg.getParameter<bool>(
"ignoreHitsWithoutGlobalDerivatives")),
110 skipGlobalPositionRcdCheck_(cfg.getParameter<bool>(
"skipGlobalPositionRcdCheck")),
113 enforceSingleIOVInput_(!(enableAlignableUpdates_ && areIOVsSpecified())),
117 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm"
119 <<
"' with output directory '" <<
theDir <<
"'.";
141 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::initialize"
142 <<
"Running with AlignabeMuon not yet tested.";
152 std::ostringstream message;
154 if (iov_alignments.first().eventID().run() !=
MIN_VAL || iov_alignments.last().eventID().run() !=
MAX_VAL) {
156 <<
" with multiple IOVs in tag without specifying 'RunRangeSelection'.\n"
157 <<
"Validity range is " << iov_alignments.first().eventID().run() <<
" - "
158 << iov_alignments.last().eventID().run() <<
"\n";
161 if (iov_surfaces.first().eventID().run() !=
MIN_VAL || iov_surfaces.last().eventID().run() !=
MAX_VAL) {
163 <<
" with multiple IOVs in tag without specifying 'RunRangeSelection'.\n"
164 <<
"Validity range is " << iov_surfaces.first().eventID().run() <<
" - "
165 << iov_surfaces.last().eventID().run() <<
"\n";
168 if (iov_errors.first().eventID().run() !=
MIN_VAL || iov_errors.last().eventID().run() !=
MAX_VAL) {
170 <<
" with multiple IOVs in tag without specifying 'RunRangeSelection'.\n"
171 <<
"Validity range is " << iov_errors.first().eventID().run() <<
" - "
172 << iov_errors.last().eventID().run() <<
"\n";
176 throw cms::Exception(
"DatabaseError") <<
"@SUB=MillePedeAlignmentAlgorithm::initialize" << message.str();
199 if (!RunRangeSelectionVPSet.empty()) {
200 labelerPlugin =
"RunRangeDependentPedeLabeler";
201 if (pedeLabelerCfg.
exists(
"plugin")) {
203 if ((labelerPluginCfg !=
"PedeLabeler" && labelerPluginCfg !=
"RunRangeDependentPedeLabeler") ||
205 throw cms::Exception(
"BadConfig") <<
"MillePedeAlignmentAlgorithm::initialize"
206 <<
"both RunRangeSelection and generic labeler specified in config file. "
207 <<
"Please get rid of either one of them.\n";
211 if (pedeLabelerCfg.
exists(
"plugin")) {
216 if (!pedeLabelerCfg.
exists(
"plugin")) {
220 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::initialize"
221 <<
"Using plugin '" << labelerPlugin <<
"' to generate labels.";
239 const std::vector<edm::ParameterSet> mprespset(
241 if (!mprespset.empty()) {
242 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::initialize"
243 <<
"Apply " << mprespset.end() - mprespset.begin()
244 <<
" previous MillePede constants from 'pedeReaderInputs'.";
250 for (std::vector<edm::ParameterSet>::const_iterator iSet = mprespset.begin(), iE = mprespset.end(); iSet != iE;
256 <<
"MillePedeAlignmentAlgorithm::initialize: Problems reading input constants of "
257 <<
"pedeReaderInputs entry " << iSet - mprespset.begin() <<
'.';
259 theAlignmentParameterStore->applyParameters();
261 theAlignmentParameterStore->resetParameters();
273 throw cms::Exception(
"BadConfig") <<
"'vstring mergeTreeFiles' and 'vstring mergeBinaryFiles' must be empty for "
274 <<
"modes running mille.";
277 if (!moniFile.empty())
278 theMonitor = std::make_unique<MillePedeMonitor>(tTopo, (theDir + moniFile).c_str());
305 theThresholds->setAlignPCLThresholds(nRecords, thresholdMap);
342 theAlignmentParameterStore->restoreCachedTransformations(runrange.first);
344 theAlignmentParameterStore->restoreCachedTransformations();
348 theAlignmentParameterStore->resetParameters();
353 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::setParametersForRunRange"
354 <<
"Problems reading pede result, but applying!";
356 theAlignmentParameterStore->applyParameters();
371 std::vector<std::string>
files;
375 const std::vector<std::string> plainFiles(
theConfig.
getParameter<std::vector<std::string> >(
"mergeBinaryFiles"));
379 for (
const auto &
file : files)
380 filesForLogOutput +=
" " +
file +
",";
381 if (filesForLogOutput.length() != 0)
382 filesForLogOutput.pop_back();
383 edm::LogInfo(
"Alignment") <<
"Based on the config parameter mergeBinaryFiles, using the following "
384 <<
"files as input (assigned weights are indicated by ' -- <weight>'):"
385 << filesForLogOutput;
392 theAlignmentParameterStore->cacheTransformations();
395 throw cms::Exception(
"BadConfig") <<
"@SUB=MillePedeAlignmentAlgorithm::terminate\n"
396 <<
"Last IOV of 'RunRangeSelection' has not been processed. "
397 <<
"Please reconfigure your source to process the runs at least up to "
402 const auto run = runRange.first;
404 theAlignmentParameterStore->restoreCachedTransformations(lastCachedRun);
405 theAlignmentParameterStore->cacheTransformations(
run);
410 theAlignmentParameterStore->restoreCachedTransformations();
425 const std::vector<std::string> &plainFiles,
const std::string &theDir) {
426 std::vector<std::string>
files;
427 for (
const auto &plainFile : plainFiles) {
433 char theNumberedInputFileName[200];
434 sprintf(theNumberedInputFileName, theInputFileName.c_str(), theNumber);
435 std::string theCompleteInputFileName = theDir + theNumberedInputFileName;
436 const auto endOfStrippedFileName = theCompleteInputFileName.rfind(
" --");
437 const auto strippedInputFileName = theCompleteInputFileName.substr(0, endOfStrippedFileName);
440 if (
stat(strippedInputFileName.c_str(), &
buffer) == 0) {
442 files.push_back(theCompleteInputFileName);
443 if (theNumberedInputFileName == theInputFileName) {
456 if (theNumber == 0 && (files.empty() || files.back() != plainFile)) {
457 edm::LogWarning(
"Alignment") <<
"The input file '" << plainFile <<
"' does not exist.";
471 for (
const auto &iTrajTrack :
tracks) {
479 unsigned int refTrajCount = 0;
481 for (
auto iRefTraj = trajectories.cbegin(), iRefTrajE = trajectories.cend(); iRefTraj != iRefTrajE;
482 ++iRefTraj, ++refTrajCount) {
489 if (
theMonitor && (nHitXy.first || nHitXy.second)) {
491 const auto offset = tracksPerTraj * refTrajCount;
492 for (
unsigned int iTrack = 0; iTrack < tracksPerTraj; ++iTrack) {
503 std::pair<unsigned int, unsigned int> hitResultXy(0, 0);
504 if (refTrajPtr->isValid()) {
506 if (!refTrajPtr->gblInput().empty()) {
508 unsigned int iHit = 0;
509 unsigned int numPointsWithMeas = 0;
510 std::vector<GblPoint>::iterator itPoint;
511 auto theGblInput = refTrajPtr->gblInput();
512 for (
unsigned int iTraj = 0; iTraj < refTrajPtr->gblInput().size(); ++iTraj) {
513 for (itPoint = refTrajPtr->gblInput()[iTraj].first.begin(); itPoint < refTrajPtr->gblInput()[iTraj].first.end();
515 if (this->
addGlobalData(setup, eventInfo, refTrajPtr, iHit++, *itPoint) < 0)
517 if (itPoint->numMeasurements() >= 1)
521 hitResultXy.first = numPointsWithMeas;
523 if (hitResultXy.first == 0 || hitResultXy.first <
theMinNumHits)
526 if (refTrajPtr->gblInput().size() == 1) {
528 GblTrajectory aGblTrajectory(refTrajPtr->gblInput()[0].first, refTrajPtr->nominalField() != 0);
536 if (aGblTrajectory.isValid() && aGblTrajectory.getNumPoints() >=
theMinNumHits)
539 if (refTrajPtr->gblInput().size() == 2) {
541 GblTrajectory aGblTrajectory(refTrajPtr->gblInput(),
542 refTrajPtr->gblExtDerivatives(),
543 refTrajPtr->gblExtMeasurements(),
544 refTrajPtr->gblExtPrecisions());
546 if (aGblTrajectory.isValid() && aGblTrajectory.getNumPoints() >=
theMinNumHits)
551 std::vector<AlignmentParameters *> parVec(refTrajPtr->recHits().size());
553 std::vector<bool> validHitVecY(refTrajPtr->recHits().size(),
false);
555 for (
unsigned int iHit = 0; iHit < refTrajPtr->recHits().size(); ++iHit) {
556 const int flagXY = this->
addMeasurementData(setup, eventInfo, refTrajPtr, iHit, parVec[iHit]);
559 hitResultXy.first = 0;
564 validHitVecY[iHit] = (flagXY >= 2);
569 for (
unsigned int iVirtualMeas = 0; iVirtualMeas < refTrajPtr->numberOfVirtualMeas(); ++iVirtualMeas) {
574 if (hitResultXy.first == 0 || hitResultXy.first <
theMinNumHits) {
576 hitResultXy.first = hitResultXy.second = 0;
581 hitResultXy.second = this->
addHitCount(parVec, validHitVecY);
593 const std::vector<bool> &validHitVecY)
const {
595 unsigned int nHitY = 0;
596 for (
unsigned int iHit = 0; iHit < validHitVecY.size(); ++iHit) {
597 Alignable *ali = (parVec[iHit] ? parVec[iHit]->alignable() :
nullptr);
608 if (validHitVecY[iHit]) {
610 if (pars == parVec[iHit])
623 throw cms::Exception(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::beginRun\n"
624 <<
"Using data (run = " << run.
run() <<
") prior to the first defined IOV ("
646 std::ostringstream message;
648 message <<
"Trying to cache tracker alignment payloads for a run (" <<
runNumber <<
") in an IOV (" <<
firstRun
649 <<
") that was already cached.\n"
650 <<
"The following records in your input database tag have an IOV "
651 <<
"boundary that does not match your IOV definition:\n";
652 if (geometryRcd.validityInterval().first().eventID().run() >
firstRun) {
653 message <<
" - IdealGeometryRecord '" << geometryRcd.key().name() <<
"' (since "
654 << geometryRcd.validityInterval().first().eventID().run() <<
")\n";
658 message <<
" - GlobalPositionRecord '" << globalPosRcd.
key().
name() <<
"' (since "
661 message <<
" --> ignored\n";
668 message <<
" - TrackerAlignmentRcd '" << alignmentRcd.
key().
name() <<
"' (since "
673 message <<
" - TrackerSurfaceDeformationRcd '" << surfaceRcd.
key().
name() <<
"' (since "
678 message <<
" - TrackerAlignmentErrorExtendedRcd '" << errorRcd.
key().
name() <<
"' (since "
684 throw cms::Exception(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::beginRun\n" << message.str();
741 if (!recHitPtr->isValid())
781 GblPoint &gblPoint) {
783 std::vector<double> theDoubleBufferX, theDoubleBufferY;
784 theDoubleBufferX.clear();
785 theDoubleBufferY.clear();
792 if (!recHitPtr->isValid())
810 std::vector<IntegratedCalibrationBase::ValuesIndexPair> derivs;
813 (*iCalib)->derivatives(derivs, *recHitPtr, tsos, setup, eventInfo);
814 for (
auto iValuesInd = derivs.begin(); iValuesInd != derivs.end(); ++iValuesInd) {
816 globalLabel =
thePedeLabels->calibrationLabel(*iCalib, iValuesInd->second);
817 if (globalLabel > 0 && globalLabel <= 2147483647) {
819 theDoubleBufferX.push_back(iValuesInd->first.first);
820 theDoubleBufferY.push_back(iValuesInd->first.second);
822 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addGlobalData"
823 <<
"Invalid label " << globalLabel <<
" <= 0 or > 2147483647";
828 if (numGlobals > 0) {
829 Eigen::Matrix<double, 2, Eigen::Dynamic> globalDer{2, numGlobals};
830 for (
unsigned int i = 0;
i < numGlobals; ++
i) {
831 globalDer(0,
i) = theDoubleBufferX[
i];
832 globalDer(1,
i) = theDoubleBufferY[
i];
845 std::vector<float> &globalDerivativesX,
846 std::vector<float> &globalDerivativesY,
847 std::vector<int> &globalLabels,
862 bool hasSplitParameters =
thePedeLabels->hasSplitParameters(ali);
863 const unsigned int alignableLabel =
thePedeLabels->alignableLabel(ali);
865 if (0 == alignableLabel) {
866 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::globalDerivativesHierarchy"
867 <<
"Label not found, skip Alignable.";
871 const std::vector<bool> &selPars = params->
selector();
875 for (
unsigned int iSel = 0; iSel < selPars.size(); ++iSel) {
878 if (hasSplitParameters ==
true) {
879 globalLabels.push_back(
thePedeLabels->parameterLabel(ali, iSel, eventInfo, tsos));
881 globalLabels.push_back(
thePedeLabels->parameterLabel(alignableLabel, iSel));
892 eventInfo, tsos, ali->
mother(), alidet, globalDerivativesX, globalDerivativesY, globalLabels, lowestParams);
900 std::vector<double> &globalDerivativesX,
901 std::vector<double> &globalDerivativesY,
902 std::vector<int> &globalLabels,
917 bool hasSplitParameters =
thePedeLabels->hasSplitParameters(ali);
918 const unsigned int alignableLabel =
thePedeLabels->alignableLabel(ali);
920 if (0 == alignableLabel) {
921 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::globalDerivativesHierarchy"
922 <<
"Label not found, skip Alignable.";
926 const std::vector<bool> &selPars = params->
selector();
931 for (
unsigned int iSel = 0; iSel < selPars.size(); ++iSel) {
933 if (hasSplitParameters ==
true) {
934 globalLabel =
thePedeLabels->parameterLabel(ali, iSel, eventInfo, tsos);
936 globalLabel =
thePedeLabels->parameterLabel(alignableLabel, iSel);
938 if (globalLabel > 0 && globalLabel <= 2147483647) {
939 globalLabels.push_back(globalLabel);
943 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::globalDerivativesHierarchy"
944 <<
"Invalid label " << globalLabel <<
" <= 0 or > 2147483647";
954 eventInfo, tsos, ali->
mother(), alidet, globalDerivativesX, globalDerivativesY, globalLabels, lowestParams);
962 std::vector<float> &globalDerivativesX,
963 std::vector<float> &globalDerivativesY,
964 std::vector<int> &globalLabels)
const {
965 std::vector<IntegratedCalibrationBase::ValuesIndexPair> derivs;
968 (*iCalib)->derivatives(derivs, *recHit, tsos, setup, eventInfo);
969 for (
auto iValuesInd = derivs.begin(); iValuesInd != derivs.end(); ++iValuesInd) {
971 globalLabels.push_back(
thePedeLabels->calibrationLabel(*iCalib, iValuesInd->second));
972 globalDerivativesX.push_back(iValuesInd->first.first);
973 globalDerivativesY.push_back(iValuesInd->first.second);
1016 if (recHit->dimension() < 2) {
1018 }
else if (recHit->detUnit()) {
1019 return recHit->detUnit()->type().isTrackerPixel();
1021 if (dynamic_cast<const ProjectedSiStripRecHit2D *>(recHit->hit())) {
1038 bool okRead = reader.
read(alis, setUserVars);
1039 bool numMatch =
true;
1041 std::stringstream
out;
1042 out <<
"Read " << alis.size() <<
" alignables";
1048 out <<
", but problems in reading";
1050 out <<
", possibly overwriting previous settings";
1053 if (okRead && allEmpty) {
1055 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::readFromPede" << out.str();
1056 }
else if (!alis.empty()) {
1057 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::readFromPede" << out.str();
1059 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::readFromPede" << out.str();
1065 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::readFromPede" << out.str();
1071 for (
const auto &iAli : alignables) {
1076 for (
int i = 0;
i < parVec.num_row(); ++
i) {
1077 if (parVec[
i] != 0.)
1079 for (
int j =
i;
j < parCov.num_col(); ++
j) {
1080 if (parCov[
i][
j] != 0.)
1095 if (outFilePlain.empty()) {
1096 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO"
1097 <<
"treeFile parameter empty => skip writing for 'loop' " <<
loop;
1108 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO"
1109 <<
"Problem " << ioerr <<
" in writeAlignableOriginalPositions";
1112 }
else if (loop == 1) {
1114 const std::vector<std::string> inFiles(
theConfig.
getParameter<std::vector<std::string> >(
"mergeTreeFiles"));
1115 const std::vector<std::string> binFiles(
theConfig.
getParameter<std::vector<std::string> >(
"mergeBinaryFiles"));
1116 if (inFiles.size() != binFiles.size()) {
1117 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO"
1118 <<
"'vstring mergeTreeFiles' and 'vstring mergeBinaryFiles' "
1119 <<
"differ in size";
1126 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO"
1127 <<
"Problem " << ioerr <<
" writing MillePedeVariables";
1133 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO"
1134 <<
"Problem " << ioerr <<
" in writeOrigRigidBodyAlignmentParameters, " <<
loop;
1139 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO"
1140 <<
"Problem " << ioerr <<
" in writeAlignableAbsolutePositions, " <<
loop;
1149 for (
const auto &iAli : alis) {
1152 throw cms::Exception(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::buildUserVariables"
1153 <<
"No parameters for alignable";
1157 for (
unsigned int iPar = 0; iPar < userVars->
size(); ++iPar) {
1168 thePedeLabels->alignableTracker()->objectIdProvider().typeToName(iAli->alignableObjectId()));
1176 if (mode ==
"full") {
1178 }
else if (mode ==
"mille") {
1180 }
else if (mode ==
"pede") {
1182 }
else if (mode ==
"pedeSteer") {
1184 }
else if (mode ==
"pedeRun") {
1186 }
else if (mode ==
"pedeRead") {
1191 <<
"', use 'full', 'mille', 'pede', 'pedeRun', 'pedeSteer' or 'pedeRead'.";
1199 const std::vector<std::string> &inFiles)
const {
1203 for (std::vector<std::string>::const_iterator iFile = inFiles.begin(); iFile != inFiles.end(); ++iFile) {
1205 const std::vector<AlignmentUserVariables *> mpVars =
1208 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addHitStatistics"
1209 <<
"Error " << ierr <<
" reading from " << inFile <<
", tree " << fromIov
1210 <<
", or problems in addHits";
1213 for (std::vector<AlignmentUserVariables *>::const_iterator
i = mpVars.begin();
i != mpVars.end(); ++
i) {
1223 const std::vector<AlignmentUserVariables *> &mpVars)
const {
1224 bool allOk = (mpVars.size() == alis.size());
1225 std::vector<AlignmentUserVariables *>::const_iterator iUser = mpVars.begin();
1226 for (
auto iAli = alis.cbegin(); iAli != alis.cend() && iUser != mpVars.end(); ++iAli, ++iUser) {
1230 if (!mpVarNew || !mpVarOld || mpVarOld->
size() != mpVarNew->
size()) {
1243 template <
typename GlobalDerivativeMatrix>
1245 const std::vector<float> &globalDerivativesy,
1246 Eigen::MatrixBase<GlobalDerivativeMatrix> &aGlobalDerivativesM) {
1247 static_assert(GlobalDerivativeMatrix::RowsAtCompileTime == 2,
"global derivative matrix must have two rows");
1249 for (
size_t i = 0;
i < globalDerivativesx.size(); ++
i) {
1250 aGlobalDerivativesM(0,
i) = globalDerivativesx[
i];
1251 aGlobalDerivativesM(1,
i) = globalDerivativesy[
i];
1257 typename LocalDerivativeMatrix,
1258 typename ResidualMatrix,
1259 typename GlobalDerivativeMatrix>
1261 Eigen::MatrixBase<LocalDerivativeMatrix> &aLocalDerivativesM,
1262 Eigen::MatrixBase<ResidualMatrix> &aHitResidualsM,
1263 Eigen::MatrixBase<GlobalDerivativeMatrix> &aGlobalDerivativesM)
const {
1265 "'aLocalDerivativesM' and 'aHitResidualsM' must have the "
1266 "same underlying scalar type");
1268 "'aLocalDerivativesM' and 'aGlobalDerivativesM' must have the "
1269 "same underlying scalar type");
1271 Eigen::SelfAdjointEigenSolver<typename CovarianceMatrix::PlainObject> myDiag{aHitCovarianceM};
1273 auto aTranfoToDiagonalSystemInv =
1274 myDiag.eigenvectors().transpose().template cast<typename LocalDerivativeMatrix::Scalar>();
1276 aHitCovarianceM = myDiag.eigenvalues().asDiagonal();
1277 aLocalDerivativesM = aTranfoToDiagonalSystemInv * aLocalDerivativesM;
1278 aHitResidualsM = aTranfoToDiagonalSystemInv * aHitResidualsM;
1279 if (aGlobalDerivativesM.size() > 0) {
1281 aGlobalDerivativesM = aTranfoToDiagonalSystemInv * aGlobalDerivativesM;
1286 template <
typename CovarianceMatrix,
typename Res
idualMatrix,
typename LocalDerivativeMatrix>
1289 unsigned int iVirtualMeas,
1290 Eigen::MatrixBase<CovarianceMatrix> &aHitCovarianceM,
1291 Eigen::MatrixBase<ResidualMatrix> &aHitResidualsM,
1292 Eigen::MatrixBase<LocalDerivativeMatrix> &aLocalDerivativesM) {
1295 const unsigned int xIndex = iVirtualMeas + refTrajPtr->numberOfHitMeas();
1297 aHitCovarianceM(0, 0) = refTrajPtr->measurementErrors()[xIndex][xIndex];
1298 aHitResidualsM(0, 0) = refTrajPtr->measurements()[xIndex];
1300 const auto &locDerivMatrix = refTrajPtr->derivatives();
1301 for (
int i = 0;
i < locDerivMatrix.num_col(); ++
i) {
1302 aLocalDerivativesM(0,
i) = locDerivMatrix[xIndex][
i];
1307 template <
typename CovarianceMatrix,
typename Res
idualMatrix,
typename LocalDerivativeMatrix>
1309 unsigned int iTrajHit,
1310 Eigen::MatrixBase<CovarianceMatrix> &aHitCovarianceM,
1311 Eigen::MatrixBase<ResidualMatrix> &aHitResidualsM,
1312 Eigen::MatrixBase<LocalDerivativeMatrix> &aLocalDerivativesM) {
1315 const unsigned int xIndex = iTrajHit * 2;
1316 const unsigned int yIndex = iTrajHit * 2 + 1;
1318 aHitCovarianceM(0, 0) = refTrajPtr->measurementErrors()[xIndex][xIndex];
1319 aHitCovarianceM(0, 1) = refTrajPtr->measurementErrors()[xIndex][yIndex];
1320 aHitCovarianceM(1, 0) = refTrajPtr->measurementErrors()[yIndex][xIndex];
1321 aHitCovarianceM(1, 1) = refTrajPtr->measurementErrors()[yIndex][yIndex];
1323 aHitResidualsM(0, 0) = refTrajPtr->measurements()[xIndex] - refTrajPtr->trajectoryPositions()[xIndex];
1324 aHitResidualsM(1, 0) = refTrajPtr->measurements()[yIndex] - refTrajPtr->trajectoryPositions()[yIndex];
1326 const auto &locDerivMatrix = refTrajPtr->derivatives();
1327 for (
int i = 0;
i < locDerivMatrix.num_col(); ++
i) {
1328 aLocalDerivativesM(0,
i) = locDerivMatrix[xIndex][
i];
1329 aLocalDerivativesM(1,
i) = locDerivMatrix[yIndex][
i];
1335 unsigned int iTrajHit,
1336 const std::vector<int> &globalLabels,
1337 const std::vector<float> &globalDerivativesX,
1338 const std::vector<float> &globalDerivativesY) {
1341 if ((aRecHit)->dimension() == 1) {
1342 return this->
callMille1D(refTrajPtr, iTrajHit, globalLabels, globalDerivativesX);
1344 return this->
callMille2D(refTrajPtr, iTrajHit, globalLabels, globalDerivativesX, globalDerivativesY);
1350 unsigned int iTrajHit,
1351 const std::vector<int> &globalLabels,
1352 const std::vector<float> &globalDerivativesX) {
1354 const unsigned int xIndex = iTrajHit * 2;
1358 const int nLocal = locDerivMatrix.num_col();
1359 std::vector<float> localDerivatives(nLocal);
1360 for (
unsigned int i = 0;
i < localDerivatives.size(); ++
i) {
1361 localDerivatives[
i] = locDerivMatrix[xIndex][
i];
1365 float residX = refTrajPtr->measurements()[xIndex] - refTrajPtr->trajectoryPositions()[xIndex];
1366 float hitErrX = TMath::Sqrt(refTrajPtr->measurementErrors()[xIndex][xIndex]);
1369 const int nGlobal = globalDerivativesX.size();
1374 nLocal, &(localDerivatives[0]), nGlobal, &(globalDerivativesX[0]), &(globalLabels[0]), residX, hitErrX);
1378 aRecHit, &(localDerivatives[0]), nLocal, &(globalDerivativesX[0]), nGlobal, &(globalLabels[0]));
1379 theMonitor->fillResiduals(aRecHit, refTrajPtr->trajectoryStates()[iTrajHit], iTrajHit, residX, hitErrX,
false);
1387 unsigned int iTrajHit,
1388 const std::vector<int> &globalLabels,
1389 const std::vector<float> &globalDerivativesx,
1390 const std::vector<float> &globalDerivativesy) {
1393 if ((aRecHit)->dimension() != 2) {
1394 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::callMille2D"
1395 <<
"You try to call method for 2D hits for a " << (aRecHit)->
dimension()
1396 <<
"D Hit. Hit gets ignored!";
1400 Eigen::Matrix<double, 2, 2> aHitCovarianceM;
1401 Eigen::Matrix<float, 2, 1> aHitResidualsM;
1402 Eigen::Matrix<float, 2, Eigen::Dynamic> aLocalDerivativesM{2, refTrajPtr->derivatives().num_col()};
1404 this->
addRefTrackData2D(refTrajPtr, iTrajHit, aHitCovarianceM, aHitResidualsM, aLocalDerivativesM);
1405 Eigen::Matrix<float, 2, Eigen::Dynamic> aGlobalDerivativesM{2, globalDerivativesx.size()};
1411 const double corr = aHitCovarianceM(0, 1) /
sqrt(aHitCovarianceM(0, 0) * aHitCovarianceM(1, 1));
1413 theMonitor->fillCorrelations2D(corr, aRecHit);
1415 switch (aRecHit->geographicalId().subdetId()) {
1419 this->
diagonalize(aHitCovarianceM, aLocalDerivativesM, aHitResidualsM, aGlobalDerivativesM);
1426 float newResidX = aHitResidualsM(0, 0);
1427 float newResidY = aHitResidualsM(1, 0);
1428 float newHitErrX = TMath::Sqrt(aHitCovarianceM(0, 0));
1429 float newHitErrY = TMath::Sqrt(aHitCovarianceM(1, 1));
1433 std::vector<float> newLocalDerivs(aLocalDerivativesM.size());
1434 Eigen::Map<Eigen::Matrix<float, 2, Eigen::Dynamic, Eigen::RowMajor> >(
1435 newLocalDerivs.data(), aLocalDerivativesM.rows(), aLocalDerivativesM.cols()) = aLocalDerivativesM;
1436 float *newLocalDerivsX = &(newLocalDerivs[0]);
1437 float *newLocalDerivsY = &(newLocalDerivs[aLocalDerivativesM.cols()]);
1441 std::vector<float> newGlobDerivs(aGlobalDerivativesM.size());
1442 Eigen::Map<Eigen::Matrix<float, 2, Eigen::Dynamic, Eigen::RowMajor> >(
1443 newGlobDerivs.data(), aGlobalDerivativesM.rows(), aGlobalDerivativesM.cols()) = aGlobalDerivativesM;
1444 float *newGlobDerivsX = &(newGlobDerivs[0]);
1445 float *newGlobDerivsY = &(newGlobDerivs[aGlobalDerivativesM.cols()]);
1447 const int nLocal = aLocalDerivativesM.cols();
1448 const int nGlobal = aGlobalDerivativesM.cols();
1450 if (diag && (newHitErrX > newHitErrY)) {
1454 std::swap(newLocalDerivsX, newLocalDerivsY);
1455 std::swap(newGlobDerivsX, newGlobDerivsY);
1460 theMille->mille(nLocal, newLocalDerivsX, nGlobal, newGlobDerivsX, &(globalLabels[0]), newResidX, newHitErrX);
1463 theMonitor->fillDerivatives(aRecHit, newLocalDerivsX, nLocal, newGlobDerivsX, nGlobal, &(globalLabels[0]));
1465 aRecHit, refTrajPtr->trajectoryStates()[iTrajHit], iTrajHit, newResidX, newHitErrX,
false);
1467 const bool isReal2DHit = this->
is2D(aRecHit);
1469 theMille->mille(nLocal, newLocalDerivsY, nGlobal, newGlobDerivsY, &(globalLabels[0]), newResidY, newHitErrY);
1471 theMonitor->fillDerivatives(aRecHit, newLocalDerivsY, nLocal, newGlobDerivsY, nGlobal, &(globalLabels[0]));
1473 aRecHit, refTrajPtr->trajectoryStates()[iTrajHit], iTrajHit, newResidY, newHitErrY,
true);
1477 return (isReal2DHit ? 2 : 1);
1482 unsigned int iVirtualMeas) {
1483 Eigen::Matrix<double, 1, 1> aHitCovarianceM;
1484 Eigen::Matrix<float, 1, 1> aHitResidualsM;
1485 Eigen::Matrix<float, 1, Eigen::Dynamic> aLocalDerivativesM{1, refTrajPtr->derivatives().num_col()};
1490 auto aGlobalDerivativesM = Eigen::Matrix<float, 1, 1>::Zero();
1492 float newResidX = aHitResidualsM(0, 0);
1493 float newHitErrX = TMath::Sqrt(aHitCovarianceM(0, 0));
1494 std::vector<float> newLocalDerivsX(aLocalDerivativesM.size());
1495 Eigen::Map<Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(
1496 newLocalDerivsX.data(), aLocalDerivativesM.rows(), aLocalDerivativesM.cols()) = aLocalDerivativesM;
1498 std::vector<float> newGlobDerivsX(aGlobalDerivativesM.size());
1499 Eigen::Map<Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >(
1500 newGlobDerivsX.data(), aGlobalDerivativesM.rows(), aGlobalDerivativesM.cols()) = aGlobalDerivativesM;
1502 const int nLocal = aLocalDerivativesM.cols();
1503 const int nGlobal = 0;
1505 theMille->mille(nLocal, newLocalDerivsX.data(), nGlobal, newGlobDerivsX.data(), &nGlobal, newResidX, newHitErrX);
1512 TsosVectorCollection::const_iterator iTsoses = lasBeamTsoses.begin();
1513 for (TkFittedLasBeamCollection::const_iterator iBeam = lasBeams.begin(), iEnd = lasBeams.end(); iBeam != iEnd;
1514 ++iBeam, ++iTsoses) {
1516 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addLaserData"
1517 <<
"Beam " << iBeam->getBeamId() <<
" with " << iBeam->parameters().size()
1518 <<
" parameters and " << iBeam->getData().size() <<
" hits.\n There are "
1519 << iTsoses->size() <<
" TSOSes.";
1521 this->
addLasBeam(eventInfo, *iBeam, *iTsoses);
1528 const std::vector<TrajectoryStateOnSurface> &tsoses) {
1530 std::vector<float> lasLocalDerivsX;
1533 for (
unsigned int iHit = 0; iHit < tsoses.size(); ++iHit) {
1540 lasLocalDerivsX.clear();
1547 for (
unsigned int nFitParams = 0; nFitParams < static_cast<unsigned int>(lasBeam.
parameters().size());
1551 lasLocalDerivsX.push_back(derivative);
1559 const float residual = hit.
localPosition().x() - tsoses[iHit].localPosition().x();
1561 const float error = 0.003;
1563 theMille->mille(lasLocalDerivsX.size(),
1564 &(lasLocalDerivsX[0]),
1577 const bool doOutputOnStdout(pxbSurveyCfg.
getParameter<
bool>(
"doOutputOnStdout"));
1578 if (doOutputOnStdout) {
1579 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey"
1580 <<
"# Output from addPxbSurvey follows below because "
1581 <<
"doOutputOnStdout is set to True";
1586 pxbSurveyCfg.
getParameter<
unsigned int>(
"toySurveySeed"));
1590 std::vector<SurveyPxbImageLocalFit> measurements;
1596 if (doOutputOnStdout) {
1597 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey"
1598 <<
"Module " <<
i <<
": ";
1623 fidpointvec.push_back(fidpoint0inSurf1frame);
1624 fidpointvec.push_back(fidpoint1inSurf1frame);
1625 fidpointvec.push_back(fidpoint2);
1626 fidpointvec.push_back(fidpoint3);
1636 a = measurements[
i].getLocalParameters();
1640 if (doOutputOnStdout) {
1641 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey"
1642 <<
"a: " << a[0] <<
", " << a[1] <<
", " << a[2] <<
", " << a[3]
1643 <<
" S= " <<
sqrt(a[2] * a[2] + a[3] * a[3]) <<
" phi= " << atan(a[3] / a[2])
1644 <<
" chi2= " << chi2 << std::endl;
1648 theMonitor->fillPxbSurveyHistsLocalPars(a[0], a[1],
sqrt(a[2] * a[2] + a[3] * a[3]), atan(a[3] / a[2]));
1653 theMille->mille((
int)measurements[
i].getLocalDerivsSize(),
1654 measurements[
i].getLocalDerivsPtr(
j),
1655 (
int)measurements[
i].getGlobalDerivsSize(),
1656 measurements[
i].getGlobalDerivsPtr(
j),
1657 measurements[
i].getGlobalDerivsLabelPtr(
j),
1658 measurements[
i].getResiduum(
j),
1659 measurements[
i].getSigma(
j));
1669 if (runRangeSelection.empty())
1672 const auto runRanges =
1675 return !(runRanges.empty());
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
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
unsigned int size() const
number of parameters
LocalPoint localPosition() const override
const align::RunNumber firstIOV_
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 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.
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
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
std::map< std::string, AlignPCLThreshold > threshold_map
const EventID & eventID() const
bool areEmptyParams(const align::Alignables &alignables) const
void increaseHitsY(unsigned int add=1)
increase hits for y-measurement
void endLuminosityBlock(const edm::EventSetup &) override
called at end of luminosity block
static constexpr auto TID
void buildUserVariables(const align::Alignables &alignables) const
add MillePedeVariables for each AlignmentParameters (exception if no parameters...)
TrajectoryFactoryBase::ReferenceTrajectoryCollection RefTrajColl
std::vector< ParameterSet > VParameterSet
std::unique_ptr< TrajectoryFactoryBase > theTrajectoryFactory
bool theDoSurveyPixelBarrel
std::unique_ptr< gbl::MilleBinary > theBinary
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
std::shared_ptr< PedeLabelerBase > thePedeLabels
std::vector< std::string > getExistingFormattedFiles(const std::vector< std::string > &plainFiles, const std::string &theDir)
auto const & tracks
cannot be loose
unsigned int addHitCount(const std::vector< AlignmentParameters * > &parVec, const std::vector< bool > &validHitVecY) const
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
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void writeMillePedeVariables(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr)
const bool ignoreFirstIOVCheck_
const bool ignoreHitsWithoutGlobalDerivatives_
void writeAlignableOriginalPositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable original (before misalignment) absolute positions
void addLasBeam(const EventInfo &eventInfo, const TkFittedLasBeam &lasBeam, const std::vector< TrajectoryStateOnSurface > &tsoses)
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
align::Alignables theAlignables
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
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
const AlgebraicVector & parameters(void) const
Get alignment parameters.
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
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.
virtual AlgebraicMatrix derivatives(const TrajectoryStateOnSurface &tsos, const AlignableDetOrUnitPtr &alidet) const =0
Get derivatives of selected parameters.
bool addHits(const align::Alignables &alis, const std::vector< AlignmentUserVariables * > &mpVars) const
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 writeOrigRigidBodyAlignmentParameters(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write RigidBodyAlignmentParameters as applied on top of original positions
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
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
tuple key
prepare the HTCondor submission files and eventually submit them
std::vector< AlignmentUserVariables * > readMillePedeVariables(const align::Alignables &alivec, const char *filename, int iter, int &ierr)
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
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
bool storeAlignments() override
Returns whether MP produced results to be stored.
void terminate() override
Called at end of job.
const bool skipGlobalPositionRcdCheck_
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.
std::vector< ConstRecHitPointer > ConstRecHitContainer
bool addHitStatistics(int fromLoop, const std::string &outFile, const std::vector< std::string > &inFiles) const
Log< level::Info, false > LogInfo
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) ...
const SiStripDetId & getDetId(void) const
virtual bool storeThresholds(const int &nRecords, const AlignPCLThresholds::threshold_map &thresholdMap)
void setUserVariables(AlignmentUserVariables *auv)
Set pointer to user variables.
int size(void) const
Get number of parameters.
std::vector< float > theFloatBufferX
void addUntrackedParameter(std::string const &name, T const &value)
std::vector< IntegratedCalibrationBase * > theCalibrations
Class to hold one picture of the BPix survey.
T getParameter(std::string const &) const
std::vector< value_t > localpars_t
ValidityInterval validityInterval() const
void writeAlignableAbsolutePositions(const align::Alignables &alivec, const char *filename, int iter, bool validCheck, int &ierr) override
write Alignable current absolute positions
std::vector< Alignable * > Alignables
void run(const edm::EventSetup &setup, const EventInfo &eventInfo) override
Run the algorithm on trajectories and tracks.
align::RunNumber lastProcessedRun_
const bool enforceSingleIOVInput_
~MillePedeAlignmentAlgorithm() override
Destructor.
MillePedeAlignmentAlgorithm(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
Constructor.
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
const edm::ESGetToken< AlignPCLThresholds, AlignPCLThresholdsRcd > aliThrToken_
std::vector< float > theFloatBufferY
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
std::string fullPath() const
static const count_t nMsrmts
EventSetupRecordKey key() const override
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
Log< level::Warning, false > LogWarning
const std::vector< SiStripLaserRecHit2D > & getData(void) const
access the collection of hits
const align::RunRanges uniqueRunRanges_
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)
bool read(align::Alignables &alignables, bool setUserVars)
Alignable * mother() const
Return pointer to container alignable (if any)
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
void throwException(const std::string &message, const std::string &methodName)
bool setAllDefault(unsigned int nParam)
set default values for all data concerning nParam (false if nParam out of range)
static constexpr auto TEC
std::unique_ptr< Mille > theMille