Project
Loading...
Searching...
No Matches
Geometry.cxx
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#include "FT0Base/Geometry.h"
12#include "TSystem.h"
13#include "Framework/Logger.h"
14#include <sstream>
15#include <iomanip>
16#include <string>
17#include <iostream>
18
20
21using namespace TMath;
22using namespace o2::detectors;
23using namespace o2::ft0;
24
25Geometry::Geometry() : mMCP{{0, 0, 0}}
26{
27
28 setAsideModules();
29 setCsideModules();
30}
31
33{
34 //These are coordinate positions for the sensitive elements within the FIT mother volume
35 //measured from the CAD drawings. The positive/negative X values are referenced
36 //from the back side of the frame lookinmg toward the interaction point
37 Float_t mPosModuleAx[Geometry::NCellsA] = {-12.25, -6.15, -0.05, 6.15, 12.25, -12.25, -6.15, -0.05, 6.15, 12.25, -13.58, -7.48, 7.48, 13.58, -12.25, -6.15, 0.05, 6.15, 12.25, -12.25, -6.15, 0.05, 6.15, 12.25};
38
39 Float_t mPosModuleAy[Geometry::NCellsA] = {12.2, 12.2, 13.53, 12.2, 12.2, 6.1, 6.1, 7.43, 6.1, 6.1, 0.0, 0.0, 0.0, 0.0, -6.1, -6.1, -7.43, -6.1, -6.1, -12.2, -12.2, -13.53, -12.2, -12.2};
40
41 // A side Translations
42 for (Int_t ipmt = 0; ipmt < NCellsA; ipmt++) {
43 mMCP[ipmt].SetXYZ(mPosModuleAx[ipmt], mPosModuleAy[ipmt], ZdetA);
44 }
45}
47{
48 // C side Concave Geometry
49 Float_t mInStart[3] = {2.9491, 2.9491, 2.5};
50 Float_t mStartC[3] = {20., 20, 5.5};
51
52 Double_t crad = ZdetC; // define concave c-side radius here
53
54 Double_t dP = mInStart[0]; // side length of mcp divided by 2
55
56 // uniform angle between detector faces==
57 Double_t btta = 2 * TMath::ATan(dP / crad);
58
59 // get noncompensated translation data
60 Double_t grdin[6] = {-3, -2, -1, 1, 2, 3};
61 Double_t gridpoints[6];
62 for (Int_t i = 0; i < 6; i++) {
63 gridpoints[i] = crad * TMath::Sin((1 - 1 / (2 * TMath::Abs(grdin[i]))) * grdin[i] * btta);
64 }
65 Double_t xi[NCellsC] = {-15.038271418735729, 15.038271418735729,
66 -15.003757581112167, 15.003757581112167, -9.02690018974363,
67 9.02690018974363, -9.026897413747076, 9.026897413747076,
68 -9.026896531935773, 9.026896531935773, -3.0004568618531313,
69 3.0004568618531313, -3.0270795197907225, 3.0270795197907225,
70 3.0003978432927543, -3.0003978432927543, 3.0270569670429572,
71 -3.0270569670429572, 9.026750365564254, -9.026750365564254,
72 9.026837450695885, -9.026837450695885, 9.026849243816981,
73 -9.026849243816981, 15.038129472387304, -15.038129472387304,
74 15.003621961057961, -15.003621961057961};
75 Double_t yi[NCellsC] = {3.1599494336464455, -3.1599494336464455,
76 9.165191680982874, -9.165191680982874, 3.1383331772537426,
77 -3.1383331772537426, 9.165226363918643, -9.165226363918643,
78 15.141616002932361, -15.141616002932361, 9.16517861649866,
79 -9.16517861649866, 15.188854859073416, -15.188854859073416,
80 9.165053319552113, -9.165053319552113, 15.188703787345304,
81 -15.188703787345304, 3.138263189805292, -3.138263189805292,
82 9.165104089644917, -9.165104089644917, 15.141494417823818,
83 -15.141494417823818, 3.1599158563428644, -3.1599158563428644,
84 9.165116302773846, -9.165116302773846};
85
86 Double_t zi[NCellsC];
87 for (Int_t i = 0; i < NCellsC; i++) {
88 zi[i] = TMath::Sqrt(TMath::Power(crad, 2) - TMath::Power(xi[i], 2) - TMath::Power(yi[i], 2));
89 }
90
91 // get rotation data
92 Double_t ac[NCellsC], bc[NCellsC], gc[NCellsC];
93 for (Int_t i = 0; i < NCellsC; i++) {
94 ac[i] = TMath::ATan(yi[i] / xi[i]) - TMath::Pi() / 2 + 2 * TMath::Pi();
95 if (xi[i] < 0) {
96 bc[i] = TMath::ACos(zi[i] / crad);
97 } else {
98 bc[i] = -1 * TMath::ACos(zi[i] / crad);
99 }
100 }
101 Double_t xc2[NCellsC], yc2[NCellsC], zc2[NCellsC];
102
103 // compensation based on node position within individual detector geometries
104 // determine compensated radius
105 Double_t rcomp = crad + mStartC[2] / 2.0; //
106 for (Int_t i = 0; i < NCellsC; i++) {
107 // Get compensated translation data
108 xc2[i] = rcomp * TMath::Cos(ac[i] + TMath::Pi() / 2) * TMath::Sin(-1 * bc[i]);
109 yc2[i] = rcomp * TMath::Sin(ac[i] + TMath::Pi() / 2) * TMath::Sin(-1 * bc[i]);
110 zc2[i] = rcomp * TMath::Cos(bc[i]);
111
112 // Convert angles to degrees
113 ac[i] *= 180 / TMath::Pi();
114 bc[i] *= 180 / TMath::Pi();
115 gc[i] = -1 * ac[i];
116 mAngles[i].SetXYZ(ac[i], bc[i], gc[i]);
117 mMCP[i + NCellsA].SetXYZ(xc2[i], yc2[i], zc2[i]);
118 }
119}
121{
122 // This method calculates the position of each channel center composing both FT0-A
123 // and FT0-C, based on the position of their corresponding modules given by
124 // "Geometry::setAsideModules()" and "Geometry::setCsideModules()".
125
126 // Ensure the positions of the modules are well defined.
129
130 // Calculate first the positions for the channels for FT0-A. These correspond to the
131 // channels 0-95 in the modules mMCP[0-23].
132 Double_t delta = 5.3 / 4.; // Half-channel width (TODO: ask if it actually corresponds to ChannelWidth)
133 Double_t xLocalChannels[Nchannels]; // x-positions of all channels ordered according to xi and internal numbering.
134 Double_t yLocalChannels[Nchannels]; // y-positions of all channels ordered according to yi and internal numbering.
135 Double_t zLocalChannels[Nchannels]; // z-positions of all channels ordered according to zi and internal numbering.
136 // INFO: We assume here the modules are perpendicular to z, so z(channel) = z(module).
137
138 for (int iModA = 0; iModA < NCellsA; iModA++) {
139 xLocalChannels[4 * iModA + 0] = mMCP[iModA].X() - delta;
140 xLocalChannels[4 * iModA + 1] = mMCP[iModA].X() + delta;
141 xLocalChannels[4 * iModA + 2] = mMCP[iModA].X() - delta;
142 xLocalChannels[4 * iModA + 3] = mMCP[iModA].X() + delta;
143
144 yLocalChannels[4 * iModA + 0] = mMCP[iModA].Y() + delta;
145 yLocalChannels[4 * iModA + 1] = mMCP[iModA].Y() + delta;
146 yLocalChannels[4 * iModA + 2] = mMCP[iModA].Y() - delta;
147 yLocalChannels[4 * iModA + 3] = mMCP[iModA].Y() - delta;
148
149 zLocalChannels[4 * iModA + 0] = mMCP[iModA].Z();
150 zLocalChannels[4 * iModA + 1] = mMCP[iModA].Z();
151 zLocalChannels[4 * iModA + 2] = mMCP[iModA].Z();
152 zLocalChannels[4 * iModA + 3] = mMCP[iModA].Z();
153 }
154
155 // Calculate then the positions for the channels for FT0-C, corresponding to the
156 // channels 96-207 in the modules mMCP[24-51].
157 for (int iModC = 0; iModC < NCellsC; iModC++) {
158 xLocalChannels[4 * (iModC + NCellsA) + 0] = mMCP[iModC + NCellsA].X() - delta;
159 xLocalChannels[4 * (iModC + NCellsA) + 1] = mMCP[iModC + NCellsA].X() + delta;
160 xLocalChannels[4 * (iModC + NCellsA) + 2] = mMCP[iModC + NCellsA].X() - delta;
161 xLocalChannels[4 * (iModC + NCellsA) + 3] = mMCP[iModC + NCellsA].X() + delta;
162
163 yLocalChannels[4 * (iModC + NCellsA) + 0] = mMCP[iModC + NCellsA].Y() + delta;
164 yLocalChannels[4 * (iModC + NCellsA) + 1] = mMCP[iModC + NCellsA].Y() + delta;
165 yLocalChannels[4 * (iModC + NCellsA) + 2] = mMCP[iModC + NCellsA].Y() - delta;
166 yLocalChannels[4 * (iModC + NCellsA) + 3] = mMCP[iModC + NCellsA].Y() - delta;
167
168 zLocalChannels[4 * (iModC + NCellsA) + 0] = mMCP[iModC + NCellsA].Z();
169 zLocalChannels[4 * (iModC + NCellsA) + 1] = mMCP[iModC + NCellsA].Z();
170 zLocalChannels[4 * (iModC + NCellsA) + 2] = mMCP[iModC + NCellsA].Z();
171 zLocalChannels[4 * (iModC + NCellsA) + 3] = mMCP[iModC + NCellsA].Z();
172 }
173
174 for (int iChannel = 0; iChannel < Nchannels; iChannel++) {
175 mChannelCenter[localChannelOrder[iChannel]].SetXYZ(xLocalChannels[iChannel], yLocalChannels[iChannel], zLocalChannels[iChannel]);
176 }
177}
ClassImp(o2::ft0::Geometry)
uint64_t bc
Definition RawEventData.h:5
int32_t i
void setCsideModules()
Definition Geometry.cxx:46
static constexpr float ZdetC
Definition Geometry.h:55
void setAsideModules()
Definition Geometry.cxx:32
static constexpr float ZdetA
Definition Geometry.h:54
static constexpr int NCellsA
Definition Geometry.h:52
static constexpr int Nchannels
Definition Geometry.h:50
static constexpr int NCellsC
Definition Geometry.h:53
void calculateChannelCenter()
Definition Geometry.cxx:120