Project
Loading...
Searching...
No Matches
Detector.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
12#include "TGeoManager.h" // for TGeoManager
13#include "TMath.h"
14#include "TString.h"
15
16#include <fairlogger/Logger.h>
17#include "FairVolume.h"
18#include "FairRootManager.h"
19
20#include "TOFSimulation/Detector.h"
21
22#include <TVirtualMC.h> // for TVirtualMC, gMC
24#include "DetectorsBase/Stack.h"
25
26using namespace o2::tof;
27
29
31 : o2::base::DetImpl<Detector>("TOF", active), mEventNr(0), mTOFHoles(kTRUE), mHits(o2::utils::createSimVector<HitType>())
32{
33 for (Int_t i = 0; i < Geo::NSECTORS; i++) {
34 mTOFSectors[i] = 1;
35 }
36}
37
39 : o2::base::DetImpl<Detector>(rhs),
40 mEventNr(0),
41 mTOFHoles(rhs.mTOFHoles),
42 mHits(o2::utils::createSimVector<HitType>())
43{
44 for (Int_t i = 0; i < Geo::NSECTORS; i++) {
45 mTOFSectors[i] = rhs.mTOFSectors[i];
46 }
47}
48
53
55{
56 TGeoVolume* v = gGeoManager->GetVolume("FPAD");
57 if (v == nullptr) {
58 printf("Sensitive volume FSEN not found!!!!!!!!");
59 } else {
60 AddSensitiveVolume(v);
61 }
62}
63
64Bool_t Detector::ProcessHits(FairVolume* v)
65{
66 // This method is called from the MC stepping for the sensitive volume only
67 if (static_cast<int>(fMC->TrackCharge()) == 0) {
68 // set a very large step size for neutral particles
69 return kFALSE; // take only charged particles
70 }
71
72 float pos2x, pos2y, pos2z;
73 fMC->TrackPosition(pos2x, pos2y, pos2z);
74 Float_t radius = std::sqrt(pos2x * pos2x + pos2y * pos2y);
75 LOG(debug) << "Process hit in TOF volume ar R=" << radius << " - Z=" << pos2z;
76
77 Float_t enDep = fMC->Edep();
78 if (enDep < 1E-8) {
79 return kFALSE; // wo se need a threshold?
80 }
81
82 // ADD HIT
83 float posx, posy, posz;
84 fMC->TrackPosition(posx, posy, posz);
85 float time = fMC->TrackTime() * 1.0e09;
86 auto stack = static_cast<o2::data::Stack*>(fMC->GetStack());
87 int trackID = stack->GetCurrentTrackNumber();
88 int sensID = v->getMCid();
89 Int_t det[5];
90 Float_t pos[3] = {posx, posy, posz};
91 Float_t delta[3];
92 Geo::getPadDxDyDz(pos, det, delta);
93 auto channel = Geo::getIndex(det);
94 HitType newhit(posx, posy, posz, time, enDep, trackID, sensID);
95 if (channel != mLastChannelID || !isMergable(newhit, mHits->back())) {
96 mHits->push_back(newhit);
97 stack->addHit(GetDetId());
98 } else {
99 mHits->back().SetEnergyLoss(mHits->back().GetEnergyLoss() + newhit.GetEnergyLoss());
100 // LOG(info)<<"Merging hit "<<"\n";
101 // <<mHits->back().GetId()<<"with new hit "<<newhit.GetId()<<"\n";
102 }
103 mLastChannelID = channel;
104
105 return kTRUE;
106}
107
109{
110 FairRootManager::Instance()->RegisterAny(addNameTo("Hit").data(), mHits, kTRUE);
111}
112
114{
115 // TODO: move this out of here
116 if (!o2::utils::ShmManager::Instance().isOperational()) {
117 mHits->clear();
118 }
119 mLastChannelID = -1;
120}
121
123{
124 Int_t isxfld = 2;
125 Float_t sxmgmx = 10.;
127
128 //--- Quartz (SiO2) ---
129 Float_t aq[2] = {28.0855, 15.9994};
130 Float_t zq[2] = {14., 8.};
131 Float_t wq[2] = {1., 2.};
132 Float_t dq = 2.7; // (+5.9%)
133 Int_t nq = -2;
134
135 // --- Nomex (C14H22O2N2) ---
136 Float_t anox[4] = {12.011, 1.00794, 15.9994, 14.00674};
137 Float_t znox[4] = {6., 1., 8., 7.};
138 Float_t wnox[4] = {14., 22., 2., 2.};
139 // Float_t dnox = 0.048; //old value
140 Float_t dnox = 0.22; // (x 4.6)
141 Int_t nnox = -4;
142
143 // --- G10 {Si, O, C, H, O} ---
144 Float_t we[7], na[7];
145
146 Float_t ag10[5] = {28.0855, 15.9994, 12.011, 1.00794, 15.9994};
147 Float_t zg10[5] = {14., 8., 6., 1., 8.};
148 Float_t wmatg10[5];
149 Int_t nlmatg10 = 5;
150 na[0] = 1., na[1] = 2., na[2] = 0., na[3] = 0., na[4] = 0.;
151 MaterialMixer(we, ag10, na, 5);
152 wmatg10[0] = we[0] * 0.6;
153 wmatg10[1] = we[1] * 0.6;
154 na[0] = 0., na[1] = 0., na[2] = 14., na[3] = 20., na[4] = 3.;
155 MaterialMixer(we, ag10, na, 5);
156 wmatg10[2] = we[2] * 0.4;
157 wmatg10[3] = we[3] * 0.4;
158 wmatg10[4] = we[4] * 0.4;
159 // Float_t densg10 = 1.7; //old value
160 Float_t densg10 = 2.0; // (+17.8%)
161
162 // --- Water ---
163 Float_t awa[2] = {1.00794, 15.9994};
164 Float_t zwa[2] = {1., 8.};
165 Float_t wwa[2] = {2., 1.};
166 Float_t dwa = 1.0;
167 Int_t nwa = -2;
168
169 // --- Air ---
170 Float_t aAir[4] = {12.011, 14.00674, 15.9994, 39.948};
171 Float_t zAir[4] = {6., 7., 8., 18.};
172 Float_t wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827};
173 Float_t dAir = 1.20479E-3;
174
175 // --- Fibre Glass ---
176 Float_t afg[4] = {28.0855, 15.9994, 12.011, 1.00794};
177 Float_t zfg[4] = {14., 8., 6., 1.};
178 Float_t wfg[4] = {0.12906, 0.29405, 0.51502, 0.06187};
179 // Float_t dfg = 1.111;
180 Float_t dfg = 2.05; // (x1.845)
181 Int_t nfg = 4;
182
183 // --- Freon C2F4H2 + SF6 ---
184 Float_t afre[4] = {12.011, 1.00794, 18.9984032, 32.0065};
185 Float_t zfre[4] = {6., 1., 9., 16.};
186 Float_t wfre[4] = {0.21250, 0.01787, 0.74827, 0.021355};
187 Float_t densfre = 0.00375;
188 Int_t nfre = 4;
189
190 // --- Cables and tubes {Al, Cu} ---
191 Float_t acbt[2] = {26.981539, 63.546};
192 Float_t zcbt[2] = {13., 29.};
193 Float_t wcbt[2] = {0.407, 0.593};
194 Float_t decbt = 0.68;
195
196 // --- Cable {CH2, Al, Cu} ---
197 Float_t asc[4] = {12.011, 1.00794, 26.981539, 63.546};
198 Float_t zsc[4] = {6., 1., 13., 29.};
199 Float_t wsc[4];
200 for (Int_t ii = 0; ii < 4; ii++) {
201 wsc[ii] = 0.;
202 }
203
204 Float_t wDummy[4], nDummy[4];
205 for (Int_t ii = 0; ii < 4; ii++) {
206 wDummy[ii] = 0.;
207 }
208 for (Int_t ii = 0; ii < 4; ii++) {
209 nDummy[ii] = 0.;
210 }
211 nDummy[0] = 1.;
212 nDummy[1] = 2.;
213 MaterialMixer(wDummy, asc, nDummy, 2);
214 wsc[0] = 0.4375 * wDummy[0];
215 wsc[1] = 0.4375 * wDummy[1];
216 wsc[2] = 0.3244;
217 wsc[3] = 0.2381;
218 Float_t dsc = 1.223;
219
220 // --- Crates boxes {Al, Cu, Fe, Cr, Ni} ---
221 Float_t acra[5] = {26.981539, 63.546, 55.845, 51.9961, 58.6934};
222 Float_t zcra[5] = {13., 29., 26., 24., 28.};
223 Float_t wcra[5] = {0.7, 0.2, 0.07, 0.018, 0.012};
224 Float_t dcra = 0.77;
225
226 // --- Polietilene CH2 ---
227 Float_t aPlastic[2] = {12.011, 1.00794};
228 Float_t zPlastic[2] = {6., 1.};
229 Float_t wPlastic[2] = {1., 2.};
230 // Float_t dPlastic = 0.92; // PDB value
231 Float_t dPlastic = 0.93; // (~+1.1%)
232 Int_t nwPlastic = -2;
233
234 Mixture(0, "Air$", aAir, zAir, dAir, 4, wAir);
235 Mixture(1, "Nomex$", anox, znox, dnox, nnox, wnox);
236 Mixture(2, "G10$", ag10, zg10, densg10, nlmatg10, wmatg10);
237 Mixture(3, "fibre glass$", afg, zfg, dfg, nfg, wfg);
238 Material(4, "Al $", 26.981539, 13., 2.7, -8.9, 999.);
239 Float_t factor = 0.4 / 1.5 * 2. / 3.;
240 Material(5, "Al honeycomb$", 26.981539, 13., 2.7 * factor, -8.9 / factor, 999.);
241 Mixture(6, "Freon$", afre, zfre, densfre, nfre, wfre);
242 Mixture(7, "Glass$", aq, zq, dq, nq, wq);
243 Mixture(8, "Water$", awa, zwa, dwa, nwa, wwa);
244 Mixture(9, "cables+tubes$", acbt, zcbt, decbt, 2, wcbt);
245 Material(10, "Cu $", 63.546, 29., 8.96, -1.43, 999.);
246 Mixture(11, "cable$", asc, zsc, dsc, 4, wsc);
247 Mixture(12, "Al+Cu+steel$", acra, zcra, dcra, 5, wcra);
248 Mixture(13, "plastic$", aPlastic, zPlastic, dPlastic, nwPlastic, wPlastic);
249 Float_t factorHoles = 1. / 36.5;
250 Material(14, "Al honey for holes$", 26.981539, 13., 2.7 * factorHoles, -8.9 / factorHoles, 999.);
251
252 Float_t epsil, stmin, deemax, stemax;
253
254 // STD data
255 // EPSIL = 0.1 ! Tracking precision,
256 // STEMAX = 0.1 ! Maximum displacement for multiple scattering
257 // DEEMAX = 0.1 ! Maximum fractional energy loss, DLS
258 // STMIN = 0.1
259
260 // TOF data
261 epsil = .001; // Tracking precision,
262 stemax = -1.; // Maximum displacement for multiple scattering
263 deemax = -.3; // Maximum fractional energy loss, DLS
264 stmin = -.8;
265
266 Medium(kAir, "Air$", 0, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
267 Medium(kNomex, "Nomex$", 1, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
268 Medium(kG10, "G10$", 2, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
269 Medium(kFiberGlass, "fibre glass$", 3, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
270 Medium(kAlFrame, "Al Frame$", 4, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
271 Medium(kHoneycomb, "honeycomb$", 5, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
272 Medium(kFre, "Fre$", 6, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
273 Medium(kCuS, "Cu-S$", 10, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
274 Medium(kGlass, "Glass$", 7, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
275 Medium(kWater, "Water$", 8, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
276 Medium(kCable, "Cable$", 11, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
277 Medium(kCableTubes, "Cables+Tubes$", 9, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
278 Medium(kCopper, "Copper$", 10, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
279 Medium(kPlastic, "Plastic$", 13, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
280 Medium(kCrates, "Crates$", 12, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
281 Medium(kHoneyHoles, "honey_holes$", 14, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
282}
283
284void Detector::MaterialMixer(Float_t* p, const Float_t* const a, const Float_t* const m, Int_t n) const
285{
286 // a[] atomic weights vector (in)
287 // (atoms present in more compound appear separately)
288 // m[] number of corresponding atoms in the compound (in)
289 Float_t t = 0.;
290 for (Int_t i = 0; i < n; ++i) {
291 p[i] = a[i] * m[i];
292 t += p[i];
293 }
294 for (Int_t i = 0; i < n; ++i) {
295 p[i] = p[i] / t;
296 }
297}
298
300{
302
303 /*
304 xTof = 124.5;//fTOFGeometry->StripLength()+2.*(0.3+0.03); // cm, x-dimension of FTOA volume
305 yTof = fTOFGeometry->Rmax()-fTOFGeometry->Rmin(); // cm, y-dimension of FTOA volume
306 Float_t zTof = fTOFGeometry->ZlenA(); // cm, z-dimension of FTOA volume
307 */
308
309 Float_t xTof = Geo::STRIPLENGTH + 2.5, yTof = Geo::RMAX - Geo::RMIN, zTof = Geo::ZLENA;
310 DefineGeometry(xTof, yTof, zTof);
311
312 LOG(info) << "Loaded TOF geometry";
313}
314
317{
318 //
319 // Definition of the Time Of Fligh Resistive Plate Chambers
320 //
321
322 Float_t xFLT, yFLT, zFLTA;
323 xFLT = xtof - 2. * Geo::MODULEWALLTHICKNESS;
324 yFLT = ytof * 0.5 - Geo::MODULEWALLTHICKNESS;
325 zFLTA = zlenA - 2. * Geo::MODULEWALLTHICKNESS;
326
327 createModules(xtof, ytof, zlenA, xFLT, yFLT, zFLTA);
328 makeStripsInModules(ytof, zlenA);
329
330 createModuleCovers(xtof, zlenA);
331
332 createBackZone(xtof, ytof, zlenA);
333 makeFrontEndElectronics(xtof);
334 makeFEACooling(xtof);
335 makeNinoMask(xtof);
336 makeSuperModuleCooling(xtof, ytof, zlenA);
337 makeSuperModuleServices(xtof, ytof, zlenA);
338
339 makeModulesInBTOFvolumes(ytof, zlenA);
340 makeCoversInBTOFvolumes();
341 makeBackInBTOFvolumes(ytof);
342
343 makeReadoutCrates(ytof);
344}
345
346void Detector::createModules(Float_t xtof, Float_t ytof, Float_t zlenA, Float_t xFLT, Float_t yFLT, Float_t zFLTA) const
347{
348 //
349 // Create supermodule volume
350 // and wall volumes to separate 5 modules
351 //
352
353 Int_t idrotm[8];
354 for (Int_t ii = 0; ii < 8; ii++) {
355 idrotm[ii] = 0;
356 }
357
358 // Definition of the of fibre glass modules (FTOA, FTOB and FTOC)
359 Float_t par[3];
360 par[0] = xtof * 0.5;
361 par[1] = ytof * 0.25;
362 par[2] = zlenA * 0.5;
363 TVirtualMC::GetMC()->Gsvolu("FTOA", "BOX ", getMediumID(kFiberGlass), par, 3); // Fibre glass
364
365 if (mTOFHoles) {
366 par[0] = xtof * 0.5;
367 par[1] = ytof * 0.25;
368 par[2] = (zlenA * 0.5 - Geo::INTERCENTRMODBORDER1) * 0.5;
369 TVirtualMC::GetMC()->Gsvolu("FTOB", "BOX ", getMediumID(kFiberGlass), par, 3); // Fibre glass
370 TVirtualMC::GetMC()->Gsvolu("FTOC", "BOX ", getMediumID(kFiberGlass), par, 3); // Fibre glass
371 }
372
373 // Definition and positioning
374 // of the not sensitive volumes with Insensitive Freon (FLTA, FLTB and FLTC)
375 par[0] = xFLT * 0.5;
376 par[1] = yFLT * 0.5;
377 par[2] = zFLTA * 0.5;
378 TVirtualMC::GetMC()->Gsvolu("FLTA", "BOX ", getMediumID(kFre), par, 3); // Freon mix
379
380 Float_t xcoor, ycoor, zcoor;
381 xcoor = 0.;
382 ycoor = Geo::MODULEWALLTHICKNESS * 0.5;
383 zcoor = 0.;
384 TVirtualMC::GetMC()->Gspos("FLTA", 0, "FTOA", xcoor, ycoor, zcoor, 0, "ONLY");
385
386 if (mTOFHoles) {
387 par[2] = (zlenA * 0.5 - 2. * Geo::MODULEWALLTHICKNESS - Geo::INTERCENTRMODBORDER1) * 0.5;
388 TVirtualMC::GetMC()->Gsvolu("FLTB", "BOX ", getMediumID(kFre), par, 3); // Freon mix
389 TVirtualMC::GetMC()->Gsvolu("FLTC", "BOX ", getMediumID(kFre), par, 3); // Freon mix
390
391 // xcoor = 0.;
392 // ycoor = Geo::MODULEWALLTHICKNESS*0.5;
394 TVirtualMC::GetMC()->Gspos("FLTB", 0, "FTOB", xcoor, ycoor, zcoor, 0, "ONLY");
395 TVirtualMC::GetMC()->Gspos("FLTC", 0, "FTOC", xcoor, ycoor, -zcoor, 0, "ONLY");
396 }
397
398 // Definition and positioning
399 // of the fibre glass walls between central and intermediate modules (FWZ1 and FWZ2)
400 Float_t alpha, tgal, beta, tgbe, trpa[11];
401 // tgal = (yFLT - 2.*Geo::LENGTHINCEMODBORDER)/(Geo::INTERCENTRMODBORDER2 - Geo::INTERCENTRMODBORDER1);
404 alpha = TMath::ATan(tgal);
405 beta = (TMath::Pi() * 0.5 - alpha) * 0.5;
406 tgbe = TMath::Tan(beta);
407 trpa[0] = xFLT * 0.5;
408 trpa[1] = 0.;
409 trpa[2] = 0.;
410 trpa[3] = 2. * Geo::MODULEWALLTHICKNESS;
411 // trpa[4] = (Geo::LENGTHINCEMODBORDER - 2.*Geo::MODULEWALLTHICKNESS*tgbe)*0.5;
412 // trpa[5] = (Geo::LENGTHINCEMODBORDER + 2.*Geo::MODULEWALLTHICKNESS*tgbe)*0.5;
413 trpa[4] = (Geo::LENGTHINCEMODBORDERD - 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
414 trpa[5] = (Geo::LENGTHINCEMODBORDERD + 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
415 trpa[6] =
416 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
417 trpa[7] = 2. * Geo::MODULEWALLTHICKNESS;
418 trpa[8] = (Geo::LENGTHINCEMODBORDERD - 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
419 trpa[9] = (Geo::LENGTHINCEMODBORDERD + 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
420 // trpa[8] = (Geo::LENGTHINCEMODBORDER - 2.*Geo::MODULEWALLTHICKNESS*tgbe)*0.5;
421 // trpa[9] = (Geo::LENGTHINCEMODBORDER + 2.*Geo::MODULEWALLTHICKNESS*tgbe)*0.5;
422 trpa[10] =
423 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
424 TVirtualMC::GetMC()->Gsvolu("FWZ1D", "TRAP", getMediumID(kFiberGlass), trpa, 11); // Fibre glass
425
426 Matrix(idrotm[0], 90., 90., 180., 0., 90., 180.);
427 Matrix(idrotm[1], 90., 90., 0., 0., 90., 0.);
428
429 // xcoor = 0.;
430 // ycoor = -(yFLT - Geo::LENGTHINCEMODBORDER)*0.5;
431 ycoor = -(yFLT - Geo::LENGTHINCEMODBORDERD) * 0.5;
433 TVirtualMC::GetMC()->Gspos("FWZ1D", 1, "FLTA", xcoor, ycoor, zcoor, idrotm[0], "ONLY");
434 TVirtualMC::GetMC()->Gspos("FWZ1D", 2, "FLTA", xcoor, ycoor, -zcoor, idrotm[1], "ONLY");
435
436 Float_t y0B, ycoorB, zcoorB;
437
438 if (mTOFHoles) {
439 // y0B = Geo::LENGTHINCEMODBORDER - Geo::MODULEWALLTHICKNESS*tgbe;
441 trpa[0] = xFLT * 0.5;
442 trpa[1] = 0.;
443 trpa[2] = 0.;
444 trpa[3] = Geo::MODULEWALLTHICKNESS;
445 trpa[4] = (y0B - Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
446 trpa[5] = (y0B + Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
447 trpa[6] =
448 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
449 trpa[7] = Geo::MODULEWALLTHICKNESS;
450 trpa[8] = (y0B - Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
451 trpa[9] = (y0B + Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
452 trpa[10] =
453 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
454 // xcoor = 0.;
455 ycoorB = ycoor - Geo::MODULEWALLTHICKNESS * 0.5 * tgbe;
456 zcoorB =
458 TVirtualMC::GetMC()->Gsvolu("FWZAD", "TRAP", getMediumID(kFiberGlass), trpa, 11); // Fibre glass
459 TVirtualMC::GetMC()->Gspos("FWZAD", 1, "FLTB", xcoor, ycoorB, zcoorB, idrotm[1], "ONLY");
460 TVirtualMC::GetMC()->Gspos("FWZAD", 2, "FLTC", xcoor, ycoorB, -zcoorB, idrotm[0], "ONLY");
461 }
462
465 alpha = TMath::ATan(tgal);
466 beta = (TMath::Pi() * 0.5 - alpha) * 0.5;
467 tgbe = TMath::Tan(beta);
468 trpa[0] = xFLT * 0.5;
469 trpa[1] = 0.;
470 trpa[2] = 0.;
471 trpa[3] = 2. * Geo::MODULEWALLTHICKNESS;
472 // trpa[4] = (Geo::LENGTHINCEMODBORDER - 2.*Geo::MODULEWALLTHICKNESS*tgbe)*0.5;
473 // trpa[5] = (Geo::LENGTHINCEMODBORDER + 2.*Geo::MODULEWALLTHICKNESS*tgbe)*0.5;
474 trpa[4] = (Geo::LENGTHINCEMODBORDERU - 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
475 trpa[5] = (Geo::LENGTHINCEMODBORDERU + 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
476 trpa[6] =
477 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
478 trpa[7] = 2. * Geo::MODULEWALLTHICKNESS;
479 trpa[8] = (Geo::LENGTHINCEMODBORDERU - 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
480 trpa[9] = (Geo::LENGTHINCEMODBORDERU + 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
481 // trpa[8] = (Geo::LENGTHINCEMODBORDER - 2.*Geo::MODULEWALLTHICKNESS*tgbe)*0.5;
482 // trpa[9] = (Geo::LENGTHINCEMODBORDER + 2.*Geo::MODULEWALLTHICKNESS*tgbe)*0.5;
483 trpa[10] =
484 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
485 TVirtualMC::GetMC()->Gsvolu("FWZ1U", "TRAP", getMediumID(kFiberGlass), trpa, 11); // Fibre glass
486
487 Matrix(idrotm[2], 90., 270., 0., 0., 90., 180.);
488 Matrix(idrotm[3], 90., 270., 180., 0., 90., 0.);
489
490 // xcoor = 0.;
491 // ycoor = (yFLT - Geo::LENGTHINCEMODBORDER)*0.5;
492 ycoor = (yFLT - Geo::LENGTHINCEMODBORDERU) * 0.5;
494 TVirtualMC::GetMC()->Gspos("FWZ1U", 1, "FLTA", xcoor, ycoor, zcoor, idrotm[2], "ONLY");
495 TVirtualMC::GetMC()->Gspos("FWZ1U", 2, "FLTA", xcoor, ycoor, -zcoor, idrotm[3], "ONLY");
496
497 if (mTOFHoles) {
498 // y0B = Geo::LENGTHINCEMODBORDER + Geo::MODULEWALLTHICKNESS*tgbe;
500 trpa[0] = xFLT * 0.5;
501 trpa[1] = 0.;
502 trpa[2] = 0.;
503 trpa[3] = Geo::MODULEWALLTHICKNESS;
504 trpa[4] = (y0B - Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
505 trpa[5] = (y0B + Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
506 trpa[6] =
507 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
508 trpa[7] = Geo::MODULEWALLTHICKNESS;
509 trpa[8] = (y0B - Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
510 trpa[9] = (y0B + Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
511 trpa[10] =
512 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
513 TVirtualMC::GetMC()->Gsvolu("FWZBU", "TRAP", getMediumID(kFiberGlass), trpa, 11); // Fibre glass
514 // xcoor = 0.;
515 ycoorB = ycoor - Geo::MODULEWALLTHICKNESS * 0.5 * tgbe;
516 zcoorB = (zlenA * 0.5 - 2. * Geo::MODULEWALLTHICKNESS - Geo::INTERCENTRMODBORDER1) * 0.5 -
518 TVirtualMC::GetMC()->Gspos("FWZBU", 1, "FLTB", xcoor, ycoorB, zcoorB, idrotm[3], "ONLY");
519 TVirtualMC::GetMC()->Gspos("FWZBU", 2, "FLTC", xcoor, ycoorB, -zcoorB, idrotm[2], "ONLY");
520 }
521
522 trpa[0] = 0.5 * (Geo::INTERCENTRMODBORDER2 - Geo::INTERCENTRMODBORDER1) / TMath::Cos(alpha);
523 trpa[1] = 2. * Geo::MODULEWALLTHICKNESS;
524 trpa[2] = xFLT * 0.5;
525 trpa[3] = -beta * TMath::RadToDeg();
526 trpa[4] = 0.;
527 trpa[5] = 0.;
528 TVirtualMC::GetMC()->Gsvolu("FWZ2", "PARA", getMediumID(kFiberGlass), trpa, 6); // Fibre glass
529
530 Matrix(idrotm[4], alpha * TMath::RadToDeg(), 90., 90. + alpha * TMath::RadToDeg(), 90., 90., 180.);
531 Matrix(idrotm[5], 180. - alpha * TMath::RadToDeg(), 90., 90. - alpha * TMath::RadToDeg(), 90., 90., 0.);
532
533 // xcoor = 0.;
534 // ycoor = 0.;
537 TVirtualMC::GetMC()->Gspos("FWZ2", 1, "FLTA", xcoor, ycoor, zcoor, idrotm[4], "ONLY");
538 TVirtualMC::GetMC()->Gspos("FWZ2", 2, "FLTA", xcoor, ycoor, -zcoor, idrotm[5], "ONLY");
539
540 if (mTOFHoles) {
541 trpa[0] = 0.5 * (Geo::INTERCENTRMODBORDER2 - Geo::INTERCENTRMODBORDER1) / TMath::Cos(alpha);
542 trpa[1] = Geo::MODULEWALLTHICKNESS;
543 trpa[2] = xFLT * 0.5;
544 trpa[3] = -beta * TMath::RadToDeg();
545 trpa[4] = 0.;
546 trpa[5] = 0.;
547 TVirtualMC::GetMC()->Gsvolu("FWZC", "PARA", getMediumID(kFiberGlass), trpa, 6); // Fibre glass
548 // xcoor = 0.;
549 ycoorB = ycoor - Geo::MODULEWALLTHICKNESS * tgbe;
550 zcoorB = (zlenA * 0.5 - 2. * Geo::MODULEWALLTHICKNESS - Geo::INTERCENTRMODBORDER1) * 0.5 -
552 TVirtualMC::GetMC()->Gspos("FWZC", 1, "FLTB", xcoor, ycoorB, zcoorB, idrotm[5], "ONLY");
553 TVirtualMC::GetMC()->Gspos("FWZC", 2, "FLTC", xcoor, ycoorB, -zcoorB, idrotm[4], "ONLY");
554 }
555
556 // Definition and positioning
557 // of the fibre glass walls between intermediate and lateral modules (FWZ3 and FWZ4)
559 alpha = TMath::ATan(tgal);
560 beta = (TMath::Pi() * 0.5 - alpha) * 0.5;
561 tgbe = TMath::Tan(beta);
562 trpa[0] = xFLT * 0.5;
563 trpa[1] = 0.;
564 trpa[2] = 0.;
565 trpa[3] = 2. * Geo::MODULEWALLTHICKNESS;
566 trpa[4] = (Geo::LENGTHEXINMODBORDER - 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
567 trpa[5] = (Geo::LENGTHEXINMODBORDER + 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
568 trpa[6] =
569 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
570 trpa[7] = 2. * Geo::MODULEWALLTHICKNESS;
571 trpa[8] = (Geo::LENGTHEXINMODBORDER - 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
572 trpa[9] = (Geo::LENGTHEXINMODBORDER + 2. * Geo::MODULEWALLTHICKNESS * tgbe) * 0.5;
573 trpa[10] =
574 TMath::ATan(tgbe * 0.5) * TMath::RadToDeg(); // TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*TMath::RadToDeg();
575 TVirtualMC::GetMC()->Gsvolu("FWZ3", "TRAP", getMediumID(kFiberGlass), trpa, 11); // Fibre glass
576
577 // xcoor = 0.;
578 ycoor = (yFLT - Geo::LENGTHEXINMODBORDER) * 0.5;
580 TVirtualMC::GetMC()->Gspos("FWZ3", 1, "FLTA", xcoor, ycoor, zcoor, idrotm[3], "ONLY");
581 TVirtualMC::GetMC()->Gspos("FWZ3", 2, "FLTA", xcoor, ycoor, -zcoor, idrotm[2], "ONLY");
582
583 if (mTOFHoles) {
584 // xcoor = 0.;
585 // ycoor = (yFLT - Geo::LENGTHEXINMODBORDER)*0.5;
586 zcoor =
588 TVirtualMC::GetMC()->Gspos("FWZ3", 5, "FLTB", xcoor, ycoor, zcoor, idrotm[2], "ONLY");
589 TVirtualMC::GetMC()->Gspos("FWZ3", 6, "FLTC", xcoor, ycoor, -zcoor, idrotm[3], "ONLY");
590 }
591
592 // xcoor = 0.;
593 ycoor = -(yFLT - Geo::LENGTHEXINMODBORDER) * 0.5;
595 TVirtualMC::GetMC()->Gspos("FWZ3", 3, "FLTA", xcoor, ycoor, zcoor, idrotm[1], "ONLY");
596 TVirtualMC::GetMC()->Gspos("FWZ3", 4, "FLTA", xcoor, ycoor, -zcoor, idrotm[0], "ONLY");
597
598 if (mTOFHoles) {
599 // xcoor = 0.;
600 // ycoor = -(yFLT - Geo::LENGTHEXINMODBORDER)*0.5;
601 zcoor =
603 TVirtualMC::GetMC()->Gspos("FWZ3", 7, "FLTB", xcoor, ycoor, zcoor, idrotm[0], "ONLY");
604 TVirtualMC::GetMC()->Gspos("FWZ3", 8, "FLTC", xcoor, ycoor, -zcoor, idrotm[1], "ONLY");
605 }
606
607 trpa[0] = 0.5 * (Geo::EXTERINTERMODBORDER2 - Geo::EXTERINTERMODBORDER1) / TMath::Cos(alpha);
608 trpa[1] = 2. * Geo::MODULEWALLTHICKNESS;
609 trpa[2] = xFLT * 0.5;
610 trpa[3] = -beta * TMath::RadToDeg();
611 trpa[4] = 0.;
612 trpa[5] = 0.;
613 TVirtualMC::GetMC()->Gsvolu("FWZ4", "PARA", getMediumID(kFiberGlass), trpa, 6); // Fibre glass
614
615 Matrix(idrotm[6], alpha * TMath::RadToDeg(), 90., 90. + alpha * TMath::RadToDeg(), 90., 90., 180.);
616 Matrix(idrotm[7], 180. - alpha * TMath::RadToDeg(), 90., 90. - alpha * TMath::RadToDeg(), 90., 90., 0.);
617
618 // xcoor = 0.;
619 ycoor = 0.;
621 TVirtualMC::GetMC()->Gspos("FWZ4", 1, "FLTA", xcoor, ycoor, zcoor, idrotm[7], "ONLY");
622 TVirtualMC::GetMC()->Gspos("FWZ4", 2, "FLTA", xcoor, ycoor, -zcoor, idrotm[6], "ONLY");
623
624 if (mTOFHoles) {
625 // xcoor = 0.;
626 // ycoor = 0.;
628 (zlenA * 0.5 + Geo::INTERCENTRMODBORDER1 - 2. * Geo::MODULEWALLTHICKNESS) * 0.5;
629 TVirtualMC::GetMC()->Gspos("FWZ4", 3, "FLTB", xcoor, ycoor, zcoor, idrotm[6], "ONLY");
630 TVirtualMC::GetMC()->Gspos("FWZ4", 4, "FLTC", xcoor, ycoor, -zcoor, idrotm[7], "ONLY");
631 }
632}
633
634void Detector::makeStripsInModules(Float_t ytof, Float_t zlenA) const
635{
636 //
637 // Define MRPC strip volume, called FSTR
638 // Insert FSTR volume in FLTA/B/C volumes
639 //
640 // ciao
641 Float_t yFLT = ytof * 0.5 - Geo::MODULEWALLTHICKNESS;
642
644
645 // new description for strip volume -double stack strip-
646 // -- all constants are expressed in cm
647 // height of different layers
648 constexpr Float_t HGLFY = Geo::HFILIY + 2. * Geo::HGLASSY; // height of GLASS Layer
649
650 constexpr Float_t LSENSMX = Geo::NPADX * Geo::XPAD; // length of Sensitive Layer
651 constexpr Float_t HSENSMY = Geo::HSENSMY; // height of Sensitive Layer
652 constexpr Float_t WSENSMZ = Geo::NPADZ * Geo::ZPAD; // width of Sensitive Layer
653
654 // height of the FSTR Volume (the strip volume)
655 constexpr Float_t HSTRIPY = 2. * Geo::HHONY + 2. * Geo::HPCBY + 4. * Geo::HRGLY + 2. * HGLFY + Geo::HCPCBY;
656
657 // width of the FSTR Volume (the strip volume)
658 constexpr Float_t WSTRIPZ = Geo::WCPCBZ;
659 // length of the FSTR Volume (the strip volume)
660 constexpr Float_t LSTRIPX = Geo::STRIPLENGTH;
661
662 // FSTR volume definition-filling this volume with non sensitive Gas Mixture
663 Float_t parfp[3] = {static_cast<Float_t>(LSTRIPX * 0.5), static_cast<Float_t>(HSTRIPY * 0.5),
664 static_cast<Float_t>(WSTRIPZ * 0.5)};
665 TVirtualMC::GetMC()->Gsvolu("FSTR", "BOX", getMediumID(kFre), parfp, 3); // Freon mix
666
667 Float_t posfp[3] = {0., 0., 0.};
668
669 // NOMEX (HONEYCOMB) Layer definition
670 // parfp[0] = LSTRIPX*0.5;
671 parfp[1] = Geo::HHONY * 0.5;
672 parfp[2] = Geo::WHONZ * 0.5;
673 TVirtualMC::GetMC()->Gsvolu("FHON", "BOX", getMediumID(kNomex), parfp, 3); // Nomex (Honeycomb)
674 // positioning 2 NOMEX Layers on FSTR volume
675 // posfp[0] = 0.;
676 posfp[1] = -HSTRIPY * 0.5 + parfp[1];
677 // posfp[2] = 0.;
678 TVirtualMC::GetMC()->Gspos("FHON", 1, "FSTR", 0., posfp[1], 0., 0, "ONLY");
679 TVirtualMC::GetMC()->Gspos("FHON", 2, "FSTR", 0., -posfp[1], 0., 0, "ONLY");
680
681 // Lower PCB Layer definition
682 // parfp[0] = LSTRIPX*0.5;
683 parfp[1] = Geo::HPCBY * 0.5;
684 parfp[2] = Geo::WPCBZ1 * 0.5;
685 TVirtualMC::GetMC()->Gsvolu("FPC1", "BOX", getMediumID(kG10), parfp, 3); // G10
686
687 // Upper PCB Layer definition
688 // parfp[0] = LSTRIPX*0.5;
689 // parfp[1] = Geo::HPCBY*0.5;
690 parfp[2] = Geo::WPCBZ2 * 0.5;
691 TVirtualMC::GetMC()->Gsvolu("FPC2", "BOX", getMediumID(kG10), parfp, 3); // G10
692
693 // positioning 2 external PCB Layers in FSTR volume
694 // posfp[0] = 0.;
695 posfp[1] = -HSTRIPY * 0.5 + Geo::HHONY + parfp[1];
696 // posfp[2] = 0.;
697 TVirtualMC::GetMC()->Gspos("FPC1", 1, "FSTR", 0., -posfp[1], 0., 0, "ONLY");
698 TVirtualMC::GetMC()->Gspos("FPC2", 1, "FSTR", 0., posfp[1], 0., 0, "ONLY");
699
700 // Central PCB layer definition
701 // parfp[0] = LSTRIPX*0.5;
702 parfp[1] = Geo::HCPCBY * 0.5;
703 parfp[2] = Geo::WCPCBZ * 0.5;
704 TVirtualMC::GetMC()->Gsvolu("FPCB", "BOX", getMediumID(kG10), parfp, 3); // G10
705 gGeoManager->GetVolume("FPCB")->VisibleDaughters(kFALSE);
706
707 // positioning the central PCB layer
708 TVirtualMC::GetMC()->Gspos("FPCB", 1, "FSTR", 0., 0., 0., 0, "ONLY");
709
710 // Sensitive volume definition
711 Float_t parfs[3] = {static_cast<Float_t>(LSENSMX * 0.5), static_cast<Float_t>(HSENSMY * 0.5),
712 static_cast<Float_t>(WSENSMZ * 0.5)};
713 TVirtualMC::GetMC()->Gsvolu("FSEN", "BOX", getMediumID(kCuS), parfs, 3); // Cu sensitive
714
715 // printf("check material\n");
716 // printf("ID used = %i\n",getMediumID(kCuS));
717 // printf("ID needed = %i\n",gGeoManager->GetMedium("TOF_Cu-S$")->GetId());
718 // getchar();
719
720 // dividing FSEN along z in Geo::NPADZ=2 and along x in Geo::NPADX=48
721 TVirtualMC::GetMC()->Gsdvn("FSEZ", "FSEN", Geo::NPADZ, 3);
722 TVirtualMC::GetMC()->Gsdvn("FPAD", "FSEZ", Geo::NPADX, 1);
723 // positioning sensitive layer inside FPCB
724 TVirtualMC::GetMC()->Gspos("FSEN", 1, "FPCB", 0., 0., 0., 0, "ONLY");
725
726 // RED GLASS Layer definition
727 // parfp[0] = LSTRIPX*0.5;
728 parfp[1] = Geo::HRGLY * 0.5;
729 parfp[2] = Geo::WRGLZ * 0.5;
730 TVirtualMC::GetMC()->Gsvolu("FRGL", "BOX", getMediumID(kGlass), parfp, 3); // red glass
731 // positioning 4 RED GLASS Layers in FSTR volume
732 // posfp[0] = 0.;
733 posfp[1] = -HSTRIPY * 0.5 + Geo::HHONY + Geo::HPCBY + parfp[1];
734 // posfp[2] = 0.;
735 TVirtualMC::GetMC()->Gspos("FRGL", 1, "FSTR", 0., posfp[1], 0., 0, "ONLY");
736 TVirtualMC::GetMC()->Gspos("FRGL", 4, "FSTR", 0., -posfp[1], 0., 0, "ONLY");
737 // posfp[0] = 0.;
738 posfp[1] = (Geo::HCPCBY + Geo::HRGLY) * 0.5;
739 // posfp[2] = 0.;
740 TVirtualMC::GetMC()->Gspos("FRGL", 2, "FSTR", 0., -posfp[1], 0., 0, "ONLY");
741 TVirtualMC::GetMC()->Gspos("FRGL", 3, "FSTR", 0., posfp[1], 0., 0, "ONLY");
742
743 // GLASS Layer definition
744 // parfp[0] = LSTRIPX*0.5;
745 parfp[1] = Geo::HGLASSY;
746 parfp[2] = Geo::WGLFZ * 0.5;
747 TVirtualMC::GetMC()->Gsvolu("FGLF", "BOX", getMediumID(kGlass), parfp, 3); // glass
748 // positioning 2 GLASS Layers in FSTR volume
749 // posfp[0] = 0.;
750 posfp[1] = (Geo::HCPCBY + HGLFY) * 0.5 + Geo::HRGLY;
751 // posfp[2] = 0.;
752 TVirtualMC::GetMC()->Gspos("FGLF", 1, "FSTR", 0., -posfp[1], 0., 0, "ONLY");
753 TVirtualMC::GetMC()->Gspos("FGLF", 2, "FSTR", 0., posfp[1], 0., 0, "ONLY");
754
755 // Positioning the Strips (FSTR volumes) in the FLT volumes
756 Int_t maxStripNumbers[5] = {Geo::NSTRIPC, Geo::NSTRIPB, Geo::NSTRIPA, Geo::NSTRIPB, Geo::NSTRIPC};
757
758 Int_t idrotm[Geo::NSTRIPXSECTOR];
759 for (Int_t ii = 0; ii < Geo::NSTRIPXSECTOR; ii++) {
760 idrotm[ii] = 0;
761 }
762
763 Int_t totalStrip = 0;
764 Float_t xpos, zpos, ypos, ang;
765 for (Int_t iplate = 0; iplate < Geo::NPLATES; iplate++) {
766 if (iplate > 0) {
767 totalStrip += maxStripNumbers[iplate - 1];
768 }
769 for (Int_t istrip = 0; istrip < maxStripNumbers[iplate]; istrip++) {
770 ang = Geo::getAngles(iplate, istrip);
771
772 if (ang > 0.) {
773 Matrix(idrotm[istrip + totalStrip], 90., 0., 90. + ang, 90., ang, 90.);
774 } else if (ang == 0.) {
775 Matrix(idrotm[istrip + totalStrip], 90., 0., 90., 90., 0., 0.);
776 } else if (ang < 0.) {
777 Matrix(idrotm[istrip + totalStrip], 90., 0., 90. + ang, 90., -ang, 270.);
778 }
779
780 xpos = 0.;
781 ypos = Geo::getHeights(iplate, istrip) + yFLT * 0.5;
782 zpos = Geo::getDistances(iplate, istrip);
783 TVirtualMC::GetMC()->Gspos("FSTR", istrip + totalStrip + 1, "FLTA", xpos, ypos, -zpos,
784 idrotm[istrip + totalStrip], "ONLY");
785
786 if (mTOFHoles) {
787 if (istrip + totalStrip + 1 > 53) {
788 TVirtualMC::GetMC()->Gspos(
789 "FSTR", istrip + totalStrip + 1, "FLTC", xpos, ypos,
790 -zpos - (zlenA * 0.5 - 2. * Geo::MODULEWALLTHICKNESS + Geo::INTERCENTRMODBORDER1) * 0.5,
791 idrotm[istrip + totalStrip], "ONLY");
792 }
793 if (istrip + totalStrip + 1 < 39) {
794 TVirtualMC::GetMC()->Gspos(
795 "FSTR", istrip + totalStrip + 1, "FLTB", xpos, ypos,
796 -zpos + (zlenA * 0.5 - 2. * Geo::MODULEWALLTHICKNESS + Geo::INTERCENTRMODBORDER1) * 0.5,
797 idrotm[istrip + totalStrip], "ONLY");
798 }
799 }
800 }
801 }
802}
803
804void Detector::createModuleCovers(Float_t xtof, Float_t zlenA) const
805{
806 //
807 // Create covers for module:
808 // per each module zone, defined according to
809 // fgkInterCentrModBorder2, fgkExterInterModBorder1 and zlenA+2 values,
810 // there is a frame of thickness 2cm in Al
811 // and the contained zones in honeycomb of Al.
812 // There is also an interface layer (1.6mm thichness)
813 // and plastic and Cu corresponding to the flat cables.
814 //
815
816 Float_t par[3];
817 par[0] = xtof * 0.5 + 2.;
818 par[1] = Geo::MODULECOVERTHICKNESS * 0.5;
819 par[2] = zlenA * 0.5 + 2.;
820 TVirtualMC::GetMC()->Gsvolu("FPEA", "BOX ", getMediumID(kAir), par, 3); // Air
821 if (mTOFHoles) {
822 TVirtualMC::GetMC()->Gsvolu("FPEB", "BOX ", getMediumID(kAir), par, 3); // Air
823 }
824
825 constexpr Float_t ALCOVERTHICKNESS = 1.5;
826 constexpr Float_t INTERFACECARDTHICKNESS = 0.16;
827 constexpr Float_t ALSKINTHICKNESS = 0.1;
828 constexpr Float_t PLASTICFLATCABLETHICKNESS = 0.25;
829 constexpr Float_t COPPERFLATCABLETHICKNESS = 0.01;
830
831 // par[0] = xtof*0.5 + 2.;
832 par[1] = ALCOVERTHICKNESS * 0.5;
833 // par[2] = zlenA*0.5 + 2.;
834 TVirtualMC::GetMC()->Gsvolu("FALT", "BOX ", getMediumID(kAlFrame), par, 3); // Al
835 if (mTOFHoles) {
836 TVirtualMC::GetMC()->Gsvolu("FALB", "BOX ", getMediumID(kAlFrame), par, 3); // Al
837 }
838 Float_t xcoor, ycoor, zcoor;
839 xcoor = 0.;
840 ycoor = 0.;
841 zcoor = 0.;
842 TVirtualMC::GetMC()->Gspos("FALT", 0, "FPEA", xcoor, ycoor, zcoor, 0, "ONLY");
843 if (mTOFHoles) {
844 TVirtualMC::GetMC()->Gspos("FALB", 0, "FPEB", xcoor, ycoor, zcoor, 0, "ONLY");
845 }
846
847 par[0] = xtof * 0.5;
848 // par[1] = ALCOVERTHICKNESS*0.5;
849 par[2] = Geo::INTERCENTRMODBORDER2 - 2.;
850 TVirtualMC::GetMC()->Gsvolu("FPE1", "BOX ", getMediumID(kHoneycomb), par, 3); // Al honeycomb
851 // xcoor = 0.;
852 // ycoor = 0.;
853 // zcoor = 0.;
854 TVirtualMC::GetMC()->Gspos("FPE1", 0, "FALT", xcoor, ycoor, zcoor, 0, "ONLY");
855
856 if (mTOFHoles) {
857 // par[0] = xtof*0.5;
858 par[1] = ALCOVERTHICKNESS * 0.5 - ALSKINTHICKNESS;
859 // par[2] = Geo::INTERCENTRMODBORDER2 - 2.;
860 TVirtualMC::GetMC()->Gsvolu("FPE4", "BOX ", getMediumID(kHoneyHoles), par, 3); // Al honeycomb for holes
861 // xcoor = 0.;
862 // ycoor = 0.;
863 // zcoor = 0.;
864 TVirtualMC::GetMC()->Gspos("FPE4", 0, "FALB", xcoor, ycoor, zcoor, 0, "ONLY");
865 }
866
867 // par[0] = xtof*0.5;
868 // par[1] = ALCOVERTHICKNESS*0.5;
870 TVirtualMC::GetMC()->Gsvolu("FPE2", "BOX ", getMediumID(kHoneycomb), par, 3); // Al honeycomb
871 // xcoor = 0.;
872 // ycoor = 0.;
874 TVirtualMC::GetMC()->Gspos("FPE2", 1, "FALT", xcoor, ycoor, zcoor, 0, "ONLY");
875 TVirtualMC::GetMC()->Gspos("FPE2", 2, "FALT", xcoor, ycoor, -zcoor, 0, "ONLY");
876
877 if (mTOFHoles) {
878 // xcoor = 0.;
879 // ycoor = 0.;
880 // zcoor = (Geo::EXTERINTERMODBORDER1 + Geo::INTERCENTRMODBORDER2)*0.5;
881 TVirtualMC::GetMC()->Gspos("FPE2", 1, "FALB", xcoor, ycoor, zcoor, 0, "ONLY");
882 TVirtualMC::GetMC()->Gspos("FPE2", 2, "FALB", xcoor, ycoor, -zcoor, 0, "ONLY");
883 }
884
885 // par[0] = xtof*0.5;
886 // par[1] = ALCOVERTHICKNESS*0.5;
887 par[2] = (zlenA * 0.5 + 2. - Geo::EXTERINTERMODBORDER1) * 0.5 - 2.;
888 TVirtualMC::GetMC()->Gsvolu("FPE3", "BOX ", getMediumID(kHoneycomb), par, 3); // Al honeycomb
889 // xcoor = 0.;
890 // ycoor = 0.;
891 zcoor = (zlenA * 0.5 + 2. + Geo::EXTERINTERMODBORDER1) * 0.5;
892 TVirtualMC::GetMC()->Gspos("FPE3", 1, "FALT", xcoor, ycoor, zcoor, 0, "ONLY");
893 TVirtualMC::GetMC()->Gspos("FPE3", 2, "FALT", xcoor, ycoor, -zcoor, 0, "ONLY");
894
895 if (mTOFHoles) {
896 // xcoor = 0.;
897 // ycoor = 0.;
898 zcoor = (zlenA * 0.5 + 2. + Geo::EXTERINTERMODBORDER1) * 0.5;
899 TVirtualMC::GetMC()->Gspos("FPE3", 1, "FALB", xcoor, ycoor, zcoor, 0, "ONLY");
900 TVirtualMC::GetMC()->Gspos("FPE3", 2, "FALB", xcoor, ycoor, -zcoor, 0, "ONLY");
901 }
902
903 // volumes for Interface cards
904 par[0] = xtof * 0.5;
905 par[1] = INTERFACECARDTHICKNESS * 0.5;
906 par[2] = Geo::INTERCENTRMODBORDER2 - 2.;
907 TVirtualMC::GetMC()->Gsvolu("FIF1", "BOX ", getMediumID(kG10), par, 3); // G10
908 // xcoor = 0.;
909 ycoor = ALCOVERTHICKNESS * 0.5 + INTERFACECARDTHICKNESS * 0.5;
910 zcoor = 0.;
911 TVirtualMC::GetMC()->Gspos("FIF1", 0, "FPEA", xcoor, ycoor, zcoor, 0, "ONLY");
912
913 // par[0] = xtof*0.5;
914 // par[1] = INTERFACECARDTHICKNESS*0.5;
916 TVirtualMC::GetMC()->Gsvolu("FIF2", "BOX ", getMediumID(kG10), par, 3); // G10
917 // xcoor = 0.;
918 // ycoor = ALCOVERTHICKNESS*0.5 + INTERFACECARDTHICKNESS*0.5;
920 TVirtualMC::GetMC()->Gspos("FIF2", 1, "FPEA", xcoor, ycoor, zcoor, 0, "ONLY");
921 TVirtualMC::GetMC()->Gspos("FIF2", 2, "FPEA", xcoor, ycoor, -zcoor, 0, "ONLY");
922 if (mTOFHoles) {
923 TVirtualMC::GetMC()->Gspos("FIF2", 1, "FPEB", xcoor, ycoor, zcoor, 0, "ONLY");
924 TVirtualMC::GetMC()->Gspos("FIF2", 2, "FPEB", xcoor, ycoor, -zcoor, 0, "ONLY");
925 }
926
927 // par[0] = xtof*0.5;
928 // par[1] = INTERFACECARDTHICKNESS*0.5;
929 par[2] = (zlenA * 0.5 + 2. - Geo::EXTERINTERMODBORDER1) * 0.5 - 2.;
930 TVirtualMC::GetMC()->Gsvolu("FIF3", "BOX ", getMediumID(kG10), par, 3); // G10
931 // xcoor = 0.;
932 // ycoor = ALCOVERTHICKNESS*0.5 + INTERFACECARDTHICKNESS*0.5;
933 zcoor = (zlenA * 0.5 + 2. + Geo::EXTERINTERMODBORDER1) * 0.5;
934 TVirtualMC::GetMC()->Gspos("FIF3", 1, "FPEA", xcoor, ycoor, zcoor, 0, "ONLY");
935 TVirtualMC::GetMC()->Gspos("FIF3", 2, "FPEA", xcoor, ycoor, -zcoor, 0, "ONLY");
936 if (mTOFHoles) {
937 TVirtualMC::GetMC()->Gspos("FIF3", 1, "FPEB", xcoor, ycoor, zcoor, 0, "ONLY");
938 TVirtualMC::GetMC()->Gspos("FIF3", 2, "FPEB", xcoor, ycoor, -zcoor, 0, "ONLY");
939 }
940
941 // volumes for flat cables
942 // plastic
943 par[0] = xtof * 0.5;
944 par[1] = PLASTICFLATCABLETHICKNESS * 0.5;
945 par[2] = Geo::INTERCENTRMODBORDER2 - 2.;
946 TVirtualMC::GetMC()->Gsvolu("FFC1", "BOX ", getMediumID(kPlastic), par, 3); // Plastic (CH2)
947 // xcoor = 0.;
948 ycoor = -ALCOVERTHICKNESS * 0.5 - PLASTICFLATCABLETHICKNESS * 0.5;
949 zcoor = 0.;
950 TVirtualMC::GetMC()->Gspos("FFC1", 0, "FPEA", xcoor, ycoor, zcoor, 0, "ONLY");
951
952 // par[0] = xtof*0.5;
953 // par[1] = PLASTICFLATCABLETHICKNESS*0.5;
955 TVirtualMC::GetMC()->Gsvolu("FFC2", "BOX ", getMediumID(kPlastic), par, 3); // Plastic (CH2)
956 // xcoor = 0.;
957 // ycoor = -ALCOVERTHICKNESS*0.5 - PLASTICFLATCABLETHICKNESS*0.5;
959 TVirtualMC::GetMC()->Gspos("FFC2", 1, "FPEA", xcoor, ycoor, zcoor, 0, "ONLY");
960 TVirtualMC::GetMC()->Gspos("FFC2", 2, "FPEA", xcoor, ycoor, -zcoor, 0, "ONLY");
961 if (mTOFHoles) {
962 TVirtualMC::GetMC()->Gspos("FFC2", 1, "FPEB", xcoor, ycoor, zcoor, 0, "ONLY");
963 TVirtualMC::GetMC()->Gspos("FFC2", 2, "FPEB", xcoor, ycoor, -zcoor, 0, "ONLY");
964 }
965
966 // par[0] = xtof*0.5;
967 // par[1] = PLASTICFLATCABLETHICKNESS*0.5;
968 par[2] = (zlenA * 0.5 + 2. - Geo::EXTERINTERMODBORDER1) * 0.5 - 2.;
969 TVirtualMC::GetMC()->Gsvolu("FFC3", "BOX ", getMediumID(kPlastic), par, 3); // Plastic (CH2)
970 // xcoor = 0.;
971 // ycoor = -ALCOVERTHICKNESS*0.5 - PLASTICFLATCABLETHICKNESS*0.5;
972 zcoor = (zlenA * 0.5 + 2. + Geo::EXTERINTERMODBORDER1) * 0.5;
973 TVirtualMC::GetMC()->Gspos("FFC3", 1, "FPEA", xcoor, ycoor, zcoor, 0, "ONLY");
974 TVirtualMC::GetMC()->Gspos("FFC3", 2, "FPEA", xcoor, ycoor, -zcoor, 0, "ONLY");
975 if (mTOFHoles) {
976 TVirtualMC::GetMC()->Gspos("FFC3", 1, "FPEB", xcoor, ycoor, zcoor, 0, "ONLY");
977 TVirtualMC::GetMC()->Gspos("FFC3", 2, "FPEB", xcoor, ycoor, -zcoor, 0, "ONLY");
978 }
979
980 // Cu
981 par[0] = xtof * 0.5;
982 par[1] = COPPERFLATCABLETHICKNESS * 0.5;
983 par[2] = Geo::INTERCENTRMODBORDER2 - 2.;
984 TVirtualMC::GetMC()->Gsvolu("FCC1", "BOX ", getMediumID(kCopper), par, 3); // Cu
985 TVirtualMC::GetMC()->Gspos("FCC1", 0, "FFC1", 0., 0., 0., 0, "ONLY");
986
987 // par[0] = xtof*0.5;
988 // par[1] = COPPERFLATCABLETHICKNESS*0.5;
990 TVirtualMC::GetMC()->Gsvolu("FCC2", "BOX ", getMediumID(kCopper), par, 3); // Cu
991 TVirtualMC::GetMC()->Gspos("FCC2", 0, "FFC2", 0., 0., 0., 0, "ONLY");
992
993 // par[0] = xtof*0.5;
994 // par[1] = COPPERFLATCABLETHICKNESS*0.5;
995 par[2] = (zlenA * 0.5 + 2. - Geo::EXTERINTERMODBORDER1) * 0.5 - 2.;
996 TVirtualMC::GetMC()->Gsvolu("FCC3", "BOX ", getMediumID(kCopper), par, 3); // Cu
997 TVirtualMC::GetMC()->Gspos("FCC3", 0, "FFC3", 0., 0., 0., 0, "ONLY");
998}
999
1000void Detector::createBackZone(Float_t xtof, Float_t ytof, Float_t zlenA) const
1001{
1002 //
1003 // Define:
1004 // - containers for FEA cards, cooling system
1005 // signal cables and supermodule support structure
1006 // (volumes called FAIA/B/C),
1007 // - containers for FEA cards and some cooling
1008 // elements for a FEA (volumes called FCA1/2).
1009 //
1010
1011 Int_t idrotm[1] = {0};
1012
1013 // Definition of the air card containers (FAIA, FAIC and FAIB)
1014
1015 Float_t par[3];
1016 par[0] = xtof * 0.5;
1017 par[1] = (ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5;
1018 par[2] = zlenA * 0.5;
1019 TVirtualMC::GetMC()->Gsvolu("FAIA", "BOX ", getMediumID(kAir), par, 3); // Air
1020 if (mTOFHoles) {
1021 TVirtualMC::GetMC()->Gsvolu("FAIB", "BOX ", getMediumID(kAir), par, 3); // Air
1022 }
1023 TVirtualMC::GetMC()->Gsvolu("FAIC", "BOX ", getMediumID(kAir), par, 3); // Air
1024
1028 // Float_t feaRoof2[3] = {Geo::ROOF2PARAMETERS[0], Geo::ROOF2PARAMETERS[1], Geo::ROOF2PARAMETERS[2]};
1029
1030 // FEA card mother-volume definition
1031 Float_t carpar[3] = {static_cast<Float_t>(xtof * 0.5 - Geo::CBLW - Geo::SAWTHICKNESS),
1032 static_cast<Float_t>(feaParam[1] + feaRoof1[1] + Geo::ROOF2PARAMETERS[1] * 0.5),
1033 static_cast<Float_t>(feaRoof1[2] + Geo::BETWEENLANDMASK * 0.5 + al3[2])};
1034 TVirtualMC::GetMC()->Gsvolu("FCA1", "BOX ", getMediumID(kAir), carpar, 3); // Air
1035 TVirtualMC::GetMC()->Gsvolu("FCA2", "BOX ", getMediumID(kAir), carpar, 3); // Air
1036
1037 // rotation matrix
1038 Matrix(idrotm[0], 90., 180., 90., 90., 180., 0.);
1039
1040 // FEA card mother-volume positioning
1041 Float_t rowstep = 6.66;
1042 Float_t rowgap[5] = {13.5, 22.9, 16.94, 23.8, 20.4};
1043 Int_t rowb[5] = {6, 7, 6, 19, 7};
1044 Float_t carpos[3] = {0., static_cast<Float_t>(-(ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5 + carpar[1]), -0.8};
1045 TVirtualMC::GetMC()->Gspos("FCA1", 91, "FAIA", carpos[0], carpos[1], carpos[2], 0, "MANY");
1046 TVirtualMC::GetMC()->Gspos("FCA2", 91, "FAIC", carpos[0], carpos[1], carpos[2], 0, "MANY");
1047
1048 Int_t row = 1;
1049 Int_t nrow = 0;
1050 for (Int_t sg = -1; sg < 2; sg += 2) {
1051 carpos[2] = sg * zlenA * 0.5 - 0.8;
1052 for (Int_t nb = 0; nb < 5; ++nb) {
1053 carpos[2] = carpos[2] - sg * (rowgap[nb] - rowstep);
1054 nrow = row + rowb[nb];
1055 for (; row < nrow; ++row) {
1056 carpos[2] -= sg * rowstep;
1057
1058 if (nb == 4) {
1059 TVirtualMC::GetMC()->Gspos("FCA1", row, "FAIA", carpos[0], carpos[1], carpos[2], 0, "ONLY");
1060 TVirtualMC::GetMC()->Gspos("FCA2", row, "FAIC", carpos[0], carpos[1], carpos[2], 0, "ONLY");
1061
1062 } else {
1063 switch (sg) {
1064 case 1:
1065 TVirtualMC::GetMC()->Gspos("FCA1", row, "FAIA", carpos[0], carpos[1], carpos[2], 0, "ONLY");
1066 TVirtualMC::GetMC()->Gspos("FCA2", row, "FAIC", carpos[0], carpos[1], carpos[2], 0, "ONLY");
1067 break;
1068 case -1:
1069 TVirtualMC::GetMC()->Gspos("FCA1", row, "FAIA", carpos[0], carpos[1], carpos[2], idrotm[0], "ONLY");
1070 TVirtualMC::GetMC()->Gspos("FCA2", row, "FAIC", carpos[0], carpos[1], carpos[2], idrotm[0], "ONLY");
1071 break;
1072 }
1073 }
1074 }
1075 }
1076 }
1077
1078 if (mTOFHoles) {
1079 row = 1;
1080 for (Int_t sg = -1; sg < 2; sg += 2) {
1081 carpos[2] = sg * zlenA * 0.5 - 0.8;
1082 for (Int_t nb = 0; nb < 4; ++nb) {
1083 carpos[2] = carpos[2] - sg * (rowgap[nb] - rowstep);
1084 nrow = row + rowb[nb];
1085 for (; row < nrow; ++row) {
1086 carpos[2] -= sg * rowstep;
1087
1088 switch (sg) {
1089 case 1:
1090 TVirtualMC::GetMC()->Gspos("FCA1", row, "FAIB", carpos[0], carpos[1], carpos[2], 0, "ONLY");
1091 break;
1092 case -1:
1093 TVirtualMC::GetMC()->Gspos("FCA1", row, "FAIB", carpos[0], carpos[1], carpos[2], idrotm[0], "ONLY");
1094 break;
1095 }
1096 }
1097 }
1098 }
1099 }
1100}
1101
1102void Detector::makeFrontEndElectronics(Float_t xtof) const
1103{
1104 //
1105 // Fill FCA1/2 volumes with FEA cards (FFEA volumes).
1106 //
1107
1108 // FEA card volume definition
1110 TVirtualMC::GetMC()->Gsvolu("FFEA", "BOX ", getMediumID(kG10), feaParam, 3); // G10
1111
1115 // Float_t feaRoof2[3] = {Geo::ROOF2PARAMETERS[0], Geo::ROOF2PARAMETERS[1], Geo::ROOF2PARAMETERS[2]};
1116
1117 Float_t carpar[3] = {static_cast<Float_t>(xtof * 0.5 - Geo::CBLW - Geo::SAWTHICKNESS),
1118 static_cast<Float_t>(feaParam[1] + feaRoof1[1] + Geo::ROOF2PARAMETERS[1] * 0.5),
1119 static_cast<Float_t>(feaRoof1[2] + Geo::BETWEENLANDMASK * 0.5 + al3[2])};
1120
1121 // FEA card volume positioning
1122 Float_t xCoor = xtof * 0.5 - 25.;
1123 Float_t yCoor = -carpar[1] + feaParam[1];
1124 Float_t zCoor = -carpar[2] + (2. * feaRoof1[2] - 2. * al1[2] - feaParam[2]);
1125 TVirtualMC::GetMC()->Gspos("FFEA", 1, "FCA1", -xCoor, yCoor, zCoor, 0, "ONLY");
1126 TVirtualMC::GetMC()->Gspos("FFEA", 4, "FCA1", xCoor, yCoor, zCoor, 0, "ONLY");
1127 TVirtualMC::GetMC()->Gspos("FFEA", 1, "FCA2", -xCoor, yCoor, zCoor, 0, "ONLY");
1128 TVirtualMC::GetMC()->Gspos("FFEA", 4, "FCA2", xCoor, yCoor, zCoor, 0, "ONLY");
1129 xCoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1130 TVirtualMC::GetMC()->Gspos("FFEA", 2, "FCA1", -xCoor, yCoor, zCoor, 0, "ONLY");
1131 TVirtualMC::GetMC()->Gspos("FFEA", 3, "FCA1", xCoor, yCoor, zCoor, 0, "ONLY");
1132 TVirtualMC::GetMC()->Gspos("FFEA", 2, "FCA2", -xCoor, yCoor, zCoor, 0, "ONLY");
1133 TVirtualMC::GetMC()->Gspos("FFEA", 3, "FCA2", xCoor, yCoor, zCoor, 0, "ONLY");
1134}
1135
1136void Detector::makeFEACooling(Float_t xtof) const
1137{
1138 //
1139 // Make cooling system attached to each FEA card
1140 // (FAL1, FRO1 and FBAR/1/2 volumes)
1141 // in FCA1/2 volume containers.
1142 //
1143
1144 // first FEA cooling element definition
1146 TVirtualMC::GetMC()->Gsvolu("FAL1", "BOX ", getMediumID(kAlFrame), al1, 3); // Al
1147
1148 // second FEA cooling element definition
1150 TVirtualMC::GetMC()->Gsvolu("FRO1", "BOX ", getMediumID(kAlFrame), feaRoof1, 3); // Al
1151
1153 // Float_t feaRoof2[3] = {Geo::ROOF2PARAMETERS[0], Geo::ROOF2PARAMETERS[1], Geo::ROOF2PARAMETERS[2]};
1154
1155 // definition and positioning of a small air groove in the FRO1 volume
1156 Float_t airHole[3] = {Geo::ROOF2PARAMETERS[0], static_cast<Float_t>(Geo::ROOF2PARAMETERS[1] * 0.5), feaRoof1[2]};
1157 TVirtualMC::GetMC()->Gsvolu("FREE", "BOX ", getMediumID(kAir), airHole, 3); // Air
1158 TVirtualMC::GetMC()->Gspos("FREE", 1, "FRO1", 0., feaRoof1[1] - airHole[1], 0., 0, "ONLY");
1159 gGeoManager->GetVolume("FRO1")->VisibleDaughters(kFALSE);
1160
1161 // third FEA cooling element definition
1162 Float_t bar[3] = {Geo::BAR[0], Geo::BAR[1], Geo::BAR[2]};
1163 TVirtualMC::GetMC()->Gsvolu("FBAR", "BOX ", getMediumID(kAlFrame), bar, 3); // Al
1164
1166
1167 Float_t carpar[3] = {static_cast<Float_t>(xtof * 0.5 - Geo::CBLW - Geo::SAWTHICKNESS),
1168 static_cast<Float_t>(feaParam[1] + feaRoof1[1] + Geo::ROOF2PARAMETERS[1] * 0.5),
1169 static_cast<Float_t>(feaRoof1[2] + Geo::BETWEENLANDMASK * 0.5 + al3[2])};
1170
1171 // fourth FEA cooling element definition
1172 Float_t bar1[3] = {Geo::BAR1[0], Geo::BAR1[1], Geo::BAR1[2]};
1173 TVirtualMC::GetMC()->Gsvolu("FBA1", "BOX ", getMediumID(kAlFrame), bar1, 3); // Al
1174
1175 // fifth FEA cooling element definition
1176 Float_t bar2[3] = {Geo::BAR2[0], Geo::BAR2[1], Geo::BAR2[2]};
1177 TVirtualMC::GetMC()->Gsvolu("FBA2", "BOX ", getMediumID(kAlFrame), bar2, 3); // Al
1178
1179 // first FEA cooling element positioning
1180 Float_t xcoor = xtof * 0.5 - 25.;
1181 Float_t ycoor = carpar[1] - 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - al1[1];
1182 Float_t zcoor = -carpar[2] + 2. * feaRoof1[2] - al1[2];
1183 TVirtualMC::GetMC()->Gspos("FAL1", 1, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1184 TVirtualMC::GetMC()->Gspos("FAL1", 4, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1185 TVirtualMC::GetMC()->Gspos("FAL1", 1, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1186 TVirtualMC::GetMC()->Gspos("FAL1", 4, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1187 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1188 TVirtualMC::GetMC()->Gspos("FAL1", 2, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1189 TVirtualMC::GetMC()->Gspos("FAL1", 3, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1190 TVirtualMC::GetMC()->Gspos("FAL1", 2, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1191 TVirtualMC::GetMC()->Gspos("FAL1", 3, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1192
1193 // second FEA cooling element positioning
1194 xcoor = xtof * 0.5 - 25.;
1195 ycoor = carpar[1] - 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - feaRoof1[1];
1196 zcoor = -carpar[2] + feaRoof1[2];
1197 TVirtualMC::GetMC()->Gspos("FRO1", 1, "FCA1", -xcoor, ycoor, zcoor, 0, "MANY"); // (AdC)
1198 TVirtualMC::GetMC()->Gspos("FRO1", 4, "FCA1", xcoor, ycoor, zcoor, 0, "MANY"); // (AdC)
1199 TVirtualMC::GetMC()->Gspos("FRO1", 1, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1200 TVirtualMC::GetMC()->Gspos("FRO1", 4, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1201 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1202 TVirtualMC::GetMC()->Gspos("FRO1", 2, "FCA1", -xcoor, ycoor, zcoor, 0, "MANY"); // (AdC)
1203 TVirtualMC::GetMC()->Gspos("FRO1", 3, "FCA1", xcoor, ycoor, zcoor, 0, "MANY"); // (AdC)
1204 TVirtualMC::GetMC()->Gspos("FRO1", 2, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1205 TVirtualMC::GetMC()->Gspos("FRO1", 3, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1206
1207 // third FEA cooling element positioning
1208 xcoor = xtof * 0.5 - 25.;
1209 ycoor = carpar[1] - 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - bar[1];
1210 zcoor = -carpar[2] + bar[2];
1211 TVirtualMC::GetMC()->Gspos("FBAR", 1, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1212 TVirtualMC::GetMC()->Gspos("FBAR", 4, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1213 TVirtualMC::GetMC()->Gspos("FBAR", 1, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1214 TVirtualMC::GetMC()->Gspos("FBAR", 4, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1215 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1216 TVirtualMC::GetMC()->Gspos("FBAR", 2, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1217 TVirtualMC::GetMC()->Gspos("FBAR", 3, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1218 TVirtualMC::GetMC()->Gspos("FBAR", 2, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1219 TVirtualMC::GetMC()->Gspos("FBAR", 3, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1220
1221 // fourth FEA cooling element positioning
1222 Float_t tubepar[3] = {0., 0.4, static_cast<Float_t>(xtof * 0.5 - Geo::CBLW)};
1223 xcoor = xtof * 0.5 - 25.;
1224 ycoor = carpar[1] - 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - bar[1];
1225 zcoor = -carpar[2] + 2. * bar[2] + 2. * tubepar[1] + bar1[2];
1226 TVirtualMC::GetMC()->Gspos("FBA1", 1, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1227 TVirtualMC::GetMC()->Gspos("FBA1", 4, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1228 TVirtualMC::GetMC()->Gspos("FBA1", 1, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1229 TVirtualMC::GetMC()->Gspos("FBA1", 4, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1230 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1231 TVirtualMC::GetMC()->Gspos("FBA1", 2, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1232 TVirtualMC::GetMC()->Gspos("FBA1", 3, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1233 TVirtualMC::GetMC()->Gspos("FBA1", 2, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1234 TVirtualMC::GetMC()->Gspos("FBA1", 3, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1235
1236 // fifth FEA cooling element positioning
1237 xcoor = xtof * 0.5 - 25.;
1238 ycoor = carpar[1] - 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - bar2[1];
1239 zcoor = -carpar[2] + 2. * bar[2] + bar2[2];
1240 TVirtualMC::GetMC()->Gspos("FBA2", 1, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1241 TVirtualMC::GetMC()->Gspos("FBA2", 4, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1242 TVirtualMC::GetMC()->Gspos("FBA2", 1, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1243 TVirtualMC::GetMC()->Gspos("FBA2", 4, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1244 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1245 TVirtualMC::GetMC()->Gspos("FBA2", 2, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1246 TVirtualMC::GetMC()->Gspos("FBA2", 3, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1247 TVirtualMC::GetMC()->Gspos("FBA2", 2, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1248 TVirtualMC::GetMC()->Gspos("FBA2", 3, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1249
1250 xcoor = xtof * 0.5 - 25.;
1251 ycoor = carpar[1] - 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - 2. * bar2[1] - 2. * tubepar[1] - bar2[1];
1252 zcoor = -carpar[2] + 2. * bar[2] + bar2[2];
1253 TVirtualMC::GetMC()->Gspos("FBA2", 5, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1254 TVirtualMC::GetMC()->Gspos("FBA2", 8, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1255 TVirtualMC::GetMC()->Gspos("FBA2", 5, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1256 TVirtualMC::GetMC()->Gspos("FBA2", 8, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1257 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1258 TVirtualMC::GetMC()->Gspos("FBA2", 6, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1259 TVirtualMC::GetMC()->Gspos("FBA2", 7, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1260 TVirtualMC::GetMC()->Gspos("FBA2", 6, "FCA2", -xcoor, ycoor, zcoor, 0, "ONLY");
1261 TVirtualMC::GetMC()->Gspos("FBA2", 7, "FCA2", xcoor, ycoor, zcoor, 0, "ONLY");
1262}
1263
1264void Detector::makeNinoMask(Float_t xtof) const
1265{
1266 //
1267 // Make cooling Nino mask
1268 // for each FEA card (FAL2/3 and FRO2 volumes)
1269 // in FCA1 volume container.
1270 //
1271
1272 // first Nino ASIC mask volume definition
1274 TVirtualMC::GetMC()->Gsvolu("FAL2", "BOX ", getMediumID(kAlFrame), al2, 3); // Al
1275
1276 // second Nino ASIC mask volume definition
1278 TVirtualMC::GetMC()->Gsvolu("FAL3", "BOX ", getMediumID(kAlFrame), al3, 3); // Al
1279
1280 // third Nino ASIC mask volume definition
1282 TVirtualMC::GetMC()->Gsvolu("FRO2", "BOX ", getMediumID(kAlFrame), feaRoof2, 3); // Al
1283
1286
1287 Float_t carpar[3] = {static_cast<Float_t>(xtof * 0.5 - Geo::CBLW - Geo::SAWTHICKNESS),
1288 static_cast<Float_t>(feaParam[1] + feaRoof1[1] + Geo::ROOF2PARAMETERS[1] * 0.5),
1289 static_cast<Float_t>(feaRoof1[2] + Geo::BETWEENLANDMASK * 0.5 + al3[2])};
1290
1291 // first Nino ASIC mask volume positioning
1292 Float_t xcoor = xtof * 0.5 - 25.;
1293 Float_t ycoor = carpar[1] - 2. * al3[1];
1294 Float_t zcoor = carpar[2] - 2. * al3[2] - al2[2];
1295 TVirtualMC::GetMC()->Gspos("FAL2", 1, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1296 TVirtualMC::GetMC()->Gspos("FAL2", 4, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1297 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1298 TVirtualMC::GetMC()->Gspos("FAL2", 2, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1299 TVirtualMC::GetMC()->Gspos("FAL2", 3, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1300
1301 // second Nino ASIC mask volume positioning
1302 xcoor = xtof * 0.5 - 25.;
1303 ycoor = carpar[1] - al3[1];
1304 zcoor = carpar[2] - al3[2];
1305 TVirtualMC::GetMC()->Gspos("FAL3", 1, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1306 TVirtualMC::GetMC()->Gspos("FAL3", 4, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1307 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1308 TVirtualMC::GetMC()->Gspos("FAL3", 2, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1309 TVirtualMC::GetMC()->Gspos("FAL3", 3, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1310
1311 // third Nino ASIC mask volume positioning
1312 xcoor = xtof * 0.5 - 25.;
1313 ycoor = carpar[1] - Geo::ROOF2PARAMETERS[1];
1314 zcoor = carpar[2] - 2. * al3[2] - Geo::ROOF2PARAMETERS[2];
1315 TVirtualMC::GetMC()->Gspos("FRO2", 1, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1316 TVirtualMC::GetMC()->Gspos("FRO2", 4, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1317 xcoor = feaParam[0] + (Geo::FEAWIDTH2 * 0.5 - Geo::FEAWIDTH1);
1318 TVirtualMC::GetMC()->Gspos("FRO2", 2, "FCA1", -xcoor, ycoor, zcoor, 0, "ONLY");
1319 TVirtualMC::GetMC()->Gspos("FRO2", 3, "FCA1", xcoor, ycoor, zcoor, 0, "ONLY");
1320}
1321
1322void Detector::makeSuperModuleCooling(Float_t xtof, Float_t ytof, Float_t zlenA) const
1323{
1324 //
1325 // Make cooling tubes (FTUB volume)
1326 // and cooling bars (FTLN and FLO1/2/3 volumes)
1327 // in FAIA/B/C volume containers.
1328 //
1329
1330 Int_t idrotm[1] = {0};
1331
1332 // cooling tube volume definition
1333 Float_t tubepar[3] = {0., 0.4, static_cast<Float_t>(xtof * 0.5 - Geo::CBLW - Geo::SAWTHICKNESS)};
1334 TVirtualMC::GetMC()->Gsvolu("FTUB", "TUBE", getMediumID(kCopper), tubepar, 3); // Cu
1335
1336 // water cooling tube volume definition
1337 Float_t tubeparW[3] = {0., 0.3, tubepar[2]};
1338 TVirtualMC::GetMC()->Gsvolu("FITU", "TUBE", getMediumID(kWater), tubeparW, 3); // H2O
1339
1340 // Positioning of the water tube into the steel one
1341 TVirtualMC::GetMC()->Gspos("FITU", 1, "FTUB", 0., 0., 0., 0, "ONLY");
1342
1343 // definition of transverse components of SM cooling system
1344 Float_t trapar[3] = {tubepar[2], 6.175 /*6.15*/, 0.7};
1345 TVirtualMC::GetMC()->Gsvolu("FTLN", "BOX ", getMediumID(kAlFrame), trapar, 3); // Al
1346
1347 // rotation matrix
1348 Matrix(idrotm[0], 180., 90., 90., 90., 90., 0.);
1349
1352 Float_t bar[3] = {Geo::BAR[0], Geo::BAR[1], Geo::BAR[2]};
1353 Float_t bar2[3] = {Geo::BAR2[0], Geo::BAR2[1], Geo::BAR2[2]};
1355 // Float_t feaRoof2[3] = {Geo::ROOF2PARAMETERS[0], Geo::ROOF2PARAMETERS[1], Geo::ROOF2PARAMETERS[2]};
1356
1357 Float_t carpar[3] = {static_cast<Float_t>(xtof * 0.5 - Geo::CBLW - Geo::SAWTHICKNESS),
1358 static_cast<Float_t>(feaParam[1] + feaRoof1[1] + Geo::ROOF2PARAMETERS[1] * 0.5),
1359 static_cast<Float_t>(feaRoof1[2] + Geo::BETWEENLANDMASK * 0.5 + al3[2])};
1360
1361 Float_t ytub = -(ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5 + carpar[1] + carpar[1] -
1362 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - 2. * bar2[1] - tubepar[1];
1363
1364 // Positioning of tubes for the SM cooling system
1365 Float_t ycoor = carpar[1] - 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - 2. * bar2[1] - tubepar[1];
1366 Float_t zcoor = -carpar[2] + 2. * bar[2] + tubepar[1];
1367 TVirtualMC::GetMC()->Gspos("FTUB", 1, "FCA1", 0., ycoor, zcoor, idrotm[0], "ONLY");
1368 TVirtualMC::GetMC()->Gspos("FTUB", 1, "FCA2", 0., ycoor, zcoor, idrotm[0], "ONLY");
1369 gGeoManager->GetVolume("FTUB")->VisibleDaughters(kFALSE);
1370
1371 Float_t yFLTN = trapar[1] - (ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5;
1372 for (Int_t sg = -1; sg < 2; sg += 2) {
1373 // Positioning of transverse components for the SM cooling system
1374 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 4 * sg, "FAIA", 0., yFLTN, 369.9 * sg, 0, "MANY");
1375 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 3 * sg, "FAIA", 0., yFLTN, 366.9 * sg, 0, "MANY");
1376 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 2 * sg, "FAIA", 0., yFLTN, 198.8 * sg, 0, "MANY");
1377 TVirtualMC::GetMC()->Gspos("FTLN", 5 + sg, "FAIA", 0., yFLTN, 56.82 * sg, 0, "MANY");
1378 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 4 * sg, "FAIC", 0., yFLTN, 369.9 * sg, 0, "MANY");
1379 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 3 * sg, "FAIC", 0., yFLTN, 366.9 * sg, 0, "MANY");
1380 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 2 * sg, "FAIC", 0., yFLTN, 198.8 * sg, 0, "MANY");
1381 TVirtualMC::GetMC()->Gspos("FTLN", 5 + sg, "FAIC", 0., yFLTN, 56.82 * sg, 0, "MANY");
1382 }
1383
1384 // definition of longitudinal components of SM cooling system
1385 Float_t lonpar1[3] = {2., 0.5, static_cast<Float_t>(56.82 - trapar[2])};
1386 Float_t lonpar2[3] = {lonpar1[0], lonpar1[1], static_cast<Float_t>((198.8 - 56.82) * 0.5 - trapar[2])};
1387 Float_t lonpar3[3] = {lonpar1[0], lonpar1[1], static_cast<Float_t>((366.9 - 198.8) * 0.5 - trapar[2])};
1388 TVirtualMC::GetMC()->Gsvolu("FLO1", "BOX ", getMediumID(kAlFrame), lonpar1, 3); // Al
1389 TVirtualMC::GetMC()->Gsvolu("FLO2", "BOX ", getMediumID(kAlFrame), lonpar2, 3); // Al
1390 TVirtualMC::GetMC()->Gsvolu("FLO3", "BOX ", getMediumID(kAlFrame), lonpar3, 3); // Al
1391
1392 // Positioning of longitudinal components for the SM cooling system
1393 ycoor = ytub + (tubepar[1] + 2. * bar2[1] + lonpar1[1]);
1394 TVirtualMC::GetMC()->Gspos("FLO1", 4, "FAIA", -24., ycoor, 0., 0, "MANY");
1395 TVirtualMC::GetMC()->Gspos("FLO1", 2, "FAIA", 24., ycoor, 0., 0, "MANY");
1396 TVirtualMC::GetMC()->Gspos("FLO1", 4, "FAIC", -24., ycoor, 0., 0, "MANY");
1397 TVirtualMC::GetMC()->Gspos("FLO1", 2, "FAIC", 24., ycoor, 0., 0, "MANY");
1398
1399 zcoor = (198.8 + 56.82) * 0.5;
1400 TVirtualMC::GetMC()->Gspos("FLO2", 4, "FAIA", -24., ycoor, -zcoor, 0, "MANY");
1401 TVirtualMC::GetMC()->Gspos("FLO2", 2, "FAIA", 24., ycoor, -zcoor, 0, "MANY");
1402 TVirtualMC::GetMC()->Gspos("FLO2", 4, "FAIC", -24., ycoor, -zcoor, 0, "MANY");
1403 TVirtualMC::GetMC()->Gspos("FLO2", 2, "FAIC", 24., ycoor, -zcoor, 0, "MANY");
1404 TVirtualMC::GetMC()->Gspos("FLO2", 8, "FAIA", -24., ycoor, zcoor, 0, "MANY");
1405 TVirtualMC::GetMC()->Gspos("FLO2", 6, "FAIA", 24., ycoor, zcoor, 0, "MANY");
1406 TVirtualMC::GetMC()->Gspos("FLO2", 8, "FAIC", -24., ycoor, zcoor, 0, "MANY");
1407 TVirtualMC::GetMC()->Gspos("FLO2", 6, "FAIC", 24., ycoor, zcoor, 0, "MANY");
1408
1409 zcoor = (366.9 + 198.8) * 0.5;
1410 TVirtualMC::GetMC()->Gspos("FLO3", 4, "FAIA", -24., ycoor, -zcoor, 0, "MANY");
1411 TVirtualMC::GetMC()->Gspos("FLO3", 2, "FAIA", 24., ycoor, -zcoor, 0, "MANY");
1412 TVirtualMC::GetMC()->Gspos("FLO3", 4, "FAIC", -24., ycoor, -zcoor, 0, "MANY");
1413 TVirtualMC::GetMC()->Gspos("FLO3", 2, "FAIC", 24., ycoor, -zcoor, 0, "MANY");
1414 TVirtualMC::GetMC()->Gspos("FLO3", 8, "FAIA", -24., ycoor, zcoor, 0, "MANY");
1415 TVirtualMC::GetMC()->Gspos("FLO3", 6, "FAIA", 24., ycoor, zcoor, 0, "MANY");
1416 TVirtualMC::GetMC()->Gspos("FLO3", 8, "FAIC", -24., ycoor, zcoor, 0, "MANY");
1417 TVirtualMC::GetMC()->Gspos("FLO3", 6, "FAIC", 24., ycoor, zcoor, 0, "MANY");
1418
1419 ycoor = ytub - (tubepar[1] + 2. * bar2[1] + lonpar1[1]);
1420 TVirtualMC::GetMC()->Gspos("FLO1", 3, "FAIA", -24., ycoor, 0., 0, "MANY");
1421 TVirtualMC::GetMC()->Gspos("FLO1", 1, "FAIA", 24., ycoor, 0., 0, "MANY");
1422 TVirtualMC::GetMC()->Gspos("FLO1", 3, "FAIC", -24., ycoor, 0., 0, "MANY");
1423 TVirtualMC::GetMC()->Gspos("FLO1", 1, "FAIC", 24., ycoor, 0., 0, "MANY");
1424
1425 zcoor = (198.8 + 56.82) * 0.5;
1426 TVirtualMC::GetMC()->Gspos("FLO2", 3, "FAIA", -24., ycoor, -zcoor, 0, "MANY");
1427 TVirtualMC::GetMC()->Gspos("FLO2", 1, "FAIA", 24., ycoor, -zcoor, 0, "MANY");
1428 TVirtualMC::GetMC()->Gspos("FLO2", 3, "FAIC", -24., ycoor, -zcoor, 0, "MANY");
1429 TVirtualMC::GetMC()->Gspos("FLO2", 1, "FAIC", 24., ycoor, -zcoor, 0, "MANY");
1430 TVirtualMC::GetMC()->Gspos("FLO2", 7, "FAIA", -24., ycoor, zcoor, 0, "MANY");
1431 TVirtualMC::GetMC()->Gspos("FLO2", 5, "FAIA", 24., ycoor, zcoor, 0, "MANY");
1432 TVirtualMC::GetMC()->Gspos("FLO2", 7, "FAIC", -24., ycoor, zcoor, 0, "MANY");
1433 TVirtualMC::GetMC()->Gspos("FLO2", 5, "FAIC", 24., ycoor, zcoor, 0, "MANY");
1434
1435 zcoor = (366.9 + 198.8) * 0.5;
1436 TVirtualMC::GetMC()->Gspos("FLO3", 3, "FAIA", -24., ycoor, -zcoor, 0, "MANY");
1437 TVirtualMC::GetMC()->Gspos("FLO3", 1, "FAIA", 24., ycoor, -zcoor, 0, "MANY");
1438 TVirtualMC::GetMC()->Gspos("FLO3", 3, "FAIC", -24., ycoor, -zcoor, 0, "MANY");
1439 TVirtualMC::GetMC()->Gspos("FLO3", 1, "FAIC", 24., ycoor, -zcoor, 0, "MANY");
1440 TVirtualMC::GetMC()->Gspos("FLO3", 7, "FAIA", -24., ycoor, zcoor, 0, "MANY");
1441 TVirtualMC::GetMC()->Gspos("FLO3", 5, "FAIA", 24., ycoor, zcoor, 0, "MANY");
1442 TVirtualMC::GetMC()->Gspos("FLO3", 7, "FAIC", -24., ycoor, zcoor, 0, "MANY");
1443 TVirtualMC::GetMC()->Gspos("FLO3", 5, "FAIC", 24., ycoor, zcoor, 0, "MANY");
1444
1445 Float_t carpos[3] = {static_cast<Float_t>(25. - xtof * 0.5),
1446 static_cast<Float_t>((11.5 - (ytof * 0.5 - Geo::MODULECOVERTHICKNESS)) * 0.5), 0.};
1447 if (mTOFHoles) {
1448 for (Int_t sg = -1; sg < 2; sg += 2) {
1449 carpos[2] = sg * zlenA * 0.5;
1450 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 4 * sg, "FAIB", 0., yFLTN, 369.9 * sg, 0, "MANY");
1451 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 3 * sg, "FAIB", 0., yFLTN, 366.9 * sg, 0, "MANY");
1452 TVirtualMC::GetMC()->Gspos("FTLN", 5 + 2 * sg, "FAIB", 0., yFLTN, 198.8 * sg, 0, "MANY");
1453 TVirtualMC::GetMC()->Gspos("FTLN", 5 + sg, "FAIB", 0., yFLTN, 56.82 * sg, 0, "MANY");
1454 }
1455
1456 ycoor = ytub + (tubepar[1] + 2. * bar2[1] + lonpar1[1]);
1457 zcoor = (198.8 + 56.82) * 0.5;
1458 TVirtualMC::GetMC()->Gspos("FLO2", 2, "FAIB", -24., ycoor, -zcoor, 0, "MANY");
1459 TVirtualMC::GetMC()->Gspos("FLO2", 1, "FAIB", -24., ycoor, zcoor, 0, "MANY");
1460 zcoor = (366.9 + 198.8) * 0.5;
1461 TVirtualMC::GetMC()->Gspos("FLO3", 2, "FAIB", -24., ycoor, -zcoor, 0, "MANY");
1462 TVirtualMC::GetMC()->Gspos("FLO3", 1, "FAIB", -24., ycoor, zcoor, 0, "MANY");
1463 ycoor = ytub - (tubepar[1] + 2. * bar2[1] + lonpar1[1]);
1464 zcoor = (198.8 + 56.82) * 0.5;
1465 TVirtualMC::GetMC()->Gspos("FLO2", 4, "FAIB", 24., ycoor, -zcoor, 0, "MANY");
1466 TVirtualMC::GetMC()->Gspos("FLO2", 3, "FAIB", 24., ycoor, zcoor, 0, "MANY");
1467 zcoor = (366.9 + 198.8) * 0.5;
1468 TVirtualMC::GetMC()->Gspos("FLO3", 4, "FAIB", 24., ycoor, -zcoor, 0, "MANY");
1469 TVirtualMC::GetMC()->Gspos("FLO3", 3, "FAIB", 24., ycoor, zcoor, 0, "MANY");
1470 }
1471
1472 Float_t barS[3] = {Geo::BARS[0], Geo::BARS[1], Geo::BARS[2]};
1473 TVirtualMC::GetMC()->Gsvolu("FBAS", "BOX ", getMediumID(kAlFrame), barS, 3); // Al
1474
1475 Float_t barS1[3] = {Geo::BARS1[0], Geo::BARS1[1], Geo::BARS1[2]};
1476 TVirtualMC::GetMC()->Gsvolu("FBS1", "BOX ", getMediumID(kAlFrame), barS1, 3); // Al
1477
1478 Float_t barS2[3] = {Geo::BARS2[0], Geo::BARS2[1], Geo::BARS2[2]};
1479 TVirtualMC::GetMC()->Gsvolu("FBS2", "BOX ", getMediumID(kAlFrame), barS2, 3); // Al
1480
1481 Float_t ytubBis = carpar[1] - 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - 2. * barS2[1] - tubepar[1];
1482 ycoor = ytubBis;
1483 zcoor = -carpar[2] + barS[2];
1484 TVirtualMC::GetMC()->Gspos("FBAS", 1, "FCA1", -24., ycoor, zcoor, 0, "ONLY");
1485 TVirtualMC::GetMC()->Gspos("FBAS", 2, "FCA1", 24., ycoor, zcoor, 0, "ONLY");
1486 TVirtualMC::GetMC()->Gspos("FBAS", 1, "FCA2", -24., ycoor, zcoor, 0, "ONLY");
1487 TVirtualMC::GetMC()->Gspos("FBAS", 2, "FCA2", 24., ycoor, zcoor, 0, "ONLY");
1488
1489 zcoor = -carpar[2] + 2. * barS[2] + 2. * tubepar[1] + barS1[2];
1490 TVirtualMC::GetMC()->Gspos("FBS1", 1, "FCA1", -24., ycoor, zcoor, 0, "ONLY");
1491 TVirtualMC::GetMC()->Gspos("FBS1", 2, "FCA1", 24., ycoor, zcoor, 0, "ONLY");
1492 TVirtualMC::GetMC()->Gspos("FBS1", 1, "FCA2", -24., ycoor, zcoor, 0, "ONLY");
1493 TVirtualMC::GetMC()->Gspos("FBS1", 2, "FCA2", 24., ycoor, zcoor, 0, "ONLY");
1494
1495 ycoor = ytubBis + (tubepar[1] + barS2[1]);
1496 zcoor = -carpar[2] + 2. * barS[2] + barS2[2];
1497 TVirtualMC::GetMC()->Gspos("FBS2", 1, "FCA1", -24., ycoor, zcoor, 0, "ONLY");
1498 TVirtualMC::GetMC()->Gspos("FBS2", 2, "FCA1", 24., ycoor, zcoor, 0, "ONLY");
1499 TVirtualMC::GetMC()->Gspos("FBS2", 1, "FCA2", -24., ycoor, zcoor, 0, "ONLY");
1500 TVirtualMC::GetMC()->Gspos("FBS2", 2, "FCA2", 24., ycoor, zcoor, 0, "ONLY");
1501
1502 ycoor = ytubBis - (tubepar[1] + barS2[1]);
1503 // zcoor =-carpar[2] + 2.*barS[2] + barS2[2];
1504 TVirtualMC::GetMC()->Gspos("FBS2", 3, "FCA1", -24., ycoor, zcoor, 0, "ONLY");
1505 TVirtualMC::GetMC()->Gspos("FBS2", 4, "FCA1", 24., ycoor, zcoor, 0, "ONLY");
1506 TVirtualMC::GetMC()->Gspos("FBS2", 3, "FCA2", -24., ycoor, zcoor, 0, "ONLY");
1507 TVirtualMC::GetMC()->Gspos("FBS2", 4, "FCA2", 24., ycoor, zcoor, 0, "ONLY");
1508}
1509
1510//_____________________________________________________________________________
1511void Detector::makeSuperModuleServices(Float_t xtof, Float_t ytof, Float_t zlenA) const
1512{
1513 //
1514 // Make signal cables (FCAB/L and FCBL/B volumes),
1515 // supemodule cover (FCOV volume) and wall (FSAW volume)
1516 // in FAIA/B/C volume containers.
1517 //
1518
1519 Int_t idrotm[3] = {0, 0, 0};
1520
1521 Float_t tubepar[3] = {0., 0.4, static_cast<Float_t>(xtof * 0.5 - Geo::CBLW - Geo::SAWTHICKNESS)};
1525 // Float_t feaRoof2[3] = {Geo::ROOF2PARAMETERS[0], Geo::ROOF2PARAMETERS[1], Geo::ROOF2PARAMETERS[2]};
1527
1528 // FEA cables definition
1529 Float_t cbpar[3] = {0., 0.5,
1530 static_cast<Float_t>((tubepar[2] - (Geo::FEAWIDTH2 - Geo::FEAWIDTH1 / 6.) * 0.5) * 0.5)};
1531 TVirtualMC::GetMC()->Gsvolu("FCAB", "TUBE", getMediumID(kCable), cbpar, 3); // copper+alu
1532
1533 Float_t cbparS[3] = {cbpar[0], cbpar[1],
1534 static_cast<Float_t>(
1535 (tubepar[2] - (xtof * 0.5 - 25. + (Geo::FEAWIDTH1 - Geo::FEAWIDTH1 / 6.) * 0.5)) * 0.5)};
1536 TVirtualMC::GetMC()->Gsvolu("FCAL", "TUBE", getMediumID(kCable), cbparS, 3); // copper+alu
1537
1538 // rotation matrix
1539 Matrix(idrotm[0], 180., 90., 90., 90., 90., 0.);
1540
1541 Float_t carpar[3] = {static_cast<Float_t>(xtof * 0.5 - Geo::CBLW - Geo::SAWTHICKNESS),
1542 static_cast<Float_t>(feaParam[1] + feaRoof1[1] + Geo::ROOF2PARAMETERS[1] * 0.5),
1543 static_cast<Float_t>(feaRoof1[2] + Geo::BETWEENLANDMASK * 0.5 + al3[2])};
1544
1545 Float_t bar2[3] = {Geo::BAR2[0], Geo::BAR2[1], Geo::BAR2[2]};
1546 Float_t ytub = -(ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5 + carpar[1] + carpar[1] -
1547 2. * Geo::ROOF2PARAMETERS[1] * 0.5 - 2. * feaRoof1[1] - 2. * bar2[1] - tubepar[1];
1548
1549 // FEA cables positioning
1550 Float_t xcoor = (tubepar[2] + (Geo::FEAWIDTH2 - Geo::FEAWIDTH1 / 6.) * 0.5) * 0.5;
1551 Float_t ycoor = ytub - 3.;
1552 Float_t zcoor = -carpar[2] + (2. * feaRoof1[2] - 2. * al1[2] - 2. * feaParam[2] - cbpar[1]);
1553 TVirtualMC::GetMC()->Gspos("FCAB", 1, "FCA1", -xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1554 TVirtualMC::GetMC()->Gspos("FCAB", 2, "FCA1", xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1555 TVirtualMC::GetMC()->Gspos("FCAB", 1, "FCA2", -xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1556 TVirtualMC::GetMC()->Gspos("FCAB", 2, "FCA2", xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1557 xcoor = (tubepar[2] + (xtof * 0.5 - 25. + (Geo::FEAWIDTH1 - Geo::FEAWIDTH1 / 6.) * 0.5)) * 0.5;
1558 ycoor -= 2. * cbpar[1];
1559 TVirtualMC::GetMC()->Gspos("FCAL", 1, "FCA1", -xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1560 TVirtualMC::GetMC()->Gspos("FCAL", 2, "FCA1", xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1561 TVirtualMC::GetMC()->Gspos("FCAL", 1, "FCA2", -xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1562 TVirtualMC::GetMC()->Gspos("FCAL", 2, "FCA2", xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1563
1564 // Cables and tubes on the side blocks
1565 // constants definition
1566 Float_t kCBLl = zlenA * 0.5; // length of block
1567 Float_t kCBLlh = zlenA * 0.5 - Geo::INTERCENTRMODBORDER2; // length of block in case of holes
1568 // constexpr Float_t Geo::CBLW = 13.5; // width of block
1569 // constexpr Float_t Geo::CBLH1 = 2.; // min. height of block
1570 // constexpr Float_t Geo::CBLH2 = 12.3; // max. height of block
1571 // constexpr Float_t Geo::SAWTHICKNESS = 1.; // Al wall thickness
1572
1573 // lateral cable and tube volume definition
1574 Float_t tgal = (Geo::CBLH2 - Geo::CBLH1) / (2. * kCBLl);
1575 Float_t cblpar[11];
1576 cblpar[0] = Geo::CBLW * 0.5;
1577 cblpar[1] = 0.;
1578 cblpar[2] = 0.;
1579 cblpar[3] = kCBLl * 0.5;
1580 cblpar[4] = Geo::CBLH1 * 0.5;
1581 cblpar[5] = Geo::CBLH2 * 0.5;
1582 cblpar[6] = TMath::ATan(tgal) * TMath::RadToDeg();
1583 cblpar[7] = kCBLl * 0.5;
1584 cblpar[8] = Geo::CBLH1 * 0.5;
1585 cblpar[9] = Geo::CBLH2 * 0.5;
1586 cblpar[10] = cblpar[6];
1587 TVirtualMC::GetMC()->Gsvolu("FCBL", "TRAP", getMediumID(kCableTubes), cblpar, 11); // cables and tubes mix
1588
1589 // Side Al Walls definition
1590 Float_t sawpar[3] = {static_cast<Float_t>(Geo::SAWTHICKNESS * 0.5), static_cast<Float_t>(Geo::CBLH2 * 0.5), kCBLl};
1591 TVirtualMC::GetMC()->Gsvolu("FSAW", "BOX ", getMediumID(kAlFrame), sawpar, 3); // Al
1592
1593 Matrix(idrotm[1], 90., 90., 180., 0., 90., 180.);
1594 Matrix(idrotm[2], 90., 90., 0., 0., 90., 0.);
1595
1596 // lateral cable and tube volume positioning
1597 xcoor = (xtof - Geo::CBLW) * 0.5 - 2. * sawpar[0];
1598 ycoor = (Geo::CBLH1 + Geo::CBLH2) * 0.25 - (ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5;
1599 zcoor = kCBLl * 0.5;
1600 TVirtualMC::GetMC()->Gspos("FCBL", 1, "FAIA", -xcoor, ycoor, -zcoor, idrotm[1], "ONLY");
1601 TVirtualMC::GetMC()->Gspos("FCBL", 2, "FAIA", xcoor, ycoor, -zcoor, idrotm[1], "ONLY");
1602 TVirtualMC::GetMC()->Gspos("FCBL", 3, "FAIA", -xcoor, ycoor, zcoor, idrotm[2], "ONLY");
1603 TVirtualMC::GetMC()->Gspos("FCBL", 4, "FAIA", xcoor, ycoor, zcoor, idrotm[2], "ONLY");
1604 TVirtualMC::GetMC()->Gspos("FCBL", 1, "FAIC", -xcoor, ycoor, -zcoor, idrotm[1], "ONLY");
1605 TVirtualMC::GetMC()->Gspos("FCBL", 2, "FAIC", xcoor, ycoor, -zcoor, idrotm[1], "ONLY");
1606 TVirtualMC::GetMC()->Gspos("FCBL", 3, "FAIC", -xcoor, ycoor, zcoor, idrotm[2], "ONLY");
1607 TVirtualMC::GetMC()->Gspos("FCBL", 4, "FAIC", xcoor, ycoor, zcoor, idrotm[2], "ONLY");
1608
1609 if (mTOFHoles) {
1610 cblpar[3] = kCBLlh * 0.5;
1611 cblpar[5] = Geo::CBLH1 * 0.5 + kCBLlh * tgal;
1612 cblpar[7] = kCBLlh * 0.5;
1613 cblpar[9] = cblpar[5];
1614 TVirtualMC::GetMC()->Gsvolu("FCBB", "TRAP", getMediumID(kCableTubes), cblpar, 11); // cables and tubes mix
1615
1616 xcoor = (xtof - Geo::CBLW) * 0.5 - 2. * sawpar[0];
1617 ycoor = (Geo::CBLH1 + 2. * cblpar[5]) * 0.25 - (ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5;
1618 zcoor = kCBLl - kCBLlh * 0.5;
1619 TVirtualMC::GetMC()->Gspos("FCBB", 1, "FAIB", -xcoor, ycoor, -zcoor, idrotm[1], "ONLY");
1620 TVirtualMC::GetMC()->Gspos("FCBB", 2, "FAIB", xcoor, ycoor, -zcoor, idrotm[1], "ONLY");
1621 TVirtualMC::GetMC()->Gspos("FCBB", 3, "FAIB", -xcoor, ycoor, zcoor, idrotm[2], "ONLY");
1622 TVirtualMC::GetMC()->Gspos("FCBB", 4, "FAIB", xcoor, ycoor, zcoor, idrotm[2], "ONLY");
1623 }
1624
1625 // lateral cable and tube volume positioning
1626 xcoor = xtof * 0.5 - sawpar[0];
1627 ycoor = (Geo::CBLH2 - ytof * 0.5 + Geo::MODULECOVERTHICKNESS) * 0.5;
1628 zcoor = 0.;
1629 TVirtualMC::GetMC()->Gspos("FSAW", 1, "FAIA", -xcoor, ycoor, zcoor, 0, "ONLY");
1630 TVirtualMC::GetMC()->Gspos("FSAW", 2, "FAIA", xcoor, ycoor, zcoor, 0, "ONLY");
1631 TVirtualMC::GetMC()->Gspos("FSAW", 1, "FAIC", -xcoor, ycoor, zcoor, 0, "ONLY");
1632 TVirtualMC::GetMC()->Gspos("FSAW", 2, "FAIC", xcoor, ycoor, zcoor, 0, "ONLY");
1633
1634 if (mTOFHoles) {
1635 xcoor = xtof * 0.5 - sawpar[0];
1636 ycoor = (Geo::CBLH2 - ytof * 0.5 + Geo::MODULECOVERTHICKNESS) * 0.5;
1637 TVirtualMC::GetMC()->Gspos("FSAW", 1, "FAIB", -xcoor, ycoor, 0., 0, "ONLY");
1638 TVirtualMC::GetMC()->Gspos("FSAW", 2, "FAIB", xcoor, ycoor, 0., 0, "ONLY");
1639 }
1640
1641 // TOF Supermodule cover definition and positioning
1642 Float_t covpar[3] = {static_cast<Float_t>(xtof * 0.5), 0.075, static_cast<Float_t>(zlenA * 0.5)};
1643 TVirtualMC::GetMC()->Gsvolu("FCOV", "BOX ", getMediumID(kAlFrame), covpar, 3); // Al
1644 if (mTOFHoles) {
1645 covpar[2] = (zlenA * 0.5 - Geo::INTERCENTRMODBORDER2) * 0.5;
1646 TVirtualMC::GetMC()->Gsvolu("FCOB", "BOX ", getMediumID(kAlFrame), covpar, 3); // Al
1647 covpar[2] = Geo::INTERCENTRMODBORDER2;
1648 TVirtualMC::GetMC()->Gsvolu("FCOP", "BOX ", getMediumID(kPlastic), covpar, 3); // Plastic (CH2)
1649 }
1650
1651 xcoor = 0.;
1652 ycoor = (ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5 - covpar[1];
1653 zcoor = 0.;
1654 TVirtualMC::GetMC()->Gspos("FCOV", 0, "FAIA", xcoor, ycoor, zcoor, 0, "ONLY");
1655 TVirtualMC::GetMC()->Gspos("FCOV", 0, "FAIC", xcoor, ycoor, zcoor, 0, "ONLY");
1656 if (mTOFHoles) {
1657 zcoor = (zlenA * 0.5 + Geo::INTERCENTRMODBORDER2) * 0.5;
1658 TVirtualMC::GetMC()->Gspos("FCOB", 1, "FAIB", xcoor, ycoor, zcoor, 0, "ONLY");
1659 TVirtualMC::GetMC()->Gspos("FCOB", 2, "FAIB", xcoor, ycoor, -zcoor, 0, "ONLY");
1660 zcoor = 0.;
1661 TVirtualMC::GetMC()->Gspos("FCOP", 0, "FAIB", xcoor, ycoor, zcoor, 0, "ONLY");
1662 }
1663}
1664
1665//_____________________________________________________________________________
1666void Detector::makeReadoutCrates(Float_t ytof) const
1667{
1668 // Services Volumes
1669
1670 // Empty crate weight: 50 Kg, electronics cards + cables ~ 52 Kg.
1671 // Per each side (A and C) the total weight is: 2x102 ~ 204 Kg.
1672 // ... + weight of the connection pannel for the steel cooling system (Cr 18%, Ni 12%, Fe 70%)
1673 // + other remaining elements + various supports
1674
1675 // Each FEA card weight + all supports
1676 // (including all bolts and not including the cable connectors)
1677 // 353.1 g.
1678 // Per each strip there are 4 FEA cards, then
1679 // the total weight of the front-end electonics section is: 353.1 g x 4 = 1412.4 g.
1680
1681 // Services Volumes
1682
1683 // Empty crate weight: 50 Kg, electronics cards + cables ~ 52 Kg.
1684 // Per each side (A and C) the total weight is: 2x102 ~ 204 Kg.
1685 // ... + weight of the connection pannel for the steel cooling system (Cr 18%, Ni 12%, Fe 70%)
1686 // + other remaining elements + various supports
1687
1688 // Each FEA card weight + all supports
1689 // (including all bolts and not including the cable connectors)
1690 // 353.1 g.
1691 // Per each strip there are 4 FEA cards, then
1692 // the total weight of the front-end electonics section is: 353.1 g x 4 = 1412.4 g.
1693 //
1694
1695 Int_t idrotm[Geo::NSECTORS];
1696 for (Int_t ii = 0; ii < Geo::NSECTORS; ii++) {
1697 idrotm[ii] = 0;
1698 }
1699
1700 // volume definition
1701 Float_t serpar[3] = {29. * 0.5, 121. * 0.5, 90. * 0.5};
1702 TVirtualMC::GetMC()->Gsvolu("FTOS", "BOX ", getMediumID(kCrates), serpar, 3); // Al + Cu + steel
1703
1704 Float_t xcoor, ycoor, zcoor;
1705 zcoor = (118. - 90.) * 0.5;
1706 Float_t phi = -10., ra = Geo::RMIN + ytof * 0.5;
1707 for (Int_t i = 0; i < Geo::NSECTORS; i++) {
1708 phi += Geo::PHISEC;
1709 xcoor = ra * TMath::Cos(phi * TMath::DegToRad());
1710 ycoor = ra * TMath::Sin(phi * TMath::DegToRad());
1711 Matrix(idrotm[i], 90., phi, 90., phi + 270., 0., 0.);
1712 TVirtualMC::GetMC()->Gspos("FTOS", i, "BFMO", xcoor, ycoor, zcoor, idrotm[i], "ONLY");
1713 }
1714
1715 zcoor = (90. - 223.) * 0.5;
1716 TVirtualMC::GetMC()->Gspos("FTOS", 1, "BBCE", ra, -3., zcoor, 0, "ONLY");
1717}
1718
1719void Detector::makeModulesInBTOFvolumes(Float_t ytof, Float_t zlenA) const
1720{
1721 //
1722 // Fill BTOF_%i (for i=0,...17) volumes
1723 // with volumes FTOA (MRPC strip container),
1724 // In case of TOF holes, three sectors (i.e. 13th, 14th and 15th)
1725 // are filled with volumes: FTOB and FTOC (MRPC containers),
1726 //
1727
1728 constexpr Int_t SIZESTR = 16;
1729
1730 Int_t idrotm[1] = {0};
1731
1732 // Matrix(idrotm[0], 90., 0., 0., 0., 90.,-90.);
1733 Matrix(idrotm[0], 90., 0., 0., 0., 90., 270.);
1734
1735 Float_t xcoor, ycoor, zcoor;
1736 xcoor = 0.;
1737
1738 // Positioning of fibre glass modules (FTOA, FTOB and FTOC)
1739 for (Int_t isec = 0; isec < Geo::NSECTORS; isec++) {
1740 if (mTOFSectors[isec] == -1) {
1741 continue;
1742 }
1743
1744 char name[SIZESTR];
1745 snprintf(name, SIZESTR, "BTOF%d", isec);
1746 if (mTOFHoles && (isec == 13 || isec == 14 || isec == 15)) {
1747 // xcoor = 0.;
1748 ycoor = (zlenA * 0.5 + Geo::INTERCENTRMODBORDER1) * 0.5;
1749 zcoor = -ytof * 0.25;
1750 TVirtualMC::GetMC()->Gspos("FTOB", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1751 TVirtualMC::GetMC()->Gspos("FTOC", 0, name, xcoor, -ycoor, zcoor, idrotm[0], "ONLY");
1752 } else {
1753 // xcoor = 0.;
1754 ycoor = 0.;
1755 zcoor = -ytof * 0.25;
1756 TVirtualMC::GetMC()->Gspos("FTOA", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1757 }
1758 }
1759
1760 // float par[3] = {100,500,10};
1761 // TVirtualMC::GetMC()->Gsvolu("FTEM", "BOX ", getMediumID(kAlFrame), par, 3); // Fibre glass
1762 // ycoor = 0.;
1763 // zcoor = 350;
1764 // TVirtualMC::GetMC()->Gspos("FTEM", 0, "cave", xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1765
1766 // TVirtualMC::GetMC()->Gspos("FTOA", 0, "cave", xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1767}
1768
1769void Detector::makeCoversInBTOFvolumes() const
1770{
1771 //
1772 // Fill BTOF_%i (for i=0,...17) volumes
1773 // with volumes FPEA (to separate strips from FEA cards)
1774 // In case of TOF holes, three sectors (i.e. 13th, 14th and 15th)
1775 // are filled with FPEB volumes
1776 // (to separate MRPC strips from FEA cards)
1777 //
1778
1779 constexpr Int_t SIZESTR = 16;
1780
1781 Int_t idrotm[1] = {0};
1782
1783 // Matrix(idrotm[0], 90., 0., 0., 0., 90.,-90.);
1784 Matrix(idrotm[0], 90., 0., 0., 0., 90., 270.);
1785
1786 Float_t xcoor, ycoor, zcoor;
1787 xcoor = 0.;
1788 ycoor = 0.;
1789 zcoor = Geo::MODULECOVERTHICKNESS * 0.5;
1790
1791 char name[SIZESTR];
1792
1793 // Positioning of module covers (FPEA, FPEB)
1794 for (Int_t isec = 0; isec < Geo::NSECTORS; isec++) {
1795 if (mTOFSectors[isec] == -1) {
1796 continue;
1797 }
1798 snprintf(name, SIZESTR, "BTOF%d", isec);
1799 if (mTOFHoles && (isec == 13 || isec == 14 || isec == 15)) {
1800 TVirtualMC::GetMC()->Gspos("FPEB", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1801 } else {
1802 TVirtualMC::GetMC()->Gspos("FPEA", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1803 }
1804 }
1805}
1806
1807//_____________________________________________________________________________
1808void Detector::makeBackInBTOFvolumes(Float_t ytof) const
1809{
1810 //
1811 // Fill BTOF_%i (for i=0,...17) volumes with volumes called FAIA and
1812 // FAIC (FEA cards and services container).
1813 // In case of TOF holes, three sectors (i.e. 13th, 14th and 15th) are
1814 // filled with volumes FAIB (FEA cards and services container).
1815 //
1816
1817 constexpr Int_t SIZESTR = 16;
1818
1819 Int_t idrotm[1] = {0};
1820
1821 // Matrix(idrotm[0], 90., 0., 0., 0., 90.,-90.);
1822 Matrix(idrotm[0], 90., 0., 0., 0., 90., 270.);
1823
1824 Float_t xcoor, ycoor, zcoor;
1825 xcoor = 0.;
1826 ycoor = 0.;
1827 zcoor = Geo::MODULECOVERTHICKNESS + (ytof * 0.5 - Geo::MODULECOVERTHICKNESS) * 0.5;
1828
1829 char name[SIZESTR];
1830
1831 // Positioning of FEA cards and services containers (FAIA, FAIC and FAIB)
1832 for (Int_t isec = 0; isec < Geo::NSECTORS; isec++) {
1833 if (mTOFSectors[isec] == -1) {
1834 continue;
1835 }
1836 snprintf(name, SIZESTR, "BTOF%d", isec);
1837 if (Geo::FEAWITHMASKS[isec]) {
1838 TVirtualMC::GetMC()->Gspos("FAIA", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1839 } else {
1840 if (mTOFHoles && (isec == 13 || isec == 14 || isec == 15)) {
1841 TVirtualMC::GetMC()->Gspos("FAIB", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1842 } else {
1843 TVirtualMC::GetMC()->Gspos("FAIC", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
1844 }
1845 }
1846 }
1847}
1848
1850{
1851 //
1852 // Create entries for alignable volumes associating the symbolic volume
1853 // name with the corresponding volume path. Needs to be syncronized with
1854 // eventual changes in the geometry.
1855 //
1856
1858 Int_t modUID, modnum = 0;
1859
1860 TString volPath;
1861 TString symName;
1862
1863 TString vpL0 = "cave/barrel_1/B077_1/BSEGMO";
1864 TString vpL1 = "_1/BTOF";
1865 TString vpL2 = "_1";
1866 TString vpL3 = "/FTOA_0";
1867 TString vpL4 = "/FLTA_0/FSTR_";
1868
1869 TString snSM = "TOF/sm";
1870 TString snSTRIP = "/strip";
1871
1872 //
1873 // The TOF MRPC Strips
1874 // The symbolic names are: TOF/sm00/strip01
1875 // ...
1876 // TOF/sm17/strip91
1877
1878 Int_t imod = 0;
1879
1880 for (Int_t isect = 0; isect < Geo::NSECTORS; isect++) {
1881 for (Int_t istr = 1; istr <= Geo::NSTRIPXSECTOR; istr++) {
1882 modUID = o2::base::GeometryManager::getSensID(idTOF, modnum++);
1883 LOG(debug) << "modUID: " << modUID;
1884
1885 if (mTOFSectors[isect] == -1) {
1886 continue;
1887 }
1888
1889 if (mTOFHoles && (isect == 13 || isect == 14 || isect == 15)) {
1890 if (istr < 39) {
1891 vpL3 = "/FTOB_0";
1892 vpL4 = "/FLTB_0/FSTR_";
1893 } else if (istr > 53) {
1894 vpL3 = "/FTOC_0";
1895 vpL4 = "/FLTC_0/FSTR_";
1896 } else {
1897 continue;
1898 }
1899 } else {
1900 vpL3 = "/FTOA_0";
1901 vpL4 = "/FLTA_0/FSTR_";
1902 }
1903
1904 volPath = vpL0;
1905 volPath += isect;
1906 volPath += vpL1;
1907 volPath += isect;
1908 volPath += vpL2;
1909 volPath += vpL3;
1910 volPath += vpL4;
1911 volPath += istr;
1912
1913 symName = snSM;
1914 symName += Form("%02d", isect);
1915 symName += snSTRIP;
1916 symName += Form("%02d", istr);
1917
1918 LOG(debug) << "--------------------------------------------"
1919 << "\n";
1920 LOG(debug) << "Alignable object" << imod << "\n";
1921 LOG(debug) << "volPath=" << volPath << "\n";
1922 LOG(debug) << "symName=" << symName << "\n";
1923 LOG(debug) << "--------------------------------------------"
1924 << "\n";
1925
1926 LOG(debug) << "Check for alignable entry: " << symName;
1927
1928 if (!gGeoManager->SetAlignableEntry(symName.Data(), volPath.Data(), modUID)) {
1929 LOG(error) << "Alignable entry " << symName << " NOT set";
1930 }
1931 LOG(debug) << "Alignable entry " << symName << " set";
1932
1933 // T2L matrices for alignment
1934 TGeoPNEntry* e = gGeoManager->GetAlignableEntryByUID(modUID);
1935 LOG(debug) << "Got TGeoPNEntry " << e;
1936
1937 if (e) {
1938 TGeoHMatrix* globMatrix = e->GetGlobalOrig();
1939 Double_t phi = Geo::PHISEC * (isect % Geo::NSECTORS) + Geo::PHISEC * 0.5;
1940 TGeoHMatrix* t2l = new TGeoHMatrix();
1941 t2l->RotateZ(phi);
1942 const TGeoHMatrix& globMatrixi = globMatrix->Inverse();
1943 t2l->MultiplyLeft(&globMatrixi);
1944 e->SetMatrix(t2l);
1945 } else {
1946 // AliError(Form("Alignable entry %s is not valid!",symName.Data()));
1947 }
1948 imod++;
1949 }
1950 }
1951
1952 //
1953 // The TOF supermodules
1954 // The symbolic names are: TOF/sm00
1955 // ...
1956 // TOF/sm17
1957 //
1958 for (Int_t isect = 0; isect < Geo::NSECTORS; isect++) {
1959 volPath = vpL0;
1960 volPath += isect;
1961 volPath += vpL1;
1962 volPath += isect;
1963 volPath += vpL2;
1964
1965 symName = snSM;
1966 symName += Form("%02d", isect);
1967
1968 // AliDebug(2,"--------------------------------------------");
1969 // AliDebug(2,Form("Alignable object %d", isect+imod));
1970 // AliDebug(2,Form("volPath=%s\n",volPath.Data()));
1971 // AliDebug(2,Form("symName=%s\n",symName.Data()));
1972 // AliDebug(2,"--------------------------------------------");
1973
1974 gGeoManager->SetAlignableEntry(symName.Data(), volPath.Data());
1975 }
1976}
Definition of the GeometryManager class.
Definition of the Stack class.
int16_t time
Definition RawEventData.h:4
int32_t i
uint16_t pos
Definition RawData.h:3
uint32_t stack
Definition RawData.h:1
ClassImp(Detector)
std::ostringstream debug
V GetEnergyLoss() const
Definition BaseHits.h:103
void Matrix(Int_t &nmat, Float_t theta1, Float_t phi1, Float_t theta2, Float_t phi2, Float_t theta3, Float_t phi3) const
Definition Detector.cxx:104
void Mixture(Int_t imat, const char *name, Float_t *a, Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat)
Definition Detector.cxx:66
void Medium(Int_t numed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax, Float_t epsil, Float_t stmin, Float_t *ubuf=nullptr, Int_t nbuf=0)
Definition Detector.cxx:72
int getMediumID(int imed) const
Definition Detector.h:135
static void initFieldTrackingParams(int &mode, float &maxfield)
Definition Detector.cxx:143
void Material(Int_t imat, const char *name, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl, Float_t *buf=nullptr, Int_t nwbuf=0)
Definition Detector.cxx:59
std::string addNameTo(const char *ext) const
Definition Detector.h:150
static int getSensID(o2::detectors::DetID detid, int sensid)
Int_t GetCurrentTrackNumber() const override
Definition Stack.h:133
static constexpr ID TOF
Definition DetID.h:66
~Detector() override
Definition Detector.cxx:49
virtual void MaterialMixer(Float_t *p, const Float_t *const a, const Float_t *const m, Int_t n) const final
Definition Detector.cxx:284
void ConstructGeometry() final
Definition Detector.cxx:299
void Register() override
Definition Detector.cxx:108
void InitializeO2Detector() final
Definition Detector.cxx:54
void addAlignableVolumes() const override
declare alignable volumes of detector
Bool_t ProcessHits(FairVolume *v=nullptr) final
Definition Detector.cxx:64
void EndOfEvent() final
Definition Detector.cxx:315
Detector()=default
virtual void DefineGeometry(Float_t xtof, Float_t ytof, Float_t zlenA) final
Definition Detector.cxx:316
void Reset() final
Definition Detector.cxx:113
static constexpr Float_t RMAX
Definition Geo.h:134
static constexpr Float_t ZPAD
Definition Geo.h:141
static constexpr Float_t HFILIY
Definition Geo.h:328
static constexpr Float_t MODULECOVERTHICKNESS
Definition Geo.h:294
static constexpr Float_t ROOF2PARAMETERS[3]
Definition Geo.h:316
static constexpr Float_t XPAD
Definition Geo.h:139
static constexpr Float_t LENGTHEXINMODBORDER
Definition Geo.h:289
static constexpr Int_t NSECTORS
Definition Geo.h:120
static constexpr Float_t HCPCBY
Definition Geo.h:330
static constexpr Float_t BARS[3]
Definition Geo.h:321
static constexpr Float_t HGLASSY
Definition Geo.h:329
static Float_t getAngles(Int_t iplate, Int_t istrip)
Definition Geo.h:79
static constexpr Int_t NPADZ
Definition Geo.h:109
static constexpr Float_t HHONY
Definition Geo.h:325
static constexpr Float_t WGLFZ
Definition Geo.h:336
static constexpr Float_t HPCBY
Definition Geo.h:326
static constexpr Float_t CBLH2
Definition Geo.h:307
static constexpr Float_t WRGLZ
Definition Geo.h:335
static constexpr Float_t HRGLY
Definition Geo.h:327
static constexpr Int_t NSTRIPXSECTOR
Definition Geo.h:116
static constexpr Float_t ROOF1PARAMETERS[3]
Definition Geo.h:315
static constexpr Float_t HSENSMY
Definition Geo.h:337
static constexpr Float_t INTERCENTRMODBORDER1
Definition Geo.h:253
static constexpr Float_t BAR2[3]
Definition Geo.h:320
static Float_t getHeights(Int_t iplate, Int_t istrip)
Definition Geo.h:80
static constexpr Int_t NSTRIPB
Definition Geo.h:113
static constexpr Int_t NSTRIPC
Definition Geo.h:114
static constexpr Float_t AL1PARAMETERS[3]
Definition Geo.h:312
static constexpr Float_t FEAPARAMETERS[3]
Definition Geo.h:317
static constexpr Int_t NSTRIPA
Definition Geo.h:112
static constexpr Float_t CBLH1
Definition Geo.h:305
static constexpr Float_t ZLENA
Definition Geo.h:128
static constexpr Float_t BAR1[3]
Definition Geo.h:319
static constexpr Float_t BETWEENLANDMASK
Definition Geo.h:309
static constexpr Float_t AL2PARAMETERS[3]
Definition Geo.h:313
static constexpr Float_t WPCBZ1
Definition Geo.h:332
static constexpr Float_t LENGTHINCEMODBORDERD
Definition Geo.h:285
static constexpr Float_t INTERCENTRMODBORDER2
Definition Geo.h:260
static constexpr Float_t MODULEWALLTHICKNESS
Definition Geo.h:252
static constexpr Float_t FEAWIDTH1
Definition Geo.h:296
static constexpr Float_t RMIN
Definition Geo.h:133
static constexpr Float_t BARS2[3]
Definition Geo.h:323
static constexpr Float_t SAWTHICKNESS
Definition Geo.h:302
static Int_t getIndex(const Int_t *detId)
Definition Geo.cxx:563
static constexpr Int_t NPLATES
Definition Geo.h:122
static constexpr Float_t WPCBZ2
Definition Geo.h:333
static Float_t getDistances(Int_t iplate, Int_t istrip)
Definition Geo.h:81
static constexpr Float_t BARS1[3]
Definition Geo.h:322
static void getPadDxDyDz(const Float_t *pos, Int_t *det, Float_t *DeltaPos, int sector=-1)
Definition Geo.cxx:835
static constexpr Float_t WHONZ
Definition Geo.h:331
static constexpr Float_t EXTERINTERMODBORDER1
Definition Geo.h:267
static constexpr Int_t NPADX
Definition Geo.h:107
static constexpr Float_t FEAWIDTH2
Definition Geo.h:299
static constexpr Float_t STRIPLENGTH
Definition Geo.h:142
static constexpr Float_t BAR[3]
Definition Geo.h:318
static constexpr Float_t LENGTHINCEMODBORDERU
Definition Geo.h:281
static constexpr Float_t EXTERINTERMODBORDER2
Definition Geo.h:274
static constexpr Float_t WCPCBZ
Definition Geo.h:334
static constexpr Float_t PHISEC
Definition Geo.h:147
static constexpr Float_t CBLW
Definition Geo.h:304
static constexpr Float_t AL3PARAMETERS[3]
Definition Geo.h:314
static constexpr Bool_t FEAWITHMASKS[NSECTORS]
Definition Geo.h:246
static ShmManager & Instance()
Definition ShmManager.h:61
GLdouble n
Definition glcorearb.h:1982
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
const GLfloat * m
Definition glcorearb.h:4066
const GLdouble * v
Definition glcorearb.h:832
GLuint const GLchar * name
Definition glcorearb.h:781
GLboolean * data
Definition glcorearb.h:298
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
void freeSimVector(std::vector< T > *ptr)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Common utility functions.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< int > row