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;
80 edm::LogError(
"MillePedeFileReader") <<
"Could not read millepede log-file.";
94 std::ifstream resFile;
95 resFile.open(millePedeResFile_.c_str());
97 if (resFile.is_open()) {
98 edm::LogInfo(
"MillePedeFileReader") <<
"Reading millepede result-file";
99 double Multiplier[6] = {10000.,10000.,10000.,1000000.,1000000.,1000000.};
102 getline(resFile, line);
104 while (getline(resFile, line)) {
105 std::istringstream iss(line);
107 std::vector<std::string> tokens;
109 while (iss >> token) {
110 tokens.push_back(token);
113 if (tokens.size() > 4 ) {
116 int alignable = std::stoi(tokens[0]);
117 int alignableIndex = alignable % 10 - 1;
119 double ObsMove = std::stof(tokens[3]) * Multiplier[alignableIndex];
120 double ObsErr = std::stof(tokens[4]) * Multiplier[alignableIndex];
124 if (alignable >= 60 && alignable <= 69) {
126 }
else if (alignable >= 8780 && alignable <= 8789) {
128 }
else if (alignable >= 17520 && alignable <= 17529) {
130 }
else if (alignable >= 22380 && alignable <= 22389) {
132 }
else if (alignable >= 27260 && alignable <= 27269) {
134 }
else if (alignable >= 32120 && alignable <= 32129) {
140 if (alignableIndex == 0 && det >= 0 && det <= 5) {
142 XobsErr[det] = ObsErr;
143 }
else if (alignableIndex == 1 && det >= 0 && det <= 5) {
145 YobsErr[det] = ObsErr;
146 }
else if (alignableIndex == 2 && det >= 0 && det <= 5) {
148 ZobsErr[det] = ObsErr;
149 }
else if (alignableIndex == 3 && det >= 0 && det <= 5) {
150 tXobs[det] = ObsMove;
151 tXobsErr[det] = ObsErr;
152 }
else if (alignableIndex == 4 && det >= 0 && det <= 5) {
153 tYobs[det] = ObsMove;
154 tYobsErr[det] = ObsErr;
155 }
else if (alignableIndex == 5 && det >= 0 && det <= 5) {
156 tZobs[det] = ObsMove;
157 tZobsErr[det] = ObsErr;
160 if (
std::abs(ObsMove) > maxMoveCut_) {
168 }
else if (
std::abs(ObsMove) > Cutoffs[alignableIndex]) {
171 if (
std::abs(ObsErr) > maxErrorCut_) {
179 if (
std::abs(ObsMove/ObsErr) > sigCut_) {
188 edm::LogError(
"MillePedeFileReader") <<
"Could not read millepede result-file.";
void readMillePedeLogFile()
void readMillePedeResultFile()
Abs< T >::type abs(const T &t)
MillePedeFileReader(const edm::ParameterSet &)