1 #ifndef CBM_RICH_MIRROR_MISALIGNMENT_CORRECTION_UTILS
2 #define CBM_RICH_MIRROR_MISALIGNMENT_CORRECTION_UTILS
6 #include "FairLogger.h"
37 void Init(
const string& s) {
38 SetMirrorCorrectionParameterFile(s);
39 tBoolCorrection = CheckMirrorCorrectionParameterFile();
40 if (tBoolCorrection) {
41 ReadAndStoreMirrorCorrectionParamMap(
42 fMirrorMisalignmentCorrectionParameterMap);
45 <<
"CbmRichProjectionProducerAnalytical::Init() No correction table.";
50 fPathToMirrorMisalignmentCorrectionParameterFile = s;
54 if (fPathToMirrorMisalignmentCorrectionParameterFile
55 ==
"/correction_table/correction_param_array.txt") {
59 corrFile.open(fPathToMirrorMisalignmentCorrectionParameterFile);
60 if (!corrFile.is_open()) {
61 Fatal(
"CbmRichMirrorMisalignmentCorrectionUtils::"
62 "CheckMirrorCorrectionParameterFile:",
63 "Wrong correction parameter path given!");
69 std::map<
string, std::pair<Double_t, Double_t>>& mirrorCorrectionParamMap) {
70 string mirrorID =
"", fileLine =
"";
71 Double_t misX = 0., misY = 0.;
73 corrFile.open(fPathToMirrorMisalignmentCorrectionParameterFile, ios::in);
74 if (corrFile.is_open()) {
76 <<
"CbmRichProjectionProducerUtils::CheckMirrorCorrectionParameterFile("
77 ") Correction table used at: "
78 << fPathToMirrorMisalignmentCorrectionParameterFile;
79 cout <<
"mirrorID: \t\t\t (misY, misX): " << endl;
80 while (corrFile >> mirrorID >> misY >> misX) {
81 cout << mirrorID <<
" \t ; \t(" << misY <<
", " << misX <<
")" << endl;
82 mirrorCorrectionParamMap[mirrorID] = std::make_pair(misX, misY);
86 Fatal(
"CbmRichMirrorMisalignmentCorrectionUtils::"
87 "ReadAndStoreMirrorCorrectionParam:",
88 "Wrong correction parameter path given!");
91 cout << endl <<
"Mapping:" << endl;
92 cout <<
"mirrorID: \t\t\t (misY, misX): " << endl;
93 for (std::map<
string, std::pair<Double_t, Double_t>>::iterator it =
94 fMirrorMisalignmentCorrectionParameterMap.begin();
95 it != fMirrorMisalignmentCorrectionParameterMap.end();
97 cout << it->first <<
" \t ; \t(" << it->second.first <<
", "
98 << it->second.second <<
")" << endl;
103 std::map<string, std::pair<Double_t, Double_t>>
105 return fMirrorMisalignmentCorrectionParameterMap;
113 std::map<string, pair<Double_t, Double_t>>