CbmRoot
Loading...
Searching...
No Matches
CbmRichMirrorMisalignmentCorrectionUtils.h
Go to the documentation of this file.
1/* Copyright (C) 2017-2020 Justus-Liebig-Universitaet Giessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Jordan Bendarouach [committer] */
4
5#ifndef CBM_RICH_MIRROR_MISALIGNMENT_CORRECTION_UTILS
6#define CBM_RICH_MIRROR_MISALIGNMENT_CORRECTION_UTILS
7
8using namespace std;
9using std::string;
10#include <Logger.h>
11
12#include <fstream>
13#include <iostream>
14#include <map>
15
26 public:
31
36
40 // virtual void Init() { }
41
42 void Init(const string& s)
43 {
46 if (tBoolCorrection) {
48 }
49 else {
50 LOG(info) << "CbmRichProjectionProducerAnalytical::Init() No correction table.";
51 }
52 }
53
55
57 {
58 if (fPathToMirrorMisalignmentCorrectionParameterFile == "/correction_table/correction_param_array.txt") {
59 return false;
60 }
61 ifstream corrFile;
63 if (!corrFile.is_open()) {
64 Fatal("CbmRichMirrorMisalignmentCorrectionUtils::"
65 "CheckMirrorCorrectionParameterFile:",
66 "Wrong correction parameter path given!");
67 }
68 return true;
69 }
70
71 void ReadAndStoreMirrorCorrectionParamMap(std::map<string, std::pair<Double_t, Double_t>>& mirrorCorrectionParamMap)
72 {
73 string mirrorID = "", fileLine = "";
74 Double_t misX = 0., misY = 0.;
75 ifstream corrFile;
77 if (corrFile.is_open()) {
78 LOG(info) << "CbmRichProjectionProducerUtils::CheckMirrorCorrectionParameterFile("
79 ") Correction table used at: "
81 cout << "mirrorID: \t\t\t (misY, misX): " << endl;
82 while (corrFile >> mirrorID >> misY >> misX) {
83 cout << mirrorID << " \t ; \t(" << misY << ", " << misX << ")" << endl;
84 mirrorCorrectionParamMap[mirrorID] = std::make_pair(misX, misY);
85 }
86 corrFile.close();
87 }
88 else {
89 Fatal("CbmRichMirrorMisalignmentCorrectionUtils::"
90 "ReadAndStoreMirrorCorrectionParam:",
91 "Wrong correction parameter path given!");
92 }
93
94 cout << endl << "Mapping:" << endl;
95 cout << "mirrorID: \t\t\t (misY, misX): " << endl;
96 for (std::map<string, std::pair<Double_t, Double_t>>::iterator it =
99 cout << it->first << " \t ; \t(" << it->second.first << ", " << it->second.second << ")" << endl;
100 }
101 cout << endl;
102 }
103
104 std::map<string, std::pair<Double_t, Double_t>> GetMirrorCorrectionParamMap()
105 {
107 }
108
110
111 private:
114 std::map<string, pair<Double_t, Double_t>> fMirrorMisalignmentCorrectionParameterMap;
115};
116
117#endif
class checks correction parameter file containing mirror misalignment information.
std::map< string, pair< Double_t, Double_t > > fMirrorMisalignmentCorrectionParameterMap
void ReadAndStoreMirrorCorrectionParamMap(std::map< string, std::pair< Double_t, Double_t > > &mirrorCorrectionParamMap)
std::map< string, std::pair< Double_t, Double_t > > GetMirrorCorrectionParamMap()
void Init(const string &s)
Initialization in case one needs to initialize some TCloneArrays.
Hash for CbmL1LinkKey.