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
13#include "HMPIDBase/Param.h"
14#include "TGeoManager.h"
15#include "TGeoShapeAssembly.h"
16#include "TGeoNode.h"
17#include "TGeoBBox.h"
18#include "TGeoXtru.h"
19#include "TGeoCompositeShape.h"
20#include "TVirtualMC.h"
21#include "TF1.h"
22#include "TF2.h"
23#include "TMath.h"
24#include <TPDGCode.h> //StepHistory()
25#include <TGeoGlobalMagField.h>
26#include <TGeoPhysicalNode.h> //AddAlignableVolumes()
27#include <TGeoXtru.h> //CradleBaseVolume()
28#include <TLorentzVector.h> //IsLostByFresnel()
29#include <TString.h> //StepManager()
30#include <TTree.h>
31#include "DetectorsBase/Stack.h"
34
35#include "Framework/Logger.h"
36
37namespace o2
38{
39namespace hmpid
40{
41
42Detector::Detector(Bool_t active) : o2::base::DetImpl<Detector>("HMP", active), mHits(new std::vector<o2::hmpid::HitType>) {}
43
44Detector::Detector(const Detector& other) : mSensitiveVolumes(other.mSensitiveVolumes),
45 mHits(new std::vector<o2::hmpid::HitType>) {}
46
48{
49 TVirtualMC* fMC = TVirtualMC::GetMC();
50 for (auto sensitiveHpad : mSensitiveVolumes) {
51 LOG(debug) << "HMPID: registering sensitive " << sensitiveHpad->GetName();
52 AddSensitiveVolume(sensitiveHpad);
53 mHpad0VolID = fMC->VolId("Hpad0");
54 mHpad1VolID = fMC->VolId("Hpad1");
55 mHpad2VolID = fMC->VolId("Hpad2");
56 mHpad3VolID = fMC->VolId("Hpad3");
57 mHpad4VolID = fMC->VolId("Hpad4");
58 mHpad5VolID = fMC->VolId("Hpad5");
59 mHpad6VolID = fMC->VolId("Hpad6");
60 mHcel0VolID = fMC->VolId("Hcel0");
61 mHcel1VolID = fMC->VolId("Hcel1");
62 mHcel2VolID = fMC->VolId("Hcel2");
63 mHcel3VolID = fMC->VolId("Hcel3");
64 mHcel4VolID = fMC->VolId("Hcel4");
65 mHcel5VolID = fMC->VolId("Hcel5");
66 mHcel6VolID = fMC->VolId("Hcel6");
67 }
68}
69//*********************************************************************************************************
70bool Detector::ProcessHits(FairVolume* v)
71{
72 Int_t copy;
73 Int_t volID = fMC->CurrentVolID(copy);
74 auto stack = (o2::data::Stack*)fMC->GetStack();
75
76 // Treat photons
77 // photon (Ckov or feedback) hits on module PC (Hpad)
78 if ((fMC->TrackPid() == 50000050 || fMC->TrackPid() == 50000051) && (volID == mHpad0VolID || volID == mHpad1VolID || volID == mHpad2VolID || volID == mHpad3VolID || volID == mHpad4VolID || volID == mHpad5VolID || volID == mHpad6VolID)) {
79 if (fMC->Edep() > 0) { // photon survided QE test i.e. produces electron
80 if (IsLostByFresnel()) {
81 fMC->StopTrack();
82 return false;
83 } // photon lost due to fersnel reflection on PC
84 Int_t tid = fMC->GetStack()->GetCurrentTrackNumber(); // take TID
85 Int_t pid = fMC->TrackPid(); // take PID
86 Float_t etot = fMC->Etot(); // total hpoton energy, [GeV]
87 Double_t x[3];
88 fMC->TrackPosition(x[0], x[1], x[2]); // take MARS position at entrance to PC
89 Float_t hitTime = (Float_t)fMC->TrackTime(); // hit formation time
90 Int_t idch; // chamber number
91 if (volID == mHpad0VolID) {
92 idch = 0;
93 } else if (volID == mHpad1VolID) {
94 idch = 1;
95 } else if (volID == mHpad2VolID) {
96 idch = 2;
97 } else if (volID == mHpad3VolID) {
98 idch = 3;
99 } else if (volID == mHpad4VolID) {
100 idch = 4;
101 } else if (volID == mHpad5VolID) {
102 idch = 5;
103 } else if (volID == mHpad6VolID) {
104 idch = 6;
105 }
106 Double_t xl, yl;
107 o2::hmpid::Param::instance()->mars2Lors(idch, x, xl, yl); // take LORS position
108 AddHit(x[0], x[1], x[2], hitTime, etot, tid, idch); // HIT for photon, position at P, etot will be set to Q
109 GenFee(etot); // generate feedback photons etot is modified in hit ctor to Q of hit
110 stack->addHit(GetDetId());
111 } // photon hit PC and DE >0
112 return kTRUE;
113 } // photon hit PC
114
115 // Treat charged particles
116 static Float_t eloss; // need to store mip parameters between different steps
117 static Double_t in[3];
118
119 if (fMC->IsTrackEntering() && fMC->TrackCharge() && (volID == mHpad0VolID || volID == mHpad1VolID || volID == mHpad2VolID || volID == mHpad3VolID || volID == mHpad4VolID || volID == mHpad5VolID || volID == mHpad6VolID)) {
120 // Trackref stored when entering in the pad volume
121 o2::TrackReference tr(*fMC, GetDetId());
122 tr.setTrackID(stack->GetCurrentTrackNumber());
123 // tr.setUserId(lay);
124 stack->addTrackReference(tr);
125 }
126
127 if (fMC->TrackCharge() && (volID == mHcel0VolID || volID == mHcel1VolID || volID == mHcel2VolID || volID == mHcel3VolID || volID == mHcel4VolID || volID == mHcel5VolID || volID == mHcel6VolID)) {
128 // charged particle in amplification gap (Hcel)
129 if (fMC->IsTrackEntering() || fMC->IsNewTrack()) { // entering or newly created
130 eloss = 0; // reset Eloss collector
131 fMC->TrackPosition(in[0], in[1], in[2]); // take position at the entrance
132 } else if (fMC->IsTrackExiting() || fMC->IsTrackStop() || fMC->IsTrackDisappeared()) { // exiting or disappeared
133 eloss += fMC->Edep(); // take into account last step Eloss
134 Int_t tid = fMC->GetStack()->GetCurrentTrackNumber(); // take TID
135 Int_t pid = fMC->TrackPid(); // take PID
136 Double_t out[3];
137 fMC->TrackPosition(out[0], out[1], out[2]); // take MARS position at exit
138 Float_t hitTime = (Float_t)fMC->TrackTime(); // hit formation time
139 out[0] = 0.5 * (out[0] + in[0]); //
140 out[1] = 0.5 * (out[1] + in[1]); // take hit position at the anod plane
141 out[2] = 0.5 * (out[2] + in[2]);
142 Int_t idch; // chamber number
143 if (volID == mHcel0VolID) {
144 idch = 0;
145 } else if (volID == mHcel1VolID) {
146 idch = 1;
147 } else if (volID == mHcel2VolID) {
148 idch = 2;
149 } else if (volID == mHcel3VolID) {
150 idch = 3;
151 } else if (volID == mHcel4VolID) {
152 idch = 4;
153 } else if (volID == mHcel5VolID) {
154 idch = 5;
155 } else if (volID == mHcel6VolID) {
156 idch = 6;
157 }
158 Double_t xl, yl;
159 o2::hmpid::Param::instance()->mars2Lors(idch, out, xl, yl); // take LORS position
160 if (eloss > 0) {
161 // HIT for MIP, position near anod plane, eloss will be set to Q
162 AddHit(out[0], out[1], out[2], hitTime, eloss, tid, idch);
163 GenFee(eloss); // generate feedback photons
164 stack->addHit(GetDetId());
165 eloss = 0;
166 }
167 } else {
168 // just going inside
169 eloss += fMC->Edep(); // collect this step eloss
170 }
171 return kTRUE;
172 } // MIP in GAP
173
174 // later on return true if there was a hit!
175 return false;
176}
177//*********************************************************************************************************
178o2::hmpid::HitType* Detector::AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId)
179{
180 mHits->emplace_back(x, y, z, time, energy, trackId, detId);
181 return &(mHits->back());
182}
183//*********************************************************************************************************
185{
186 // Generate FeedBack photons for the current particle. To be invoked from StepManager().
187 // eloss=0 means photon so only pulse height distribution is to be analysed.
188 TLorentzVector x4;
189 fMC->TrackPosition(x4);
190 Int_t iNphotons = fMC->GetRandom()->Poisson(0.02 * qtot); // # of feedback photons is proportional to the charge of hit
191 // AliDebug(1,Form("N photons=%i",iNphotons));
192 Int_t j;
193 Float_t cthf, phif, enfp = 0, sthf, e1[3], e2[3], e3[3], vmod, uswop, dir[3], phi, pol[3], mom[4];
194 // Generate photons
195 for (Int_t i = 0; i < iNphotons; i++) { // feedbacks loop
196 Double_t ranf[2];
197 fMC->GetRandom()->RndmArray(2, ranf); // Sample direction
198 cthf = ranf[0] * 2 - 1.0;
199 if (cthf < 0) {
200 continue;
201 }
202 sthf = TMath::Sqrt((1. - cthf) * (1. + cthf));
203 phif = ranf[1] * 2 * TMath::Pi();
204
205 if (Double_t randomNumber = fMC->GetRandom()->Rndm() <= 0.57) {
206 enfp = 7.5e-9;
207 } else if (randomNumber <= 0.7) {
208 enfp = 6.4e-9;
209 } else {
210 enfp = 7.9e-9;
211 }
212
213 dir[0] = sthf * TMath::Sin(phif);
214 dir[1] = cthf;
215 dir[2] = sthf * TMath::Cos(phif);
216 fMC->Gdtom(dir, mom, 2);
217 mom[0] *= enfp;
218 mom[1] *= enfp;
219 mom[2] *= enfp;
220 mom[3] = TMath::Sqrt(mom[0] * mom[0] + mom[1] * mom[1] + mom[2] * mom[2]);
221
222 // Polarisation
223 e1[0] = 0;
224 e1[1] = -dir[2];
225 e1[2] = dir[1];
226 e2[0] = -dir[1];
227 e2[1] = dir[0];
228 e2[2] = 0;
229 e3[0] = dir[1];
230 e3[1] = 0;
231 e3[2] = -dir[0];
232
233 vmod = 0;
234 for (j = 0; j < 3; j++) {
235 vmod += e1[j] * e1[j];
236 }
237 if (!vmod) {
238 for (j = 0; j < 3; j++) {
239 uswop = e1[j];
240 e1[j] = e3[j];
241 e3[j] = uswop;
242 }
243 }
244 vmod = 0;
245 for (j = 0; j < 3; j++) {
246 vmod += e2[j] * e2[j];
247 }
248 if (!vmod) {
249 for (j = 0; j < 3; j++) {
250 uswop = e2[j];
251 e2[j] = e3[j];
252 e3[j] = uswop;
253 }
254 }
255
256 vmod = 0;
257 for (j = 0; j < 3; j++) {
258 vmod += e1[j] * e1[j];
259 }
260 vmod = TMath::Sqrt(1 / vmod);
261 for (j = 0; j < 3; j++) {
262 e1[j] *= vmod;
263 }
264 vmod = 0;
265 for (j = 0; j < 3; j++) {
266 vmod += e2[j] * e2[j];
267 }
268 vmod = TMath::Sqrt(1 / vmod);
269 for (j = 0; j < 3; j++) {
270 e2[j] *= vmod;
271 }
272
273 phi = fMC->GetRandom()->Rndm() * 2 * TMath::Pi();
274 for (j = 0; j < 3; j++) {
275 pol[j] = e1[j] * TMath::Sin(phi) + e2[j] * TMath::Cos(phi);
276 }
277 fMC->Gdtom(pol, pol, 2);
278 Int_t outputNtracksStored;
279 } // feedbacks loop
280} // GenerateFeedbacks()
281//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
283{
284 // Calculate probability for the photon to be lost by Fresnel reflection.
285 TLorentzVector p4;
286 Double_t mom[3], localMom[3];
287 fMC->TrackMomentum(p4);
288 mom[0] = p4(1);
289 mom[1] = p4(2);
290 mom[2] = p4(3);
291 localMom[0] = 0;
292 localMom[1] = 0;
293 localMom[2] = 0;
294 fMC->Gmtod(mom, localMom, 2);
295 Double_t localTc = localMom[0] * localMom[0] + localMom[2] * localMom[2];
296 Double_t localTheta = TMath::ATan2(TMath::Sqrt(localTc), localMom[1]);
297 Double_t cotheta = TMath::Abs(TMath::Cos(localTheta));
298 if (fMC->GetRandom()->Rndm() < Fresnel(p4.E() * 1e9, cotheta, 1)) {
299 // AliDebug(1,"Photon lost");
300 return kTRUE;
301 } else {
302 return kFALSE;
303 }
304} // IsLostByFresnel()
305//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
306Float_t Detector::Fresnel(Float_t ene, Float_t pdoti, Bool_t pola)
307{
308 // Correction for Fresnel ???????????
309 // Arguments: ene - photon energy [GeV],
310 // PDOTI=COS(INC.ANG.), PDOTR=COS(POL.PLANE ROT.ANG.)
311 // Returns:
312 Float_t en[36] = {5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6.0, 6.1, 6.2,
313 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7,
314 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5};
315 Float_t csin[36] = {2.14, 2.21, 2.33, 2.48, 2.76, 2.97, 2.99, 2.59, 2.81, 3.05,
316 2.86, 2.53, 2.55, 2.66, 2.79, 2.96, 3.18, 3.05, 2.84, 2.81, 2.38, 2.11,
317 2.01, 2.13, 2.39, 2.73, 3.08, 3.15, 2.95, 2.73, 2.56, 2.41, 2.12, 1.95,
318 1.72, 1.53};
319 Float_t csik[36] = {0., 0., 0., 0., 0., 0.196, 0.408, 0.208, 0.118, 0.49, 0.784, 0.543,
320 0.424, 0.404, 0.371, 0.514, 0.922, 1.102, 1.139, 1.376, 1.461, 1.253, 0.878,
321 0.69, 0.612, 0.649, 0.824, 1.347, 1.571, 1.678, 1.763, 1.857, 1.824, 1.824,
322 1.714, 1.498};
323 Float_t xe = ene;
324 Int_t j = Int_t(xe * 10) - 49;
325 Float_t cn = csin[j] + ((csin[j + 1] - csin[j]) / 0.1) * (xe - en[j]);
326 Float_t ck = csik[j] + ((csik[j + 1] - csik[j]) / 0.1) * (xe - en[j]);
327
328 // FORMULAE FROM HANDBOOK OF OPTICS, 33.23 OR
329 // W.R. HUNTER, J.O.S.A. 54 (1964),15 , J.O.S.A. 55(1965),1197
330
331 Float_t sinin = TMath::Sqrt((1. - pdoti) * (1. + pdoti));
332 Float_t tanin = sinin / pdoti;
333
334 Float_t c1 = cn * cn - ck * ck - sinin * sinin;
335 Float_t c2 = 4 * cn * cn * ck * ck;
336 Float_t aO = TMath::Sqrt(0.5 * (TMath::Sqrt(c1 * c1 + c2) + c1));
337 Float_t b2 = 0.5 * (TMath::Sqrt(c1 * c1 + c2) - c1);
338
339 Float_t rs = ((aO - pdoti) * (aO - pdoti) + b2) / ((aO + pdoti) * (aO + pdoti) + b2);
340 Float_t rp = rs * ((aO - sinin * tanin) * (aO - sinin * tanin) + b2) /
341 ((aO + sinin * tanin) * (aO + sinin * tanin) + b2);
342
343 // CORRECTION FACTOR FOR SURFACE ROUGHNESS
344 // B.J. STAGG APPLIED OPTICS, 30(1991),4113
345
346 Float_t sigraf = 18.;
347 Float_t lamb = 1240 / ene;
348 Float_t fresn;
349
350 Float_t rO = TMath::Exp(-(4 * TMath::Pi() * pdoti * sigraf / lamb) *
351 (4 * TMath::Pi() * pdoti * sigraf / lamb));
352
353 if (pola) {
354 Float_t pdotr = 0.8; // DEGREE OF POLARIZATION : 1->P , -1->S
355 fresn = 0.5 * (rp * (1 + pdotr) + rs * (1 - pdotr));
356 } else {
357 fresn = 0.5 * (rp + rs);
358 }
359
360 fresn = fresn * rO;
361 return fresn;
362} // Fresnel()
363//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
364void Detector::Register() { FairRootManager::Instance()->RegisterAny(addNameTo("Hit").data(), mHits, true); }
365
367{
368 if (!o2::utils::ShmManager::Instance().isOperational()) {
369 mHits->clear();
370 }
371}
372
373void Detector::IdealPosition(Int_t iCh, TGeoHMatrix* pMatrix) // ideal position of given chamber
374{
375 // Construct ideal position matrix for a given chamber
376 // Arguments: iCh- chamber ID; pMatrix- pointer to precreated unity matrix where to store the results
377 // Returns: none
378 const double kAngHor = 19.5; // horizontal angle between chambers 19.5 grad
379 const double kAngVer = 20; // vertical angle between chambers 20 grad
380 const double kAngCom = 30; // common HMPID rotation with respect to x axis 30 grad
381 const double kTrans[3] = {490, 0, 0}; // center of the chamber is on window-gap surface
382 pMatrix->RotateY(90); // rotate around y since initial position is in XY plane -> now in YZ plane
383 pMatrix->SetTranslation(kTrans); // now plane in YZ is shifted along x
384 switch (iCh) {
385 case 0:
386 pMatrix->RotateY(kAngHor);
387 pMatrix->RotateZ(-kAngVer);
388 break; // right and down
389 case 1:
390 pMatrix->RotateZ(-kAngVer);
391 break; // down
392 case 2:
393 pMatrix->RotateY(kAngHor);
394 break; // right
395 case 3:
396 break; // no rotation
397 case 4:
398 pMatrix->RotateY(-kAngHor);
399 break; // left
400 case 5:
401 pMatrix->RotateZ(kAngVer);
402 break; // up
403 case 6:
404 pMatrix->RotateY(-kAngHor);
405 pMatrix->RotateZ(kAngVer);
406 break; // left and up
407 }
408 pMatrix->RotateZ(kAngCom); // apply common rotation in XY plane
409 Double_t* t = pMatrix->GetTranslation();
410 t[1] += 30.;
411 pMatrix->SetTranslation(t);
412}
413
414void Detector::IdealPositionCradle(Int_t iCh, TGeoHMatrix* pMatrix) // ideal position of given one module of the cradle
415{
416 // Construct ideal position matrix for a given module cradle
417 // Arguments: iCh- chamber ID; pMatrix- pointer to precreated unity matrix where to store the results
418 // Returns: none
419 const double kAngHor = 19.5; // horizontal angle between chambers 19.5 grad
420 const double kAngVer = 20; // vertical angle between chambers 20 grad
421 const double kAngCom = 30; // common HMPID rotation with respect to x axis 30 grad
422 const double kTrans[3] = {423. + 29, 0, 67}; // z-center of the cradle module
423 pMatrix->RotateY(90); // rotate around y since initial position is in XY plane -> now in YZ plane
424 pMatrix->SetTranslation(kTrans); // now plane in YZ is shifted along x
425 switch (iCh) {
426 case 0:
427 pMatrix->RotateY(kAngHor);
428 pMatrix->RotateZ(-kAngVer);
429 break; // right and down
430 case 1:
431 pMatrix->RotateZ(-kAngVer);
432 break; // down
433 case 2:
434 pMatrix->RotateY(kAngHor);
435 break; // right
436 case 3:
437 break; // no rotation
438 case 4:
439 pMatrix->RotateY(-kAngHor);
440 break; // left
441 case 5:
442 pMatrix->RotateZ(kAngVer);
443 break; // up
444 case 6:
445 pMatrix->RotateY(-kAngHor);
446 pMatrix->RotateZ(kAngVer);
447 break; // left and up
448 }
449 pMatrix->RotateZ(kAngCom); // apply common rotation in XY plane
450 Double_t* t = pMatrix->GetTranslation();
451 t[1] += 30.;
452 pMatrix->SetTranslation(t);
453}
454
455//*********************************************************************************************************
456
458{
459 // implement materials here
460 // Definition of available HMPID materials
461 // Arguments: none
462 // Returns: none
463
464 // clm update material definition later on from Antonello
465 // Ported to O2 (24.4.2018) -- taken from AliRoot AliHMPIDv3
466
467 // data from PDG booklet 2002 density [gr/cm^3] rad len [cm] abs len [cm]
468 float aAir[4] = {12, 14, 16, 36}, zAir[4] = {6, 7, 8, 18}, wAir[4] = {0.000124, 0.755267, 0.231781, 0.012827},
469 dAir = 0.00120479;
470 int nAir = 4; // mixture 0.9999999
471 float aC6F14[2] = {12.01, 18.99}, zC6F14[2] = {6, 9}, wC6F14[2] = {6, 14}, dC6F14 = 1.68;
472 int nC6F14 = -2;
473 float aSiO2[2] = {28.09, 15.99}, zSiO2[2] = {14, 8}, wSiO2[2] = {1, 2}, dSiO2 = 2.64;
474 int nSiO2 = -2;
475 float aCH4[2] = {12.01, 1.01}, zCH4[2] = {6, 1}, wCH4[2] = {1, 4}, dCH4 = 7.17e-4;
476 int nCH4 = -2;
477
478 float aRoha = 12.01, zRoha = 6, dRoha = 0.10, radRoha = 18.80,
479 absRoha = 86.3 / dRoha; // special material- quasi quartz
480 float aCu = 63.55, zCu = 29, dCu = 8.96, radCu = 1.43, absCu = 134.9 / dCu;
481 float aW = 183.84, zW = 74, dW = 19.30, radW = 0.35, absW = 185.0 / dW;
482 float aAl = 26.98, zAl = 13, dAl = 2.70, radAl = 8.90, absAl = 106.4 / dAl;
483 float aAr = 39.94, zAr = 18, dAr = 1.396e-3, radAr = 14.0, absAr = 117.2 / dAr;
484
485 int matId = 0; // tmp material id number
486 int unsens = 0, sens = 1; // sensitive or unsensitive medium
487 int itgfld;
488 float maxfld;
490
491 float tmaxfd = -10.0; // max deflection angle due to magnetic field in one step
492 float deemax = -0.2; // max fractional energy loss in one step
493 float stemax = -0.1; // max step allowed [cm]
494 float epsil = 0.001; // abs tracking precision [cm]
495 float stmin = -0.001; // min step size [cm] in continius process transport, negative value: choose it automatically
496
497 // PCB copmposed mainly by G10 (Si,C,H,O) -> CsI is negligible (<500nm thick)
498 // So what is called CsI has the optical properties of CsI, but the composition of G-10 (for delta elec, etc
499 // production...)
500
501 float aG10[4] = {28.09, 12.01, 1.01, 16.00};
502 float zG10[4] = {14., 6., 1., 8.};
503 float wG10[4] = {0.129060, 0.515016, 0.061873, 0.294050};
504 float dG10 = 1.7;
505 int nG10 = 4;
506
507 Mixture(++matId, "Air", aAir, zAir, dAir, nAir, wAir);
508 Medium(kAir, "Air", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
509
510 Mixture(++matId, "C6F14", aC6F14, zC6F14, dC6F14, nC6F14, wC6F14);
511 Medium(kC6F14, "C6F14", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
512
513 Mixture(++matId, "SiO2", aSiO2, zSiO2, dSiO2, nSiO2, wSiO2);
514 Medium(kSiO2, "SiO2", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
515
516 Mixture(++matId, "CH4", aCH4, zCH4, dCH4, nCH4, wCH4);
517 Medium(kCH4, "CH4", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
518
519 Mixture(++matId, "CsI+PCB", aG10, zG10, dG10, nG10, wG10);
520 Medium(kCsI, "CsI", matId, sens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin); // sensitive
521
522 Mixture(++matId, "Neo", aSiO2, zSiO2, dSiO2, nSiO2, wSiO2);
523 Medium(kNeo, "Neo", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin); // clm neoceram
524
525 Material(++matId, "Roha", aRoha, zRoha, dRoha, radRoha, absRoha);
526 Medium(kRoha, "Roha", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin); // Roha->honeycomb
527
528 Material(++matId, "Cu", aCu, zCu, dCu, radCu, absCu);
529 Medium(kCu, "Cu", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
530
531 Material(++matId, "W", aW, zW, dW, radW, absW);
532 Medium(kW, "W", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
533
534 Material(++matId, "Al", aAl, zAl, dAl, radAl, absAl);
535 Medium(kAl, "Al", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
536
537 Material(++matId, "Ar", aAr, zAr, dAr, radAr, absAr);
538 Medium(kAr, "Ar", matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
539}
540//**************************************************************************************************
541TGeoVolume* Detector::createAbsorber(float tickness)
542{
543 double cm = 1, mm = 0.1 * cm, um = 0.001 * mm; // default is cm
545 TGeoMedium* al = matmgr.getTGeoMedium("HMP_Al");
546 TGeoVolume* abs = gGeoManager->MakeBox("Habs", al, tickness * mm / 2, 1300.00 * mm / 2, 1300 * mm / 2);
547 return abs;
548}
549//**************************************************************************************************
550
551TGeoVolume* Detector::createChamber(int number)
552{
553 // Single module geometry building
554
555 double cm = 1, mm = 0.1 * cm, um = 0.001 * mm; // default is cm
556
557 TGeoVolume* hmp = new TGeoVolumeAssembly(Form("Hmp%i", number));
558
560
561 TGeoMedium* al = matmgr.getTGeoMedium("HMP_Al");
562 TGeoMedium* ch4 = matmgr.getTGeoMedium("HMP_CH4");
563 TGeoMedium* roha = matmgr.getTGeoMedium("HMP_Roha");
564 TGeoMedium* neoc = matmgr.getTGeoMedium("HMP_Neo");
565 TGeoMedium* c6f14 = matmgr.getTGeoMedium("HMP_C6F14");
566 TGeoMedium* sio2 = matmgr.getTGeoMedium("HMP_SiO2");
567 TGeoMedium* cu = matmgr.getTGeoMedium("HMP_Cu");
568 TGeoMedium* w = matmgr.getTGeoMedium("HMP_W");
569 TGeoMedium* csi = matmgr.getTGeoMedium("HMP_CsI");
570 TGeoMedium* ar = matmgr.getTGeoMedium("HMP_Ar");
571
572 TGeoRotation* rot = new TGeoRotation("HwireRot");
573 rot->RotateY(90); // rotate wires around Y to be along X (initially along Z)
574 TGeoVolume* sbo = gGeoManager->MakeBox("Hsbo", ch4, 1419 * mm / 2, 1378.00 * mm / 2, 50.5 * mm / 2); // 2072P1
575 TGeoVolume* cov = gGeoManager->MakeBox("Hcov", al, 1419 * mm / 2, 1378.00 * mm / 2, 0.5 * mm / 2);
576 TGeoVolume* hon = gGeoManager->MakeBox("Hhon", roha, 1359 * mm / 2, 1318.00 * mm / 2, 49.5 * mm / 2);
577 TGeoVolume* rad = gGeoManager->MakeBox("Hrad", c6f14, 1330 * mm / 2, 413.00 * mm / 2, 24.0 * mm / 2); // 2011P1
578 TGeoVolume* neo = gGeoManager->MakeBox("Hneo", neoc, 1330 * mm / 2, 413.00 * mm / 2, 4.0 * mm / 2);
579 TGeoVolume* win = gGeoManager->MakeBox("Hwin", sio2, 1330 * mm / 2, 413.00 * mm / 2, 5.0 * mm / 2);
580 TGeoVolume* si1 = gGeoManager->MakeBox("Hsi1", sio2, 1330 * mm / 2, 5.00 * mm / 2, 15.0 * mm / 2);
581 TGeoVolume* si2 = gGeoManager->MakeBox("Hsi2", neoc, 10 * mm / 2, 403.00 * mm / 2, 15.0 * mm / 2);
582 TGeoVolume* spa = gGeoManager->MakeTube("Hspa", sio2, 0 * mm, 5.00 * mm, 15.0 * mm / 2);
583 TGeoVolume* fr4 = gGeoManager->MakeBox("Hfr4", ch4, 1407 * mm / 2, 1366.00 * mm / 2, 15.0 * mm / 2); // 2043P1
584 TGeoVolume* f4a = gGeoManager->MakeBox("Hf4a", al, 1407 * mm / 2, 1366.00 * mm / 2, 10.0 * mm / 2);
585 TGeoVolume* f4i = gGeoManager->MakeBox("Hf4i", ch4, 1323 * mm / 2, 1296.00 * mm / 2, 10.0 * mm / 2);
586 TGeoVolume* col = gGeoManager->MakeTube("Hcol", cu, 0 * mm, 100.00 * um, 1323.0 * mm / 2);
587 TGeoVolume* sec = gGeoManager->MakeBox("Hsec", ch4, 648 * mm / 2, 411.00 * mm / 2,
588 6.2 * mm / 2); // sec=gap 2099P1 (6.2 = 4.45 + 0.05 (1/2 diameter wire)+1.7)
589
590 double cellx = 8.04 * mm, celly = 8.4 * mm;
591 int nPadX = 80, nPadY = 48;
592 TGeoVolume* gap = gGeoManager->MakeBox("Hgap", ch4, cellx * nPadX / 2, celly * nPadY / 2,
593 6.2 * mm / 2); // x=8.04*80 y=8.4*48 z=pad+pad-ano+marign 2006p1
594 TGeoVolume* row = gap->Divide("Hrow", 2, nPadY, 0, 0); // along Y->48 rows
595 TGeoVolume* cel = row->Divide(Form("Hcel%i", number), 1, nPadX, 0, 0); // along X->80 cells
596 mSensitiveVolumes.emplace_back(cel);
597
598 TGeoVolume* cat = gGeoManager->MakeTube("Hcat", cu, 0.00 * mm, 50.00 * um, cellx / 2);
599 TGeoVolume* ano = gGeoManager->MakeTube("Hano", w, 0.00 * mm, 20.00 * um, cellx / 2);
600 TGeoVolume* pad = gGeoManager->MakeBox(Form("Hpad%i", number), csi, 7.54 * mm / 2, 7.90 * mm / 2,
601 1.7 * mm / 2); // 2006P1 PCB material...
602 mSensitiveVolumes.emplace_back(pad);
603
604 TGeoVolume* fr1 = gGeoManager->MakeBox("Hfr1", al, 1463 * mm / 2, 1422.00 * mm / 2,
605 58.3 * mm / 2); // 2040P1 and pad plane is excluded (62 - 2 - 17)
606 TGeoVolume* fr1up = gGeoManager->MakeBox("Hfr1up", ch4, (1426.00 - 37.00) * mm / 2, (1385.00 - 37.00) * mm / 2,
607 20.0 * mm / 2); // 2040P1
608
609 TGeoVolume* fr1upcard = gGeoManager->MakeBox("Hfr1upcard", ch4, 662. * mm / 2., 425. * mm / 2.,
610 19.0 * mm / 2); // needed to set the gassiplex
611
612 TGeoVolume* fr1perUpBig = gGeoManager->MakeBox("Hfr1perUpBig", ch4, 1389 * mm / 2, 35 * mm / 2, 10 * mm / 2);
613 TGeoVolume* fr1perUpSma =
614 gGeoManager->MakeBox("Hfr1perUpSma", ch4, 35 * mm / 2, (1385 - 37 - 2 * 35) * mm / 2, 10 * mm / 2);
615 TGeoVolume* fr1perDowBig = gGeoManager->MakeBox("Hfr1perDowBig", ch4, 1389 * mm / 2, 46 * mm / 2, 2.3 * mm / 2);
616 TGeoVolume* fr1perDowSma =
617 gGeoManager->MakeBox("Hfr1perDowSma", ch4, 46 * mm / 2, (1385 - 37 - 2 * 46) * mm / 2, 2.3 * mm / 2);
618
619 TGeoVolume* ppf = gGeoManager->MakeBox("Hppf", al, 648 * mm / 2, 411.00 * mm / 2, 38.3 * mm / 2); // 2001P2
620 TGeoVolume* lar = gGeoManager->MakeBox("Hlar", ar, 181 * mm / 2, 89.25 * mm / 2, 38.3 * mm / 2); // 2001P2
621 TGeoVolume* smo = gGeoManager->MakeBox("Hsmo", ar, 114 * mm / 2, 89.25 * mm / 2, 38.3 * mm / 2); // 2001P2
622
623 TGeoVolume* cufoil = gGeoManager->MakeBox("Hcufoil", csi, 662. * mm / 2., 425. * mm / 2.,
624 1. * mm / 2.); // PCB foil at the back of the ppf with holes for GASSIPLEX
625 TGeoVolume* rect = gGeoManager->MakeBox("Hrect", ch4, 48 * mm / 2, 19 * mm / 2., 1 * mm / 2.);
626
627 TGeoVolume* fr3 = gGeoManager->MakeBox("Hfr3", al, 1463 * mm / 2, 1422 * mm / 2, 34 * mm / 2); // 2041P1
628 TGeoVolume* fr3up = gGeoManager->MakeBox("Hfr3up", ch4, 1323 * mm / 2, 1282 * mm / 2, 20 * mm / 2); // 2041P1
629 TGeoVolume* fr3down = gGeoManager->MakeBox("Hfr3down", ch4, 1437 * mm / 2, 1370 * mm / 2, 14 * mm / 2); // 2041P1
630
631 TGeoVolume* proxgap1 = gGeoManager->MakeBox("Hproxgap1", ch4, 1407 * mm / 2, 1366.00 * mm / 2,
632 (9. - 7.5) * mm / 2.); // methane volume between quartz and fr4
633 TGeoVolume* proxgap2 = gGeoManager->MakeBox("Hproxgap2", ch4, 1407 * mm / 2, 1366.00 * mm / 2,
634 (81.7 - 6.2 - 34. - 9. - 7.5) * mm / 2.); // methane volume between fr4
635 // and Hgap(tot height(81.7) -
636 // Hsec (6.2) - proxygap2 (34)
637 // -upper bound of fr4 (9+7.5))
638
639 // ^ Y z= z=-12mm z=98.25mm ALIC->7xHmp (virtual)-->1xHsbo (virtual) --->2xHcov (real)
640 // 2072P1
641 // | ____________________________________ | |-->1xHhon (real)
642 // 2072P1
643 // | | ______ ____ ______ | |
644 // | | | | | * | | | |->3xHrad (virtual) --->1xHneo (real)
645 // 2011P1
646 // | |50.5mm| |24mm| * |45.5mm| | | |-->1xHwin (real)
647 // 2011P1
648 // | | | | | * | | | | |-->2xHsi1 (real)
649 // 2011P1
650 // | | | |____| * |______| | | |-->2xHsi2 (real)
651 // 2011P1
652 // | | | ____ * ______ | | |->30xHspa (real)
653 // 2011P1
654 // | | | | | * | | | |
655 // | | | | | * | | | |->1xHfr4 (vitual) --->1xHf4a
656 // (real)---->1xHf4i(virtual) 2043P1
657 // | | sb | | rad| * | | | | |-->322xHcol (real)
658 // 2043P1
659 // | | | |____| * |______| | |
660 // | | | ____ * ______ | |->1xHfr1 (real) --> 6xHppf(real)
661 // ---->8xHlar (virtual) 2001P1
662 // | | | | | * | | | | |--->8xHsmo (virtual) 2001P1
663 // | | | | | * | | | |
664 // | | | | | * | | | |-> 6xHgap (virtual) --->48xHrow
665 // (virtual) -->80xHcel (virtual) -->4xHcat (real) from p84 TDR
666 // | |______| |____| * |______| | |-->2xHano (real) from p84 TDR
667 // |____________________________________| |-->1xHpad (real) from p84 TDR
668 // --->Z
669 hmp->AddNode(sbo, 1, new TGeoTranslation(0 * mm, 0 * mm, -73.75 * mm)); // p.84 TDR
670 sbo->AddNode(hon, 1, new TGeoTranslation(0 * mm, 0 * mm, 0 * mm)); // 2072P1
671 sbo->AddNode(cov, 1, new TGeoTranslation(0 * mm, 0 * mm, +25 * mm));
672 sbo->AddNode(cov, 2, new TGeoTranslation(0 * mm, 0 * mm, -25 * mm));
673 hmp->AddNode(rad, 2, new TGeoTranslation(0 * mm, +434 * mm, -12.00 * mm));
674 hmp->AddNode(rad, 1, new TGeoTranslation(0 * mm, 0 * mm, -12.00 * mm));
675 hmp->AddNode(rad, 0, new TGeoTranslation(0 * mm, -434 * mm, -12.00 * mm));
676 rad->AddNode(neo, 1, new TGeoTranslation(0 * mm, 0 * mm, -10.0 * mm));
677 rad->AddNode(win, 1, new TGeoTranslation(0 * mm, 0 * mm, 9.5 * mm));
678 rad->AddNode(si1, 1, new TGeoTranslation(0 * mm, -204 * mm, -0.5 * mm));
679 rad->AddNode(si1, 2, new TGeoTranslation(0 * mm, +204 * mm, -0.5 * mm));
680 rad->AddNode(si2, 1, new TGeoTranslation(-660 * mm, 0 * mm, -0.5 * mm));
681 rad->AddNode(si2, 2, new TGeoTranslation(+660 * mm, 0 * mm, -0.5 * mm));
682 for (Int_t i = 0; i < 3; i++) {
683 for (Int_t j = 0; j < 10; j++) {
684 rad->AddNode(spa, 10 * i + j,
685 new TGeoTranslation(-1330 * mm / 2 + 116 * mm + j * 122 * mm, (i - 1) * 105 * mm, -0.5 * mm));
686 }
687 }
688 hmp->AddNode(fr4, 1, new TGeoTranslation(0 * mm, 0 * mm, 9.00 * mm)); // p.84 TDR
689 for (int i = 1; i <= 322; i++) {
690 fr4->AddNode(col, i, new TGeoCombiTrans(0 * mm, -1296 / 2 * mm + i * 4 * mm, -5 * mm, rot)); // F4 2043P1
691 }
692 fr4->AddNode(f4a, 1, new TGeoTranslation(0 * mm, 0 * mm, 2.5 * mm));
693 f4a->AddNode(f4i, 1, new TGeoTranslation(0 * mm, 0 * mm, 0 * mm));
694 hmp->AddNode(sec, 4, new TGeoTranslation(-335 * mm, +433 * mm, 78.6 * mm));
695 hmp->AddNode(sec, 5, new TGeoTranslation(+335 * mm, +433 * mm, 78.6 * mm));
696 hmp->AddNode(sec, 2, new TGeoTranslation(-335 * mm, 0 * mm, 78.6 * mm));
697 hmp->AddNode(sec, 3, new TGeoTranslation(+335 * mm, 0 * mm, 78.6 * mm));
698 hmp->AddNode(sec, 0, new TGeoTranslation(-335 * mm, -433 * mm, 78.6 * mm));
699 hmp->AddNode(sec, 1, new TGeoTranslation(+335 * mm, -433 * mm, 78.6 * mm));
700 sec->AddNode(gap, 1, new TGeoTranslation(0, 0, 0. * mm));
701 cel->AddNode(cat, 1, new TGeoCombiTrans(0, 3.15 * mm, -2.70 * mm, rot)); // 4 cathode wires
702 cel->AddNode(ano, 1, new TGeoCombiTrans(0, 2.00 * mm, -0.29 * mm, rot)); // 2 anod wires
703 cel->AddNode(cat, 2, new TGeoCombiTrans(0, 1.05 * mm, -2.70 * mm, rot));
704 cel->AddNode(cat, 3, new TGeoCombiTrans(0, -1.05 * mm, -2.70 * mm, rot));
705 cel->AddNode(ano, 2, new TGeoCombiTrans(0, -2.00 * mm, -0.29 * mm, rot));
706 cel->AddNode(cat, 4, new TGeoCombiTrans(0, -3.15 * mm, -2.70 * mm, rot));
707 cel->AddNode(pad, 1, new TGeoTranslation(0, 0.00 * mm, 2.25 * mm)); // 1 pad
708
709 hmp->AddNode(fr1, 1, new TGeoTranslation(0., 0., (80. + 1.7) * mm + 58.3 * mm / 2.));
710 fr1->AddNode(fr1up, 1, new TGeoTranslation(0., 0., (58.3 * mm - 20.00 * mm) / 2.));
711
712 fr1->AddNode(fr1perUpBig, 0,
713 new TGeoTranslation(0., (1385 - 37 - 35) * mm / 2., (58.3 * mm - 20.00 * 2 * mm - 10.0 * mm) / 2.));
714 fr1->AddNode(fr1perUpSma, 0,
715 new TGeoTranslation((1426 - 37 - 35) * mm / 2., 0., (58.3 * mm - 20.00 * 2 * mm - 10.0 * mm) / 2.));
716 fr1->AddNode(fr1perUpBig, 1,
717 new TGeoTranslation(0., -(1385 - 37 - 35) * mm / 2., (58.3 * mm - 20.00 * 2 * mm - 10.0 * mm) / 2.));
718 fr1->AddNode(fr1perUpSma, 1,
719 new TGeoTranslation(-(1426 - 37 - 35) * mm / 2., 0., (58.3 * mm - 20.00 * 2 * mm - 10.0 * mm) / 2.));
720
721 fr1->AddNode(fr1perDowBig, 0, new TGeoTranslation(0., (1385 - 37) * mm / 2., (-58.3 * mm + 2.3 * mm) / 2.));
722 fr1->AddNode(fr1perDowSma, 0, new TGeoTranslation((1426 - 37) * mm / 2., 0., (-58.3 * mm + 2.3 * mm) / 2.));
723 fr1->AddNode(fr1perDowBig, 1, new TGeoTranslation(0., -(1385 - 37) * mm / 2., (-58.3 * mm + 2.3 * mm) / 2.));
724 fr1->AddNode(fr1perDowSma, 1, new TGeoTranslation(-(1426 - 37) * mm / 2., 0., (-58.3 * mm + 2.3 * mm) / 2.));
725
726 fr1->AddNode(ppf, 4, new TGeoTranslation(-335 * mm, 433 * mm, (-58.3 + 38.3) * mm / 2.));
727 fr1->AddNode(ppf, 5, new TGeoTranslation(335 * mm, 433 * mm, (-58.3 + 38.3) * mm / 2.));
728 fr1->AddNode(ppf, 2, new TGeoTranslation(-335 * mm, 0., (-58.3 + 38.3) * mm / 2.));
729 fr1->AddNode(ppf, 3, new TGeoTranslation(335 * mm, 0., (-58.3 + 38.3) * mm / 2.));
730 fr1->AddNode(ppf, 0, new TGeoTranslation(-335 * mm, -433 * mm, (-58.3 + 38.3) * mm / 2.));
731 fr1->AddNode(ppf, 1, new TGeoTranslation(335 * mm, -433 * mm, (-58.3 + 38.3) * mm / 2.));
732
733 Double_t offsetx = 16. * mm, offsety = 34. * mm / 2., interdistx = 48 * mm + offsetx + 0.6666 * mm,
734 interdisty = 19. * mm + 2. * offsety;
735
736 // gassiplex implementation
737 // it is in 3 different volumes: Hrec (in Hcufoil)+Hext
738
739 TGeoVolume* gassipl2 = gGeoManager->MakeBox("Hgassipl2", csi, 32. * mm / 2, 3. * mm / 2., 1. * mm / 2.); // in Hrect
740 TGeoVolume* gassipl3 =
741 gGeoManager->MakeBox("Hgassipl3", csi, 60. * mm / 2, 3. * mm / 2., 19. * mm / 2.); // in Hfr1upcard
742 TGeoVolume* gassipl4 = gGeoManager->MakeBox(
743 "Hgassipl4", csi, 60. * mm / 2, 3. * mm / 2.,
744 91. * mm / 2.); // in Hext (the big rectangle of the card is 110 mm long, 62 mm wide and 1.5 mm high)
745 TGeoVolume* busext = gGeoManager->MakeTubs("Hbusext", csi, 29 * mm, 30 * mm, 40 * mm / 2., 0., 180); // in Hext
746 TGeoVolume* ext = new TGeoVolumeAssembly("Hext");
747
748 rect->AddNode(gassipl2, 1, new TGeoTranslation(0., 0., 0));
749
750 for (Int_t hor = 0; hor < 10; hor++) {
751 for (Int_t vert = 0; vert < 8; vert++) {
752 cufoil->AddNode(rect, hor + vert * 10,
753 new TGeoTranslation(offsetx + 48. * mm / 2 + hor * interdistx - 662. * mm / 2,
754 offsety + 19. * mm / 2 + vert * interdisty - 425. * mm / 2., 0.));
755 fr1upcard->AddNode(gassipl3, hor + vert * 10,
756 new TGeoTranslation(offsetx + 48. * mm / 2 + hor * interdistx - 662. * mm / 2,
757 offsety + 19. * mm / 2 + vert * interdisty - 425. * mm / 2., 0.));
758 ext->AddNode(gassipl4, hor + vert * 10,
759 new TGeoTranslation(offsetx + 48. * mm / 2 + hor * interdistx - 662. * mm / 2,
760 offsety + 19. * mm / 2 + vert * interdisty - 425. * mm / 2., 0));
761 ext->AddNode(busext, hor + vert * 10,
762 new TGeoTranslation(offsetx + 48. * mm / 2 + hor * interdistx - 662. * mm / 2,
763 offsety + 19. * mm / 2 + vert * interdisty - 425. * mm / 2 + 3. * mm / 2., 0));
764 }
765 }
766
767 fr1up->AddNode(cufoil, 4, new TGeoTranslation(-335 * mm, 433 * mm, -20.0 * mm / 2 + 1. * mm / 2));
768 fr1up->AddNode(cufoil, 5, new TGeoTranslation(335 * mm, 433 * mm, -20.0 * mm / 2 + 1. * mm / 2));
769 fr1up->AddNode(cufoil, 2, new TGeoTranslation(-335 * mm, 0, -20.0 * mm / 2 + 1. * mm / 2));
770 fr1up->AddNode(cufoil, 3, new TGeoTranslation(335 * mm, 0, -20.0 * mm / 2 + 1. * mm / 2));
771 fr1up->AddNode(cufoil, 0, new TGeoTranslation(-335 * mm, -433 * mm, -20.0 * mm / 2 + 1. * mm / 2));
772 fr1up->AddNode(cufoil, 1, new TGeoTranslation(335 * mm, -433 * mm, -20.0 * mm / 2 + 1. * mm / 2));
773
774 fr1up->AddNode(fr1upcard, 4, new TGeoTranslation(-335 * mm, 433 * mm, 1. * mm / 2.));
775 fr1up->AddNode(fr1upcard, 5, new TGeoTranslation(335 * mm, 433 * mm, 1. * mm / 2.));
776 fr1up->AddNode(fr1upcard, 2, new TGeoTranslation(-335 * mm, 0, 1. * mm / 2.));
777 fr1up->AddNode(fr1upcard, 3, new TGeoTranslation(335 * mm, 0, 1. * mm / 2.));
778 fr1up->AddNode(fr1upcard, 0, new TGeoTranslation(-335 * mm, -433 * mm, 1. * mm / 2));
779 fr1up->AddNode(fr1upcard, 1, new TGeoTranslation(335 * mm, -433 * mm, 1. * mm / 2.));
780
781 hmp->AddNode(ext, 4, new TGeoTranslation(-335 * mm, +433 * mm, (80. + 1.7) * mm + 58.3 * mm + 91 * mm / 2.));
782 hmp->AddNode(ext, 5, new TGeoTranslation(+335 * mm, +433 * mm, (80. + 1.7) * mm + 58.3 * mm + 91 * mm / 2.));
783 hmp->AddNode(ext, 2, new TGeoTranslation(-335 * mm, 0 * mm, (80. + 1.7) * mm + 58.3 * mm + 91 * mm / 2.));
784 hmp->AddNode(ext, 3, new TGeoTranslation(+335 * mm, 0 * mm, (80. + 1.7) * mm + 58.3 * mm + 91 * mm / 2.));
785 hmp->AddNode(ext, 0, new TGeoTranslation(-335 * mm, -433 * mm, (80. + 1.7) * mm + 58.3 * mm + 91 * mm / 2.));
786 hmp->AddNode(ext, 1, new TGeoTranslation(+335 * mm, -433 * mm, (80. + 1.7) * mm + 58.3 * mm + 91 * mm / 2.));
787
788 hmp->AddNode(proxgap1, 0, new TGeoTranslation(0., 0., (9. - 7.5) * mm / 2.)); // due to the TGeoVolumeAssembly
789 // definition the ch4 volume must be
790 // inserted around the collecting wires
791 hmp->AddNode(proxgap2, 0,
792 new TGeoTranslation(0., 0., (9 + 7.5 + 34) * mm + (81.7 - 6.2 - 34. - 9. - 7.5) * mm / 2.)); // tot height(81.7) - Hsec - proxygap2 - top edge fr4 at(9+7.5) mm
793
794 // ^ Y single cell 5.5mm CH4 = 1*mm CsI + 4.45*mm CsI x cath +0.05*mm
795 // safety margin
796 // | ______________________________
797 // | | | ^ ||
798 // | | 1.05mm ||
799 // 2.2*mm| xxxxxxxxxxxxxxxxxxxxxxxxxxxx |-- 50um x || cat shift x=0mm , y= 3.15mm ,
800 // z=-2.70mm
801 // | | ||
802 // | | ||
803 // __ | .......................... | 2.1mm 20un . || ano shift x=0mm , y= 2.00mm ,
804 // z=-0.29mm
805 // | | ||
806 // | | ||
807 // | xxxxxxxxxxxxxxxxxxxxxxxxxxxx |-- x || cat shift x=0mm , y= 1.05mm ,
808 // z=-2.70mm
809 // | | ||
810 // | | 8.4mm ||
811 // 4*mm | | 2.1mm || pad shift x=0mm , y= 0.00mm ,
812 // z=2.25*mm
813 // | | ||
814 // | | ||
815 // | xxxxxxxxxxxxxxxxxxxxxxxxxxxx |-- x || cat shift x=0mm , y=-1.05mm ,
816 // z=-2.70mm
817 // | | ||
818 // | | ||
819 // __ | .......................... | 2.1mm . 2.04mm|| ano shift x=0mm , y=-2.00mm ,
820 // z=-0.29mm
821 // | | ||
822 // | | ||
823 // | xxxxxxxxxxxxxxxxxxxxxxxxxxxx |-- x 4.45mm || cat shift x=0mm , y=-3.15mm ,
824 // z=-2.70mm
825 // 2.2*mm| | ||
826 // | | 1.05mm ||
827 // |______________________________| v ||
828 // < 8 mm >
829 // ----->X ----->Z
830
831 ppf->AddNode(lar, 0, new TGeoTranslation(-224.5 * mm, -151.875 * mm, 0. * mm));
832 ppf->AddNode(lar, 1, new TGeoTranslation(-224.5 * mm, -50.625 * mm, 0. * mm));
833 ppf->AddNode(lar, 2, new TGeoTranslation(-224.5 * mm, +50.625 * mm, 0. * mm));
834 ppf->AddNode(lar, 3, new TGeoTranslation(-224.5 * mm, +151.875 * mm, 0. * mm));
835 ppf->AddNode(lar, 4, new TGeoTranslation(+224.5 * mm, -151.875 * mm, 0. * mm));
836 ppf->AddNode(lar, 5, new TGeoTranslation(+224.5 * mm, -50.625 * mm, 0. * mm));
837 ppf->AddNode(lar, 6, new TGeoTranslation(+224.5 * mm, +50.625 * mm, 0. * mm));
838 ppf->AddNode(lar, 7, new TGeoTranslation(+224.5 * mm, +151.875 * mm, 0. * mm));
839 ppf->AddNode(smo, 0, new TGeoTranslation(-65.0 * mm, -151.875 * mm, 0. * mm));
840 ppf->AddNode(smo, 1, new TGeoTranslation(-65.0 * mm, -50.625 * mm, 0. * mm));
841 ppf->AddNode(smo, 2, new TGeoTranslation(-65.0 * mm, +50.625 * mm, 0. * mm));
842 ppf->AddNode(smo, 3, new TGeoTranslation(-65.0 * mm, +151.875 * mm, 0. * mm));
843 ppf->AddNode(smo, 4, new TGeoTranslation(+65.0 * mm, -151.875 * mm, 0. * mm));
844 ppf->AddNode(smo, 5, new TGeoTranslation(+65.0 * mm, -50.625 * mm, 0. * mm));
845 ppf->AddNode(smo, 6, new TGeoTranslation(+65.0 * mm, +50.625 * mm, 0. * mm));
846 ppf->AddNode(smo, 7, new TGeoTranslation(+65.0 * mm, +151.875 * mm, 0. * mm));
847
848 // hmp->AddNode(fr3,1,new TGeoTranslation(0.,0.,(81.7-29.)*mm-34.*mm/2));
849 hmp->AddNode(fr3, 1, new TGeoTranslation(0., 0., (9. + 7.5) * mm + 34. * mm / 2));
850 fr3->AddNode(fr3up, 1, new TGeoTranslation(0., 0., 7 * mm));
851 fr3->AddNode(fr3down, 1, new TGeoTranslation(0., 0., -10 * mm));
852
853 return hmp;
854}
855
856//*************************************************************************************************************
857
859{
860
861 // Method that builds the Cradle geometry
862 // according to the base topology created
863 // in CradleBaseVolume(...)
864
865 Double_t mm = 0.1;
866
867 Double_t params[10] = {0.5, 10., 24., -1, 5.2, 1.5, 3.5, 8.5, 3.8, 0.};
868 TGeoMedium* med = gGeoManager->GetMedium("HMP_Al");
869 TGeoVolume* cradle = new TGeoVolumeAssembly("Hcradle");
870
871 // Double_t baselong[7]={6037*mm-2*60*mm, 6037*mm-2*60*mm,60*mm,0.,100*mm,10*mm,10*mm};//2CRE2112P3
872 Double_t baselong[7] = {
873 6037 * mm - 2 * 100 * mm, 6037 * mm - 2 * 100 * mm, 60 * mm, 0., 100 * mm, 10 * mm, 10 * mm}; // 2CRE2112P3
874 TGeoVolume* lbase = CradleBaseVolume(med, baselong, "cradleLbase");
875 lbase->SetLineColor(kGray);
876
877 Double_t baseshort[7] = {
878 1288. * mm + 2 * 100 * mm, 1288. * mm + 2 * 100 * mm, 60 * mm, 0., 100 * mm, 10 * mm, 10 * mm}; // 2CRE2112P3
879 TGeoVolume* sbase = CradleBaseVolume(med, baseshort, "cradleSbase");
880 sbase->SetLineColor(kGray);
881
882 // one side
883
884 Double_t height = 30. * mm; // 30 = 2*(1488/2-729) (2CRE2112P3)
885 Double_t tubeh = 50. * mm; // tube height
886 Double_t heightred = 5. * mm;
887 Double_t zred = 5. * mm;
888 Double_t oneshift = tubeh / TMath::Tan(TMath::DegToRad() * 20.) + (1458. - 35) * mm / 2 - (1607 - 35) * mm / 2;
889 Double_t linclined[7] = {
890 1458. * mm - params[6] - 0.5, 1607. * mm - params[6] - 0.5, tubeh, oneshift, height, heightred, zred}; // 3.5 is for not correct measurements in 2CRE2112P3<=> 597!=inclined*sin(20)
891 TGeoVolume* inclin = CradleBaseVolume(med, linclined, "inclinedbar");
892 inclin->SetLineColor(kGray);
893 Double_t lhorizontal[7] = {
894 1641.36 * mm + params[7], 1659. * mm + params[7], tubeh, 0, height, heightred, zred};
895 TGeoVolume* horiz = CradleBaseVolume(med, lhorizontal, "horizontalbar");
896 horiz->SetLineColor(kGray);
897
898 // inner bars, they are named as the numbering in 2CRE2112P3
899 Double_t fourshift = tubeh / TMath::Tan(TMath::DegToRad() * 55.);
900 Double_t lfour[7] = {592 * mm, 592 * mm, tubeh, fourshift, height, heightred, zred};
901 TGeoVolume* four = CradleBaseVolume(med, lfour, "bar4");
902 four->SetLineColor(kGray);
903
904 Double_t fiveshift = tubeh / TMath::Tan(TMath::DegToRad() * 75);
905 Double_t lfive[7] = {500. * mm, 500. * mm, tubeh, fiveshift, height, heightred, zred};
906 TGeoVolume* five = CradleBaseVolume(med, lfive, "bar5");
907 five->SetLineColor(kGray);
908
909 Double_t sixshift = tubeh / TMath::Tan(TMath::DegToRad() * 55) + 459 * mm / 2 - 480 * mm / 2;
910 Double_t lsix[7] = {456 * mm, 477 * mm, tubeh, sixshift, height, heightred, zred};
911 TGeoVolume* six = CradleBaseVolume(med, lsix, "bar6");
912 six->SetLineColor(kGray);
913
914 Double_t sevenshift = tubeh / TMath::Tan(TMath::DegToRad() * 50) + 472 * mm / 2 - 429. * mm / 2;
915 Double_t lseven[7] = {429 * mm, 472 * mm, tubeh, sevenshift, height, heightred, zred};
916 TGeoVolume* seven = CradleBaseVolume(med, lseven, "bar7");
917 seven->SetLineColor(kGray);
918
919 Double_t eightshift = tubeh / TMath::Tan(TMath::DegToRad() * 30) + 244. * mm / 2 - 200. * mm / 2 - 3;
920 Double_t leight[7] = {200. * mm, 244. * mm, tubeh, eightshift, height, heightred, zred};
921 TGeoVolume* eight = CradleBaseVolume(med, leight, "bar8");
922 eight->SetLineColor(kGray);
923
924 Double_t nineshift = -tubeh / TMath::Tan(TMath::DegToRad() * 71) + 83. * mm / 2 - 66. * mm / 2;
925 Double_t lnine[7] = {59.5 * mm, 76.5 * mm, tubeh, nineshift, height, heightred, zred};
926 TGeoVolume* nine = CradleBaseVolume(med, lnine, "bar9");
927 nine->SetLineColor(kGray);
928
929 Double_t tenshift = (-tubeh / TMath::Tan(TMath::DegToRad() * 60) - 221. * mm / 2 + 195. * mm / 2);
930 Double_t lten[7] = {195. * mm, 221. * mm, tubeh, tenshift, height, heightred, zred};
931 TGeoVolume* ten = CradleBaseVolume(med, lten, "bar10");
932 ten->SetLineColor(kGray);
933
934 Double_t elevenshift = (-tubeh / TMath::Tan(TMath::DegToRad() * 70) - 338. * mm / 2 + 315. * mm / 2);
935 Double_t leleven[7] = {308. * mm, 331. * mm, tubeh, elevenshift, height, heightred, zred};
936 TGeoVolume* eleven = CradleBaseVolume(med, leleven, "bar11");
937 eleven->SetLineColor(kGray);
938
939 Double_t twelveshift = (-tubeh / TMath::Tan(TMath::DegToRad() * 60) - 538. * mm / 2 + 508. * mm / 2);
940 Double_t ltwelve[7] = {507. * mm, 537. * mm, tubeh, twelveshift, height, heightred, zred};
941 TGeoVolume* twelve = CradleBaseVolume(med, ltwelve, "bar12");
942 twelve->SetLineColor(kGray);
943
944 Double_t thirteenshift = tubeh / TMath::Tan(TMath::DegToRad() * 43);
945 Double_t lthirteen[7] = {708. * mm, 708. * mm, tubeh, thirteenshift, height, heightred, zred};
946 TGeoVolume* thirteen = CradleBaseVolume(med, lthirteen, "bar13");
947 thirteen->SetLineColor(kGray);
948
949 // vertical rectangles
950 TGeoVolume* vbox = new TGeoVolumeAssembly("Hvbox");
951 vbox->SetLineColor(kViolet);
952 Double_t width = 50. * mm;
953
954 TGeoVolume* vboxlast = new TGeoVolumeAssembly("Hvboxlast"); // vertical structure on the short base
955 vboxlast->SetLineColor(kViolet);
956
957 Double_t barheight = 100. * mm;
958 Double_t lAfourteen[7] = {1488. * mm, 1488. * mm, barheight, 0, width, heightred, zred};
959 TGeoVolume* afourteen = CradleBaseVolume(med, lAfourteen, "bar14top");
960 afourteen->SetLineColor(kGray);
961
962 Double_t lBfourteen[7] = {387 * mm, 387. * mm, barheight, 0, width, heightred, zred};
963 TGeoVolume* bfourteen = CradleBaseVolume(med, lBfourteen, "bar14vert");
964 bfourteen->SetLineColor(kGray);
965
966 Double_t lCfourteen[7] = {1288. * mm, 1288. * mm, barheight, 0, width, heightred, zred};
967 TGeoVolume* cfourteen = CradleBaseVolume(med, lCfourteen, "bar14bot");
968 cfourteen->SetLineColor(kGray);
969
970 Double_t oblshift = 50. * mm / TMath::Tan(TMath::DegToRad() * 35);
971 Double_t lDfourteen[7] = {603. * mm, 603. * mm, 50. * mm, oblshift, width, heightred, zred};
972 TGeoVolume* dfourteen = CradleBaseVolume(med, lDfourteen, "bar14incl");
973 dfourteen->SetLineColor(kGray);
974
975 Double_t lDfourteenlast[7] = {667. * mm, 667. * mm, 50. * mm, oblshift, width, heightred, zred};
976 TGeoVolume* dfourteenlast = CradleBaseVolume(med, lDfourteenlast, "bar14incllast");
977 dfourteenlast->SetLineColor(kGray);
978
979 vbox->AddNode(afourteen, 1, new TGeoTranslation(0., 487. * mm / 2 - 100. * mm / 2, 0.));
980 TGeoRotation* vinrot = new TGeoRotation("vertbar");
981 vinrot->RotateZ(90);
982 vbox->AddNode(bfourteen, 1, new TGeoCombiTrans(1488 * mm / 2 - 100. * mm / 2, -100. * mm / 2, 0., vinrot));
983 vbox->AddNode(bfourteen, 2, new TGeoCombiTrans(-1488 * mm / 2 + 100. * mm / 2, -100. * mm / 2, 0., vinrot));
984 TGeoRotation* rotboxbar = new TGeoRotation("rotboxbar");
985 rotboxbar->RotateZ(-35);
986 TGeoRotation* arotboxbar = new TGeoRotation("arotboxbar");
987 arotboxbar->RotateZ(-35);
988 arotboxbar->RotateY(180);
989 vbox->AddNode(dfourteen, 1, new TGeoCombiTrans(-1488 * mm / 4, -1, 0.4, rotboxbar));
990 vbox->AddNode(dfourteen, 2, new TGeoCombiTrans(+1488 * mm / 4, -1, 0.4, arotboxbar));
991 // vertical box on the short base of the cradle
992 vboxlast->AddNode(afourteen, 1, new TGeoTranslation(0., 487. * mm / 2 - 100. * mm / 2, 0.));
993 vboxlast->AddNode(bfourteen, 1, new TGeoCombiTrans(1488 * mm / 2 - 100. * mm / 2, -100. * mm / 2, 0., vinrot));
994 vboxlast->AddNode(bfourteen, 2, new TGeoCombiTrans(-1488 * mm / 2 + 100. * mm / 2, -100. * mm / 2, 0., vinrot));
995 vboxlast->AddNode(dfourteenlast, 1, new TGeoCombiTrans(-1488 * mm / 4 + 1.7, -3., 0., rotboxbar));
996 vboxlast->AddNode(dfourteenlast, 2, new TGeoCombiTrans(+1488 * mm / 4 - 1.7, -3., 0., arotboxbar));
997
998 // POSITIONING IN THE VIRTUAL VOLUME "cradle"
999
1000 // long base
1001 TGeoRotation* rotl = new TGeoRotation("Clongbase");
1002 rotl->RotateX(90);
1003 cradle->AddNode(lbase, 0, new TGeoCombiTrans(0 * mm, (1488 - 100) * mm / 2, -(597 - 60) * mm / 2, rotl));
1004 cradle->AddNode(lbase, 1, new TGeoCombiTrans(0 * mm, -(1488 - 100) * mm / 2, -(597 - 60) * mm / 2, rotl));
1005 // short base
1006 TGeoRotation* rots = new TGeoRotation("Cshortbase");
1007 rots->RotateX(90);
1008 rots->RotateZ(90);
1009 cradle->AddNode(sbase, 1, new TGeoCombiTrans((6037 - 100) * mm / 2, 0., -(597 - 60) * mm / 2, rots));
1010 cradle->AddNode(sbase, 2, new TGeoCombiTrans(-(6037 - 100) * mm / 2, 0., -(597 - 60) * mm / 2, rots));
1011
1012 // trapezoidal structure
1013 Double_t origtrastruct = (6037 - 2 * 60) * mm / 2 - 2288 * mm;
1014
1015 TGeoRotation* rot1 = new TGeoRotation("inclrot");
1016 rot1->RotateX(90);
1017 rot1->RotateY(200);
1018 TGeoRotation* rot2 = new TGeoRotation("horizrot");
1019 rot2->RotateX(-90);
1020 Double_t dx = (1607 - 35) * mm * TMath::Cos(TMath::DegToRad() * 20) / 2 -
1021 tubeh / 2 * TMath::Sin(TMath::DegToRad() * 20) + params[5];
1022
1023 cradle->AddNode(inclin, 1, new TGeoCombiTrans(origtrastruct + (2288 + 60) * mm - dx, 729 * mm, params[0] + 0.4,
1024 rot1)); //+0.7 added
1025 cradle->AddNode(horiz, 1, new TGeoCombiTrans(origtrastruct, 729 * mm, 597 * mm / 2 - tubeh / 2,
1026 rot2)); // correctly positioned
1027 TGeoRotation* rot1mirror = new TGeoRotation("inclmirrot");
1028 rot1mirror->RotateX(90);
1029 rot1mirror->RotateY(200);
1030 rot1mirror->RotateZ(180);
1031 cradle->AddNode(inclin, 2, new TGeoCombiTrans(origtrastruct - 2345 * mm + dx, 729 * mm, params[0] + 0.4,
1032 rot1mirror)); //+0.7 added
1033 cradle->AddNode(inclin, 3, new TGeoCombiTrans(origtrastruct + (2288 + 60) * mm - dx, -729 * mm, params[0] + 0.4,
1034 rot1)); // 0.7 added
1035 cradle->AddNode(horiz, 2, new TGeoCombiTrans(origtrastruct, -729 * mm, 597 * mm / 2 - tubeh / 2,
1036 rot2)); // correctly positioned
1037 cradle->AddNode(inclin, 4, new TGeoCombiTrans(origtrastruct - 2345 * mm + dx, -729 * mm, params[0] + 0.4,
1038 rot1mirror)); // 0.7 added
1039
1040 Double_t tan1 = (2 * TMath::Tan(TMath::DegToRad() * 55));
1041
1042 // inner pieces on one side
1043 TGeoRotation* rot4 = new TGeoRotation("4rot");
1044 rot4->RotateX(-90);
1045 rot4->RotateY(-55);
1046 rot4->RotateZ(180);
1047 TGeoRotation* rot4a = new TGeoRotation("4arot");
1048 rot4a->RotateX(-90);
1049 rot4a->RotateY(-55);
1050 cradle->AddNode(four, 1, new TGeoCombiTrans(origtrastruct - (39 + (597 - 50 - 60) / tan1) * mm - tubeh / (2 * TMath::Sin(TMath::DegToRad() * 55)), -729 * mm, params[3], rot4));
1051
1052 cradle->AddNode(four, 2, new TGeoCombiTrans(origtrastruct + (39 + (597 - 50 - 60) / tan1) * mm + tubeh / (2 * TMath::Sin(TMath::DegToRad() * 55)), -729 * mm, params[3], rot4a));
1053
1054 TGeoRotation* rot5 = new TGeoRotation("5rot");
1055 rot5->RotateX(-90);
1056 rot5->RotateY(-75);
1057 rot5->RotateZ(180);
1058 TGeoRotation* rot5a = new TGeoRotation("5arot");
1059 rot5a->RotateX(-90);
1060 rot5a->RotateY(-75);
1061 cradle->AddNode(
1062 five, 1,
1063 new TGeoCombiTrans(origtrastruct + (486 + (597 - 50 - 60) / (2 * TMath::Tan(TMath::DegToRad() * 75))) * mm +
1064 tubeh / (2 * TMath::Sin(TMath::DegToRad() * 75)),
1065 -729 * mm, 0, rot5));
1066 cradle->AddNode(
1067 five, 2,
1068 new TGeoCombiTrans(origtrastruct - (486 + (597 - 50 - 60) / (2 * TMath::Tan(TMath::DegToRad() * 75))) * mm -
1069 tubeh / (2 * TMath::Sin(TMath::DegToRad() * 75)),
1070 -729 * mm, 0, rot5a));
1071 cradle->AddNode(six, 1,
1072 new TGeoCombiTrans(origtrastruct + 808 * mm + (480 * mm / 2) * TMath::Cos(TMath::DegToRad() * 55) +
1073 tubeh / (2 * TMath::Sin(TMath::DegToRad() * 55)) + 2.,
1074 -729 * mm, -params[4] - 0.5, rot4a));
1075 cradle->AddNode(six, 2,
1076 new TGeoCombiTrans(origtrastruct - 808 * mm - (480 * mm / 2) * TMath::Cos(TMath::DegToRad() * 55) -
1077 tubeh / (2 * TMath::Sin(TMath::DegToRad() * 55)) - 2.,
1078 -729 * mm, -params[4] - 0.5, rot4));
1079
1080 TGeoRotation* rot7 = new TGeoRotation("7rot");
1081 rot7->RotateX(-90);
1082 rot7->RotateY(130);
1083 rot7->RotateZ(180);
1084 TGeoRotation* rot7a = new TGeoRotation("7arot");
1085 rot7a->RotateX(-90);
1086 rot7a->RotateY(130);
1087
1088 cradle->AddNode(
1089 seven, 1, new TGeoCombiTrans(origtrastruct + 1478 * mm - (472 * mm / 2) * TMath::Cos(TMath::DegToRad() * 50) + tubeh / (2 * TMath::Sin(TMath::DegToRad() * 50)), -729 * mm, -params[8], rot7));
1090 cradle->AddNode(
1091 seven, 2, new TGeoCombiTrans(origtrastruct - 1478 * mm + (472 * mm / 2) * TMath::Cos(TMath::DegToRad() * 50) - tubeh / (2 * TMath::Sin(TMath::DegToRad() * 50)), -729 * mm, -params[8], rot7a));
1092 TGeoRotation* rot8 = new TGeoRotation("8rot");
1093 rot8->RotateX(-90);
1094 rot8->RotateY(-25);
1095 TGeoRotation* rot8a = new TGeoRotation("8arot");
1096 rot8a->RotateX(-90);
1097 rot8a->RotateY(-25);
1098 rot8a->RotateZ(180);
1099 cradle->AddNode(
1100 eight, 1, new TGeoCombiTrans(origtrastruct + 1640 * mm + (244 * mm / 2) * TMath::Cos(TMath::DegToRad() * 30) + tubeh / (2 * TMath::Sin(TMath::DegToRad() * 30)), -729 * mm, -20.5, rot8));
1101 cradle->AddNode(
1102 eight, 2, new TGeoCombiTrans(origtrastruct - 1640 * mm - (244 * mm / 2) * TMath::Cos(TMath::DegToRad() * 30) - tubeh / (2 * TMath::Sin(TMath::DegToRad() * 30)), -729 * mm, -20.5, rot8a));
1103 TGeoRotation* rot9 = new TGeoRotation("9rot");
1104 rot9->RotateX(-90);
1105 rot9->RotateY(-90);
1106 TGeoRotation* rot9a = new TGeoRotation("9arot");
1107 rot9a->RotateX(-90);
1108 rot9a->RotateY(-90);
1109 rot9a->RotateZ(180);
1110 cradle->AddNode(nine, 1, new TGeoCombiTrans(origtrastruct + 1960 * mm + 2.5 + 3., -729. * mm, -20., rot9));
1111 cradle->AddNode(nine, 2, new TGeoCombiTrans(origtrastruct - 1960 * mm - 2.5 - 3., -729. * mm, -20., rot9a));
1112 // inner pieces on the other side
1113 TGeoRotation* rot10 = new TGeoRotation("10rot");
1114 rot10->RotateX(-90);
1115 rot10->RotateY(-120);
1116 TGeoRotation* rot10a = new TGeoRotation("10arot");
1117 rot10a->RotateX(-90);
1118 rot10a->RotateY(-120);
1119 rot10a->RotateZ(180);
1120
1121 cradle->AddNode(
1122 ten, 1, new TGeoCombiTrans(origtrastruct + 1738 * mm + tubeh / (2 * TMath::Sin(TMath::DegToRad() * 60)) - 2, +729. * mm, -13., rot10));
1123 cradle->AddNode(
1124 ten, 2, new TGeoCombiTrans(origtrastruct - 1738 * mm - tubeh / (2 * TMath::Sin(TMath::DegToRad() * 60)) + 2, +729. * mm, -13., rot10a));
1125
1126 TGeoRotation* rot11 = new TGeoRotation("11rot");
1127 rot11->RotateX(-90);
1128 rot11->RotateY(50);
1129 TGeoRotation* rot11a = new TGeoRotation("11arot");
1130 rot11a->RotateX(-90);
1131 rot11a->RotateY(50);
1132 rot11a->RotateZ(180);
1133 cradle->AddNode(eleven, 1, new TGeoCombiTrans(origtrastruct - 1738 * mm - tubeh / (2 * TMath::Sin(TMath::DegToRad() * 60)) + 352. * mm, +729. * mm, -12.7, rot11));
1134 cradle->AddNode(eleven, 2, new TGeoCombiTrans(origtrastruct + 1738 * mm + tubeh / (2 * TMath::Sin(TMath::DegToRad() * 60)) - 352. * mm, +729. * mm, -12.7, rot11a));
1135
1136 TGeoRotation* rot12 = new TGeoRotation("12rot");
1137 rot12->RotateX(-90);
1138 rot12->RotateY(-120);
1139 TGeoRotation* rot12a = new TGeoRotation("12arot");
1140 rot12a->RotateX(-90);
1141 rot12a->RotateY(-120);
1142 rot12a->RotateZ(180);
1143 cradle->AddNode(twelve, 1, new TGeoCombiTrans(origtrastruct + 1065 * mm, +729. * mm, 1., rot12));
1144 cradle->AddNode(twelve, 2, new TGeoCombiTrans(origtrastruct - 1065 * mm, +729. * mm, 1., rot12a));
1145
1146 TGeoRotation* rot13 = new TGeoRotation("13rot");
1147 rot13->RotateX(-90);
1148 rot13->RotateY(-43);
1149 rot13->RotateZ(180);
1150 TGeoRotation* rot13a = new TGeoRotation("13arot");
1151 rot13a->RotateX(-90);
1152 rot13a->RotateY(-43);
1153 cradle->AddNode(thirteen, 1, new TGeoCombiTrans(origtrastruct + 572 * mm - 18., +729. * mm, -1.5, rot13));
1154 cradle->AddNode(thirteen, 2, new TGeoCombiTrans(origtrastruct - 572 * mm + 18., +729. * mm, -1.5, rot13a));
1155
1156 // vertical structures
1157 TGeoRotation* vrot = new TGeoRotation("vertbox");
1158 vrot->RotateX(90);
1159 vrot->RotateZ(90);
1160 cradle->AddNode(vboxlast, 1, new TGeoCombiTrans(-6037 * mm / 2 + 50. * mm / 2, 0., 0.5,
1161 vrot)); // vertial box on the short cradle base
1162
1163 cradle->AddNode(vbox, 2, new TGeoCombiTrans(-6037 * mm / 2 + 50. * mm / 2 + 990. * mm, 0., 0.5, vrot));
1164 cradle->AddNode(cfourteen, 2, new TGeoCombiTrans(-6037 * mm / 2 + 50. * mm / 2 + 990. * mm, 0., -477. * mm / 2 - 20. * mm / 2, vrot));
1165
1166 cradle->AddNode(
1167 vbox, 3, new TGeoCombiTrans(origtrastruct - (1641.36 * mm + params[7]) / 2. + 50. * mm / 2. + 3, 0., 0.5, vrot));
1168 cradle->AddNode(cfourteen, 3,
1169 new TGeoCombiTrans(origtrastruct - (1641.36 * mm + params[7]) / 2. + 50. * mm / 2. + 3, 0.,
1170 -477. * mm / 2 - 20. * mm / 2, vrot));
1171
1172 cradle->AddNode(
1173 vbox, 4, new TGeoCombiTrans(origtrastruct + (1641.36 * mm + params[7]) / 2. - 50. * mm / 2. - 3, 0., 0.5, vrot));
1174 cradle->AddNode(cfourteen, 4,
1175 new TGeoCombiTrans(origtrastruct + (1641.36 * mm + params[7]) / 2. - 50. * mm / 2. - 3, 0.,
1176 -477. * mm / 2 - 20. * mm / 2, vrot));
1177
1178 return cradle;
1179} // CreateCradle()
1180
1181//*****************************************************************************************************************
1182
1183TGeoVolume* Detector::CradleBaseVolume(TGeoMedium* med, Double_t l[7], const char* name)
1184{
1185 /*
1186 The trapezoid is build in the xy plane
1187 0 ________________ 1
1188 / | \
1189 / | \
1190 / (0,0) \
1191 / | \
1192 3 /___________|____________\ 2
1193 01 is right shifted => shift is positive
1194 //1: small base (0-1); 2: long base (3-2);
1195 //3: trapezoid height; 4: shift between the two bases;
1196 //5: height 6: height reduction; 7: z-reduction;
1197 */
1198
1199 TGeoXtru* xtruIn = new TGeoXtru(2);
1200 TGeoXtru* xtruOut = new TGeoXtru(2);
1201 xtruIn->SetName(Form("%sIN", name));
1202 xtruOut->SetName(Form("%sOUT", name));
1203
1204 Double_t xv[4], yv[4];
1205
1206 xv[0] = -(l[0] / 2 - l[3]);
1207 yv[0] = l[2] / 2;
1208 xv[1] = l[0] / 2 + l[3];
1209 yv[1] = l[2] / 2;
1210 xv[2] = l[1] / 2;
1211 yv[2] = -l[2] / 2;
1212 xv[3] = -l[1] / 2;
1213 yv[3] = -l[2] / 2;
1214
1215 xtruOut->DefinePolygon(4, xv, yv);
1216 xtruOut->DefineSection(0, -l[4] / 2., 0., 0.,
1217 1.0); // 0= I plane z; (0.,0.) = shift wrt centre; 1.= shape scale factor
1218 xtruOut->DefineSection(1, +l[4] / 2., 0., 0., 1.0); // 1= II plane z;
1219
1220 Double_t tgalpha = 0;
1221 if (xv[3] - xv[0] == 0) {
1222 tgalpha = 999999;
1223 } else {
1224 tgalpha = l[2] / TMath::Abs(xv[3] - xv[0]);
1225 }
1226 Double_t tgbeta = 0;
1227 if (xv[2] - xv[1] == 0) {
1228 tgbeta = 999999;
1229 } else {
1230 tgbeta = l[2] / TMath::Abs(xv[2] - xv[1]);
1231 }
1232
1233 xv[0] = xv[0] - l[5] / tgalpha;
1234 yv[0] = l[2] / 2 - l[5];
1235 xv[1] = xv[1] + l[5] / tgbeta;
1236 yv[1] = l[2] / 2 - l[5];
1237 xv[2] = xv[2] + l[5] / tgbeta;
1238 yv[2] = -l[2] / 2 + l[5];
1239 xv[3] = xv[3] - l[5] / tgalpha;
1240 yv[3] = -l[2] / 2 + l[5];
1241
1242 xtruIn->DefinePolygon(4, xv, yv);
1243 xtruIn->DefineSection(0, (-l[4] + l[6]) / 2, 0., 0., 1.0);
1244 xtruIn->DefineSection(1, (+l[4] - l[6]) / 2, 0., 0., 1.0);
1245
1246 TGeoCompositeShape* shape = new TGeoCompositeShape(name, Form("%sOUT-%sIN", name, name));
1247
1248 TGeoVolume* vol = new TGeoVolume(name, shape, med);
1249
1250 return vol;
1251} // CradleBaseVolume()
1252//****************************************************************************************************************
1253
1255{
1256 // Creates detailed geometry simulation (currently GEANT volumes tree)
1257 // includind the HMPID cradle
1258
1260
1261 TGeoVolume* hmpcradle = CreateCradle();
1262
1263 TGeoVolume* hmpidabs_cham2 = createAbsorber(40.0);
1264 TGeoVolume* hmpidabs_cham4 = createAbsorber(80.0);
1265
1266 double theta = 33.5;
1267
1268 TGeoHMatrix* pMatrixAbs2 = new TGeoHMatrix;
1269 const double trans2[] = {435.5, 0., -155.};
1270 pMatrixAbs2->SetTranslation(trans2);
1271 pMatrixAbs2->RotateZ(theta);
1272
1273 gGeoManager->GetVolume("barrel")->AddNode(hmpidabs_cham2, 0, pMatrixAbs2);
1274
1275 TGeoHMatrix* pMatrixAbs4 = new TGeoHMatrix;
1276 const double trans4[] = {435., 0., 155.};
1277 pMatrixAbs4->SetTranslation(trans4);
1278 pMatrixAbs4->RotateZ(theta);
1279
1280 gGeoManager->GetVolume("barrel")->AddNode(hmpidabs_cham4, 0, pMatrixAbs4);
1281
1282 for (Int_t iCh = 0; iCh <= 6; iCh++) { // place 7 chambers
1283 TGeoVolume* hmpid = createChamber(iCh);
1284 TGeoHMatrix* pMatrix = new TGeoHMatrix;
1285 IdealPosition(iCh, pMatrix);
1286 gGeoManager->GetVolume("barrel")->AddNode(hmpid, 0, pMatrix);
1287 if (iCh == 1 || iCh == 3 || iCh == 5) {
1288 TGeoHMatrix* pCradleMatrix = new TGeoHMatrix;
1289 IdealPositionCradle(iCh, pCradleMatrix);
1290 gGeoManager->GetVolume("barrel")->AddNode(hmpcradle, iCh, pCradleMatrix);
1291 }
1292 }
1293 // }
1294 // AliDebug(1,"Stop v3. HMPID option");
1295}
1296
1298{
1299 defineOpticalProperties(); // needs to be called within this hook
1300}
1301
1302//*****************************************************************************************************************
1304{
1305 // AliDebug(1,"");
1306
1307 // Optical properties definition.
1308 const Int_t kNbins = 30; // number of photon energy points
1309 Float_t emin = 5.5, emax = 8.5; // Photon energy range,[eV]
1310 Float_t deltaE = (emax - emin) / kNbins;
1311 Float_t aEckov[kNbins];
1312 Double_t dEckov[kNbins];
1313 Float_t aAbsRad[kNbins], aAbsWin[kNbins], aAbsGap[kNbins], aAbsMet[kNbins];
1314 Float_t aIdxRad[kNbins], aIdxWin[kNbins], aIdxGap[kNbins], aIdxMet[kNbins], aIdxPc[kNbins];
1315 Float_t aQeAll[kNbins], aQePc[kNbins];
1316 Double_t dReflMet[kNbins], dQePc[kNbins];
1317
1318 TF2 pRaIF("HidxRad", "sqrt(1+0.554*(1239.84/x)^2/((1239.84/x)^2-5769)-0.0005*(y-20))", emin, emax, 0,
1319 50); // DiMauro mail temp 0-50 degrees C
1320 TF1 pWiIF("HidxWin", "sqrt(1+46.411/(10.666*10.666-x*x)+228.71/(18.125*18.125-x*x))", emin,
1321 emax); // SiO2 idx TDR p.35
1322 TF1 pGaIF("HidxGap", "1+0.12489e-6/(2.62e-4 - x*x/1239.84/1239.84)", emin, emax); //?????? from where
1323
1324 TF1 pRaAF("HabsRad", "(x<7.8)*(gaus+gaus(3))+(x>=7.8)*0.0001", emin, emax); // fit from DiMauro data 28.10.03
1325 pRaAF.SetParameters(3.20491e16, -0.00917890, 0.742402, 3035.37, 4.81171, 0.626309);
1326 TF1 pWiAF("HabsWin", "(x<8.2)*(818.8638-301.0436*x+36.89642*x*x-1.507555*x*x*x)+(x>=8.2)*0.0001", emin,
1327 emax); // fit from DiMauro data 28.10.03
1328 TF1 pGaAF(
1329 "HabsGap", "(x<7.75)*6512.399+(x>=7.75)*3.90743e-2/(-1.655279e-1+6.307392e-2*x-8.011441e-3*x*x+3.392126e-4*x*x*x)",
1330 emin, emax); //????? from where
1331
1332 TF1 pQeF("Hqe", "0+(x>6.07267)*0.344811*(1-exp(-1.29730*(x-6.07267)))", emin,
1333 emax); // fit from DiMauro data 28.10.03
1334
1335 TString title = GetTitle();
1336 Bool_t isFlatIdx = title.Contains("FlatIdx");
1337
1338 for (Int_t i = 0; i < kNbins; i++) {
1339 Float_t eV = emin + deltaE * i; // Ckov energy in eV
1340 aEckov[i] = 1e-9 * eV; // Ckov energy in GeV
1341 dEckov[i] = aEckov[i];
1342 aAbsRad[i] = pRaAF.Eval(eV);
1343 (isFlatIdx) ? aIdxRad[i] = 1.292 : aIdxRad[i] = pRaIF.Eval(eV, 20);
1344 aAbsWin[i] = pWiAF.Eval(eV);
1345 aIdxWin[i] = pWiIF.Eval(eV);
1346 aAbsGap[i] = pGaAF.Eval(eV);
1347 aIdxGap[i] = pGaIF.Eval(eV);
1348 aQeAll[i] = 1; // QE for all other materials except for PC must be 1.
1349 aAbsMet[i] = 0.0001;
1350 aIdxMet[i] = 0; // metal ref idx must be 0 in order to reflect photon
1351 aIdxPc[i] = 1;
1352 aQePc[i] = pQeF.Eval(eV); // PC ref idx must be 1 in order to apply photon to QE conversion
1353 dQePc[i] = pQeF.Eval(eV);
1354 dReflMet[i] = 0.; // no reflection on the surface of the pc (?)
1355 }
1356 // at this moment, the fMC member doesn't seem to be initialized
1357 // so we fetch from the singleton
1358 auto vmc = TVirtualMC::GetMC();
1359 vmc->SetCerenkov(getMediumID(kC6F14), kNbins, aEckov, aAbsRad, aQeAll, aIdxRad);
1360 vmc->SetCerenkov(getMediumID(kSiO2), kNbins, aEckov, aAbsWin, aQeAll, aIdxWin);
1361 vmc->SetCerenkov(getMediumID(kCH4), kNbins, aEckov, aAbsGap, aQeAll, aIdxGap);
1362 vmc->SetCerenkov(getMediumID(kCu), kNbins, aEckov, aAbsMet, aQeAll, aIdxMet);
1363 vmc->SetCerenkov(getMediumID(kW), kNbins, aEckov, aAbsMet, aQeAll,
1364 aIdxMet); // n=0 means reflect photons
1365 vmc->SetCerenkov(getMediumID(kCsI), kNbins, aEckov, aAbsMet, aQePc,
1366 aIdxPc); // n=1 means convert photons
1367 vmc->SetCerenkov(getMediumID(kAl), kNbins, aEckov, aAbsMet, aQeAll, aIdxMet);
1368
1369 // Define a skin surface for the photocatode to enable 'detection' in G4
1370 for (Int_t i = 0; i < 7; i++) {
1371 vmc->DefineOpSurface(Form("surfPc%i", i), kGlisur /*kUnified*/, kDielectric_metal, kPolished, 0.);
1372 vmc->SetMaterialProperty(Form("surfPc%i", i), "EFFICIENCY", kNbins, dEckov, dQePc);
1373 vmc->SetMaterialProperty(Form("surfPc%i", i), "REFLECTIVITY", kNbins, dEckov, dReflMet);
1374 vmc->SetSkinSurface(Form("skinPc%i", i), Form("Hpad%i", i), Form("surfPc%i", i));
1375 }
1376}
1377
1378} // end namespace hmpid
1379} // end namespace o2
1380
Definition of the Stack class.
int16_t time
Definition RawEventData.h:4
int32_t i
bool const GPUTPCGMMerger::trackCluster * c1
bool const GPUTPCGMMerger::trackCluster const clcomparestruct * c2
ClassImp(o2::hmpid::Detector)
uint32_t j
Definition RawData.h:0
uint16_t pid
Definition RawData.h:2
uint32_t col
Definition RawData.h:4
uint32_t stack
Definition RawData.h:1
std::ostringstream debug
void setTrackID(Int_t track)
Detector()
Default Constructor.
Definition Detector.cxx:36
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 MaterialManager & Instance()
float Fresnel(float ene, float pdoti, Bool_t pola)
Definition Detector.cxx:306
void Register() override
Definition Detector.cxx:364
o2::hmpid::HitType * AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId)
Definition Detector.cxx:178
void InitializeO2Detector() override
Definition Detector.cxx:47
Bool_t IsLostByFresnel()
Definition Detector.cxx:282
bool ProcessHits(FairVolume *v) override
Definition Detector.cxx:70
TGeoVolume * createChamber(int number)
Definition Detector.cxx:551
void ConstructOpGeometry() override
TGeoVolume * CreateCradle()
Definition Detector.cxx:858
void GenFee(float qtot)
Definition Detector.cxx:184
TGeoVolume * createAbsorber(float tickness)
Definition Detector.cxx:541
void IdealPositionCradle(int iCh, TGeoHMatrix *pMatrix)
Definition Detector.cxx:414
TGeoVolume * CradleBaseVolume(TGeoMedium *med, double l[7], const char *name)
void ConstructGeometry() override
void Reset() override
Definition Detector.cxx:366
void IdealPosition(int iCh, TGeoHMatrix *pMatrix)
Definition Detector.cxx:373
void defineOpticalProperties()
void mars2Lors(Int_t c, double *m, double &x, double &y) const
Definition Param.h:199
static Param * instance()
Definition Param.cxx:438
static ShmManager & Instance()
Definition ShmManager.h:61
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLuint const GLchar * name
Definition glcorearb.h:781
GLint GLsizei GLsizei height
Definition glcorearb.h:270
GLint GLsizei width
Definition glcorearb.h:270
GLenum const GLfloat * params
Definition glcorearb.h:272
GLboolean * data
Definition glcorearb.h:298
GLubyte GLubyte GLubyte GLubyte w
Definition glcorearb.h:852
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
VectorOfTObjectPtrs other
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< int > row