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_){
100 std::ifstream resFile;
103 if (resFile.is_open()) {
104 edm::LogInfo(
"MillePedeFileReader") <<
"Reading millepede result-file";
107 getline(resFile, line);
109 while (getline(resFile, line)) {
110 std::istringstream iss(line);
112 std::vector<std::string> tokens;
114 while (iss >> token) {
115 tokens.push_back(token);
118 if (tokens.size() > 4 ) {
120 auto alignableLabel = std::stoul(tokens[0]);
121 auto alignableIndex = alignableLabel % 10 - 1;
122 const auto alignable =
pedeLabeler_->alignableFromLabel(alignableLabel);
124 double ObsMove = std::stof(tokens[3]) *
multiplier_[alignableIndex];
125 double ObsErr = std::stof(tokens[4]) *
multiplier_[alignableIndex];
127 auto det =
getHLS(alignable);
128 int detIndex =
static_cast<int>(det);
135 Xobs_[detIndex] = ObsMove;
139 Yobs_[detIndex] = ObsMove;
143 Zobs_[detIndex] = ObsMove;
147 tXobs_[detIndex] = ObsMove;
151 tYobs_[detIndex] = ObsMove;
155 tZobs_[detIndex] = ObsMove;
159 edm::LogError(
"MillePedeFileReader") <<
"Currently not able to handle DOF " << coord
167 edm::LogVerbatim(
"MillePedeFileReader")<<
" alignableLabel: "<< alignableLabel <<
" with alignableIndex "<<alignableIndex <<
" detIndex"<< detIndex <<
"\n" 168 <<
" i.e. detLabel: "<< detLabel <<
" ("<< coord <<
")\n" 169 <<
" has movement: "<< ObsMove <<
" +/- "<< ObsErr <<
"\n" 170 <<
" cutoff (cutoffs_["<< detLabel <<
"]["<< coord <<
"]): "<< cutoffs_[detLabel][alignableIndex] <<
"\n" 171 <<
" significance (significances_["<< detLabel <<
"]["<< coord <<
"]): "<< significances_[detLabel][alignableIndex] <<
"\n" 172 <<
" error thresolds (errors_["<< detLabel <<
"]["<< coord <<
"]): "<< errors_[detLabel][alignableIndex] <<
"\n" 173 <<
" max movement (thresholds_["<< detLabel <<
"]["<< coord <<
"]): "<< thresholds_[detLabel][alignableIndex] <<
"\n" 174 <<
"============="<< std::endl;
176 if (
std::abs(ObsMove) > thresholds_[detLabel][alignableIndex]) {
178 <<
" Exceeding maximum thresholds for movement: "<<
std::abs(ObsMove)<<
" for"<< detLabel <<
"("<<coord<<
")" ;
182 }
else if (
std::abs(ObsMove) > cutoffs_[detLabel][alignableIndex]) {
184 if (
std::abs(ObsErr) > errors_[detLabel][alignableIndex]) {
186 <<
" Exceeding maximum thresholds for error: "<<
std::abs(ObsErr)<<
" for"<< detLabel <<
"("<<coord<<
")" ;
190 if (
std::abs(ObsMove/ObsErr) < significances_[detLabel][alignableIndex]) {
195 edm::LogInfo(
"MillePedeFileReader")<<
"This correction: "<<ObsMove<<
"+/-" <<ObsErr<<
" for "<< detLabel <<
"("<<coord<<
") will trigger a new Tracker Alignment payload!";
200 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_