19 millePedeLogFile_(config.getParameter<std::
string>(
"millePedeLogFile")),
20 millePedeResFile_(config.getParameter<std::
string>(
"millePedeResFile")),
22 sigCut_ (config.getParameter<double>(
"sigCut")),
23 Xcut_ (config.getParameter<double>(
"Xcut")),
24 tXcut_ (config.getParameter<double>(
"tXcut")),
25 Ycut_ (config.getParameter<double>(
"Ycut")),
26 tYcut_ (config.getParameter<double>(
"tYcut")),
27 Zcut_ (config.getParameter<double>(
"Zcut")),
28 tZcut_ (config.getParameter<double>(
"tZcut")),
29 maxMoveCut_ (config.getParameter<double>(
"maxMoveCut")),
30 maxErrorCut_(config.getParameter<double>(
"maxErrorCut"))
36 readMillePedeLogFile();
37 readMillePedeResultFile();
55 logFile.open(millePedeLogFile_.c_str());
57 if (logFile.is_open()) {
58 edm::LogInfo(
"MillePedeFileReader") <<
"Reading millepede log-file";
61 while (getline(logFile, line)) {
64 if (line.find(Nrec_string) != std::string::npos) {
65 std::istringstream iss(line);
67 iss >> trash >> trash >> Nrec;
76 edm::LogError(
"MillePedeFileReader") <<
"Could not read millepede log-file.";
87 std::ifstream resFile;
88 resFile.open(millePedeResFile_.c_str());
90 if (resFile.is_open()) {
91 edm::LogInfo(
"MillePedeFileReader") <<
"Reading millepede result-file";
92 double Multiplier[6] = {10000.,10000.,10000.,1000000.,1000000.,1000000.};
95 getline(resFile, line);
97 while (getline(resFile, line)) {
98 std::istringstream iss(line);
100 std::vector<std::string> tokens;
102 while (iss >> token) {
103 tokens.push_back(token);
106 if (tokens.size() > 4 ) {
108 int alignable = std::stoi(tokens[0]);
109 int alignableIndex = alignable % 10 - 1;
111 double ObsMove = std::stof(tokens[3]) * Multiplier[alignableIndex];
112 double ObsErr = std::stof(tokens[4]) * Multiplier[alignableIndex];
116 if (alignable >= 60 && alignable <= 69) {
118 }
else if (alignable >= 8780 && alignable <= 8789) {
120 }
else if (alignable >= 17520 && alignable <= 17529) {
122 }
else if (alignable >= 22380 && alignable <= 22389) {
124 }
else if (alignable >= 27260 && alignable <= 27269) {
126 }
else if (alignable >= 32120 && alignable <= 32129) {
132 if (alignableIndex == 0 && det >= 0 && det <= 5) {
134 XobsErr[det] = ObsErr;
135 }
else if (alignableIndex == 1 && det >= 0 && det <= 5) {
137 YobsErr[det] = ObsErr;
138 }
else if (alignableIndex == 2 && det >= 0 && det <= 5) {
140 ZobsErr[det] = ObsErr;
141 }
else if (alignableIndex == 3 && det >= 0 && det <= 5) {
142 tXobs[det] = ObsMove;
143 tXobsErr[det] = ObsErr;
144 }
else if (alignableIndex == 4 && det >= 0 && det <= 5) {
145 tYobs[det] = ObsMove;
146 tYobsErr[det] = ObsErr;
147 }
else if (alignableIndex == 5 && det >= 0 && det <= 5) {
148 tZobs[det] = ObsMove;
149 tZobsErr[det] = ObsErr;
152 if (
std::abs(ObsMove) > maxMoveCut_) {
156 }
else if (
std::abs(ObsMove) > Cutoffs[alignableIndex]) {
158 if (
std::abs(ObsErr) > maxErrorCut_) {
162 if (
std::abs(ObsMove/ObsErr) < sigCut_) {
171 edm::LogError(
"MillePedeFileReader") <<
"Could not read millepede result-file.";
void readMillePedeLogFile()
void readMillePedeResultFile()
Abs< T >::type abs(const T &t)
MillePedeFileReader(const edm::ParameterSet &)