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.empty()) {
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.empty())
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.empty() || 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().empty()) {
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 );
568 if (aGblTrajectory.isValid() && aGblTrajectory.getNumPoints() >=
theMinNumHits) aGblTrajectory.milleOut(*
theBinary);
570 if (refTrajPtr->gblInput().size() == 2) {
572 GblTrajectory aGblTrajectory( refTrajPtr->gblInput(), refTrajPtr->gblExtDerivatives(), refTrajPtr->gblExtMeasurements(), refTrajPtr->gblExtPrecisions() );
574 if (aGblTrajectory.isValid() && aGblTrajectory.getNumPoints() >=
theMinNumHits) aGblTrajectory.milleOut(*
theBinary);
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() :
nullptr);
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())) {
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.empty()) {
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 (
const auto& iAli: alignables) {
1106 for (
int i = 0;
i < parVec.num_row(); ++
i) {
1107 if (parVec[
i] != 0.)
return false;
1108 for (
int j =
i; j < parCov.num_col(); ++j) {
1109 if (parCov[
i][j] != 0.)
return false;
1124 if (outFilePlain.empty()) {
1125 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" 1126 <<
"treeFile parameter empty => skip writing for 'loop' " <<
loop;
1137 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" 1138 <<
"Problem " << ioerr <<
" in writeAlignableOriginalPositions";
1141 }
else if (loop == 1) {
1143 const std::vector<std::string> inFiles
1145 const std::vector<std::string> binFiles
1147 if (inFiles.size() != binFiles.size()) {
1148 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" 1149 <<
"'vstring mergeTreeFiles' and 'vstring mergeBinaryFiles' " 1150 <<
"differ in size";
1157 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" 1158 <<
"Problem " << ioerr <<
" writing MillePedeVariables";
1164 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" <<
"Problem " << ioerr
1165 <<
" in writeOrigRigidBodyAlignmentParameters, " <<
loop;
1170 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::doIO" <<
"Problem " << ioerr
1171 <<
" in writeAlignableAbsolutePositions, " <<
loop;
1181 for (
const auto& iAli: alis) {
1184 throw cms::Exception(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::buildUserVariables" 1185 <<
"No parameters for alignable";
1189 for (
unsigned int iPar = 0; iPar < userVars->
size(); ++iPar) {
1198 thePedeLabels->alignableTracker()->objectIdProvider().typeToName(iAli->alignableObjectId()));
1207 if (mode ==
"full") {
1209 }
else if (mode ==
"mille") {
1211 }
else if (mode ==
"pede") {
1213 }
else if (mode ==
"pedeSteer") {
1215 }
else if (mode ==
"pedeRun") {
1217 }
else if (mode ==
"pedeRead") {
1222 <<
"Unknown mode '" << mode
1223 <<
"', use 'full', 'mille', 'pede', 'pedeRun', 'pedeSteer' or 'pedeRead'.";
1230 const std::vector<std::string> &inFiles)
const 1235 for (std::vector<std::string>::const_iterator iFile = inFiles.begin();
1236 iFile != inFiles.end(); ++iFile) {
1238 const std::vector<AlignmentUserVariables*> mpVars =
1241 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addHitStatistics" 1242 <<
"Error " << ierr <<
" reading from " << inFile
1243 <<
", tree " << fromIov <<
", or problems in addHits";
1246 for (std::vector<AlignmentUserVariables*>::const_iterator
i = mpVars.begin();
1247 i != mpVars.end(); ++
i) {
1257 const std::vector<AlignmentUserVariables*> &mpVars)
const 1259 bool allOk = (mpVars.size() == alis.size());
1260 std::vector<AlignmentUserVariables*>::const_iterator iUser = mpVars.begin();
1261 for (
auto iAli = alis.cbegin(); iAli != alis.cend() && iUser != mpVars.end(); ++iAli, ++iUser) {
1265 if (!mpVarNew || !mpVarOld || mpVarOld->
size() != mpVarNew->
size()) {
1278 template <
typename GlobalDerivativeMatrix>
1280 const std::vector<float> &globalDerivativesy,
1281 Eigen::MatrixBase<GlobalDerivativeMatrix>& aGlobalDerivativesM)
1283 static_assert(GlobalDerivativeMatrix::RowsAtCompileTime == 2,
1284 "global derivative matrix must have two rows");
1286 for (
size_t i = 0;
i < globalDerivativesx.size(); ++
i) {
1287 aGlobalDerivativesM(0,
i) = globalDerivativesx[
i];
1288 aGlobalDerivativesM(1,
i) = globalDerivativesy[
i];
1294 typename LocalDerivativeMatrix,
1295 typename ResidualMatrix,
1296 typename GlobalDerivativeMatrix>
1298 (Eigen::MatrixBase<CovarianceMatrix>& aHitCovarianceM,
1299 Eigen::MatrixBase<LocalDerivativeMatrix>& aLocalDerivativesM,
1300 Eigen::MatrixBase<ResidualMatrix>& aHitResidualsM,
1301 Eigen::MatrixBase<GlobalDerivativeMatrix>& aGlobalDerivativesM)
const 1305 "'aLocalDerivativesM' and 'aHitResidualsM' must have the " 1306 "same underlying scalar type");
1309 "'aLocalDerivativesM' and 'aGlobalDerivativesM' must have the " 1310 "same underlying scalar type");
1312 Eigen::SelfAdjointEigenSolver<typename CovarianceMatrix::PlainObject> myDiag{aHitCovarianceM};
1314 auto aTranfoToDiagonalSystemInv =
1315 myDiag.eigenvectors().transpose().template cast<typename LocalDerivativeMatrix::Scalar>();
1317 aHitCovarianceM = myDiag.eigenvalues().asDiagonal();
1318 aLocalDerivativesM = aTranfoToDiagonalSystemInv * aLocalDerivativesM;
1319 aHitResidualsM = aTranfoToDiagonalSystemInv * aHitResidualsM;
1320 if (aGlobalDerivativesM.size() > 0) {
1322 aGlobalDerivativesM = aTranfoToDiagonalSystemInv * aGlobalDerivativesM;
1328 typename ResidualMatrix,
1329 typename LocalDerivativeMatrix>
1332 unsigned int iVirtualMeas,
1333 Eigen::MatrixBase<CovarianceMatrix>& aHitCovarianceM,
1334 Eigen::MatrixBase<ResidualMatrix>& aHitResidualsM,
1335 Eigen::MatrixBase<LocalDerivativeMatrix>& aLocalDerivativesM)
1339 const unsigned int xIndex = iVirtualMeas + refTrajPtr->numberOfHitMeas();
1341 aHitCovarianceM(0,0)=refTrajPtr->measurementErrors()[xIndex][xIndex];
1342 aHitResidualsM(0,0)= refTrajPtr->measurements()[xIndex];
1344 const auto& locDerivMatrix = refTrajPtr->derivatives();
1345 for (
int i = 0;
i < locDerivMatrix.num_col(); ++
i) {
1346 aLocalDerivativesM(0,
i) = locDerivMatrix[xIndex][
i];
1352 typename ResidualMatrix,
1353 typename LocalDerivativeMatrix>
1356 unsigned int iTrajHit,
1357 Eigen::MatrixBase<CovarianceMatrix>& aHitCovarianceM,
1358 Eigen::MatrixBase<ResidualMatrix>& aHitResidualsM,
1359 Eigen::MatrixBase<LocalDerivativeMatrix>& aLocalDerivativesM)
1363 const unsigned int xIndex = iTrajHit*2;
1364 const unsigned int yIndex = iTrajHit*2+1;
1366 aHitCovarianceM(0,0)=refTrajPtr->measurementErrors()[xIndex][xIndex];
1367 aHitCovarianceM(0,1)=refTrajPtr->measurementErrors()[xIndex][yIndex];
1368 aHitCovarianceM(1,0)=refTrajPtr->measurementErrors()[yIndex][xIndex];
1369 aHitCovarianceM(1,1)=refTrajPtr->measurementErrors()[yIndex][yIndex];
1371 aHitResidualsM(0,0)= refTrajPtr->measurements()[xIndex] - refTrajPtr->trajectoryPositions()[xIndex];
1372 aHitResidualsM(1,0)= refTrajPtr->measurements()[yIndex] - refTrajPtr->trajectoryPositions()[yIndex];
1374 const auto& locDerivMatrix = refTrajPtr->derivatives();
1375 for (
int i = 0;
i < locDerivMatrix.num_col(); ++
i) {
1376 aLocalDerivativesM(0,
i) = locDerivMatrix[xIndex][
i];
1377 aLocalDerivativesM(1,
i) = locDerivMatrix[yIndex][
i];
1384 unsigned int iTrajHit,
const std::vector<int> &globalLabels,
1385 const std::vector<float> &globalDerivativesX,
1386 const std::vector<float> &globalDerivativesY)
1390 if((aRecHit)->dimension() == 1) {
1391 return this->
callMille1D(refTrajPtr, iTrajHit, globalLabels, globalDerivativesX);
1393 return this->
callMille2D(refTrajPtr, iTrajHit, globalLabels,
1394 globalDerivativesX, globalDerivativesY);
1402 unsigned int iTrajHit,
const std::vector<int> &globalLabels,
1403 const std::vector<float> &globalDerivativesX)
1406 const unsigned int xIndex = iTrajHit*2;
1410 const int nLocal = locDerivMatrix.num_col();
1411 std::vector<float> localDerivatives(nLocal);
1412 for (
unsigned int i = 0;
i < localDerivatives.size(); ++
i) {
1413 localDerivatives[
i] = locDerivMatrix[xIndex][
i];
1417 float residX = refTrajPtr->measurements()[xIndex] - refTrajPtr->trajectoryPositions()[xIndex];
1418 float hitErrX = TMath::Sqrt(refTrajPtr->measurementErrors()[xIndex][xIndex]);
1421 const int nGlobal = globalDerivativesX.size();
1425 theMille->mille(nLocal, &(localDerivatives[0]), nGlobal, &(globalDerivativesX[0]),
1426 &(globalLabels[0]), residX, hitErrX);
1429 theMonitor->fillDerivatives(aRecHit, &(localDerivatives[0]), nLocal,
1430 &(globalDerivativesX[0]), nGlobal, &(globalLabels[0]));
1431 theMonitor->fillResiduals(aRecHit, refTrajPtr->trajectoryStates()[iTrajHit],
1432 iTrajHit, residX, hitErrX,
false);
1441 unsigned int iTrajHit,
const std::vector<int> &globalLabels,
1442 const std::vector<float> &globalDerivativesx,
1443 const std::vector<float> &globalDerivativesy)
1447 if((aRecHit)->dimension() != 2) {
1448 edm::LogError(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::callMille2D" 1449 <<
"You try to call method for 2D hits for a " 1451 <<
"D Hit. Hit gets ignored!";
1455 Eigen::Matrix<double, 2, 2> aHitCovarianceM;
1456 Eigen::Matrix<float, 2, 1> aHitResidualsM;
1457 Eigen::Matrix<float, 2, Eigen::Dynamic>
1458 aLocalDerivativesM{2, refTrajPtr->derivatives().num_col()};
1460 this->
addRefTrackData2D(refTrajPtr, iTrajHit, aHitCovarianceM,aHitResidualsM,aLocalDerivativesM);
1461 Eigen::Matrix<float, 2, Eigen::Dynamic>
1462 aGlobalDerivativesM{2, globalDerivativesx.size()};
1468 const double corr = aHitCovarianceM(0,1) /
sqrt(aHitCovarianceM(0,0) * aHitCovarianceM(1,1));
1471 switch(aRecHit->geographicalId().subdetId()) {
1475 this->
diagonalize(aHitCovarianceM, aLocalDerivativesM, aHitResidualsM, aGlobalDerivativesM);
1482 float newResidX = aHitResidualsM(0,0);
1483 float newResidY = aHitResidualsM(1,0);
1484 float newHitErrX = TMath::Sqrt(aHitCovarianceM(0,0));
1485 float newHitErrY = TMath::Sqrt(aHitCovarianceM(1,1));
1489 std::vector<float> newLocalDerivs(aLocalDerivativesM.size());
1490 Eigen::Map<Eigen::Matrix<float, 2, Eigen::Dynamic, Eigen::RowMajor> >
1491 (newLocalDerivs.data(),
1492 aLocalDerivativesM.rows(),
1493 aLocalDerivativesM.cols()) = aLocalDerivativesM;
1494 float* newLocalDerivsX = &(newLocalDerivs[0]);
1495 float* newLocalDerivsY = &(newLocalDerivs[aLocalDerivativesM.cols()]);
1499 std::vector<float> newGlobDerivs(aGlobalDerivativesM.size());
1500 Eigen::Map<Eigen::Matrix<float, 2, Eigen::Dynamic, Eigen::RowMajor> >
1501 (newGlobDerivs.data(),
1502 aGlobalDerivativesM.rows(),
1503 aGlobalDerivativesM.cols()) = aGlobalDerivativesM;
1504 float* newGlobDerivsX = &(newGlobDerivs[0]);
1505 float* newGlobDerivsY = &(newGlobDerivs[aGlobalDerivativesM.cols()]);
1507 const int nLocal = aLocalDerivativesM.cols();
1508 const int nGlobal = aGlobalDerivativesM.cols();
1510 if (diag && (newHitErrX > newHitErrY)) {
1514 std::swap(newLocalDerivsX, newLocalDerivsY);
1515 std::swap(newGlobDerivsX, newGlobDerivsY);
1520 theMille->mille(nLocal, newLocalDerivsX, nGlobal, newGlobDerivsX,
1521 &(globalLabels[0]), newResidX, newHitErrX);
1524 theMonitor->fillDerivatives(aRecHit, newLocalDerivsX, nLocal, newGlobDerivsX,
1525 nGlobal, &(globalLabels[0]));
1526 theMonitor->fillResiduals(aRecHit, refTrajPtr->trajectoryStates()[iTrajHit],
1527 iTrajHit, newResidX, newHitErrX,
false);
1529 const bool isReal2DHit = this->
is2D(aRecHit);
1531 theMille->mille(nLocal, newLocalDerivsY, nGlobal, newGlobDerivsY,
1532 &(globalLabels[0]), newResidY, newHitErrY);
1534 theMonitor->fillDerivatives(aRecHit, newLocalDerivsY, nLocal, newGlobDerivsY,
1535 nGlobal, &(globalLabels[0]));
1536 theMonitor->fillResiduals(aRecHit, refTrajPtr->trajectoryStates()[iTrajHit],
1537 iTrajHit, newResidY, newHitErrY,
true);
1541 return (isReal2DHit ? 2 : 1);
1548 Eigen::Matrix<double, 1, 1> aHitCovarianceM;
1549 Eigen::Matrix<float, 1, 1> aHitResidualsM;
1550 Eigen::Matrix<float, 1, Eigen::Dynamic>
1551 aLocalDerivativesM{1, refTrajPtr->derivatives().num_col()};
1556 auto aGlobalDerivativesM = Eigen::Matrix<float, 1, 1>::Zero();
1558 float newResidX = aHitResidualsM(0,0);
1559 float newHitErrX = TMath::Sqrt(aHitCovarianceM(0,0));
1560 std::vector<float> newLocalDerivsX(aLocalDerivativesM.size());
1561 Eigen::Map<Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >
1562 (newLocalDerivsX.data(),
1563 aLocalDerivativesM.rows(),
1564 aLocalDerivativesM.cols()) = aLocalDerivativesM;
1566 std::vector<float> newGlobDerivsX(aGlobalDerivativesM.size());
1567 Eigen::Map<Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> >
1568 (newGlobDerivsX.data(),
1569 aGlobalDerivativesM.rows(),
1570 aGlobalDerivativesM.cols()) = aGlobalDerivativesM;
1572 const int nLocal = aLocalDerivativesM.cols();
1573 const int nGlobal = 0;
1575 theMille->mille(nLocal, newLocalDerivsX.data(), nGlobal, newGlobDerivsX.data(),
1576 &nGlobal, newResidX, newHitErrX);
1584 TsosVectorCollection::const_iterator iTsoses = lasBeamTsoses.begin();
1585 for(TkFittedLasBeamCollection::const_iterator iBeam = lasBeams.begin(), iEnd = lasBeams.end();
1586 iBeam != iEnd; ++iBeam, ++iTsoses){
1588 edm::LogInfo(
"Alignment") <<
"@SUB=MillePedeAlignmentAlgorithm::addLaserData" 1589 <<
"Beam " << iBeam->getBeamId() <<
" with " 1590 << iBeam->parameters().size() <<
" parameters and " 1591 << iBeam->getData().size() <<
" hits.\n There are " 1592 << iTsoses->size() <<
" TSOSes.";
1594 this->
addLasBeam(eventInfo, *iBeam, *iTsoses);
1601 const std::vector<TrajectoryStateOnSurface> &tsoses)
1604 std::vector<float> lasLocalDerivsX;
1607 for (
unsigned int iHit = 0; iHit < tsoses.size(); ++iHit) {
1608 if (!tsoses[iHit].isValid())
continue;
1613 lasLocalDerivsX.clear();
1618 tsoses[iHit], lasAli, lasAli,
1621 for (
unsigned int nFitParams = 0;
1622 nFitParams < static_cast<unsigned int>(lasBeam.
parameters().size());
1626 lasLocalDerivsX.push_back(derivative);
1634 const float residual = hit.
localPosition().x() - tsoses[iHit].localPosition().x();
1636 const float error = 0.003;
1648 const bool doOutputOnStdout(pxbSurveyCfg.
getParameter<
bool>(
"doOutputOnStdout"));
1649 if (doOutputOnStdout) {
1651 <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey" 1652 <<
"# Output from addPxbSurvey follows below because " 1653 <<
"doOutputOnStdout is set to True";
1661 std::vector<SurveyPxbImageLocalFit> measurements;
1668 if (doOutputOnStdout) {
1670 <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey" 1671 <<
"Module " <<
i <<
": ";
1696 fidpointvec.push_back(fidpoint0inSurf1frame);
1697 fidpointvec.push_back(fidpoint1inSurf1frame);
1698 fidpointvec.push_back(fidpoint2);
1699 fidpointvec.push_back(fidpoint3);
1710 a = measurements[
i].getLocalParameters();
1714 if (doOutputOnStdout)
1717 <<
"@SUB=MillePedeAlignmentAlgorithm::addPxbSurvey" 1718 <<
"a: " << a[0] <<
", " << a[1] <<
", " << a[2] <<
", " << a[3]
1719 <<
" S= " <<
sqrt(a[2]*a[2]+a[3]*a[3])
1720 <<
" phi= " << atan(a[3]/a[2])
1721 <<
" chi2= " << chi2 << std::endl;
1726 theMonitor->fillPxbSurveyHistsLocalPars(a[0],a[1],
sqrt(a[2]*a[2]+a[3]*a[3]),atan(a[3]/a[2]));
1732 theMille->mille((
int)measurements[
i].getLocalDerivsSize(),
1733 measurements[
i].getLocalDerivsPtr(j),
1734 (
int)measurements[
i].getGlobalDerivsSize(),
1735 measurements[
i].getGlobalDerivsPtr(j),
1736 measurements[
i].getGlobalDerivsLabelPtr(j),
1737 measurements[
i].getResiduum(j),
1738 measurements[
i].getSigma(j));
1747 const auto runRangeSelection =
1750 if (runRangeSelection.empty())
return false;
1752 const auto runRanges =
1756 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
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
unsigned int size() const
number of parameters
void resetParameters(void)
reset parameters, correlations, user variables
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.
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
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
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
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
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)
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
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.
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
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
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
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
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
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
std::map< std::string, AlignPCLThreshold > threshold_map
void run(const edm::EventSetup &setup, const EventInfo &eventInfo) override
Run the algorithm on trajectories and tracks.
LocalPoint localPosition() const override
align::RunNumber lastProcessedRun_
MillePedeAlignmentAlgorithm(const edm::ParameterSet &cfg)
Constructor.
const bool enforceSingleIOVInput_
~MillePedeAlignmentAlgorithm() override
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
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_
std::vector< std::vector< TrajectoryStateOnSurface > > TsosVectorCollection
EventSetupRecordKey key() const override
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.
bool read(align::Alignables &alignables, bool setUserVars)
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