85 std::map<std::string,std::array<float, 6 > > cutoffs_;
86 std::map<std::string,std::array<float, 6 > > significances_;
87 std::map<std::string,std::array<float, 6 > > thresholds_;
88 std::map<std::string,std::array<float, 6 > > errors_;
90 std::vector<std::string> alignables_ =
theThresholds_->getAlignableList();
91 for (
auto &ali : alignables_){
99 std::ifstream resFile;
102 if (resFile.is_open()) {
103 edm::LogInfo(
"MillePedeFileReader") <<
"Reading millepede result-file";
106 getline(resFile, line);
108 while (getline(resFile, line)) {
109 std::istringstream iss(line);
111 std::vector<std::string> tokens;
113 while (iss >> token) {
114 tokens.push_back(token);
117 if (tokens.size() > 4 ) {
119 auto alignableLabel = std::stoul(tokens[0]);
120 auto alignableIndex = alignableLabel % 10 - 1;
121 const auto alignable =
pedeLabeler_->alignableFromLabel(alignableLabel);
123 double ObsMove = std::stof(tokens[3]) *
multiplier_[alignableIndex];
124 double ObsErr = std::stof(tokens[4]) *
multiplier_[alignableIndex];
126 auto det =
getHLS(alignable);
127 int detIndex =
static_cast<int>(det);
134 Xobs_[detIndex] = ObsMove;
138 Yobs_[detIndex] = ObsMove;
142 Zobs_[detIndex] = ObsMove;
146 tXobs_[detIndex] = ObsMove;
150 tYobs_[detIndex] = ObsMove;
154 tZobs_[detIndex] = ObsMove;
158 edm::LogError(
"MillePedeFileReader") <<
"Currently not able to handle DOF " << coord
166 edm::LogVerbatim(
"MillePedeFileReader")<<
" alignableLabel: "<< alignableLabel <<
" with alignableIndex "<<alignableIndex <<
" detIndex"<< detIndex <<
"\n" 167 <<
" i.e. detLabel: "<< detLabel <<
" ("<< coord <<
")\n" 168 <<
" has movement: "<< ObsMove <<
" +/- "<< ObsErr <<
"\n" 169 <<
" cutoff (cutoffs_["<< detLabel <<
"]["<< coord <<
"]): "<< cutoffs_[detLabel][alignableIndex] <<
"\n" 170 <<
" significance (significances_["<< detLabel <<
"]["<< coord <<
"]): "<< significances_[detLabel][alignableIndex] <<
"\n" 171 <<
" error thresolds (errors_["<< detLabel <<
"]["<< coord <<
"]): "<< errors_[detLabel][alignableIndex] <<
"\n" 172 <<
" max movement (thresholds_["<< detLabel <<
"]["<< coord <<
"]): "<< thresholds_[detLabel][alignableIndex] <<
"\n" 173 <<
"============="<< std::endl;
175 if (
std::abs(ObsMove) > thresholds_[detLabel][alignableIndex]) {
177 <<
" Exceeding maximum thresholds for movement: "<<
std::abs(ObsMove)<<
" for"<< detLabel <<
"("<<coord<<
")" ;
181 }
else if (
std::abs(ObsMove) > cutoffs_[detLabel][alignableIndex]) {
183 if (
std::abs(ObsErr) > errors_[detLabel][alignableIndex]) {
185 <<
" Exceeding maximum thresholds for error: "<<
std::abs(ObsErr)<<
" for"<< detLabel <<
"("<<coord<<
")" ;
189 if (
std::abs(ObsMove/ObsErr) < significances_[detLabel][alignableIndex]) {
194 edm::LogInfo(
"MillePedeFileReader")<<
"This correction: "<<ObsMove<<
"+/-" <<ObsErr<<
" for "<< detLabel <<
"("<<coord<<
") will trigger a new Tracker Alignment payload!";
199 edm::LogError(
"MillePedeFileReader") <<
"Could not read millepede result-file.";
std::array< double, 6 > tYobs_
std::array< double, 6 > tXobs_
std::array< double, 6 > YobsErr_
PclHLS getHLS(const Alignable *)
const std::shared_ptr< const AlignPCLThresholds > theThresholds_
std::array< double, 6 > tZobs_
std::array< double, 6 > tXobsErr_
std::array< double, 6 > tYobsErr_
std::array< double, 6 > Yobs_
Abs< T >::type abs(const T &t)
std::array< double, 6 > tZobsErr_
std::string getStringFromHLS(PclHLS HLS)
const std::string millePedeResFile_
std::array< double, 6 > Zobs_
std::array< double, 6 > Xobs_
const std::shared_ptr< const PedeLabelerBase > pedeLabeler_
std::array< double, 6 > ZobsErr_
std::array< double, 6 > XobsErr_
static std::array< double, 6 > multiplier_