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) {
129 x_offset = sensor_width / 2;
130 y_offset = sensor_height / 2;
133 double x_condition_min = 0;
134 double x_condition_max = 0;
135 double offset_Rin_lower = 0;
136 double offset_Rin_upper = 0;
137 bool adjust_bottom_y_pos =
false;
138 bool adjust_bottom_y_neg =
false;
139 double x_adjust_bottom_y_pos = 0;
140 double bottom_y_pos_value = 0;
141 double bottom_y_neg_value = 0;
143 double Rin_offset = (sensor_height == 19.2) ? 1 : 0;
144 double Rout_offset = (sensor_height == 19.2) ? 1 : 0;
146 if (Rin == 7 && sensor_height == 9.6 && sensor_width == 5) {
147 x_condition_min = -Rin - 2;
148 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;
157 }
else if (Rin == 5 && sensor_height == 9.6 && sensor_width == 5) {
158 x_condition_min = -Rin - 6;
159 x_condition_max = Rin;
160 adjust_bottom_y_pos =
true;
161 adjust_bottom_y_neg =
true;
162 x_adjust_bottom_y_pos = 3.5;
163 bottom_y_pos_value = 3.5;
164 bottom_y_neg_value = -3.5;
165 }
else if ((Rin == 5 || Rin == 7) && sensor_height == 19.2) {
166 x_condition_min = -Rin - 3;
167 x_condition_max = Rin - 0.2;
169 adjust_bottom_y_pos =
false;
170 adjust_bottom_y_neg =
false;
171 }
else if (Rin == 5 && sensor_height == 3.2) {
172 x_condition_min = -(Rin + 2.6);
173 x_condition_max = Rin + 1.5;
174 adjust_bottom_y_pos =
true;
175 adjust_bottom_y_neg =
true;
176 x_adjust_bottom_y_pos = 3.5;
177 bottom_y_pos_value = 3.5;
178 bottom_y_neg_value = -3.5;
179 }
else if (Rin == 7 && sensor_height == 3.2) {
180 x_condition_min = -Rin - 1;
181 x_condition_max = Rin - 0.2;
182 adjust_bottom_y_pos =
true;
183 adjust_bottom_y_neg =
true;
184 x_adjust_bottom_y_pos = 3.5;
185 bottom_y_pos_value = 3.5;
186 bottom_y_neg_value = -3.5;
187 }
else if (Rin == 5 && sensor_height == 9.6 && sensor_width == 2.5) {
188 x_condition_min = -(Rin + 2.6);
189 x_condition_max = Rin;
190 adjust_bottom_y_pos =
true;
191 adjust_bottom_y_neg =
true;
192 x_adjust_bottom_y_pos = 3.5;
193 bottom_y_pos_value = 3.5;
194 bottom_y_neg_value = -3.5;
195 }
else if (Rin == 7 && sensor_height == 9.6 && sensor_width == 2.5) {
196 x_condition_min = -Rin - 2.6;
197 x_condition_max = Rin + 1;
199 adjust_bottom_y_pos =
true;
200 adjust_bottom_y_neg =
true;
201 x_adjust_bottom_y_pos = 5.5;
202 bottom_y_pos_value = 3.5;
203 bottom_y_neg_value = -3.5;
204 }
else if (Rin == 20 && sensor_height == 9.6 && sensor_width == 5.0) {
205 x_condition_min = -Rin - 4;
206 x_condition_max = Rin;
208 adjust_bottom_y_pos =
false;
209 adjust_bottom_y_neg =
false;
210 x_adjust_bottom_y_pos = 3.5;
211 bottom_y_pos_value = 3.5;
212 bottom_y_neg_value = -3.5;
214 LOG(warning) <<
"Different config - to determine offsets needed for " <<
"Rin = " << Rin <<
" ; sensor_height = " << sensor_height <<
" ; sensor_width = " << sensor_width <<
" layer " << layerNumber;
215 x_condition_min = -Rin - sensor_width;
216 x_condition_max = Rin;
217 adjust_bottom_y_pos =
false;
218 adjust_bottom_y_neg =
false;
221 offset_Rin_lower = Rin - Rin_offset;
222 offset_Rin_upper = Rout + Rout_offset;
224 std::set<std::pair<double, double>> placed_sensors;
225 int sensor_count = 0;
227 int placementCounter = 0;
228 bool justSkipped =
false;
230 std::vector<double> X_positions;
231 std::vector<int> justSkipped1;
233 if (sensor_width == 2.5) {
235 if (
face ==
"front") {
236 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,
237 -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,
239 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};
240 }
else if (
face ==
"back") {
241 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,
242 -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,
243 51.6, 54.1, 60.8, 63.3};
244 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};
250 float X_start = -2.0 - 13.5 * (sensor_width - overlap);
251 float X_start_pos = 2.0 - 0.5 * (sensor_width - overlap);
252 if (
face ==
"back") {
253 X_start += (sensor_width - overlap);
254 X_start_pos += (sensor_width - overlap);
256 while (X_start < -2) {
257 X_positions.push_back(X_start);
258 justSkipped1.push_back(1);
259 X_start += 2 * (sensor_width - overlap);
261 while (X_start_pos < Rout + x_offset - sensor_width) {
262 X_positions.push_back(X_start_pos);
263 justSkipped1.push_back(1);
264 X_start_pos += 2 * (sensor_width - overlap);
268 if (
face ==
"front") {
269 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};
270 justSkipped1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
271 }
else if (
face ==
"back") {
272 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};
273 justSkipped1 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
278 if (layout_type ==
"rectangular") {
280 double x_start = -Rout;
283 std::vector<double> x_positions;
284 for (
double x = x_start;
x <= x_end;
x += sensor_width) {
285 x_positions.push_back(
x);
289 const int rowsToAlternate = 2;
291 for (
size_t i = 0;
i < X_positions.size(); ++
i) {
293 double x = X_positions[
i];
294 bool justSkippedValue = justSkipped1[
i];
296 std::vector<double> y_positions_positive;
297 std::vector<double> y_positions_negative;
299 for (
double y = -Rout - Rin_offset;
y <= Rout + Rin_offset;
y += sensor_height) {
300 std::vector<std::pair<double, double>> corners = {
302 {
x + sensor_width,
y},
303 {
x,
y + sensor_height},
304 {
x + sensor_width,
y + sensor_height}};
306 bool within_bounds = std::all_of(corners.begin(), corners.end(), [&](
const std::pair<double, double>& corner) {
307 double cx = corner.first;
308 double cy = corner.second;
309 return (offset_Rin_lower <= std::sqrt(cx * cx + cy * cy) && std::sqrt(cx * cx + cy * cy) <= offset_Rin_upper);
314 y_positions_positive.push_back(
y);
316 y_positions_negative.push_back(
y);
322 if (x_condition_min <=
x &&
x <= x_condition_max && !y_positions_positive.empty()) {
323 double first_y_pos = y_positions_positive.front();
324 double last_y_pos = y_positions_positive.back() - sensor_height;
327 double top_distance_pos = top_y_pos - last_y_pos;
329 if (adjust_bottom_y_pos &&
x > x_adjust_bottom_y_pos) {
330 bottom_y_pos = bottom_y_pos_value;
333 double bottom_distance_pos = first_y_pos - bottom_y_pos;
335 if (std::abs(top_distance_pos + bottom_distance_pos) >= sensor_height) {
336 for (
auto&
y : y_positions_positive) {
337 y -= bottom_distance_pos - 0.2;
339 y_positions_positive.push_back(y_positions_positive.back() + sensor_height);
344 if (x_condition_min <=
x &&
x <= x_condition_max && !y_positions_negative.empty()) {
345 double first_y_neg = y_positions_negative.front();
346 double last_y_neg = y_positions_negative.back() + sensor_height;
349 double top_distance_neg = -(top_y_neg - first_y_neg);
351 if (adjust_bottom_y_neg &&
x > x_adjust_bottom_y_pos) {
352 bottom_y_neg = bottom_y_neg_value;
355 double bottom_distance_neg = -(last_y_neg - bottom_y_neg);
357 top_distance_neg = std::abs(top_distance_neg);
358 bottom_distance_neg = std::abs(bottom_distance_neg);
359 std::sort(y_positions_negative.begin(), y_positions_negative.end());
361 if (std::abs(top_distance_neg + bottom_distance_neg) >= sensor_height) {
362 if (sensor_height == 19.2) {
363 for (
auto&
y : y_positions_negative) {
364 y -= bottom_distance_neg;
367 for (
auto&
y : y_positions_negative) {
368 y += bottom_distance_neg - 0.2;
371 y_positions_negative.push_back(y_positions_negative.front() - sensor_height);
376 if ((x < x_condition_min || x > x_condition_max) && !y_positions_negative.empty() && !y_positions_positive.empty()) {
377 double first_y_neg = y_positions_negative.front();
378 double last_y_pos = y_positions_positive.back() + sensor_height;
380 double bottom_y_pos = -top_y_pos;
382 double top_distance_pos = std::abs(top_y_pos - last_y_pos);
383 double bottom_distance_pos = std::abs(first_y_neg - bottom_y_pos);
385 if (top_distance_pos + bottom_distance_pos >= sensor_height) {
386 for (
auto&
y : y_positions_positive) {
387 y += top_distance_pos - 0.2;
389 for (
auto&
y : y_positions_negative) {
390 y += top_distance_pos - 0.2;
392 double new_y = y_positions_negative.front() - sensor_height;
394 if (
static_cast<int>(new_y) >
static_cast<int>(bottom_y_pos)) {
395 y_positions_negative.push_back(new_y);
400 std::sort(y_positions_negative.begin(), y_positions_negative.end());
401 std::sort(y_positions_positive.begin(), y_positions_positive.end());
403 double first_y_pos = y_positions_negative.front();
405 last_y_pos = y_positions_positive.back() + sensor_height;
408 bottom_y_pos = -top_y_pos;
409 top_distance_pos = std::abs(top_y_pos - last_y_pos);
410 bottom_distance_pos = std::abs(first_y_pos - bottom_y_pos);
412 double Lb = (bottom_distance_pos + top_distance_pos) / 2;
414 if (top_distance_pos < Lb) {
415 double shift = Lb - top_distance_pos;
416 for (
auto&
y : y_positions_negative) {
419 for (
auto&
y : y_positions_positive) {
422 }
else if (top_distance_pos > Lb) {
423 double shift = top_distance_pos - Lb;
424 for (
auto&
y : y_positions_negative) {
427 for (
auto&
y : y_positions_positive) {
433 std::vector<double> y_positions = y_positions_positive;
434 y_positions.insert(y_positions.end(), y_positions_negative.begin(), y_positions_negative.end());
436 for (
double y : y_positions) {
439 double R_material_threshold = 0;
441 if (placed_sensors.find({x, y}) == placed_sensors.end()) {
442 placed_sensors.insert({
x,
y});
445 double inactive_width = (sensor_width - active_width) / 2;
446 double left_inactive_x_shift;
447 double right_inactive_x_shift;
448 double active_x_shift_sensor;
450 if (
face ==
"front") {
452 double active_x_shift, inactive_x_shift;
454 if (justSkippedValue) {
455 active_x_shift =
x + inactive_width / 2;
456 active_x_shift_sensor = active_x_shift + inactive_width;
458 inactive_x_shift =
x - active_width / 2 + inactive_width / 2;
460 active_x_shift =
x - inactive_width / 2;
461 active_x_shift_sensor = active_x_shift - inactive_width;
463 inactive_x_shift =
x + active_width / 2 - inactive_width / 2;
466 double inactive_x_shift_left, inactive_x_shift_right;
468 if (sensor_width == 5.0) {
470 inactive_x_shift_left =
x - sensor_width / 2 + inactive_width;
471 inactive_x_shift_right =
x + sensor_width / 2;
474 std::vector<std::pair<double, double>> corners_shifted = {
476 {
x + sensor_width,
y},
477 {
x,
y + sensor_height},
478 {
x + sensor_width,
y + sensor_height}};
480 bool within_bounds =
true;
481 for (
const auto& corner : corners_shifted) {
482 double cx = corner.first;
483 double cy = corner.second;
484 double dist = std::sqrt(cx * cx + cy * cy);
486 if (Rin > dist || dist >= Rout) {
487 within_bounds =
false;
494 double r_squared = (
x + x_offset) * (
x + x_offset) + (
y + y_offset) * (
y + y_offset);
496 if (r_squared < R_material_threshold * R_material_threshold) {
497 silicon_thickness = 0.005;
498 copper_thickness = 0.00475;
499 kapton_thickness = 0.03;
500 epoxy_thickness = 0.0012;
504 silicon_thickness = 0.01;
505 copper_thickness = 0.006;
506 kapton_thickness = 0.03;
507 epoxy_thickness = 0.0012;
512 if (sensor_width == 2.5) {
515 sensor = geoManager->MakeBox(sensor_name.c_str(),
siliconMed, active_width / 2, active_height / 2, silicon_thickness / 2);
516 sensor->SetLineColor(SiColor);
517 sensor->SetFillColorAlpha(SiColor, 0.4);
518 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));
521 sensor = geoManager->MakeBox(inactive_name.c_str(),
siliconMed, (sensor_width - active_width) / 2, sensor_height / 2, silicon_thickness / 2);
522 sensor->SetLineColor(kRed);
523 sensor->SetFillColorAlpha(kRed, 1.0);
524 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));
529 sensor = geoManager->MakeBox(sensor_name.c_str(),
siliconMed, active_width / 2, sensor_height / 2, silicon_thickness / 2);
530 sensor->SetLineColor(SiColor);
531 sensor->SetFillColorAlpha(SiColor, 0.4);
532 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));
535 sensor = geoManager->MakeBox(inactive_name_left.c_str(),
siliconMed, inactive_width / 2, sensor_height / 2, silicon_thickness / 2);
536 sensor->SetLineColor(kRed);
537 sensor->SetFillColorAlpha(kRed, 1.0);
538 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));
541 sensor = geoManager->MakeBox(inactive_name_right.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_right,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness - copper_thickness - epoxy_thickness - silicon_thickness / 2));
549 sensor = geoManager->MakeBox(glue_up_name.c_str(),
epoxyMed, sensor_width / 2, sensor_height / 2, epoxy_thickness / 2);
550 sensor->SetLineColor(kBlue);
551 sensor->SetFillColorAlpha(kBlue, 1.0);
552 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));
554 if (r_squared < R_material_threshold * R_material_threshold) {
556 sensor = geoManager->MakeBox(alu_name.c_str(),
AluminumMed, sensor_width / 2, sensor_height / 2, copper_thickness / 2);
557 sensor->SetLineColor(kBlack);
558 sensor->SetFillColorAlpha(kBlack, 0.4);
559 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));
563 sensor = geoManager->MakeBox(copper_name.c_str(),
copperMed, sensor_width / 2, sensor_height / 2, copper_thickness / 2);
564 sensor->SetLineColor(kBlack);
565 sensor->SetFillColorAlpha(kBlack, 0.4);
566 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));
571 sensor = geoManager->MakeBox(fpc_name.c_str(),
kaptonMed, sensor_width / 2, sensor_height / 2, kapton_thickness / 2);
572 sensor->SetLineColor(kGreen);
573 sensor->SetFillColorAlpha(kGreen, 0.4);
574 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift + x_offset,
y + y_offset, mZ + z_offset - epoxy_thickness - kapton_thickness / 2));
578 sensor = geoManager->MakeBox(glue_down_name.c_str(),
epoxyMed, sensor_width / 2, sensor_height / 2, epoxy_thickness / 2);
579 sensor->SetLineColor(kBlue);
580 sensor->SetFillColorAlpha(kBlue, 1.0);
581 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + active_x_shift,
y + y_offset, mZ + z_offset - epoxy_thickness / 2));
584 double x_shifted =
x;
585 double inactive_x_shift, active_x_shift;
586 double active_x_shift_sensor;
588 if (justSkippedValue) {
589 active_x_shift =
x + inactive_width / 2;
590 active_x_shift_sensor = active_x_shift + inactive_width;
592 inactive_x_shift =
x - active_width / 2 + inactive_width / 2;
594 active_x_shift =
x - inactive_width / 2;
595 active_x_shift_sensor = active_x_shift - inactive_width;
597 inactive_x_shift =
x + active_width / 2 - inactive_width / 2;
600 double inactive_x_shift_left, inactive_x_shift_right;
602 if (sensor_width == 5.0) {
604 inactive_x_shift_left =
x - sensor_width / 2 + inactive_width;
605 inactive_x_shift_right =
x + sensor_width / 2;
608 std::vector<std::pair<double, double>> corners_shifted = {
610 {x_shifted + sensor_width,
y},
611 {x_shifted,
y + sensor_height},
612 {x_shifted + sensor_width,
y + sensor_height}};
614 bool within_bounds =
true;
615 for (
const auto& corner : corners_shifted) {
616 double cx = corner.first;
617 double cy = corner.second;
618 double dist = std::sqrt(cx * cx + cy * cy);
620 if (Rin > dist + dist_offset || dist >= Rout) {
621 within_bounds =
false;
628 double r_squared = (
x + x_offset) * (
x + x_offset) + (
y + y_offset) * (
y + y_offset);
630 if (r_squared < R_material_threshold * R_material_threshold) {
631 silicon_thickness = 0.005;
632 copper_thickness = 0.00475;
633 kapton_thickness = 0.03;
634 epoxy_thickness = 0.0006;
638 silicon_thickness = 0.01;
639 copper_thickness = 0.006;
640 kapton_thickness = 0.03;
641 epoxy_thickness = 0.0012;
648 sensor = geoManager->MakeBox(glue_down_name.c_str(),
epoxyMed, sensor_width / 2, sensor_height / 2, epoxy_thickness / 2);
649 sensor->SetLineColor(kBlue);
650 sensor->SetFillColorAlpha(kBlue, 1.0);
651 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(x_offset + active_x_shift,
y + y_offset, mZ + z_offset + epoxy_thickness / 2));
655 sensor = geoManager->MakeBox(fpc_name.c_str(),
kaptonMed, sensor_width / 2, sensor_height / 2, kapton_thickness / 2);
656 sensor->SetLineColor(kGreen);
657 sensor->SetFillColorAlpha(kGreen, 0.4);
658 motherVolume->AddNode(sensor, sensor_count++,
new TGeoTranslation(active_x_shift + x_offset,
y + y_offset, mZ + z_offset + epoxy_thickness + kapton_thickness / 2));
660 if (r_squared < R_material_threshold * R_material_threshold) {
663 sensor = geoManager->MakeBox(alu_name.c_str(),
AluminumMed, sensor_width / 2, sensor_height / 2, copper_thickness / 2);
664 sensor->SetLineColor(kBlack);
665 sensor->SetFillColorAlpha(kBlack, 0.4);
666 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));
670 sensor = geoManager->MakeBox(copper_name.c_str(),
copperMed, sensor_width / 2, sensor_height / 2, copper_thickness / 2);
671 sensor->SetLineColor(kBlack);
672 sensor->SetFillColorAlpha(kBlack, 0.4);
673 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));
678 sensor = geoManager->MakeBox(glue_up_name.c_str(),
epoxyMed, sensor_width / 2, sensor_height / 2, epoxy_thickness / 2);
679 sensor->SetLineColor(kBlue);
680 sensor->SetFillColorAlpha(kBlue, 1.0);
681 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));
683 if (sensor_width == 2.5) {
686 sensor = geoManager->MakeBox(sensor_name.c_str(),
siliconMed, active_width / 2, active_height / 2, silicon_thickness / 2);
687 sensor->SetLineColor(SiColor);
688 sensor->SetFillColorAlpha(SiColor, 0.4);
689 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));
692 sensor = geoManager->MakeBox(inactive_name.c_str(),
siliconMed, (sensor_width - active_width) / 2, sensor_height / 2, silicon_thickness / 2);
693 sensor->SetLineColor(kRed);
694 sensor->SetFillColorAlpha(kRed, 1.0);
695 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));
700 sensor = geoManager->MakeBox(sensor_name.c_str(),
siliconMed, active_width / 2, sensor_height / 2, silicon_thickness / 2);
701 sensor->SetLineColor(SiColor);
702 sensor->SetFillColorAlpha(SiColor, 0.4);
703 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));
707 sensor = geoManager->MakeBox(inactive_name_left.c_str(),
siliconMed, inactive_width / 2, sensor_height / 2, silicon_thickness / 2);
708 sensor->SetLineColor(kRed);
709 sensor->SetFillColorAlpha(kRed, 1.0);
710 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));
714 sensor = geoManager->MakeBox(inactive_name_right.c_str(),
siliconMed, inactive_width / 2, sensor_height / 2, silicon_thickness / 2);
715 sensor->SetLineColor(kRed);
716 sensor->SetFillColorAlpha(kRed, 1.0);
717 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));
727 LOG(
debug) <<
"FT3Module: done create_layout";
730void 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)
733 LOG(
debug) <<
"FT3Module: createModule - Layer " << layerNumber <<
", Direction " << direction <<
", Face " <<
face;
734 create_layout(mZ, layerNumber, direction, Rin, Rout, overlap,
face, layout_type, motherVolume);
735 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"