12 std::string mapFile =
"TOF400_StripMap_RUN7.txt")
15 Int_t MapR[24] = {3, 0, 9, 6, 4, 1, 10, 7, 5, 2, 11, 8, 18, 21, 12, 15, 19, 22, 13, 16, 20, 23, 14, 17};
16 Int_t MapL[24] = {20, 23, 14, 17, 19, 22, 13, 16, 18, 21, 12, 15, 5, 2, 11, 8, 4, 1, 10, 7, 3, 0, 9, 6};
22 static const Int_t kNSlot = 23;
23 UInt_t slot[kNSlot] = {0.};
31 slot[14] = 0x046f408c;
32 slot[15] = 0x06e94033;
33 slot[16] = 0x076cae7a;
34 slot[17] = 0x07a8deb2;
35 slot[18] = 0x076cad52;
36 slot[19] = 0x076ccf62;
37 slot[20] = 0x06e940be;
42 ff.open(placementMapFile.c_str(), std::fstream::out);
44 cerr <<
"Cannot open the file " << placementMapFile << endl;
49 ff << std::hex << std::setfill(
'0') << std::setw(8) << crate <<
'\t';
50 ff << std::dec <<
i <<
'\t';
51 ff << std::hex << std::setfill(
'0') << std::setw(8) << slot[
i] << endl;
56 cout <<
"Num = " << Num << endl;
57 cout <<
"GetSlot(Num) = " <<
GetSlot(Num) <<
" GetCon(Num) = " <<
GetCon(Num) << endl;
58 cout <<
"GetDet(Num) = " <<
GetDet(Num) <<
" GetSide(Num) = " <<
GetSide(Num) << endl;
61 ffStrip.open(mapFile.c_str(), std::fstream::out);
63 cerr <<
"Cannot open the file " << mapFile << endl;
67 static const Int_t kNIt = 4;
68 static const Int_t kNDet = 10 + 1;
71 Int_t MapDetL[kNDet][kNIt] = {
72 {1202, 1104, 1001, 2203}, {2112, 2014, 3211, 3113}, {3022, 4224, 4121, 4023},
73 {5232, 5134, 5031, 6233}, {6142, 6044, 7241, 7143}, {14252, 14154, 14051, 15253},
74 {15162, 15064, 16261, 16163}, {16072, 17274, 17171, 17073}, {18282, 18184, 18081, 19283},
75 {19192, 19094, 20291, 20193}, {7005, 20005, 7005, 20005}};
80 for (
Int_t det = 0; det < kNDet; det++) {
82 for (
Int_t j = 0; j < 24; j++) {
92 ffStrip << std::hex << std::setfill(
'0') << std::setw(8) << slot[
GetSlot(MapDetL[det][
i])]
93 << std::setfill(
' ') <<
'\t';
94 ffStrip << std::dec << j + 24 *
GetCon(MapDetL[det][
i]) <<
'\t';
95 ffStrip <<
GetDet(MapDetL[det][
i]) <<
'\t';
98 ffStrip << 47 - (MapL[j] + (
GetSide(MapDetL[det][
i]) - 1) * 24) <<
'\t';
100 ffStrip << MapL[j] + (
GetSide(MapDetL[det][
i]) - 1) * 24 <<
'\t';
104 }
else if (
GetSide(MapDetL[det][
i]) == 3 ||
GetSide(MapDetL[det][
i]) == 4) {
106 ffStrip << 47 - (MapR[j] + (
GetSide(MapDetL[det][
i]) - 3) * 24) <<
'\t';
108 ffStrip << MapR[j] + (
GetSide(MapDetL[det][
i]) - 3) * 24 <<
'\t';
113 ffStrip << -1 <<
'\t';
124 slot[1] = 0x076cad53;
125 slot[2] = 0x06e9403f;
126 slot[3] = 0x06e9da9d;
127 slot[4] = 0x06e9f5cb;
128 slot[5] = 0x06e9404a;
129 slot[6] = 0x046f3872;
130 slot[7] = 0x06e940b2;
131 slot[14] = 0x06e9403e;
132 slot[15] = 0x076ccf56;
133 slot[16] = 0x06e940b1;
134 slot[17] = 0x06e9043c;
135 slot[18] = 0x06e9da86;
136 slot[19] = 0x076ccf5f;
137 slot[20] = 0x06e94032;
140 ff.open(placementMapFile.c_str(), std::fstream::in | std::fstream::out | std::fstream::app);
142 cerr <<
"2. Cannot open the file " << placementMapFile << endl;
147 ff << std::hex << std::setfill(
'0') << std::setw(8) << crate <<
'\t';
148 ff << std::dec <<
i <<
'\t';
149 ff << std::hex << std::setfill(
'0') << std::setw(8) << slot[
i] << endl;
153 Int_t MapDetR[kNDet][kNIt] = {
154 {1201, 1103, 1002, 2204}, {2111, 2013, 3212, 3114}, {3021, 4223, 4122, 4024},
155 {5231, 5133, 5032, 6234}, {6141, 6043, 7242, 7144}, {14251, 14153, 14052, 15254},
156 {15161, 15063, 16262, 16164}, {16071, 17273, 17172, 17074}, {18281, 18183, 18082, 19284},
157 {19191, 19093, 20292, 20194}, {7005, 20005, 7005, 20005}};
160 ffStrip.open(mapFile.c_str(), std::fstream::in | std::fstream::out | std::fstream::app);
161 if (ffStrip.fail()) {
162 cerr <<
"2. Cannot open the file " << mapFile << endl;
169 for (
Int_t det = 0; det < kNDet; det++) {
171 for (
Int_t j = 0; j < 24; j++) {
181 ffStrip << std::hex << std::setfill(
'0') << std::setw(8) << slot[
GetSlot(MapDetR[det][
i])]
182 << std::setfill(
' ') <<
'\t';
183 ffStrip << std::dec << j + 24 *
GetCon(MapDetR[det][
i]) <<
'\t';
184 ffStrip <<
GetDet(MapDetR[det][
i]) + 10 <<
'\t';
187 Int_t strTemp = 47 - (MapL[j] + (
GetSide(MapDetR[det][
i]) - 1) * 24);
189 ffStrip << 48 - (23 - strTemp) - 1 <<
'\t';
191 ffStrip << 48 - (71 - strTemp) - 1 <<
'\t';
193 Int_t strTemp = MapL[j] + (
GetSide(MapDetR[det][
i]) - 1) * 24;
195 ffStrip << 48 - (23 - strTemp) - 1 <<
'\t';
197 ffStrip << 48 - (71 - strTemp) - 1 <<
'\t';
202 }
else if (
GetSide(MapDetR[det][
i]) == 3 ||
GetSide(MapDetR[det][
i]) == 4) {
204 Int_t strTemp = 47 - (MapR[j] + (
GetSide(MapDetR[det][
i]) - 3) * 24);
206 ffStrip << 48 - (23 - strTemp) - 1 <<
'\t';
208 ffStrip << 48 - (71 - strTemp) - 1 <<
'\t';
210 Int_t strTemp = MapR[j] + (
GetSide(MapDetR[det][
i]) - 3) * 24;
212 ffStrip << 48 - (23 - strTemp) - 1 <<
'\t';
214 ffStrip << 48 - (71 - strTemp) - 1 <<
'\t';
220 ffStrip << -1 <<
'\t';