Project
Loading...
Searching...
No Matches
FT3ModuleConstants.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 FT3MODULECONSTANTS_H
16#define FT3MODULECONSTANTS_H
17
18#include <vector>
19#include <map>
20#include <TColor.h>
21#include <TMath.h>
22
24{
25/* CURRENT STATUS:
26 * 25x29mm sensors, 2mm inactive on one side
27 * Most granular layout is 2x1 sensors, where the one on the right has the inactive region
28 * on the right, and the one on the left has the inactive region on the left.
29 * When stacking 2x1 modules, there is a 0.2mm gap between them. By default, we assume this
30 * gap to be ABOVE the most recently placed module.
31 *
32 * |<- 25mm ->|<- 25mm ->|
33 * _______________________
34 * ----------------------- 0.2mm gap above
35 * | | | | |
36 * | | | | |
37 * | | | | |
38 * | | | | | 29mm sensor height
39 * | | | | |
40 * | | | | |
41 * ------------------------
42 *
43 */
44// First set all layout constants for the rest of the function
45const double single_sensor_width = 2.5;
46const double single_sensor_height = 2.9;
47const double inactive_width = 0.2;
48const double sensor2x1_gap = 0.02;
49const double stackGap = sensor2x1_gap; // gap between 2xN module stacks
50
53
57const std::vector<unsigned> kSensorsPerStack = {4, 2, 1};
58inline const double getStackHeight(unsigned nSensorsPerStack)
59{
60 return nSensorsPerStack * sensor2x1_height +
61 (nSensorsPerStack - 1) * sensor2x1_gap;
62}
63
64// small helper function to get 1-indexed stave ID, counting from the middle outwards,
65// with negative IDs on the left and positive IDs on the right
66inline const int staveIdxToID(int staveIdx, unsigned nStavesPerDisc)
67{
68 unsigned nStavesOneSide = nStavesPerDisc / 2;
69 bool isRight = staveIdx >= nStavesOneSide;
70 return staveIdx - nStavesOneSide + isRight;
71}
72
73// material properties
74const double siliconThickness = 0.01;
75const double copperThickness = 0.006;
76const double kaptonThickness = 0.03;
77const double epoxyThickness = 0.0012;
78
79const double effectiveCarbonThickness_Stave = 0.02; // foam + shell
80const double staveOpeningAngle = 60 * TMath::DegToRad();
81const double sinTheta = TMath::Sin(staveOpeningAngle / 2);
82const double alpha = TMath::Pi() / 2 - staveOpeningAngle / 2; // bottom angles
83const double staveSensorGap = 0.1; // 2mm padding on each side when sensor is glued
84const double staveTriangleHeight = (sensor2x1_width + 2 * staveSensorGap) / 2.0 / tan(staveOpeningAngle / 2.0);
85/*
86 * Now describe the offset of every other stave in z to avoid overlaps
87 * ______ ______
88 * \ /______\ / | <-- z_offsetStave
89 * \ / \ / \ /
90 * \/ \ / \/
91 * \/
92 */
93// If midpoint spacing becomes non constant, this becomes a function
94// TODO: add some tolerance to avoid overlaps?
95inline const double z_offsetStave(double x_midpoint_spacing)
96{
97 return staveTriangleHeight *
98 (2 - x_midpoint_spacing / (sensor2x1_width / 2 + staveSensorGap));
99}
100
101const int SiColor = kGreen;
102const int SiInactiveColor = kRed;
103const int glueColor = kBlue;
104const int CuColor = kOrange;
105const int kaptonColor = kYellow;
106const int carbonFiberColor = kGray + 1;
107
108// Struct for stave position configuration (varies between ML/OT)
110 const unsigned isML; // whether this config is for ML or OT
111 /*
112 * Constants for staves are written for both positive
113 * and negative x even though they are just mirrored now,
114 * because there might be design changes in the future
115 * that require a non-mirrored layout, making it easier to
116 * change here if so required, even though it looks uglier now.
117 *
118 * The second element in the mapping pair is whether the stave
119 * with a certain ID should be mirrored around the x-axis.
120 */
121 // map from Stave ID (1-indexed from other documents) to midpoint
122 // Do NOT add any zero midpoints, this is taken off separately
123 const std::map<int, std::pair<double, bool>>& staveID_to_y_midpoint;
124 // lengths of staves, their midpoint, and their face
125 const std::vector<double>& y_lengths;
126 const std::vector<double>& x_midpoints;
127 const double x_midpoint_spacing;
128 // whether staves can be placed outside of nominal radii
129 const double maxToleranceInner;
130 const double maxToleranceOuter;
131 // which side of the disc do we place the stave?
132 // kSegmentedStave: staggering staves in z (see z_offsetStave)
133 // accessed via stave index, NOT stave ID
134 const std::vector<bool>& staveOnFront;
135};
136
137namespace OT_StavePositions
138{
139const std::map<int, std::pair<double, bool>> staveID_to_y_midpoint = {
140 {-2, {39.0, true}},
141 {-1, {41.4, true}},
142 {1, {41.4, true}},
143 {2, {39.0, true}}};
144const std::vector<double> y_lengths = {
145 52.8, 66.0, 79.2, 92.4, 99.0, 105.6, 118.8, 118.8,
146 128.7, 132.0, 132.0, 138.6, 138.6, 56.1, 52.8,
147 52.8, 56.1, 138.6, 138.6, 132.0, 132.0, 128.7,
148 118.8, 118.8, 105.6, 99.0, 92.4, 79.2, 66.0, 52.8};
149const std::vector<double> x_midpoints = {
150 -65.25, -60.75, -56.25, -51.75, -47.25, -42.75, -38.25, // L
151 -33.75, -29.25, -24.75, -20.25, -15.75, -11.25, -6.75, -2.25, // L
152 2.25, 6.75, 11.25, 15.75, 20.25, 24.75, 29.25, 33.75, // R
153 38.25, 42.75, 47.25, 51.75, 56.25, 60.75, 65.25 // R
154};
155const double x_midpoint_spacing = 4.5; // assume constant for now
156const double maxToleranceInner = 0.; // default not allowed inwards
157const double maxToleranceOuter = 3.4; // leave 1mm for layer air encapsulation
158const std::vector<bool> staveOnFront =
159 {
160 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, // L
161 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 // R
162};
163} // namespace OT_StavePositions
164
165namespace ML_StavePositions
166{
167// Use prelim numbers for now, these will change! TODO
168const std::map<int, std::pair<double, bool>> staveID_to_y_midpoint = {
169 {-3, {19.1, true}},
170 {-2, {21.8, true}},
171 {-1, {22.5, true}},
172 {1, {22.5, true}},
173 {2, {21.8, true}},
174 {3, {19.1, true}}};
175const std::vector<double> y_lengths = {
176 30.5, 44.5, 53.6, 60.0, 64.6, 29.5, 25.8, 25.0,
177 25.0, 25.8, 29.5, 64.6, 60.0, 53.6, 44.5, 30.5};
178const std::vector<double> x_midpoints = {
179 -33.75, -29.25, -24.75, -20.25, -15.75, -11.25, -6.75, -2.25, // L
180 2.25, 6.75, 11.25, 15.75, 20.25, 24.75, 29.25, 33.75 // R
181};
182const double x_midpoint_spacing = 4.5;
183const double maxToleranceInner = 0.; // default not allowed inwards
184const double maxToleranceOuter = 3.4; // leave 1mm for layer air encapsulation
185const std::vector<bool> staveOnFront =
186 {
187 1, 0, 1, 0, 1, 0, 1, 0, // L
188 1, 0, 1, 0, 1, 0, 1, 0 // R
189};
190} // namespace ML_StavePositions
191
192// Get stave configuration based on tracker type
217
218} // namespace o2::ft3::ModuleConstants
219
220#endif // FT3MODULECONSTANTS_H
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
const std::map< int, std::pair< double, bool > > staveID_to_y_midpoint
const std::map< int, std::pair< double, bool > > staveID_to_y_midpoint
const double effectiveCarbonThickness_Stave
const double z_offsetStave(double x_midpoint_spacing)
const int staveIdxToID(int staveIdx, unsigned nStavesPerDisc)
StaveConfig getStaveConfig(bool isInnerDisk)
const double getStackHeight(unsigned nSensorsPerStack)
const std::vector< unsigned > kSensorsPerStack
const std::vector< double > & x_midpoints
const std::vector< double > & y_lengths
const std::map< int, std::pair< double, bool > > & staveID_to_y_midpoint
const std::vector< bool > & staveOnFront