Project
Loading...
Searching...
No Matches
FT3Module.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef FT3MODULE_H
16#define FT3MODULE_H
17
18#include <TGeoMedium.h>
19#include <TGeoVolume.h>
20#include <string>
21#include <vector>
22
25
26// define types for y positions, second element is the stack height
27using PositionType = std::pair<double, unsigned>;
28using PositionTypes = std::vector<PositionType>;
29using PosNegPositionTypes = std::pair<PositionTypes, PositionTypes>;
30// define type of the y position range: First pair is (min, max) for positive y
31using PositionRangeType = std::pair<std::pair<double, double>, std::pair<double, double>>;
34
36{
37
38 public:
39 const char* mDetName;
40
41 static void createModule(
42 double mZ, int layerNumber, int direction, double Rin,
43 double Rout, double overlap, const std::string& face,
44 const std::string& layout_type, TGeoVolume* motherVolume);
45
47 double mZ, int layerNumber, int direction, double Rin,
48 double Rout, double z_offset_local, const Constants::StaveConfig& staveConfig,
49 TGeoVolume* motherVolume);
50
51 private:
52 static void create_layout(
53 double mZ, int layerNumber, int direction, double Rin,
54 double Rout, double overlap, const std::string& face,
55 const std::string& layout_type, TGeoVolume* motherVolume);
56
57 void create_layout_staveGeo(
58 double mZ, int layerNumber, int direction, double Rin,
59 double Rout, double z_offset_local, const Constants::StaveConfig& staveConfig,
60 TGeoVolume* motherVolume);
61
62 // Walk every stave of a layer, create its volumes and work out where its
63 // modules go, leaving the positions in y_positionsPosNeg
64 void build_staves_exact(
65 TGeoVolume* motherVolume, int layerNumber, int direction,
66 const Constants::StaveConfig& staveConfig,
67 const std::array<std::array<double, 3>, 4>& staveTriangles,
68 double z_offset_to_carbon_face,
69 std::vector<PosNegPositionTypes>& y_positionsPosNeg,
70 unsigned& staveVolumeCount);
71
72 void build_staves_greedy(
73 TGeoVolume* motherVolume, int layerNumber, int direction, double Rin, double Rout,
74 const Constants::StaveConfig& staveConfig,
75 const std::array<std::array<double, 3>, 4>& staveTriangles,
76 double z_offset_to_carbon_face,
77 std::vector<PosNegPositionTypes>& y_positionsPosNeg, unsigned& staveVolumeCount);
78
79 // Shared by both: one stave's carbon shell, plus its mirror where needed
80 void add_stave_volumes(
81 TGeoVolume* motherVolume, int layerNumber, int direction,
82 const Constants::StaveConfig& staveConfig, unsigned i_stave,
83 const std::array<std::array<double, 3>, 4>& staveTriangles,
84 double z_offset_to_carbon_face, std::pair<double, double>& absAllowedYRange,
85 double y_midpoint, bool mirrorStaveAroundX, unsigned* staveVolumeCount);
86
87 // FR4 + Cu end-of-stave card at the outer-radius tip of a disk stave. One card
88 // per stave tip, placed downstream of the stave (away from the IP), in front of
89 // the connection disk. Dimensions from Constants::getEosCardParams(isML).
90 void addEndOfStaveCard(
91 TGeoVolume* motherVolume, const std::string& name, int direction,
92 unsigned volume_count, double x_mid, double y_tip, double z_sensor,
93 bool isML, double cuThickness);
94
95 // Helper functions
96 void fill_stave_greedy(
97 PosNegPositionTypes& y_positions, unsigned kSensorStack,
98 PositionRangeType y_range,
99 std::pair<double, double>& absAllowedYRange);
100
101 PositionTypes fill_stave_exact(const std::vector<Constants::StaveFill>& fills);
102
103 void addStaveVolume(
104 TGeoVolume* motherVolume, std::string volumeName, int direction,
105 unsigned* volume_count, double staveLength,
106 std::array<std::array<double, 3>, 4> staveTriangles,
107 std::pair<double, double>& absAllowedYRange,
108 double x_mid, double y_mid, double z_stave_shift_forward);
109 void addDetectorVolume(
110 TGeoVolume* motherVolume, std::string volumeName, int color, TGeoMedium* med,
111 unsigned volume_count, double x_mid, double y_mid, double z_mid,
112 double x_half_length, double y_half_length, double z_half_length, double rotX = 0);
113
114 void add2x1GlueVolume(
115 TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
116 unsigned volume_count, double x_mid, double y_mid, double z_mid,
117 std::string element_glued_to);
118
119 void add2x1CopperVolume(
120 TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
121 unsigned volume_count, double x_mid, double y_mid, double z_mid);
122
123 void add2x1KaptonVolume(
124 TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
125 unsigned volume_count, double x_mid, double y_mid, double z_mid);
126
127 void addSingleSensorVolume(
128 TGeoVolume* motherVolume, int layerNumber, int direction, unsigned stave_idx,
129 unsigned volume_count, double active_x_mid, double y_mid, double z_mid, bool isLeft);
130};
131
132#endif // FT3MODULE_H
Materials of the FT3 detector, and access to the media made from them.
Definition of various constants for tiling the modules of sensors.
std::pair< std::pair< double, double >, std::pair< double, double > > PositionRangeType
Definition FT3Module.h:31
std::vector< PositionType > PositionTypes
Definition FT3Module.h:28
std::pair< double, unsigned > PositionType
Definition FT3Module.h:27
std::pair< PositionTypes, PositionTypes > PosNegPositionTypes
Definition FT3Module.h:29
void createModule_staveGeo(double mZ, int layerNumber, int direction, double Rin, double Rout, double z_offset_local, const Constants::StaveConfig &staveConfig, TGeoVolume *motherVolume)
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)
const char * mDetName
Definition FT3Module.h:39
GLuint color
Definition glcorearb.h:1272
GLuint const GLchar * name
Definition glcorearb.h:781
GLenum GLuint GLint GLenum face
Definition glcorearb.h:3184