HighLAND
DetectorDefinition.cxx
1 #include <DetectorDefinition.hxx>
2 #include <iomanip>
3 
4 //dumping of array
5 #define dump_array3(par) std::cout << std::fixed << \
6  std::setw(10) << std::left << #par << ": \t" << \
7  std::setw(10) << std::right << par[0] << " " << \
8  std::setw(10) << std::right << par[1] << " " << \
9  std::setw(10) << std::right << par[2] << std::endl;
10 
11 #define dump_var(par) std::cout << std::fixed << std::setw(20) << std::left << #par << ":\t" << \
12  std::setw(10) << std::right << par << std::endl;
13 
14 namespace DetDef {
15 
16  // Detector definitions
17  // Can be overridden in yourAnalysis::Initialize()
18  // with e.g. DetDef::fgd1min[0] = x;
19  // (note that DetDef::fgd1min = {x,y,z} works only with old compilers)
20  // Fiducial volume is defined by removing the edge volumes in FiducialVolumeDefinition.cxx
21 
22 // new defintion of FGD volumes after definition of bar positions (more below)
23 // Float_t fgd1min[3] = {-932.17,-877.17,115.95};
24 // Float_t fgd1max[3] = {932.17,987.17,446.955};
25 // Float_t fgd2min[3] = {-932.17,-877.17,1473.95};
26 // Float_t fgd2max[3] = {932.17,987.17,1807.05};
27 
28 
29  Float_t p0dmin[3] = {-1092.79,-1107.39,-3296.48};
30  Float_t p0dmax[3] = {1012.45,1130.99,-938.753};
31 
32  //from RECPACK simplified geometry: active DsECal volume
33  Float_t dsecalmin[3] = {-1019.97,-1009.97,2855.03};
34  Float_t dsecalmax[3] = {1019.97,1029.97,3273.17};
35 
36  //active Barrel ECal from RECPACK simplified geomtry
37  Float_t tecalLmin[3] = {1385.03,-1063.47,-663.97};
38  Float_t tecalLmax[3] = {1766.27,1236.47,3215.97};
39  Float_t tecalRmin[3] = {-1766.27,-1063.47,-663.97};
40  Float_t tecalRmax[3] = {-1385.03,1237.47,3215.97};
41 
42  Float_t tecalTLmin[3] = {36.03,1310.53,-663.97};
43  Float_t tecalTLmax[3] = {1575.97,1691.77,3215.97};
44  Float_t tecalTRmin[3] = {-1575.97,1310.53,-663.97};
45  Float_t tecalTRmax[3] = {-36.03,1691.77,3215.97};
46 
47  Float_t tecalBLmin[3] = {136.03,-1711.77,-663.97};
48  Float_t tecalBLmax[3] = {1675.97,-1330.53,3215.97};
49  Float_t tecalBRmin[3] = {-1675.03,-1711.77,-663.97};
50  Float_t tecalBRmax[3] = {-136.03,-1330.53,3215.97};
51 
52  //active P0D ECal from RECPACK simplified geomtry
53  Float_t pecalLmin[3] = {1570.00, -1344.00, -3270.00};
54  Float_t pecalLmax[3] = {1657.00, 1436.00, -890.00};
55  Float_t pecalRmin[3] = {-1657.00, -1344.00, -3270.00};
56  Float_t pecalRmax[3] = {-1570.00, 1436.00, -890.00};
57 
58 
59  Float_t pecalTLmin[3] = {36.00, 1490.00, -3270.00};
60  Float_t pecalTLmax[3] = {1576.00, 1577.00, -890.00};
61  Float_t pecalTRmin[3] = {-1576.00, 1490.03, -3269.97};
62  Float_t pecalTRmax[3] = {-36.00, 1577.97, -890.03};
63 
64  Float_t pecalBLmin[3] = {136.00, -1597.00, -3270.00};
65  Float_t pecalBLmax[3] = {1676.00, -1510.00, -890.00};
66  Float_t pecalBRmin[3] = {-1676.00, -1597.00, -3270.00};
67  Float_t pecalBRmax[3] = {136.00, -1510.00, -890.00};
68 
69 
70  //from RECPACK simplified geometry: SMRD volumes
71  Float_t smrd15Lmin[3] = {1832.03,-2029.98, -3813.98};
72  Float_t smrd15Lmax[3] = {2021.97,2009.98,915.47};
73 
74  Float_t smrd6Lmin[3] = {1832.03,-2029.98, 996.03};
75  Float_t smrd6Lmax[3] = {2086.97,2009.98,1871.97};
76 
77  Float_t smrd78Lmin[3] = {1832.03,-2029.98, 1952.03};
78  Float_t smrd78Lmax[3] = {2216.97,2009.98,3813.48};
79 
80  Float_t smrd15Rmin[3] = {-2021.97,-2029.98,-3813.98};
81  Float_t smrd15Rmax[3] = {-1832.02,2009.98,915.47};
82 
83  Float_t smrd6Rmin[3] = {-2086.97,-2029.98,996.03};
84  Float_t smrd6Rmax[3] = {-1832.02,2009.98,1871.97};
85 
86  Float_t smrd78Rmin[3] = {-2216.97,-2029.98,1952.03};
87  Float_t smrd78Rmax[3] = {-1832.02,2009.98,3813.47};
88 
89  Float_t smrdTLmin[3] = {32.02,2010.02,-3813.98};
90  Float_t smrdTLmax[3] = {1896.98,2197.48,3818.98};
91 
92  Float_t smrdTRmin[3] = {-1896.98,2010.02,-3813.98};
93  Float_t smrdTRmax[3] = {-32.02,2197.48,3818.98};
94 
95  Float_t smrdBLmin[3] = {32.02,-2222.48,-3813.98};
96  Float_t smrdBLmax[3] = {1896.98,-2030.02,3813.98};
97 
98  Float_t smrdBRmin[3] = {-1896.98,-2222.48,-3813.98};
99  Float_t smrdBRmax[3] = {-32.02,-2030.02,3813.98};
100 
101 
102  Float_t tpc1min[3] = {-1150.00, -1170.0, -885.0};
103  Float_t tpc1max[3] = { 1150.00, 1230.0, 89.0};
104  Float_t tpc2min[3] = {-1150.00, -1170.0, 474.0};
105  Float_t tpc2max[3] = { 1150.00, 1230.0, 1448.0};
106  Float_t tpc3min[3] = {-1150.00, -1170.0, 1833.0};
107  Float_t tpc3max[3] = { 1150.00, 1230.0, 2807.0};
108 
109  Float_t trackerAllmin[3] = {-1160.00, -1256.0, -885.0};
110  Float_t trackerAllmax[3] = { 1160.00, 1230.0, 2807.0};
111 
112 
113  // FGDs
114 
115  // center values found using oaApplyAlign/v2r1/Linux/ViewCenters.exe
116  // on a prod5F neut reco file of run2, different for DATA and MC
117  Float_t fgd2BarCenterMC[14] = {1478.85,1488.65,1531.1,1540.9,1583.35,1593.15,1635.6,1645.4,1687.85,1697.65,1740.1,1749.9,1792.35,1802.15};
118  Float_t fgd2BarCenterDATA[14] = {1479.937,1489.737,1532.187,1541.987,1584.437,1594.237,1636.687,1646.487,1688.937,1698.737,1741.187,1750.987,1793.437,1803.237};
119  Float_t fgd2WaterCenterMC[6] = {1509.84,1562.09,1614.34,1666.59,1718.84,1771.09};
120  Float_t fgd2WaterCenterDATA[6] = {1510.93,1563.18,1615.43,1667.68,1719.93,1772.18};
121 
122  // This will be filled automatically depending from the geometry available so no need to split MC and Data
123  Float_t fgd2WaterCenter[6] = {1509.84, 1562.09, 1614.34, 1666.59, 1718.84, 1771.09};
124  Float_t fgd2BarCenter[14] = {1478.85, 1488.65, 1531.1, 1540.9, 1583.35, 1593.15, 1635.6, 1645.4, 1687.85, 1697.65, 1740.1, 1749.9, 1792.35, 1802.15};
125  Float_t fgd1BarCenter[30] = {
126  120.85,
127  130.65,
128  143.10,
129  152.90,
130  165.35,
131  175.15,
132  187.60,
133  197.40,
134  209.85,
135  219.65,
136  232.10,
137  241.90,
138  254.35,
139  264.15,
140  276.60,
141  286.40,
142  298.85,
143  308.65,
144  321.10,
145  330.90,
146  343.35,
147  353.15,
148  365.60,
149  375.40,
150  387.85,
151  397.65,
152  410.10,
153  419.90,
154  432.35,
155  442.15
156  };
157 
158  Float_t fgdXYModuleWidth = 20.25;
159  Float_t fgdXYAirWidth = 2.0;
160  Float_t fgdXYBarWidth = 9.61;
161  Float_t fgdXYMiddleGlueWidth = 0.190;
162  Float_t fgdXYGlueWidth = 0.188;
163  Float_t fgdXYSkinWidth = 0.232;
164 
165  Float_t fgdWaterModuleWidth = 27.9379;
166  Float_t fgdWaterAirWidth = 2.0621;
167  Float_t fgdWaterPCWidth = 25.0632;
168  Float_t fgdWaterGlueWidth = 0.6329;
169  Float_t fgdWaterSkinWidth = 0.80445;
170 
171  // FGD1 = XY module + air/G10_spacer
172  // 20.25 + 2.0
173  // FGD2 = XY module + air/G10_spacer + water module + air/G10_spacer
174  // 20.25 + 2.0 + 27.9379 + 2.0621 = 52.25 mm
175 
176  // XY module = G10_sheets + glue + X layer + glue + Y layer + glue + G10_sheets
177  // 20.25 mm = 0.232 + 0.188 + 9.61 + 0.190 + 9.61 + 0.188 + 0.232
178 
179  // water module = polypropylene + glue + water/PC(polycarbonate) + glue + polypropylene
180  // 27.9379 mm = 0.80445 + 0.6329 + 25.0632 + 0.6329 + 0.80445
181  // Actually the more trustable value is 27.9379, the others are calulated through the averaged areal desities (see TN 122)
182 
183  // reference
184  // https://repo.nd280.org/viewvc/ND280/nd280mc/src/ND280FGDConstructor.cc?revision=1.19.2.1&view=markup
185  // http://www.t2k.org/nd280/software/alignment/asbuilt/fgd-geometry-status/FGD_geometry_checks
186 
187  // We have to include also skin and glue since mass studies are done on the whole modules (TN 91, 122, 198)
188  Float_t fgd1minZ = fgd1BarCenter[0] - (fgdXYBarWidth/2.) - fgdXYSkinWidth - fgdXYGlueWidth;
189  Float_t fgd2minZ = fgd2BarCenter[0] - (fgdXYBarWidth/2.) - fgdXYSkinWidth - fgdXYGlueWidth;
190  Float_t fgd1maxZ = fgd1BarCenter[29] + (fgdXYBarWidth/2.) + fgdXYSkinWidth + fgdXYGlueWidth;
191  Float_t fgd2maxZ = fgd2BarCenter[13] + (fgdXYBarWidth/2.) + fgdXYSkinWidth + fgdXYGlueWidth;
192  Float_t fgd1min[3] = {-932.17, -877.17, fgd1minZ};
193  Float_t fgd2min[3] = {-932.17, -877.17, fgd2minZ};
194  Float_t fgd1max[3] = {932.17, 987.17, fgd1maxZ};
195  Float_t fgd2max[3] = {932.17, 987.17, fgd2maxZ};
196 
197 
198 
199  // active Barrel ECal from RECPACK simplified geometry
200  // prod6 data with alignment applied
201  Float_t tecalLmin_p6_data[3] = { 1342.03, -1051.47, -703.97 };
202  Float_t tecalLmax_p6_data[3] = { 1723.27, 1248.47, 3175.97 };
203  Float_t tecalRmin_p6_data[3] = { -1751.27, -1053.47, -693.97 };
204  Float_t tecalRmax_p6_data[3] = { -1370.03, 1247.47, 3185.97 };
205 
206  Float_t tecalTLmin_p6_data[3] = { 4.03, 1320.53, -693.97 };
207  Float_t tecalTLmax_p6_data[3] = { 1543.97, 1701.77, 3185.97 };
208  Float_t tecalTRmin_p6_data[3] = { -1569.97, 1320.53, -693.97 };
209  Float_t tecalTRmax_p6_data[3] = { -30.03, 1701.77, 3185.97 };
210 
211  Float_t tecalBLmin_p6_data[3] = { 96.03, -1695.77, -698.97 };
212  Float_t tecalBLmax_p6_data[3] = { 1635.97, -1314.53, 3180.97 };
213  Float_t tecalBRmin_p6_data[3] = {-1658.03, -1693.77, -688.97 };
214  Float_t tecalBRmax_p6_data[3] = {-119.03, -1312.53, 3190.97 };
215 
216 
217 
218  //**********************************
219  void DumpVolumes(){
220  //**********************************
221  std::streamsize ss = std::cout.precision();
222  std::cout.precision(3);
223 
224  std::cout << "\n***** DetectorDefinition: available volumes list: ***** \n" << std::endl;
225 
226  dump_array3(fgd1min);
227  dump_array3(fgd1max);
228 
229  dump_array3(fgd2min);
230  dump_array3(fgd2max);
231 
232  dump_array3(tpc1min);
233  dump_array3(tpc1max);
234 
235  dump_array3(tpc2min);
236  dump_array3(tpc2max);
237 
238  dump_array3(tpc3min);
239  dump_array3(tpc3max);
240 
241  dump_array3(trackerAllmin);
242  dump_array3(trackerAllmax);
243 
244  dump_array3(p0dmin);
245  dump_array3(p0dmax);
246 
247  dump_array3(dsecalmin);
248  dump_array3(dsecalmax);
249 
250  dump_array3(tecalLmin);
251  dump_array3(tecalLmax);
252 
253  dump_array3(tecalRmin);
254  dump_array3(tecalRmax);
255 
256  dump_array3(tecalTLmin);
257  dump_array3(tecalTLmax);
258  dump_array3(tecalTRmin);
259  dump_array3(tecalTRmax);
260 
261  dump_array3(tecalBLmin);
262  dump_array3(tecalBLmax);
263  dump_array3(tecalBRmin);
264  dump_array3(tecalBRmax);
265 
266  dump_array3(pecalLmin);
267  dump_array3(pecalLmax);
268 
269  dump_array3(pecalRmin);
270  dump_array3(pecalRmax);
271 
272  dump_array3(pecalTLmin);
273  dump_array3(pecalTLmax);
274  dump_array3(pecalTRmin);
275  dump_array3(pecalTRmax);
276 
277 
278  dump_array3(pecalBLmin);
279  dump_array3(pecalBLmax);
280  dump_array3(pecalBRmin);
281  dump_array3(pecalBRmax);
282 
283  dump_array3(smrd15Lmin);
284  dump_array3(smrd15Lmax);
285 
286  dump_array3(smrd6Lmin);
287  dump_array3(smrd6Lmax);
288 
289  dump_array3(smrd78Lmin);
290  dump_array3(smrd78Lmax);
291 
292  dump_array3(smrd15Rmin);
293  dump_array3(smrd15Rmax);
294 
295  dump_array3(smrd6Rmin);
296  dump_array3(smrd6Rmax);
297 
298  dump_array3(smrd78Rmin);
299  dump_array3(smrd78Rmax);
300 
301  dump_array3(smrdTLmin);
302  dump_array3(smrdTLmax);
303  dump_array3(smrdTRmin);
304  dump_array3(smrdTRmax);
305 
306  dump_array3(smrdBLmin);
307  dump_array3(smrdBLmax);
308  dump_array3(smrdBRmin);
309  dump_array3(smrdBRmax);
310 
311  std::cout << "\n******************************************************* \n" << std::endl;
312 
313  std::cout.precision(ss);
314  }
315 
316  //**********************************
317  void DumpFGDInfo(){
318  //**********************************
319  std::streamsize ss = std::cout.precision();
320  std::cout.precision(6);
321 
322  std::cout << " \n ***** DetectorDefinition: FGD Information: ***** \n" << std::endl;
323 
324  std::cout << " \n ***** FGD1 Bar Centers: ***** \n" << std::endl;
325 
326  for (int i=0; i<30; i++)
327  std::cout << " FGD1 Bar Center_" << i <<":\t" << std::right << fgd1BarCenter[i] << std::endl;
328 
329  std::cout << " \n ***** \n" << std::endl;
330 
331 
332  std::cout << " \n ***** FGD2 Bar Centers: ***** \n" << std::endl;
333 
334  for (int i=0; i<14; i++)
335  std::cout << " FGD2 Bar Center_" << i <<":\t" << std::right << fgd2BarCenter[i] << std::endl;
336 
337  std::cout << " \n ***** \n" << std::endl;
338 
339  std::cout << " \n ***** FGD2 Water Centers: ***** \n" << std::endl;
340 
341  for (int i=0; i<6; i++)
342  std::cout << " FGD2 Water Center_" << i <<":\t" << std::right << fgd2WaterCenter[i] << std::endl;
343 
344 
345  std::cout << " \n ***** \n" << std::endl;
346 
347  std::cout.precision(3);
348 
349  dump_var(fgdXYModuleWidth);
350  dump_var(fgdXYAirWidth);
351  dump_var(fgdXYBarWidth);
352  dump_var(fgdXYMiddleGlueWidth);
353  dump_var(fgdXYGlueWidth);
354  dump_var(fgdXYSkinWidth);
355  dump_var(fgdWaterModuleWidth);
356  dump_var(fgdWaterAirWidth);
357  dump_var(fgdWaterPCWidth);
358  dump_var(fgdWaterGlueWidth);
359  dump_var(fgdWaterSkinWidth);
360 
361  std::cout << " \n ******************************************************* \n " << std::endl;
362 
363  std::cout.precision(ss);
364  }
365 
366 } //namespace
367