16#include <TGeoManager.h>
17#include <TGeoMaterial.h>
18#include <TGeoMedium.h>
20#include <TGeoMatrix.h>
45 LOG(
debug) <<
"FT3Module: initialize_materials";
50 TGeoManager* geoManager = gGeoManager;
52 auto* itsH =
new TGeoElement(
"FT3_H",
"Hydrogen", 1, 1.00794);
53 auto* itsC =
new TGeoElement(
"FT3_C",
"Carbon", 6, 12.0107);
54 auto* itsO =
new TGeoElement(
"FT3_O",
"Oxygen", 8, 15.994);
56 siliconMat =
new TGeoMaterial(
"FT3_Silicon", 28.0855, 14, 2.33);
59 copperMat =
new TGeoMaterial(
"FT3_Copper", 63.546, 29, 8.96);
62 kaptonMat =
new TGeoMaterial(
"FT3_Kapton", 13.84, 6.88, 1.346);
66 auto* itsEpoxy =
new TGeoMixture(
"FT3_Epoxy", 3);
67 itsEpoxy->AddElement(itsC, 18);
68 itsEpoxy->AddElement(itsH, 19);
69 itsEpoxy->AddElement(itsO, 3);
70 itsEpoxy->SetDensity(2.186);
72 epoxyMed =
new TGeoMedium(
"FT3_Epoxy", 4, itsEpoxy);
75 AluminumMat =
new TGeoMaterial(
"Aluminum", 26.98, 13, 2.7);
77 LOG(
debug) <<
"FT3Module: done initialize_materials";
82 return (
x *
x < radius * radius) ? std::sqrt(radius * radius -
x *
x) : 0;
85void FT3Module::create_layout(
double mZ,
int layerNumber,
int direction,
double Rin,
double Rout,
double overlap,
const std::string&
face,
const std::string& layout_type, TGeoVolume* motherVolume)
88 LOG(
debug) <<
"FT3Module: create_layout - Layer " << layerNumber <<
", Direction " << direction <<
", Face " <<
face;
89 TGeoManager* geoManager = gGeoManager;
98 double sensor_width = 5.0;
99 double sensor_height = 9.6;
100 double inactive_width = 0.2;
101 double active_width = 4.6;
102 double active_height = 9.6;
104 double silicon_thickness = 0.01;
105 double copper_thickness = 0.006;
106 double kapton_thickness = 0.03;
107 double epoxy_thickness = 0.0012;
109 double carbonFiberThickness = 0.01;
111 double foamSpacingThickness = 1.0;
118 double z_offset = (
face ==
"front") ? -foamSpacingThickness / 2.0 - carbonFiberThickness : foamSpacingThickness / 2.0 + carbonFiberThickness;
121 if (sensor_height == 3.2 && sensor_width == 2.5) {
124 }
else if (sensor_height == 19.2 && sensor_width == 5) {
128 x_offset = sensor_width / 2;
129 y_offset = sensor_height / 2;
132 double x_condition_min = 0;
133 double x_condition_max = 0;
134 double offset_Rin_lower = 0;
135 double offset_Rin_upper = 0;
136 bool adjust_bottom_y_pos =
false;
137 bool adjust_bottom_y_neg =
false;
138 double x_adjust_bottom_y_pos = 0;
139 double bottom_y_pos_value = 0;
140 double bottom_y_neg_value = 0;
142 double Rin_offset = (sensor_height == 19.2) ? 1 : 0;
143 double Rout_offset = (sensor_height == 19.2) ? 1 : 0;
145 if (Rin == 7 && sensor_height == 9.6 && sensor_width == 5) {
146 x_condition_min = -Rin - 2;
147 x_condition_max = Rin;
149 adjust_bottom_y_pos =
true;
150 adjust_bottom_y_neg =
true;
151 x_adjust_bottom_y_pos = 3.5;
152 bottom_y_pos_value = 3.5;
153 bottom_y_neg_value = -3.5;
154 }
else if (Rin == 5 && sensor_height == 9.6 && sensor_width == 5) {
155 x_condition_min = -Rin - 6;
156 x_condition_max = Rin;
157 adjust_bottom_y_pos =
true;
158 adjust_bottom_y_neg =
true;
159 x_adjust_bottom_y_pos = 3.5;
160 bottom_y_pos_value = 3.5;
161 bottom_y_neg_value = -3.5;
162 }
else if ((Rin == 5 || Rin == 7) && sensor_height == 19.2) {
163 x_condition_min = -Rin - 3;
164 x_condition_max = Rin - 0.2;
166 adjust_bottom_y_pos =
false;
167 adjust_bottom_y_neg =
false;
168 }
else if (Rin == 5 && sensor_height == 3.2) {
169 x_condition_min = -(Rin + 2.6);
170 x_condition_max = Rin + 1.5;
171 adjust_bottom_y_pos =
true;
172 adjust_bottom_y_neg =
true;
173 x_adjust_bottom_y_pos = 3.5;
174 bottom_y_pos_value = 3.5;
175 bottom_y_neg_value = -3.5;
176 }
else if (Rin == 7 && sensor_height == 3.2) {
177 x_condition_min = -Rin - 1;
178 x_condition_max = Rin - 0.2;
179 adjust_bottom_y_pos =
true;
180 adjust_bottom_y_neg =
true;
181 x_adjust_bottom_y_pos = 3.5;
182 bottom_y_pos_value = 3.5;
183 bottom_y_neg_value = -3.5;
184 }
else if (Rin == 5 && sensor_height == 9.6 && sensor_width == 2.5) {
185 x_condition_min = -(Rin + 2.6);
186 x_condition_max = Rin;
187 adjust_bottom_y_pos =
true;
188 adjust_bottom_y_neg =
true;
189 x_adjust_bottom_y_pos = 3.5;
190 bottom_y_pos_value = 3.5;
191 bottom_y_neg_value = -3.5;
192 }
else if (Rin == 7 && sensor_height == 9.6 && sensor_width == 2.5) {
193 x_condition_min = -Rin - 2.6;
194 x_condition_max = Rin + 1;
196 adjust_bottom_y_pos =
true;
197 adjust_bottom_y_neg =
true;
198 x_adjust_bottom_y_pos = 5.5;
199 bottom_y_pos_value = 3.5;
200 bottom_y_neg_value = -3.5;
201 }
else if (Rin == 10 && sensor_height == 9.6 && sensor_width == 5.0) {
202 x_condition_min = -Rin - 4;
203 x_condition_max = Rin;
205 adjust_bottom_y_pos =
false;
206 adjust_bottom_y_neg =
false;
207 x_adjust_bottom_y_pos = 3.5;
208 bottom_y_pos_value = 3.5;
209 bottom_y_neg_value = -3.5;
210 }
else if (Rin == 20 && sensor_height == 9.6 && sensor_width == 5.0) {
211 x_condition_min = -Rin - 4;
212 x_condition_max = Rin;
214 adjust_bottom_y_pos =
false;
215 adjust_bottom_y_neg =
false;
216 x_adjust_bottom_y_pos = 3.5;
217 bottom_y_pos_value = 3.5;
218 bottom_y_neg_value = -3.5;
220 LOG(warning) <<
"Different config - to determine offsets needed for " <<
"Rin = " << Rin <<
" ; sensor_height = " << sensor_height <<
" ; sensor_width = " << sensor_width <<
" layer " << layerNumber;
221 x_condition_min = -Rin - sensor_width;
222 x_condition_max = Rin;
223 adjust_bottom_y_pos =
false;
224 adjust_bottom_y_neg =
false;
227 offset_Rin_lower = Rin - Rin_offset;
228 offset_Rin_upper = Rout + Rout_offset;
230 std::set<std::pair<double, double>> placed_sensors;
231 int sensor_count = 0;
233 int placementCounter = 0;
234 bool justSkipped =
false;
236 std::vector<double> X_positions;
237 std::vector<int> justSkipped1;
239 if (sensor_width == 2.5) {
241 if (
face ==
"front") {
242 X_positions = {-63.4, -60.9, -54.2, -51.7, -45.0, -42.5, -35.8, -33.3, -26.6, -24.1, -17.4, -14.9,
243 -8.2, -5.7, 1.0, 3.5, 10.2, 12.7, 19.4, 21.9, 28.6, 31.1, 37.8, 40.3, 47.0, 49.5,
245 justSkipped1 = {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
246 }
else if (
face ==
"back") {
247 X_positions = {-65.5, -58.8, -56.3, -49.6, -47.1, -40.4, -37.9, -31.2, -28.7, -22.0, -19.5, -12.8,
248 -10.3, -3.6, -1.1, 5.6, 8.1, 14.8, 17.3, 24.0, 26.5, 33.2, 35.7, 42.4, 44.9,
249 51.6, 54.1, 60.8, 63.3};
250 justSkipped1 = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0};
253 if (Rin == 10 || Rin == 20) {
256 float X_start = -2.0 - 13.5 * (sensor_width - overlap);
257 float X_start_pos = 2.0 - 0.5 * (sensor_width - overlap);
258 if (
face ==
"back") {
259 X_start += (sensor_width - overlap);
260 X_start_pos += (sensor_width - overlap);
262 while (X_start < -2) {
263 X_positions.push_back(X_start);
264 justSkipped1.push_back(1);
265 X_start += 2 * (sensor_width - overlap);
267 while (X_start_pos < Rout + x_offset - sensor_width) {
268 X_positions.push_back(X_start_pos);
269 justSkipped1.push_back(1);
270 X_start_pos += 2 * (sensor_width - overlap);
274 if (
face ==
"front") {
275 X_positions = {-63.4, -54.2, -45, -35.8, -26.6, -17.4, -8.2, 1., 10.2, 19.4, 28.6, 37.8, 47., 56.2, 65.4};
276 justSkipped1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
277 }
else if (
face ==
"back") {
278 X_positions = {-58.8, -49.6, -40.4, -31.2, -22, -12.8, -3.6, 5.6, 14.8, 24, 33.2, 42.4, 51.6, 60.8};
279 justSkipped1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
284 if (layout_type ==
"rectangular") {
286 double x_start = -Rout;
289 std::vector<double> x_positions;
290 for (
double x = x_start;
x <= x_end;
x += sensor_width) {
291 x_positions.push_back(
x);
295 const int rowsToAlternate = 2;
297 for (
size_t i = 0;
i < X_positions.size(); ++
i) {
299 double x = X_positions[
i];
300 bool justSkippedValue = justSkipped1[
i];
302 std::vector<double> y_positions_positive;
303 std::vector<double> y_positions_negative;
305 for (
double y = -Rout - Rin_offset;
y <= Rout + Rin_offset;
y += sensor_height) {
306 std::vector<std::pair<double, double>> corners = {
308 {
x + sensor_width,
y},
309 {
x,
y + sensor_height},
310 {
x + sensor_width,
y + sensor_height}};
312 bool within_bounds = std::all_of(corners.begin(), corners.end(), [&](
const std::pair<double, double>& corner) {
313 double cx = corner.first;
314 double cy = corner.second;
315 return (offset_Rin_lower <= std::sqrt(cx * cx + cy * cy) && std::sqrt(cx * cx + cy * cy) <= offset_Rin_upper);
320 y_positions_positive.push_back(
y);
322 y_positions_negative.push_back(
y);
328 if (x_condition_min <=
x &&
x <= x_condition_max && !y_positions_positive.empty()) {
329 double first_y_pos = y_positions_positive.front();
330 double last_y_pos = y_positions_positive.back() - sensor_height;
333 double top_distance_pos = top_y_pos - last_y_pos;
335 if (adjust_bottom_y_pos &&
x > x_adjust_bottom_y_pos) {
336 bottom_y_pos = bottom_y_pos_value;
339 double bottom_distance_pos = first_y_pos - bottom_y_pos;
341 if (std::abs(top_distance_pos + bottom_distance_pos) >= sensor_height) {
342 for (
auto&
y : y_positions_positive) {
343 y -= bottom_distance_pos - 0.2;
345 y_positions_positive.push_back(y_positions_positive.back() + sensor_height);
350 if (x_condition_min <=
x &&
x <= x_condition_max && !y_positions_negative.empty()) {
351 double first_y_neg = y_positions_negative.front();
352 double last_y_neg = y_positions_negative.back() + sensor_height;
355 double top_distance_neg = -(top_y_neg - first_y_neg);
357 if (adjust_bottom_y_neg &&
x > x_adjust_bottom_y_pos) {
358 bottom_y_neg = bottom_y_neg_value;
361 double bottom_distance_neg = -(last_y_neg - bottom_y_neg);
363 top_distance_neg = std::abs(top_distance_neg);
364 bottom_distance_neg = std::abs(bottom_distance_neg);
365 std::sort(y_positions_negative.begin(), y_positions_negative.end());
367 if (std::abs(top_distance_neg + bottom_distance_neg) >= sensor_height) {
368 if (sensor_height == 19.2) {
369 for (
auto&
y : y_positions_negative) {
370 y -= bottom_distance_neg;
373 for (
auto&
y : y_positions_negative) {
374 y += bottom_distance_neg - 0.2;
377 y_positions_negative.push_back(y_positions_negative.front() - sensor_height);
382 if ((x < x_condition_min || x > x_condition_max) && !y_positions_negative.empty() && !y_positions_positive.empty()) {
383 double first_y_neg = y_positions_negative.front();
384 double last_y_pos = y_positions_positive.back() + sensor_height;
386 double bottom_y_pos = -top_y_pos;
388 double top_distance_pos = std::abs(top_y_pos - last_y_pos);
389 double bottom_distance_pos = std::abs(first_y_neg - bottom_y_pos);
391 if (top_distance_pos + bottom_distance_pos >= sensor_height) {
392 for (
auto&
y : y_positions_positive) {
393 y += top_distance_pos - 0.2;
395 for (
auto&
y : y_positions_negative) {
396 y += top_distance_pos - 0.2;
398 double new_y = y_positions_negative.front() - sensor_height;
400 if (
static_cast<int>(new_y) >
static_cast<int>(bottom_y_pos)) {
401 y_positions_negative.push_back(new_y);
406 std::sort(y_positions_negative.begin(), y_positions_negative.end());
407 std::sort(y_positions_positive.begin(), y_positions_positive.end());
409 double first_y_pos = y_positions_negative.front();
411 last_y_pos = y_positions_positive.back() + sensor_height;
414 bottom_y_pos = -top_y_pos;
415 top_distance_pos = std::abs(top_y_pos - last_y_pos);
416 bottom_distance_pos = std::abs(first_y_pos - bottom_y_pos);
418 double Lb = (bottom_distance_pos + top_distance_pos) / 2;
420 if (top_distance_pos < Lb) {
421 double shift = Lb - top_distance_pos;
422 for (
auto&
y : y_positions_negative) {
425 for (
auto&
y : y_positions_positive) {
428 }
else if (top_distance_pos > Lb) {
429 double shift = top_distance_pos - Lb;
430 for (
auto&
y : y_positions_negative) {
433 for (
auto&
y : y_positions_positive) {
439 std::vector<double> y_positions = y_positions_positive;
440 y_positions.insert(y_positions.end(), y_positions_negative.begin(), y_positions_negative.end());
442 for (
double y : y_positions) {
445 double R_material_threshold = 0;
447 if (placed_sensors.find({x, y}) == placed_sensors.end()) {
448 placed_sensors.insert({
x,
y});
451 double inactive_width = (sensor_width - active_width) / 2;
452 double left_inactive_x_shift;
453 double right_inactive_x_shift;
454 double active_x_shift_sensor;
456 if (
face ==
"front") {
458 double active_x_shift, inactive_x_shift;
460 if (justSkippedValue) {
461 active_x_shift =
x + inactive_width / 2;
462 active_x_shift_sensor = active_x_shift + inactive_width;
464 inactive_x_shift =
x - active_width / 2 + inactive_width / 2;
466 active_x_shift =
x - inactive_width / 2;
467 active_x_shift_sensor = active_x_shift - inactive_width;
469 inactive_x_shift =
x + active_width / 2 - inactive_width / 2;
472 double inactive_x_shift_left, inactive_x_shift_right;
474 if (sensor_width == 5.0) {
476 inactive_x_shift_left =
x - sensor_width / 2 + inactive_width;
477 inactive_x_shift_right =
x + sensor_width / 2;
480 std::vector<std::pair<double, double>> corners_shifted = {
482 {
x + sensor_width,
y},
483 {
x,
y + sensor_height},
484 {
x + sensor_width,
y + sensor_height}};
486 bool within_bounds =
true;
487 for (
const auto& corner : corners_shifted) {
488 double cx = corner.first;
489 double cy = corner.second;
490 double dist = std::sqrt(cx * cx + cy * cy);
492 if (Rin > dist || dist >= Rout) {
493 within_bounds =
false;
500 double r_squared = (
x + x_offset) * (
x + x_offset) + (
y + y_offset) * (
y + y_offset);
502 if (r_squared < R_material_threshold * R_material_threshold) {
503 silicon_thickness = 0.005;
504 copper_thickness = 0.00475;
505 kapton_thickness = 0.03;
506 epoxy_thickness = 0.0012;
510 silicon_thickness = 0.01;
511 copper_thickness = 0.006;
512 kapton_thickness = 0.03;
513 epoxy_thickness = 0.0012;
518 if (sensor_width == 2.5) {
521 sensor = geoManager->MakeBox(sensor_name.c_str(),
siliconMed, active_width / 2, active_height / 2, silicon_thickness / 2);
522 sensor->SetLineColor(SiColor);
523 sensor->SetFillColorAlpha(SiColor, 0.4);
524 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift_sensor + x_offset,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness - epoxy_thickness - silicon_thickness / 2));
527 sensor = geoManager->MakeBox(inactive_name.c_str(),
siliconMed, (sensor_width - active_width) / 2, sensor_height / 2, silicon_thickness / 2);
528 sensor->SetLineColor(kRed);
529 sensor->SetFillColorAlpha(kRed, 1.0);
530 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + inactive_x_shift,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness - epoxy_thickness - silicon_thickness / 2));
535 sensor = geoManager->MakeBox(sensor_name.c_str(),
siliconMed, active_width / 2, sensor_height / 2, silicon_thickness / 2);
536 sensor->SetLineColor(SiColor);
537 sensor->SetFillColorAlpha(SiColor, 0.4);
538 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset +
x + inactive_width / 2,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness - epoxy_thickness - silicon_thickness / 2));
541 sensor = geoManager->MakeBox(inactive_name_left.c_str(),
siliconMed, inactive_width / 2, sensor_height / 2, silicon_thickness / 2);
542 sensor->SetLineColor(kRed);
543 sensor->SetFillColorAlpha(kRed, 1.0);
544 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + inactive_x_shift_left,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness - epoxy_thickness - silicon_thickness / 2));
547 sensor = geoManager->MakeBox(inactive_name_right.c_str(),
siliconMed, inactive_width / 2, sensor_height / 2, silicon_thickness / 2);
548 sensor->SetLineColor(kRed);
549 sensor->SetFillColorAlpha(kRed, 1.0);
550 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + inactive_x_shift_right,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness - epoxy_thickness - silicon_thickness / 2));
555 sensor = geoManager->MakeBox(glue_up_name.c_str(),
epoxyMed, sensor_width / 2, sensor_height / 2, epoxy_thickness / 2);
556 sensor->SetLineColor(kBlue);
557 sensor->SetFillColorAlpha(kBlue, 1.0);
558 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + active_x_shift,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness - epoxy_thickness / 2));
560 if (r_squared < R_material_threshold * R_material_threshold) {
562 sensor = geoManager->MakeBox(alu_name.c_str(),
AluminumMed, sensor_width / 2, sensor_height / 2, copper_thickness / 2);
563 sensor->SetLineColor(kBlack);
564 sensor->SetFillColorAlpha(kBlack, 0.4);
565 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift + x_offset,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness / 2));
569 sensor = geoManager->MakeBox(copper_name.c_str(),
copperMed, sensor_width / 2, sensor_height / 2, copper_thickness / 2);
570 sensor->SetLineColor(kBlack);
571 sensor->SetFillColorAlpha(kBlack, 0.4);
572 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift + x_offset,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness / 2));
577 sensor = geoManager->MakeBox(fpc_name.c_str(),
kaptonMed, sensor_width / 2, sensor_height / 2, kapton_thickness / 2);
578 sensor->SetLineColor(kGreen);
579 sensor->SetFillColorAlpha(kGreen, 0.4);
580 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift + x_offset,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness / 2));
584 sensor = geoManager->MakeBox(glue_down_name.c_str(),
epoxyMed, sensor_width / 2, sensor_height / 2, epoxy_thickness / 2);
585 sensor->SetLineColor(kBlue);
586 sensor->SetFillColorAlpha(kBlue, 1.0);
587 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + active_x_shift,
y + y_offset, mZ + z_offset - epoxy_thickness / 2));
590 double x_shifted =
x;
591 double inactive_x_shift, active_x_shift;
592 double active_x_shift_sensor;
594 if (justSkippedValue) {
595 active_x_shift =
x + inactive_width / 2;
596 active_x_shift_sensor = active_x_shift + inactive_width;
598 inactive_x_shift =
x - active_width / 2 + inactive_width / 2;
600 active_x_shift =
x - inactive_width / 2;
601 active_x_shift_sensor = active_x_shift - inactive_width;
603 inactive_x_shift =
x + active_width / 2 - inactive_width / 2;
606 double inactive_x_shift_left, inactive_x_shift_right;
608 if (sensor_width == 5.0) {
610 inactive_x_shift_left =
x - sensor_width / 2 + inactive_width;
611 inactive_x_shift_right =
x + sensor_width / 2;
614 std::vector<std::pair<double, double>> corners_shifted = {
616 {x_shifted + sensor_width,
y},
617 {x_shifted,
y + sensor_height},
618 {x_shifted + sensor_width,
y + sensor_height}};
620 bool within_bounds =
true;
621 for (
const auto& corner : corners_shifted) {
622 double cx = corner.first;
623 double cy = corner.second;
624 double dist = std::sqrt(cx * cx + cy * cy);
626 if (Rin > dist + dist_offset || dist >= Rout) {
627 within_bounds =
false;
634 double r_squared = (
x + x_offset) * (
x + x_offset) + (
y + y_offset) * (
y + y_offset);
636 if (r_squared < R_material_threshold * R_material_threshold) {
637 silicon_thickness = 0.005;
638 copper_thickness = 0.00475;
639 kapton_thickness = 0.03;
640 epoxy_thickness = 0.0006;
644 silicon_thickness = 0.01;
645 copper_thickness = 0.006;
646 kapton_thickness = 0.03;
647 epoxy_thickness = 0.0012;
654 sensor = geoManager->MakeBox(glue_down_name.c_str(),
epoxyMed, sensor_width / 2, sensor_height / 2, epoxy_thickness / 2);
655 sensor->SetLineColor(kBlue);
656 sensor->SetFillColorAlpha(kBlue, 1.0);
657 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + active_x_shift,
y + y_offset, mZ + z_offset + epoxy_thickness / 2));
661 sensor = geoManager->MakeBox(fpc_name.c_str(),
kaptonMed, sensor_width / 2, sensor_height / 2, kapton_thickness / 2);
662 sensor->SetLineColor(kGreen);
663 sensor->SetFillColorAlpha(kGreen, 0.4);
664 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift + x_offset,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness / 2));
666 if (r_squared < R_material_threshold * R_material_threshold) {
669 sensor = geoManager->MakeBox(alu_name.c_str(),
AluminumMed, sensor_width / 2, sensor_height / 2, copper_thickness / 2);
670 sensor->SetLineColor(kBlack);
671 sensor->SetFillColorAlpha(kBlack, 0.4);
672 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift + x_offset,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness + copper_thickness / 2));
676 sensor = geoManager->MakeBox(copper_name.c_str(),
copperMed, sensor_width / 2, sensor_height / 2, copper_thickness / 2);
677 sensor->SetLineColor(kBlack);
678 sensor->SetFillColorAlpha(kBlack, 0.4);
679 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift + x_offset,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness + copper_thickness / 2));
684 sensor = geoManager->MakeBox(glue_up_name.c_str(),
epoxyMed, sensor_width / 2, sensor_height / 2, epoxy_thickness / 2);
685 sensor->SetLineColor(kBlue);
686 sensor->SetFillColorAlpha(kBlue, 1.0);
687 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + active_x_shift,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness + copper_thickness + epoxy_thickness / 2));
689 if (sensor_width == 2.5) {
692 sensor = geoManager->MakeBox(sensor_name.c_str(),
siliconMed, active_width / 2, active_height / 2, silicon_thickness / 2);
693 sensor->SetLineColor(SiColor);
694 sensor->SetFillColorAlpha(SiColor, 0.4);
695 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift_sensor + x_offset,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness + copper_thickness + epoxy_thickness + silicon_thickness / 2));
698 sensor = geoManager->MakeBox(inactive_name.c_str(),
siliconMed, (sensor_width - active_width) / 2, sensor_height / 2, silicon_thickness / 2);
699 sensor->SetLineColor(kRed);
700 sensor->SetFillColorAlpha(kRed, 1.0);
701 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + inactive_x_shift,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness + copper_thickness + epoxy_thickness + silicon_thickness / 2));
706 sensor = geoManager->MakeBox(sensor_name.c_str(),
siliconMed, active_width / 2, sensor_height / 2, silicon_thickness / 2);
707 sensor->SetLineColor(SiColor);
708 sensor->SetFillColorAlpha(SiColor, 0.4);
709 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + x_shifted + inactive_width / 2,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness + copper_thickness + epoxy_thickness + silicon_thickness / 2));
713 sensor = geoManager->MakeBox(inactive_name_left.c_str(),
siliconMed, inactive_width / 2, sensor_height / 2, silicon_thickness / 2);
714 sensor->SetLineColor(kRed);
715 sensor->SetFillColorAlpha(kRed, 1.0);
716 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + inactive_x_shift_left,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness + copper_thickness + epoxy_thickness + silicon_thickness / 2));
720 sensor = geoManager->MakeBox(inactive_name_right.c_str(),
siliconMed, inactive_width / 2, sensor_height / 2, silicon_thickness / 2);
721 sensor->SetLineColor(kRed);
722 sensor->SetFillColorAlpha(kRed, 1.0);
723 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + inactive_x_shift_right,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness + copper_thickness + epoxy_thickness + silicon_thickness / 2));
733 LOG(
debug) <<
"FT3Module: done create_layout";
736void FT3Module::createModule(
double mZ,
int layerNumber,
int direction,
double Rin,
double Rout,
double overlap,
const std::string&
face,
const std::string& layout_type, TGeoVolume* motherVolume)
739 LOG(
debug) <<
"FT3Module: createModule - Layer " << layerNumber <<
", Direction " << direction <<
", Face " <<
face;
740 create_layout(mZ, layerNumber, direction, Rin, Rout, overlap,
face, layout_type, motherVolume);
741 LOG(
debug) <<
"FT3Module: done createModule";
double calculate_y_circle(double x, double radius)
Definition of the FT3Module class.
static TGeoMedium * epoxyMed
static TGeoMaterial * epoxyMat
static TGeoMedium * siliconMed
static void createModule(double mZ, int layerNumber, int direction, double Rin, double Rout, double overlap, const std::string &face, const std::string &layout_type, TGeoVolume *motherVolume)
static TGeoMedium * copperMed
static TGeoMaterial * kaptonMat
static TGeoMaterial * copperMat
static TGeoMaterial * siliconMat
static TGeoMedium * AluminumMed
static TGeoMedium * kaptonMed
static TGeoMaterial * AluminumMat
static void initialize_materials()
GLenum GLuint GLint GLenum face
std::string to_string(gsl::span< T, Size > span)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"