1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.7 2000/01/19 17:16:41 fca
19 Introducing a list of lists of hits -- more hits allowed for detector now
21 Revision 1.6 1999/09/29 09:24:07 fca
22 Introduction of the Copyright and cvs Log
26 ///////////////////////////////////////////////////////////////////////////////
29 // This class contains the description of the CASTOR detector //
33 <img src="picts/AliCASTORClass.gif">
36 <font size=+2 color=red>
37 <p>The responsible person for this module is
38 <a href="mailto:aris.angelis@cern.ch">Aris Angelis</a>.
45 ///////////////////////////////////////////////////////////////////////////////
48 #include "AliCASTOR.h"
51 #include "TGeometry.h"
59 //_____________________________________________________________________________
60 AliCASTOR::AliCASTOR()
63 // Default constructor for CASTOR
68 //_____________________________________________________________________________
69 AliCASTOR::AliCASTOR(const char *name, const char *title)
70 : AliDetector(name,title)
73 // Standard constructor for CASTOR
77 // Create a tree of castor hits
78 fHits = new TClonesArray("AliCASTORhit", 405);
79 gAlice->AddHitList(fHits);
88 //_____________________________________________________________________________
89 void AliCASTOR::AddHit(Int_t track, Int_t *vol, Float_t *hits)
94 TClonesArray &lhits = *fHits;
95 new(lhits[fNhits++]) AliCASTORhit(fIshunt,track,vol,hits);
98 //_____________________________________________________________________________
99 void AliCASTOR::BuildGeometry()
102 // Build CASTOR ROOT TNode geometry for event display
105 const int kColorCASTOR = 4;
107 Top=gAlice->GetGeometry()->GetNode("alice");
110 pgon = new TPGON("S_CASTOR","S_CASTOR","void",22.5,360,8,2);
111 pgon->DefineSection(0,-69.05885,2.598121,12.86874);
112 pgon->DefineSection(1,69.05885,2.787778,13.88912);
113 new TRotMatrix("rotcas","rotcas",90,180,90,90,180,0);
116 Node = new TNode("CASTOR","CASTOR","S_CASTOR",0,0,-1809.59,"rotcas");
117 Node->SetLineColor(kColorCASTOR);
121 //_____________________________________________________________________________
122 Int_t AliCASTOR::DistancetoPrimitive(Int_t , Int_t )
128 ClassImp(AliCASTORv1)
130 //_____________________________________________________________________________
131 AliCASTORv1::AliCASTORv1() : AliCASTOR()
134 // Default constructor for CASTOR version 1
147 //_____________________________________________________________________________
148 AliCASTORv1::AliCASTORv1(const char *name, const char *title)
149 : AliCASTOR(name,title)
152 // Standard constructor for CASTOR version 1
165 //_____________________________________________________________________________
166 void AliCASTORv1::CreateGeometry()
169 // Creation of the geometry of the CASTOR detector
173 <img src="picts/AliCASTORTree.gif">
178 <img src="picts/AliCASTOR.gif">
182 // 28 March 1997 23 February 1998 Aris L. S. Angelis *
183 // >--------------------------------------------------------------------<*
186 Float_t dhad[11], dcal[3], beta, doct[11], alfa1, alfa2, fact1, fact2,fact3;
187 Float_t dclha[3], dcoha[3], dclem[3], dbxha[3], dcoem[3], dcalt[5], dcalv[5], dbxem[3];
189 Float_t s1, s2, s3, rxyin, rzlow, rxyut, facemd, facein, dlayha, dlayem, doctem, doctha, faceut, zendha, phicov;
193 Float_t thecen, xp, xxmdhi, zp, yp, rinbeg;
194 Float_t rutbeg, xxinhi, rinend, rutend, xxmdlo;
195 Float_t dztotl, xxinlo, xxuthi;
196 Float_t xxutlo, dem[11], ang;
199 // Angle (deg) of inclination of quartz fibres w.r.t. to beam (Cerenkov angle).
200 const Float_t kBetaD = 45;
201 //Rapidity range covered by the calorimeter.
202 const Float_t kEtaLow = 5.6;
203 const Float_t kEtaHigh = 7.2;
204 // Z position (cm) of beginning of calorimeter EM section (the tip.
205 const Float_t kZbegem = 1740;
206 // Number of azimuthal calorimeter sectors: octants.
208 // Number of e-m and hadronic layers (each layer comprises a slice
209 // of absorber material followed by a slice of active quartz fibres).
210 // DATA NLAYEM,NLAYHA /9,69/ ! 0.64 + 9.73 lambda_i
212 fLayersHad = 72; // 0.57 + 10.15 lambda_i
213 // Number of planes of quartz fibres within each active slice for
214 // e-m and hadronic sections.
215 const Int_t kFibersEM = 2;
216 const Int_t kFibersHad = 4;
217 // Thickness (cm) of absorber material for e-m and hadronic layers.
218 const Float_t kAbsorberEM = 0.5;
219 const Float_t kAbsorberHad = 1;
220 // Diameter (cm) of fibre core and of fibre with cladding.
221 const Float_t kDiamCore = 0.043;
222 const Float_t kDiamCladding = 0.045;
225 static Int_t debugFlag = 0;
227 Int_t *idtmed = fIdtmed->GetArray()-1499;
230 // >--------------------------------------------------------------------<*
231 // **> Note: ALICE frame XYZ, proper ref. frame of a trapezoid X'Y'Z'.
232 // --- Common which contains debug flags for the various detectors ---
233 // --- Also control flags (JPAWF,JOUTF) for each detector added ---
235 // **> Common containing some of the Castor FCAL geometry data.
237 //**> Angle (deg) of inclination of quartz fibres w.r.t. to beam
238 //**> (Cerenkovangle).
239 // **> Rapidity range covered by the calorimeter.
240 // **> Z position (cm) of beginning of calorimeter EM section (the tip.
241 // **> Number of planes of quartz fibres within each active slice for
242 // **> e-m and hadronic sections.
243 // **> Thickness (cm) of absorber material for e-m and hadronic layers.
244 // **> Diameter (cm) of fibre core and of fibre with cladding.
245 // **> E-M and hadronic sections of an octant and complete octant module
246 // **> (general trapezoids).
247 // **> Imaginary box to hold the complete calorimeter.
248 // **> Imaginary rectangular boxes containing the trapezoids of the
249 // **> EM and Hadronic sections of an Octant.
250 // **> Cylindrical volumes for clad fibres and fibre cores in the
251 // **> EM and Had sections.
252 //**> Narrow stainless steel conical beam tube traversing the calorimeter.
253 // **> Print calorimeter parameters.
254 // **> Number of azimuthal calorimeter sectors: octants.
256 // **> Number of e-m and hadronic layers (each layer comprises a slice
257 // **> of absorber material followed by a slice of active quartz fibres).
258 // DATA NLAYEM,NLAYHA /9,69/ ! 0.64 + 9.73 lambda_i
259 // 0.57 + 10.15 lambda_i
261 printf("----------------------------------\n");
262 printf(" EtaLo = %f, EtaHigh = %f, ZbegEM =%f\n",kEtaLow, kEtaHigh,kZbegem);
263 printf(" Nocts =%d, NlayEM=%d, NlayHad = %d\n",fOctants,fLayersEM,fLayersHad);
264 printf("----------------------------------\n");
266 // **> Radius of sensitive fibre core.
267 fRadCore = kDiamCore/2;
268 // **> Radius normalised to radius of 0.5 mm used in the calculation of
269 // **> the Cherenkov tables.
270 fRadFactor = fRadCore / .05;
271 // **> Total number of sensitive QF plane layers.
272 //nqemly = fLayersEM*kFibersEM;
273 //nqhaly = fLayersHad*kFibersHad;
274 beta = kBetaD*kDegrad; // **> Conversions to radians.
275 // **> Thickness of e-m and hadronic layers:
276 // **> Thickness = Thickness_of_Absorber + Thickness_of_N_Fibre_Planes
277 // **> For N pair: Thickness_of_N_Fibre_Planes = N/2 * [2+TMath::Sqrt(3)]*R_fibre
278 // **> taking into account staggering of fibres in adjacent planes.
279 //**> For simplicity staggering not yet introduced, use TMath::Sqrt(4) temporarily.
280 dlayem = kAbsorberEM +(0.5*kFibersEM )*(2+TMath::Sqrt(4.))*kDiamCladding/2;
281 dlayha = kAbsorberHad+(0.5*kFibersHad)*(2+TMath::Sqrt(4.))*kDiamCladding/2;
283 printf(" Layer Thickness. EM = %f, Had = %f\n",dlayem,dlayha);
285 // **> Thickness of complete octant, along the line perpendicular
286 // **> to the layers.
287 // **> Thickness = NlayerEM*DlayerEM + NlayerHad*DlayerHad (DeltaZ').
288 doctem = fLayersEM*dlayem;
289 doctha = fLayersHad*dlayha;
290 doctnt = doctem + doctha;
292 printf(" Octant Thickness. EM = %f, Had = %f, Total = %f\n",doctem,doctha,doctnt);
294 // **> Construct one octant module: general trapezoid, rotated such
295 // **> that the fibre planes are perpenicular to the Z axis of the
296 // **> proper reference frame (X'Y'Z' frame).
297 // **> Calculation of the length of the faces at +/- DeltaZ'/2 of an
298 // **> octant, projected onto the Y'Z' plane (see notes dated 4/4/97).
299 alfa1 = TMath::ATan(exp(-kEtaLow)) * 2.;
300 alfa2 = TMath::ATan(exp(-kEtaHigh)) * 2.;
301 fact1 = (TMath::Tan(alfa1) - TMath::Tan(alfa2)) * TMath::Cos(alfa1) / TMath::Sin(beta - alfa1);
303 printf(" Beta =%f,Fact1 =%f\n",kBetaD, fact1);
304 printf(" EtaLow=%f, EtaHigh=%f, Alfa1=%f, Alfa2=%f\n",kEtaLow,kEtaHigh,alfa1*kRaddeg,alfa2*kRaddeg);
306 // **> Face at entrance to E-M section (-DeltaZ'/2).
307 facein = fact1 * kZbegem;
308 // **> Face at interface from E-M to Hadronic section.
309 facemd = (doctem / TMath::Sin(beta) + kZbegem) * fact1;
310 // **> Face at exit of Hadronic section (+DeltaZ'/2).
311 faceut = (doctnt / TMath::Sin(beta) + kZbegem) * fact1;
313 printf(" Octant Face Length. Front: %f, Back: %f, EM-Had: %f\n",facein,faceut,facemd);
315 // **> Angular coverage of octant (360./8) projected onto plane
316 // **> tilted at angle Beta (see notes dated 28/3/97).
317 //**> PhiTilted = 2*atan[TMath::Tan(phi/2)TMath::Cos(beta)] = 32.65 deg for beta=45,phi=22.5.
318 fPhiOct = k2PI / fOctants;
319 phicov = TMath::ATan(TMath::Tan(fPhiOct / 2.) * TMath::Cos(beta)) * 2.;
321 printf(" FPhiOct =%f, PhiCov =%f\n",fPhiOct * kRaddeg,phicov * kRaddeg);
323 // **> Dimensions along X' of front and back faces of calorimeter
324 // **> (see notes dated 8/4/97).
325 fact2 = TMath::Tan(alfa2) / TMath::Sin(beta);
326 fact3 = TMath::Cos(alfa2) / TMath::Sin(beta - alfa2);
327 zendha = doctnt * fact3 + kZbegem;
328 zemhad = doctem * fact3 + kZbegem;
330 printf(" ZbegEM =%f, ZendHA =%f, ZEMHad =%f\n",kZbegem,zendha, zemhad);
331 printf(" Fact2 =%f, Fact3 =%f\n",fact2,fact3);
333 // **> DeltaX' at -DeltaY'/2, -DeltaZ'/2.
334 xxinlo = fact2 * 2*kZbegem * TMath::Tan(phicov / 2.);
335 // **> DeltaX' at +DeltaY'/2, -DeltaZ'/2.
336 xxinhi = (fact2 + fact1) * 2*kZbegem * TMath::Tan(phicov / 2.);
337 // **> DeltaX' at -DeltaY'/2, +DeltaZ'/2.
338 xxutlo = zendha * 2. * fact2 * TMath::Tan(phicov / 2.);
339 // **> DeltaX' at +DeltaY'/2, +DeltaZ'/2.
340 xxuthi = zendha * 2. * (fact2 + fact1) * TMath::Tan(phicov / 2.);
341 // **> DeltaX' at -DeltaY'/2, at EM/Had interface.
342 xxmdlo = zemhad * 2. * fact2 * TMath::Tan(phicov / 2.);
343 // **> DeltaX' at +DeltaY'/2, at EM/Had interface.
344 xxmdhi = zemhad * 2. * (fact2 + fact1) * TMath::Tan(phicov / 2.);
346 printf(" XXinLo=%f, XXinHi=%f, XXutLo=%f, XXutHi=%f, XXmdLo=%f, XXmdHi=%f\n",
347 xxinlo,xxinhi,xxutlo,xxuthi,xxmdlo,xxmdhi);
349 //**> Calculate the polar angle in the X'Y'Z' frame of the line joining the
350 //**> centres of the front and back faces of the octant (see notes dated 9/4/97).
351 s1 = (1. - fact2 * TMath::Cos(beta)) * kZbegem;
352 s2 = (fact2 + fact1 / 2.) * kZbegem;
353 s3 = TMath::Sqrt(s1 * s1 + s2 * s2 - s1 * s2 * TMath::Cos(kPI - beta));
354 ang = TMath::ASin(sin(kPI - beta) * s2 / s3);
355 thecen = kPI/2 - beta + ang;
357 printf(" S1=%f, S2=%f, S3=%f, Ang=%f, TheCen=%f\n",s1,s2,s3,ang*kRaddeg,thecen*kRaddeg);
359 // **> Construct the octant volume.
364 doct[4] = -(zendha - kZbegem + faceut * TMath::Cos(beta)) / 2.;
365 doct[5] = TMath::Tan(alfa2) * kZbegem;
366 doct[6] = TMath::Tan(alfa1) * kZbegem;
367 doct[7] = (zendha - kZbegem + faceut * TMath::Cos(beta)) / 2.;
368 doct[8] = zendha * TMath::Tan(alfa2);
369 doct[9] = (faceut + zendha * fact2) * TMath::Sin(beta);
372 printf("\n Doct(1-10) = ");
373 for (i = 1; i <= 10; ++i) {
374 printf("%f, ",doct[i - 1]);
378 gMC->Gsvolu("OCTA", "PGON", idtmed[fOdAbsorber - 1], doct, 10);
379 gMC->Gsdvn("OCT ", "OCTA", 8, 2);
380 // absorber material.
381 // **> Construct the E-M section volume.
382 dem[0] = doctem / 2.; // DeltaZ'/2
383 dem[1] = thecen *kRaddeg; // Theta[(Centre(-DeltaZ')--Centre(+DeltaZ'
384 dem[2] = 90.; // Phi[(Centre(-DeltaZ')--Centre(+DeltaZ')]
385 dem[3] = facein / 2.; // DeltaY'/2 at -DeltaZ'/2.
386 dem[4] = xxinlo / 2.; // DeltaX'/2 at -DeltaY'/2 at -DeltaZ'/2.
387 dem[5] = xxinhi / 2.; // DeltaX'/2 at +DeltaY'/2 at -DeltaZ'/2.
388 dem[6] = 0.; // Angle w.r.t. Y axis of line joining cent
389 // at +/- DeltaY at -DeltaZ. // Angle w.r.t. Y axis of line joining cent
390 dem[7] = facemd / 2.; // DeltaY'/2 at +DeltaZ'.
391 dem[8] = xxmdlo / 2.; // DeltaX'/2 at -DeltaY'/2 at +DeltaZ'/2.
392 dem[9] = xxmdhi / 2.; // DeltaX'/2 at +DeltaY'/2 at +DeltaZ'/2.
393 dem[10] = 0.; // Angle w.r.t. Y axis of line joining cent
394 // at +/- DeltaY at +DeltaZ.
397 printf("\n De-m(1-11) =");
398 for (i = 1; i <= 11; ++i) {
399 printf("%f, ",dem[i - 1]);
403 gMC->Gsvolu("EM ", "TRAP", idtmed[fOdAbsorber - 1], dem, 11);
404 // absorber material.
405 // **> Construct the Hadronic section volume.
407 dhad[0] = doctha / 2.; // DeltaZ'/2
408 dhad[1] = thecen *kRaddeg; // Theta[(Centre(-DeltaZ')--Centre(+DeltaZ'
409 dhad[2] = 90.; // Phi[(Centre(-DeltaZ')--Centre(+DeltaZ')]
410 dhad[3] = facemd / 2.; // DeltaY'/2 at -DeltaZ'/2.
411 dhad[4] = xxmdlo / 2.; // DeltaX'/2 at -DeltaY'/2 at -DeltaZ'/2.
412 dhad[5] = xxmdhi / 2.; // DeltaX'/2 at +DeltaY'/2 at -DeltaZ'/2.
413 dhad[6] = 0.; // Angle w.r.t. Y axis of line joining cent
414 // at +/- DeltaY at -DeltaZ.
415 dhad[7] = faceut / 2.; // DeltaY'/2 at +DeltaZ'.
416 dhad[8] = xxutlo / 2.; // DeltaX'/2 at -DeltaY'/2 at +DeltaZ'/2.
417 dhad[9] = xxuthi / 2.; // DeltaX'/2 at +DeltaY'/2 at +DeltaZ'/2.
418 dhad[10] = 0.; // Angle w.r.t. Y axis of line joining cent
419 // at +/- DeltaY at +DeltaZ.
422 printf("\n Dhad(1-11) = ");
423 for (i = 1; i <= 11; ++i) {
424 printf("%f, ",dhad[i - 1]);
428 gMC->Gsvolu("HAD ", "TRAP", idtmed[fOdAbsorber - 1], dhad, 11); // absorber material.
429 // **> Rotation matrix to rotate fibres verticaly to fit into holes.
431 AliMatrix(idrotm[0], 90., 0., 180., 0., 90., 90.);
432 // **> Internal structure of the EM section starts here. <---
433 // **> Construct one sampling module
434 gMC->Gsdvn("SLEM", "EM ", fLayersEM, 3);
435 gMC->Gsatt("SLEM", "SEEN", 0);
436 // **> Construct the (imaginary) rectangular box embedding the fibres
437 // **> Fill with air, make it invisible on the drawings.
438 dbxem[0] = xxmdhi / 2.;
439 dbxem[2] = kFibersEM*kDiamCladding/2;
440 dbxem[1] = facemd / 2. + dbxem[2] * TMath::Tan(thecen);
442 printf(" DbxEM(1-3) =");
443 for (i = 1; i <= 3; ++i) {
444 printf("%f, ",dbxem[i - 1]);
448 gMC->Gsvolu("BXEM", "BOX ", idtmed[1501], dbxem, 3);
449 gMC->Gsatt("BXEM", "SEEN", 0);
450 // **> Divide along Z to obtain one layer
451 gMC->Gsdvn("RWEM", "BXEM", 2, 3);
452 gMC->Gsatt("RWEM", "SEEN", 0);
453 // **> Divide along X' to accomodate the maximum number of individual
454 //**> fibres packed along X', make the divisions invisible on the drawings.
455 nfx = Int_t(xxmdhi / .045);
457 printf(" NfxEM = %d\n",nfx);
459 gMC->Gsdvn("FXEM", "RWEM", nfx, 1);
460 gMC->Gsatt("FXEM", "SEEN", 0);
461 // **> Construct the fiber cladding
463 dclem[1] = kDiamCladding/2;
466 printf(" DclEM(1-3) = \n");
467 for (i = 1; i <= 3; ++i) {
468 printf("%f, ",dclem[i - 1]);
472 gMC->Gsvolu("CLEM", "TUBE", idtmed[fOdCladding - 1], dclem,3);
473 gMC->Gsatt("CLEM", "SEEN", 0);
474 //**> Construct the cylindrical volume for a fibre core in the EM section.
475 //**> Fill with selected fibre material, make it invisible on the drawings.
477 dcoem[1] = kDiamCore/2;
480 printf(" DcoEM(1-3) = ");
481 for (i = 1; i <= 3; ++i) {
482 printf("%f, ",dcoem[i - 1]);
486 gMC->Gsvolu("COEM", "TUBE", idtmed[fOdFiber - 1], dcoem,3);
487 gMC->Gsatt("COEM", "SEEN", 0);
488 // **> Position the volumes
489 // **> Put the air section inside one sampling module
490 // **> Use MANY to obtain clipping of protruding edges.
492 zp = dlayem / 2. - 0.5*kFibersEM*kDiamCladding;
493 yp = zp * TMath::Tan(thecen);
494 gMC->Gspos("BXEM", 1, "SLEM", xp, yp, zp, 0, "MANY");
495 // **> Place the core fibre in the clad
499 gMC->Gspos("COEM", 1, "CLEM", xp, yp, zp, 0, "MANY");
500 // **> Put the fiber in its air box
501 gMC->Gspos("CLEM", 1, "FXEM", xp, yp, zp, idrotm[0], "MANY");
502 // **> Internal structure of the Hadronic section starts here. <---
503 gMC->Gsdvn("SLHA", "HAD ", fLayersHad, 3);
504 gMC->Gsatt("SLHA", "SEEN", 0);
505 // **> Construct the air section where the fibers are
506 dhad[0] = 0.5*kFibersEM*kDiamCladding;
507 gMC->Gsvolu("AIHA", "TRAP", idtmed[1501], dhad, 11);
508 // **> Divide along z in the appropriate number of layers
509 gMC->Gsdvn("SAHA", "AIHA", 4, 3);
510 //**> Construct the (imaginary) rectangular box embedding one lauer of fibres
511 // **> Fill with air, make it invisible on the drawings.
512 dbxha[0] = xxuthi / 2.;
513 dbxha[2] = 0.5*kFibersHad*kDiamCladding;
514 dbxha[1] = faceut / 2. + dbxha[2] * TMath::Tan(thecen);
516 printf(" DbxHa(1-3) = ");
517 for (i = 1; i <= 3; ++i) {
518 printf("%f, ",dbxem[i - 1]);
522 gMC->Gsvolu("BXHA", "BOX ", idtmed[1501], dbxha, 3);
523 gMC->Gsatt("BXHA", "SEEN", 0);
524 // **> Divide along Z to obtain one layer
525 gMC->Gsdvn("RWHA", "BXHA", 4, 3);
526 gMC->Gsatt("RWHA", "SEEN", 0);
527 // **> Divide along X' to accomodate the maximum number of individual
528 //**> fibres packed along X', make the divisions invisible on the drawings.
529 nfx = Int_t(xxuthi / .045);
531 printf(" NfxHad = %d\n",nfx);
533 gMC->Gsdvn("FXHA", "RWHA", nfx, 1);
534 gMC->Gsatt("FXHA", "SEEN", 0);
535 // **> Construct one fiber cladding
537 dclha[1] = 0.5*kDiamCladding;
540 printf(" DclHa(1-3) = ");
541 for (i = 1; i <= 3; ++i) {
542 printf("%f, ",dclha[i - 1]);
546 gMC->Gsvolu("CLHA", "TUBE", idtmed[fOdCladding - 1], dclha,3);
547 gMC->Gsatt("CLHA", "SEEN", 0);
548 //**> Construct the cylindrical volume for a fibre core in the Had section.
549 //**> Fill with selected fibre material, make it invisible on the drawings.
551 dcoha[1] = 0.5*kDiamCore;
554 printf(" DcoHa(1-3) = ");
555 for (i = 1; i <= 3; ++i) {
556 printf("%f, ",dcoha[i - 1]);
560 gMC->Gsvolu("COHA", "TUBE", idtmed[fOdFiber - 1], dcoha,3);
561 gMC->Gsatt("COHA", "SEEN", 0);
562 // **> Position the volumes
563 // **> Put the air section inside one sampling module
564 // **> Use MANY to obtain clipping of protruding edges.
566 zp = dlayha / 2. - 0.5*kFibersHad*kDiamCladding;
567 yp = zp * TMath::Tan(thecen);
568 gMC->Gspos("BXHA", 1, "SLHA", xp, yp, zp, 0, "MANY");
569 // **> Place the core fibre in the clad
573 gMC->Gspos("COHA", 1, "CLHA", xp, yp, zp, 0, "MANY");
574 // **> Place the fibre in its air box
575 gMC->Gspos("CLHA", 1, "FXHA", xp, yp, zp, idrotm[0], "MANY");
576 // **> Rotation matrices for consecutive calorimeter octants
577 // **> filling the imaginary box.
578 AliMatrix(idrotm[1], 90., -90., 45., 0., 45., 180.);
579 // **> Place the EM and Hadronic sections inside the Octant.
580 rzlow = (doct[5] + doct[6]) * .5;
581 rzhig = (doct[8] + doct[9]) * .5;
582 zp = doct[7] - (faceut * TMath::Cos(beta) + doctha * fact3) * .5;
584 xp = rzlow + (rzhig - rzlow) * .5 * (zp - doct[4]) / doct[7];
585 gMC->Gspos("HAD ", 1, "OCT ", xp, yp, zp, idrotm[1], "ONLY");
587 zp = doct[7] - faceut * TMath::Cos(beta) * .5 - doctha * fact3 - doctem * fact3 * .5;
588 xp = rzlow + (rzhig - rzlow) * .5 * (zp - doct[4]) / doct[7];
589 gMC->Gspos("EM ", 1, "OCT ", xp, yp, zp, idrotm[1], "ONLY");
590 // **> An imaginary box to hold the complete calorimeter.
591 dcal[0] = (faceut + zendha * fact2) * TMath::Sin(beta);
593 dcal[2] = (zendha - kZbegem + faceut * TMath::Cos(beta)) / 2.;
595 printf(" Dcal(1-3) = ");
596 for (i = 1; i <= 3; ++i) {
597 printf("%f, ",dcal[i - 1]);
601 gMC->Gsvolu("CAL ", "BOX ", idtmed[1501], dcal, 3);
603 rinbeg = TMath::Tan(alfa2) * kZbegem;
604 rutbeg = TMath::Tan(alfa1) * kZbegem;
605 dztotl = dcal[2] * 2.;
606 rinend = (dztotl + kZbegem) * TMath::Tan(alfa2);
607 rutend = (dztotl + kZbegem) * TMath::Tan(alfa1);
609 printf(" RinBeg=%f, RoutBeg=%f\n",rinbeg,rutbeg);
610 printf(" RinEnd=%f, RoutEnd=%f\n",rinend,rutend);
611 printf(" DeltaZtotal = %f\n",dztotl);
613 // **> Build the calorimeter inside the imaginary box.
614 rxyin = (fact2 + fact1 / 2.) * kZbegem; // Radius to centre of octant in X'Y'
615 // plane at calorimeter entrance.
616 rxyut = zendha * (fact2 + fact1 / 2.); // Radius to centre of octant in X'Y'
617 // plane at calorimeter exit.
618 rxy = (rxyin + rxyut) / 2.; // Radius to geometrical centre of octant in
619 rxy *= TMath::Sin(beta); // projected to the XY plane.
623 gMC->Gspos("OCTA", 1, "CAL ", 0., 0., 0., 0, "ONLY");
624 //**> Construct the narrow stainless steel conical beam tube traversing the
625 // **> calorimeter and its vacuum filling: WallThickness = 0.1 cm,
626 // **> Router = touching the inner side of the calorimeter,
627 // **> DeltaZ = all through the calorimeter box.
629 dcalt[2] = TMath::Tan(alfa2) * kZbegem;
630 dcalt[1] = dcalt[2] - .1 / TMath::Cos(alfa2);
631 dcalt[4] = (dcalt[0] * 2. + kZbegem) * TMath::Tan(alfa2);
632 dcalt[3] = dcalt[4] - .1 / TMath::Cos(alfa2);
638 gMC->Gsvolu("CALT", "CONE", idtmed[1506], dcalt, 5);
640 gMC->Gsvolu("CALV", "CONE", idtmed[1500], dcalv, 5);
642 gMC->Gsatt("CALV", "SEEN", 0);
643 // **> Position at centre of calorimeter box.
645 gMC->Gspos("CALT", 1, "CAL ", 0., 0., zp, 0, "ONLY");
646 gMC->Gspos("CALV", 1, "CAL ", 0., 0., zp, 0, "ONLY");
648 printf(" Dcalt,Zp,-/+ = ");
649 for (i = 1; i <= 5; ++i) {
650 printf("%f, ",dcalt[i - 1]);
652 printf("%f, %f, %f\n",zp, zp - dcalt[0], zp + dcalt[0]);
653 printf(" Dcalt,Zp,-/+ = ");
654 for (i = 1; i <= 5; ++i) {
655 printf("%f, ",dcalt[i - 1]);
657 printf("%f, %f, %f\n",zp, zp - dcalt[0], zp + dcalt[0]);
659 // **> Rotate the imaginary box carrying the calorimeter and place it
660 // **> in the ALICE volume on the -Z side.
663 zp = dcal[2] + kZbegem;
664 AliMatrix(idrotm[2], 90., 180., 90., 90., 180., 0.);
665 // -X theta and phi w.r.t. to box XYZ.
666 // Y theta and phi w.r.t. to box XYZ.
667 // -Z theta and phi w.r.t. to box XYZ.
668 gMC->Gspos("CAL ", 1, "ALIC", xp, yp, -zp, idrotm[2], "ONLY");
670 printf(" Dcal,Zp,-/+ = ");
671 for (i = 1; i <= 3; ++i) {
672 printf("%f, ",dcal[i - 1]);
674 printf("%f, %f, %f\n",zp, zp - dcal[2], zp + dcal[2]);
678 //_____________________________________________________________________________
679 void AliCASTORv1::DrawModule()
682 // Draw a shaded view of CASTOR version 1
686 gMC->Gsatt("*", "seen", -1);
687 gMC->Gsatt("alic", "seen", 0);
689 // Set visibility of elements
690 gMC->Gsatt("OCTA","seen",0);
691 gMC->Gsatt("EM ","seen",0);
692 gMC->Gsatt("HAD ","seen",0);
693 gMC->Gsatt("CAL ","seen",0);
694 gMC->Gsatt("CALT","seen",1);
695 gMC->Gsatt("OCT ","seen",0);
696 gMC->Gsatt("SLEM","seen",1);
697 gMC->Gsatt("SLHA","seen",1);
698 gMC->Gsatt("SAHA","seen",1);
700 gMC->Gdopt("hide", "on");
701 gMC->Gdopt("shad", "on");
702 gMC->Gsatt("*", "fill", 7);
703 gMC->SetClipBox(".");
704 gMC->SetClipBox("*", 0, 20, -20, 20, -1900, -1700);
706 gMC->Gdraw("alic", 40, 30, 0, -191.5, -78, .19, .19);
707 gMC->Gdhead(1111, "CASTOR Version 1");
708 gMC->Gdman(15,-2, "MAN");
709 gMC->Gdopt("hide", "off");
712 //_____________________________________________________________________________
713 void AliCASTORv1::CreateMaterials()
716 // Create materials for CASTOR version 1
718 // 30 March 1997 27 November 1997 Aris L. S. Angelis *
719 // >--------------------------------------------------------------------<*
720 Int_t ISXFLD = gAlice->Field()->Integ();
721 Float_t SXMGMX = gAlice->Field()->Max();
723 Int_t *idtmed = fIdtmed->GetArray()-1499;
725 Float_t cute, ubuf[1], cutg, epsil, awmix[3], dwmix, stmin;
727 Float_t wwmix[3], zwmix[3], aq[2], dq, zq[2], wq[2];
728 Float_t tmaxfd, stemax, deemax;
732 // **> Quartz and Wmixture.
733 // **> UBUF is the value of r0, used for calculation of the radii of
734 // **> the nuclei and the Woods-Saxon potential.
736 AliMaterial(1, "Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf, 1);
738 AliMaterial(2, "Air $", 14.61, 7.3, .001205, 30420., 67500., ubuf, 1);
739 //**> Quartz (SiO2) and fluorinated (?) quartz for cladding (insensitive).
747 AliMixture(3, "Quartz$", aq, zq, dq, -2, wq);
748 // After a call with ratios by number (negative number of elements),
749 // the ratio array is changed to the ratio by weight, so all successive
750 // calls with the same array must specify the number of elements as
752 AliMixture(4, "FQuartz$", aq, zq, dq, 2, wq);
753 // **> W mixture (90% W + 7.5% Ni + 2.5% Cu).
764 // **> (Pure W and W mixture are given the same material number
765 // **> so that they can be used interchangeably).
767 AliMixture(5, "W Mix $", awmix, zwmix, dwmix, 3, wwmix);
770 AliMaterial(6, "Pb208 $", 207.19, 82., 11.35, .56, 18.5, ubuf, 1);
773 AliMaterial(7, "Fe56 $", 55.85, 26., 7.87, 1.76, 16.7, ubuf, 1);
776 AliMaterial(8, "Cu63 $", 63.54, 29., 8.96, 1.43, 15., ubuf, 1);
777 // **> Debug Printout.
778 // CALL GPRINT('MATE',0)
779 // **> (Negative values for automatic calculation in case of AUTO=0).
780 isvol = 0; // Sensitive volume flag.
781 tmaxfd = .1; // Max allowed angular deviation in 1 step due to field
782 stemax = -.5; // Maximum permitted step size (cm).
783 deemax = -.2; // Maximum permitted fractional energy loss.
784 epsil = .01; // Boundary crossing precision (cm).
785 stmin = -.1; // Minimum permitted step size inside absorber (cm).
786 AliMedium(1, "Vacuum$", 1, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
787 AliMedium(2, "Air $", 2, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
789 // **> Options for Cherenkov fibres and cladding.
790 isvol = 1; // Declare fibre core as sensitive.
791 AliMedium(3, "Quartz$", 3, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
792 isvol = 0; // Declare fibre cladding as not sensitive.
793 AliMedium(4, "FQuartz$", 4, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
795 // **> Options for absorber material (not sensitive).
796 isvol = 0; // Sensitive volume flag.
797 stemax = .5; // Maximum permitted step size (cm).
798 deemax = .5; // Maximum permitted fractional energy loss.
799 stmin = .1; // Minimum permitted step size inside absorber (cm).
800 AliMedium(5, "W Mix $", 5, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
801 AliMedium(6, "Pb208 $", 6, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
802 AliMedium(7, "Fe56 $ ", 7, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
803 AliMedium(8, "Cu63 $ ", 8, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
805 // **> Select material for the Cherenkov fibres.
807 // CALL GPTMED(IDTMED(KODFBR))
808 // **> Select material for the fibre cladding.
811 // CALL GPTMED(IDTMED(KODCLD))
812 // **> Select absorber material.
814 fOdAbsorber = 1505; // W184/Mix
815 // KODABS=1506 ! Pb208.
816 // KODABS=1507 ! Fe56.
817 // KODABS=1508 ! Cu63.
818 // CALL GPTMED(IDTMED(KODABS))
819 // **> Set by default all interactions and decays explicitly ON
820 // **> and redefine the kinetic energy cutoffs:
821 // CUTE=0.0031 ! Allow beta >= 0.99 only.
822 cute = 7e-4; // Allow beta >= 0.67 only.
825 // **> Inside the absorber material,
826 for (kod = 1505; kod <= 1508; ++kod) {
827 Int_t absorber = idtmed[kod - 1];
828 gMC->Gstpar(absorber, "CUTELE", cute); // Allow beta >= 0.xx
829 gMC->Gstpar(absorber, "CUTGAM", cutg); // = 1.33 cutele.
830 gMC->Gstpar(absorber, "CUTNEU", .01); // Default.
831 gMC->Gstpar(absorber, "CUTHAD", .01); // Default.
832 gMC->Gstpar(absorber, "CUTMUO", .01); // Default.
833 gMC->Gstpar(absorber, "BCUTE", cutg); // = cutgam.
834 gMC->Gstpar(absorber, "BCUTM", cutg); // = cutgam.
835 gMC->Gstpar(absorber, "DCUTE", cute); // = cutele.
836 gMC->Gstpar(absorber, "DCUTM", cute); // = cutele.
837 gMC->Gstpar(absorber, "PPCUTM", cutg); // = 1.33 cutele.
838 gMC->Gstpar(absorber, "DCAY", 1.);
839 gMC->Gstpar(absorber, "MULS", 1.);
840 gMC->Gstpar(absorber, "PFIS", 1.);
841 gMC->Gstpar(absorber, "MUNU", 1.);
842 gMC->Gstpar(absorber, "LOSS", 1.);
843 gMC->Gstpar(absorber, "PHOT", 1.);
844 gMC->Gstpar(absorber, "COMP", 1.);
845 gMC->Gstpar(absorber, "PAIR", 1.);
846 gMC->Gstpar(absorber, "BREM", 1.);
847 gMC->Gstpar(absorber, "RAYL", 1.);
848 gMC->Gstpar(absorber, "DRAY", 1.);
849 gMC->Gstpar(absorber, "ANNI", 1.);
850 gMC->Gstpar(absorber, "HADR", 1.);
851 gMC->Gstpar(absorber, "LABS", 1.);
853 // **> Inside the cladding,
854 Int_t cladding = idtmed[fOdCladding - 1];
855 gMC->Gstpar(cladding, "CUTELE", cute); // Allow beta >= 0.xx
856 gMC->Gstpar(cladding, "CUTGAM", cutg); // = 1.33 cutele.
857 gMC->Gstpar(cladding, "CUTNEU", .01); // Default.
858 gMC->Gstpar(cladding, "CUTHAD", .01); // Default.
859 gMC->Gstpar(cladding, "CUTMUO", .01); // Default.
860 gMC->Gstpar(cladding, "BCUTE", cutg); // = cutgam.
861 gMC->Gstpar(cladding, "BCUTM", cutg); // = cutgam.
862 gMC->Gstpar(cladding, "DCUTE", cute); // = cutele.
863 gMC->Gstpar(cladding, "DCUTM", cute); // = cutele.
864 gMC->Gstpar(cladding, "PPCUTM", cutg); // = 1.33 cutele.
865 gMC->Gstpar(cladding, "DCAY", 1.);
866 gMC->Gstpar(cladding, "MULS", 1.);
867 gMC->Gstpar(cladding, "PFIS", 1.);
868 gMC->Gstpar(cladding, "MUNU", 1.);
869 gMC->Gstpar(cladding, "LOSS", 1.);
870 gMC->Gstpar(cladding, "PHOT", 1.);
871 gMC->Gstpar(cladding, "COMP", 1.);
872 gMC->Gstpar(cladding, "PAIR", 1.);
873 gMC->Gstpar(cladding, "BREM", 1.);
874 gMC->Gstpar(cladding, "RAYL", 1.);
875 gMC->Gstpar(cladding, "DRAY", 1.);
876 gMC->Gstpar(cladding, "ANNI", 1.);
877 gMC->Gstpar(cladding, "HADR", 1.);
878 gMC->Gstpar(cladding, "LABS", 1.);
880 // **> and Inside the Cherenkov fibres,
881 Int_t fiber = idtmed[fOdFiber - 1];
882 gMC->Gstpar(fiber, "CUTELE", cute); // Allow beta >= 0.xx
883 gMC->Gstpar(fiber, "CUTGAM", cutg); // = 1.33 cutele.
884 gMC->Gstpar(fiber, "CUTNEU", .01); // Default.
885 gMC->Gstpar(fiber, "CUTHAD", .01); // Default.
886 gMC->Gstpar(fiber, "CUTMUO", .01); // Default.
887 gMC->Gstpar(fiber, "BCUTE", cutg); // = cutgam.
888 gMC->Gstpar(fiber, "BCUTM", cutg); // = cutgam.
889 gMC->Gstpar(fiber, "DCUTE", cute); // = cutele.
890 gMC->Gstpar(fiber, "DCUTM", cute); // = cutele.
891 gMC->Gstpar(fiber, "PPCUTM", cutg); // = 1.33 cutele.
892 gMC->Gstpar(fiber, "DCAY", 1.);
893 gMC->Gstpar(fiber, "MULS", 1.);
894 gMC->Gstpar(fiber, "PFIS", 1.);
895 gMC->Gstpar(fiber, "MUNU", 1.);
896 gMC->Gstpar(fiber, "LOSS", 1.);
897 gMC->Gstpar(fiber, "PHOT", 1.);
898 gMC->Gstpar(fiber, "COMP", 1.);
899 gMC->Gstpar(fiber, "PAIR", 1.);
900 gMC->Gstpar(fiber, "BREM", 1.);
901 gMC->Gstpar(fiber, "RAYL", 1.);
902 gMC->Gstpar(fiber, "DRAY", 1.);
903 gMC->Gstpar(fiber, "ANNI", 1.);
904 gMC->Gstpar(fiber, "HADR", 1.);
905 gMC->Gstpar(fiber, "LABS", 1.);
908 //_____________________________________________________________________________
909 void AliCASTORv1::StepManager()
912 // Called at every step in CASTOR
916 //_____________________________________________________________________________
917 void AliCASTORv1::Init()
920 // Initialise CASTOR detector after it has been built
925 for(i=0;i<35;i++) printf("*");
926 printf(" CASTOR_INIT ");
927 for(i=0;i<35;i++) printf("*");
930 // Here the ABSO initialisation code (if any!)
931 for(i=0;i<80;i++) printf("*");
935 ClassImp(AliCASTORhit)
937 //_____________________________________________________________________________
938 AliCASTORhit::AliCASTORhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
942 // Store a CASTOR hit