]> git.uio.no Git - u/mrichter/AliRoot.git/blob - CASTOR/AliCASTOR.cxx
correct access to digits in SetBit()
[u/mrichter/AliRoot.git] / CASTOR / AliCASTOR.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /*
17 $Log$
18 Revision 1.8  2000/10/02 21:28:05  fca
19 Removal of useless dependecies via forward declarations
20
21 Revision 1.7  2000/01/19 17:16:41  fca
22 Introducing a list of lists of hits -- more hits allowed for detector now
23
24 Revision 1.6  1999/09/29 09:24:07  fca
25 Introduction of the Copyright and cvs Log
26
27 */
28
29 ///////////////////////////////////////////////////////////////////////////////
30 //                                                                           //
31 //  CASTOR                                                                   //
32 //  This class contains the description of the CASTOR detector               //
33 //                                                                           //
34 //Begin_Html
35 /*
36 <img src="picts/AliCASTORClass.gif">
37 </pre>
38 <br clear=left>
39 <font size=+2 color=red>
40 <p>The responsible person for this module is
41 <a href="mailto:aris.angelis@cern.ch">Aris Angelis</a>.
42 </font>
43 <pre>
44 */
45 //End_Html
46 //                                                                           //
47 //                                                                           //
48 ///////////////////////////////////////////////////////////////////////////////
49
50
51 #include "AliCASTOR.h"
52 #include <TNode.h>
53 #include <TPGON.h>
54 #include "TGeometry.h"
55 #include "AliMagF.h"
56 #include "AliRun.h"
57 #include "AliMC.h"
58 #include "AliConst.h"
59 #include "TMath.h"
60 static const Double_t kPI=TMath::Pi();
61
62 ClassImp(AliCASTOR)
63  
64 //_____________________________________________________________________________
65 AliCASTOR::AliCASTOR()
66 {
67   //
68   // Default constructor for CASTOR
69   //
70   fIshunt   = 0;
71 }
72  
73 //_____________________________________________________________________________
74 AliCASTOR::AliCASTOR(const char *name, const char *title)
75        : AliDetector(name,title)
76 {
77   //
78   // Standard constructor for CASTOR
79   //
80
81   //
82   // Create a tree of castor hits
83   fHits   = new TClonesArray("AliCASTORhit",  405);
84   gAlice->AddHitList(fHits);
85   
86   fIshunt     =  0;
87    
88   SetMarkerColor(7);
89   SetMarkerStyle(2);
90   SetMarkerSize(0.4);
91 }
92  
93 //_____________________________________________________________________________
94 void AliCASTOR::AddHit(Int_t track, Int_t *vol, Float_t *hits)
95 {
96   //
97   // Add a CASTOR hit
98   //
99   TClonesArray &lhits = *fHits;
100   new(lhits[fNhits++]) AliCASTORhit(fIshunt,track,vol,hits);
101 }
102
103 //_____________________________________________________________________________
104 void AliCASTOR::BuildGeometry()
105 {
106   //
107   // Build CASTOR ROOT TNode geometry for event display
108   TNode *Node, *Top;
109   TPGON *pgon;
110   const int kColorCASTOR  = 4;
111   //
112   Top=gAlice->GetGeometry()->GetNode("alice");
113   
114   // CASTOR
115   pgon = new TPGON("S_CASTOR","S_CASTOR","void",22.5,360,8,2);
116   pgon->DefineSection(0,-69.05885,2.598121,12.86874);
117   pgon->DefineSection(1,69.05885,2.787778,13.88912);
118   new TRotMatrix("rotcas","rotcas",90,180,90,90,180,0);
119
120   Top->cd();
121   Node = new TNode("CASTOR","CASTOR","S_CASTOR",0,0,-1809.59,"rotcas");
122   Node->SetLineColor(kColorCASTOR);
123   fNodes->Add(Node);
124 }
125
126 //_____________________________________________________________________________
127 Int_t AliCASTOR::DistancetoPrimitive(Int_t , Int_t )
128 {
129    return 9999;
130 }
131  
132  
133 ClassImp(AliCASTORv1)
134  
135 //_____________________________________________________________________________
136 AliCASTORv1::AliCASTORv1() : AliCASTOR()
137 {
138   //
139   // Default constructor for CASTOR version 1
140   //
141   fOdFiber = 0;
142   fOdCladding = 0;
143   fOdAbsorber = 0;
144   fOctants = 0;
145   fLayersEM = 0;
146   fLayersHad = 0;
147   fPhiOct = 0;
148   fRadCore = 0;
149   fRadFactor = 0;
150 }
151  
152 //_____________________________________________________________________________
153 AliCASTORv1::AliCASTORv1(const char *name, const char *title)
154        : AliCASTOR(name,title)
155 {
156   //
157   // Standard constructor for CASTOR version 1
158   //
159   fOdFiber = 0;
160   fOdCladding = 0;
161   fOdAbsorber = 0;
162   fOctants = 0;
163   fLayersEM = 0;
164   fLayersHad = 0;
165   fPhiOct = 0;
166   fRadCore = 0;
167   fRadFactor = 0;
168 }
169  
170 //_____________________________________________________________________________
171 void AliCASTORv1::CreateGeometry()
172 {
173   //
174   // Creation of the geometry of the CASTOR detector
175   //
176   //Begin_Html
177   /*
178     <img src="picts/AliCASTORTree.gif">
179   */
180   //End_Html
181   //Begin_Html
182   /*
183     <img src="picts/AliCASTOR.gif">
184   */
185   //End_Html
186   //
187   //   28 March 1997   23 February 1998              Aris L. S. Angelis   * 
188   // >--------------------------------------------------------------------<* 
189   
190   
191   Float_t dhad[11], dcal[3], beta, doct[11], alfa1, alfa2, fact1, fact2,fact3;
192   Float_t dclha[3], dcoha[3], dclem[3], dbxha[3], dcoem[3], dcalt[5], dcalv[5], dbxem[3];
193   Float_t rzhig;
194   Float_t s1, s2, s3, rxyin, rzlow, rxyut, facemd, facein, dlayha, dlayem, doctem, doctha, faceut, zendha, phicov;
195   Float_t doctnt;
196   Float_t zemhad;
197   Int_t idrotm[100];
198   Float_t thecen, xp, xxmdhi, zp, yp, rinbeg;
199   Float_t rutbeg, xxinhi, rinend, rutend, xxmdlo;
200   Float_t dztotl, xxinlo, xxuthi;
201   Float_t xxutlo, dem[11], ang;
202   Int_t nfx;
203   Float_t rxy;
204   // Angle (deg) of inclination of quartz fibres w.r.t. to beam (Cerenkov angle).
205   const Float_t kBetaD = 45;
206   //Rapidity range covered by the calorimeter.
207   const Float_t kEtaLow  = 5.6;
208   const Float_t kEtaHigh = 7.2;
209   // Z position (cm) of beginning of calorimeter EM section (the tip.
210   const Float_t kZbegem = 1740;
211   // Number of azimuthal calorimeter sectors: octants.
212   fOctants = 8;
213   // Number of e-m and hadronic layers (each layer comprises a slice
214   // of absorber material followed by a slice of active quartz fibres).
215   //     DATA NLAYEM,NLAYHA /9,69/  ! 0.64 + 9.73 lambda_i
216   fLayersEM  = 8;
217   fLayersHad = 72;  // 0.57 + 10.15 lambda_i
218   // Number of planes of quartz fibres within each active slice for
219   // e-m and hadronic sections.
220   const Int_t kFibersEM  = 2;
221   const Int_t kFibersHad = 4;
222   // Thickness (cm) of absorber material for e-m and hadronic layers.
223   const Float_t kAbsorberEM  = 0.5;
224   const Float_t kAbsorberHad = 1;
225   // Diameter (cm) of fibre core and of fibre with cladding.
226   const Float_t kDiamCore     = 0.043;
227   const Float_t kDiamCladding = 0.045;
228
229   Int_t i;
230   static Int_t debugFlag = 0;
231   
232   Int_t *idtmed = fIdtmed->GetArray()-1499;
233
234   
235   // >--------------------------------------------------------------------<*
236   // **> Note: ALICE frame XYZ, proper ref. frame of a trapezoid X'Y'Z'. 
237   // --- Common which contains debug flags for the various detectors --- 
238   // --- Also control flags (JPAWF,JOUTF) for each detector added --- 
239   
240   // **> Common containing some of the Castor FCAL geometry data. 
241   
242   //**> Angle (deg) of inclination of quartz fibres w.r.t. to beam
243   //**> (Cerenkovangle).
244   // **> Rapidity range covered by the calorimeter. 
245   // **> Z position (cm) of beginning of calorimeter EM section (the tip. 
246   // **> Number of planes of quartz fibres within each active slice for 
247   // **> e-m and hadronic sections. 
248   // **> Thickness (cm) of absorber material for e-m and hadronic layers. 
249   // **> Diameter (cm) of fibre core and of fibre with cladding. 
250   // **> E-M and hadronic sections of an octant and complete octant module 
251   // **> (general trapezoids). 
252   // **> Imaginary box to hold the complete calorimeter. 
253   // **> Imaginary rectangular boxes containing the trapezoids of the 
254   // **> EM and Hadronic sections of an Octant. 
255   // **> Cylindrical volumes for clad fibres and fibre cores in the 
256   // **> EM and Had sections. 
257   //**> Narrow stainless steel conical beam tube traversing the calorimeter.
258   // **> Print calorimeter parameters. 
259   // **> Number of azimuthal calorimeter sectors: octants. 
260   //      DATA NOCTS / 16 / 
261   // **> Number of e-m and hadronic layers (each layer comprises a slice 
262   // **> of absorber material followed by a slice of active quartz fibres). 
263   //      DATA NLAYEM,NLAYHA /9,69/  ! 0.64 + 9.73 lambda_i 
264   // 0.57 + 10.15 lambda_i 
265   if (debugFlag > 0) {
266     printf("----------------------------------\n");
267     printf(" EtaLo = %f, EtaHigh = %f, ZbegEM =%f\n",kEtaLow, kEtaHigh,kZbegem);
268     printf(" Nocts =%d, NlayEM=%d, NlayHad = %d\n",fOctants,fLayersEM,fLayersHad);
269     printf("----------------------------------\n");
270   }
271   // **> Radius of sensitive fibre core. 
272   fRadCore = kDiamCore/2;
273   // **> Radius normalised to radius of 0.5 mm used in the calculation of 
274   // **> the Cherenkov tables. 
275   fRadFactor = fRadCore / .05;
276   // **> Total number of sensitive QF plane layers. 
277   //nqemly = fLayersEM*kFibersEM;
278   //nqhaly = fLayersHad*kFibersHad;
279   beta   = kBetaD*kDegrad; // **> Conversions to radians. 
280   // **> Thickness of e-m and hadronic layers: 
281   // **> Thickness = Thickness_of_Absorber + Thickness_of_N_Fibre_Planes 
282   // **> For N pair: Thickness_of_N_Fibre_Planes = N/2 * [2+TMath::Sqrt(3)]*R_fibre
283   // **> taking into account staggering of fibres in adjacent planes. 
284   //**> For simplicity staggering not yet introduced, use TMath::Sqrt(4) temporarily.
285   dlayem = kAbsorberEM +(0.5*kFibersEM )*(2+TMath::Sqrt(4.))*kDiamCladding/2;
286   dlayha = kAbsorberHad+(0.5*kFibersHad)*(2+TMath::Sqrt(4.))*kDiamCladding/2;
287   if (debugFlag > 0) {
288     printf(" Layer Thickness. EM = %f, Had = %f\n",dlayem,dlayha);
289   }
290   // **> Thickness of complete octant, along the line perpendicular 
291   // **> to the layers. 
292   // **> Thickness = NlayerEM*DlayerEM + NlayerHad*DlayerHad (DeltaZ'). 
293   doctem = fLayersEM*dlayem;
294   doctha = fLayersHad*dlayha;
295   doctnt = doctem + doctha;
296   if (debugFlag > 0) {
297     printf(" Octant Thickness. EM = %f, Had = %f, Total = %f\n",doctem,doctha,doctnt);
298   }
299   // **> Construct one octant module: general trapezoid, rotated such 
300   // **> that the fibre planes are perpenicular to the Z axis of the 
301   // **> proper reference frame (X'Y'Z' frame). 
302   // **> Calculation of the length of the faces at +/- DeltaZ'/2 of an 
303   // **> octant, projected onto the Y'Z' plane (see notes dated 4/4/97). 
304   alfa1 = TMath::ATan(exp(-kEtaLow)) * 2.;
305   alfa2 = TMath::ATan(exp(-kEtaHigh)) * 2.;
306   fact1 = (TMath::Tan(alfa1) - TMath::Tan(alfa2)) * TMath::Cos(alfa1) / TMath::Sin(beta - alfa1);
307   if (debugFlag > 0) {
308     printf(" Beta =%f,Fact1 =%f\n",kBetaD, fact1);
309     printf(" EtaLow=%f, EtaHigh=%f, Alfa1=%f, Alfa2=%f\n",kEtaLow,kEtaHigh,alfa1*kRaddeg,alfa2*kRaddeg);
310   }
311   // **> Face at entrance to E-M section (-DeltaZ'/2). 
312   facein = fact1 * kZbegem;
313   // **> Face at interface from E-M to Hadronic section. 
314   facemd = (doctem / TMath::Sin(beta) + kZbegem) * fact1;
315   // **> Face at exit of Hadronic section (+DeltaZ'/2). 
316   faceut = (doctnt / TMath::Sin(beta) + kZbegem) * fact1;
317   if (debugFlag > 0) {
318     printf(" Octant Face Length. Front: %f, Back: %f, EM-Had: %f\n",facein,faceut,facemd);
319   }
320   // **> Angular coverage of octant (360./8) projected onto plane 
321   // **> tilted at angle Beta (see notes dated 28/3/97). 
322   //**> PhiTilted = 2*atan[TMath::Tan(phi/2)TMath::Cos(beta)] = 32.65 deg for beta=45,phi=22.5.
323   fPhiOct = k2PI / fOctants;
324   phicov = TMath::ATan(TMath::Tan(fPhiOct / 2.) * TMath::Cos(beta)) * 2.;
325   if (debugFlag > 0) {
326     printf(" FPhiOct =%f, PhiCov =%f\n",fPhiOct * kRaddeg,phicov * kRaddeg);
327   }
328   // **> Dimensions along X' of front and back faces of calorimeter 
329   // **> (see notes dated 8/4/97). 
330   fact2  = TMath::Tan(alfa2) / TMath::Sin(beta);
331   fact3  = TMath::Cos(alfa2) / TMath::Sin(beta - alfa2);
332   zendha = doctnt * fact3 + kZbegem;
333   zemhad = doctem * fact3 + kZbegem;
334   if (debugFlag > 0) {
335     printf(" ZbegEM =%f, ZendHA =%f, ZEMHad =%f\n",kZbegem,zendha, zemhad);
336     printf(" Fact2 =%f, Fact3 =%f\n",fact2,fact3);
337   }
338   // **> DeltaX' at -DeltaY'/2, -DeltaZ'/2. 
339   xxinlo = fact2 * 2*kZbegem * TMath::Tan(phicov / 2.);
340   // **> DeltaX' at +DeltaY'/2, -DeltaZ'/2. 
341   xxinhi = (fact2 + fact1) * 2*kZbegem * TMath::Tan(phicov / 2.);
342   // **> DeltaX' at -DeltaY'/2, +DeltaZ'/2. 
343   xxutlo = zendha * 2. * fact2 * TMath::Tan(phicov / 2.);
344   // **> DeltaX' at +DeltaY'/2, +DeltaZ'/2. 
345   xxuthi = zendha * 2. * (fact2 + fact1) * TMath::Tan(phicov / 2.);
346   // **> DeltaX' at -DeltaY'/2, at EM/Had interface. 
347   xxmdlo = zemhad * 2. * fact2 * TMath::Tan(phicov / 2.);
348   // **> DeltaX' at +DeltaY'/2, at EM/Had interface. 
349   xxmdhi = zemhad * 2. * (fact2 + fact1) * TMath::Tan(phicov / 2.);
350   if (debugFlag > 0) {
351     printf(" XXinLo=%f, XXinHi=%f, XXutLo=%f, XXutHi=%f, XXmdLo=%f, XXmdHi=%f\n",
352            xxinlo,xxinhi,xxutlo,xxuthi,xxmdlo,xxmdhi);
353   }
354   //**> Calculate the polar angle in the X'Y'Z' frame of the line joining the
355   //**> centres of the front and back faces of the octant (see notes dated 9/4/97).
356   s1  = (1. - fact2 * TMath::Cos(beta)) * kZbegem;
357   s2  = (fact2 + fact1 / 2.) * kZbegem;
358   s3  = TMath::Sqrt(s1 * s1 + s2 * s2 - s1 * s2 * TMath::Cos(kPI - beta));
359   ang = TMath::ASin(sin(kPI - beta) * s2 / s3);
360   thecen = kPI/2 - beta + ang;
361   if (debugFlag > 0) {
362     printf(" S1=%f, S2=%f, S3=%f, Ang=%f, TheCen=%f\n",s1,s2,s3,ang*kRaddeg,thecen*kRaddeg);
363   }
364   // **> Construct the octant volume. 
365   doct[0] = 180*0.125;
366   doct[1] = 360.;
367   doct[2] = 8.;
368   doct[3] = 2.;
369   doct[4] = -(zendha - kZbegem + faceut * TMath::Cos(beta)) / 2.;
370   doct[5] = TMath::Tan(alfa2) * kZbegem;
371   doct[6] = TMath::Tan(alfa1) * kZbegem;
372   doct[7] = (zendha - kZbegem + faceut * TMath::Cos(beta)) / 2.;
373   doct[8] = zendha * TMath::Tan(alfa2);
374   doct[9] = (faceut + zendha * fact2) * TMath::Sin(beta);
375   
376   if (debugFlag > 0) {
377     printf("\n Doct(1-10) = ");
378     for (i = 1; i <= 10; ++i) {
379       printf("%f, ",doct[i - 1]);
380     }
381     printf("   \n");
382   }
383   gMC->Gsvolu("OCTA", "PGON", idtmed[fOdAbsorber - 1], doct, 10);
384   gMC->Gsdvn("OCT ", "OCTA", 8, 2);
385   // absorber material. 
386   // **> Construct the E-M section volume. 
387   dem[0]  = doctem / 2.;      // DeltaZ'/2 
388   dem[1]  = thecen *kRaddeg;  // Theta[(Centre(-DeltaZ')--Centre(+DeltaZ' 
389   dem[2]  = 90.;              // Phi[(Centre(-DeltaZ')--Centre(+DeltaZ')] 
390   dem[3]  = facein / 2.;      // DeltaY'/2 at -DeltaZ'/2. 
391   dem[4]  = xxinlo / 2.;      // DeltaX'/2 at -DeltaY'/2 at -DeltaZ'/2. 
392   dem[5]  = xxinhi / 2.;      // DeltaX'/2 at +DeltaY'/2 at -DeltaZ'/2. 
393   dem[6]  = 0.;               // Angle w.r.t. Y axis of line joining cent 
394                                 // at +/- DeltaY at -DeltaZ. // Angle w.r.t. Y axis of line joining cent 
395   dem[7]  = facemd / 2.;      // DeltaY'/2 at +DeltaZ'. 
396   dem[8]  = xxmdlo / 2.;      // DeltaX'/2 at -DeltaY'/2 at +DeltaZ'/2. 
397   dem[9]  = xxmdhi / 2.;      // DeltaX'/2 at +DeltaY'/2 at +DeltaZ'/2. 
398   dem[10] = 0.;               // Angle w.r.t. Y axis of line joining cent
399                                 // at +/- DeltaY at +DeltaZ. 
400   
401   if (debugFlag > 0) {
402     printf("\n De-m(1-11) =");
403     for (i = 1; i <= 11; ++i) {
404       printf("%f, ",dem[i - 1]);
405     }
406     printf("   \n");
407   }
408   gMC->Gsvolu("EM  ", "TRAP", idtmed[fOdAbsorber - 1], dem, 11);
409   // absorber material. 
410   // **> Construct the Hadronic section volume. 
411   // Fill with s 
412   dhad[0]  = doctha / 2.;      // DeltaZ'/2 
413   dhad[1]  = thecen *kRaddeg;  // Theta[(Centre(-DeltaZ')--Centre(+DeltaZ' 
414   dhad[2]  = 90.;              // Phi[(Centre(-DeltaZ')--Centre(+DeltaZ')] 
415   dhad[3]  = facemd / 2.;      // DeltaY'/2 at -DeltaZ'/2. 
416   dhad[4]  = xxmdlo / 2.;      // DeltaX'/2 at -DeltaY'/2 at -DeltaZ'/2. 
417   dhad[5]  = xxmdhi / 2.;      // DeltaX'/2 at +DeltaY'/2 at -DeltaZ'/2. 
418   dhad[6]  = 0.;               // Angle w.r.t. Y axis of line joining cent
419   // at +/- DeltaY at -DeltaZ. 
420   dhad[7]  = faceut / 2.;      // DeltaY'/2 at +DeltaZ'. 
421   dhad[8]  = xxutlo / 2.;      // DeltaX'/2 at -DeltaY'/2 at +DeltaZ'/2. 
422   dhad[9]  = xxuthi / 2.;      // DeltaX'/2 at +DeltaY'/2 at +DeltaZ'/2. 
423   dhad[10] = 0.;               // Angle w.r.t. Y axis of line joining cent
424   // at +/- DeltaY at +DeltaZ. 
425   
426   if (debugFlag > 0) {
427     printf("\n Dhad(1-11) = ");
428     for (i = 1; i <= 11; ++i) {
429       printf("%f, ",dhad[i - 1]);
430     }
431     printf("   \n");
432   }
433   gMC->Gsvolu("HAD ", "TRAP", idtmed[fOdAbsorber - 1], dhad, 11); // absorber material. 
434   // **> Rotation matrix to rotate fibres verticaly to fit into holes. 
435   // Fill with 
436   AliMatrix(idrotm[0], 90., 0., 180., 0., 90., 90.);
437   // **> Internal structure of the EM section starts here.  <--- 
438   // **> Construct one sampling module 
439   gMC->Gsdvn("SLEM", "EM  ", fLayersEM, 3);
440   gMC->Gsatt("SLEM", "SEEN", 0);
441   // **> Construct the (imaginary) rectangular box embedding the fibres 
442   // **> Fill with air, make it invisible on the drawings. 
443   dbxem[0] = xxmdhi / 2.;
444   dbxem[2] = kFibersEM*kDiamCladding/2;
445   dbxem[1] = facemd / 2. + dbxem[2] * TMath::Tan(thecen);
446   if (debugFlag > 0) {
447     printf(" DbxEM(1-3) =");
448     for (i = 1; i <= 3; ++i) {
449       printf("%f, ",dbxem[i - 1]);
450     }
451     printf("   \n");
452   }
453   gMC->Gsvolu("BXEM", "BOX ", idtmed[1501], dbxem, 3);
454   gMC->Gsatt("BXEM", "SEEN", 0);
455   // **> Divide along Z to obtain one layer 
456   gMC->Gsdvn("RWEM", "BXEM", 2, 3);
457   gMC->Gsatt("RWEM", "SEEN", 0);
458   // **> Divide along X' to accomodate the maximum number of individual 
459   //**> fibres packed along X', make the divisions invisible on the drawings.
460   nfx = Int_t(xxmdhi / .045);
461   if (debugFlag > 0) {
462     printf(" NfxEM = %d\n",nfx);
463   }
464   gMC->Gsdvn("FXEM", "RWEM", nfx, 1);
465   gMC->Gsatt("FXEM", "SEEN", 0);
466   // **> Construct the fiber cladding 
467   dclem[0] = 0.;
468   dclem[1] = kDiamCladding/2;
469   dclem[2] = dbxem[1];
470   if (debugFlag > 0) {
471     printf(" DclEM(1-3) = \n");
472     for (i = 1; i <= 3; ++i) {
473       printf("%f, ",dclem[i - 1]);
474     }
475     printf("   \n");
476   }
477   gMC->Gsvolu("CLEM", "TUBE", idtmed[fOdCladding - 1], dclem,3);
478   gMC->Gsatt("CLEM", "SEEN", 0);
479   //**> Construct the cylindrical volume for a fibre core in the EM section.
480   //**> Fill with selected fibre material, make it invisible on the drawings.
481   dcoem[0] = 0.;
482   dcoem[1] = kDiamCore/2;
483   dcoem[2] = dbxem[1];
484   if (debugFlag > 0) {
485     printf(" DcoEM(1-3) = ");
486     for (i = 1; i <= 3; ++i) {
487       printf("%f, ",dcoem[i - 1]);
488     }
489     printf("   \n");
490   }
491   gMC->Gsvolu("COEM", "TUBE", idtmed[fOdFiber - 1], dcoem,3);
492   gMC->Gsatt("COEM", "SEEN", 0);
493   // **> Position the volumes 
494   // **> Put the air section inside one sampling module 
495   // **> Use MANY to obtain clipping of protruding edges. 
496   xp = 0.;
497   zp = dlayem / 2. - 0.5*kFibersEM*kDiamCladding;
498   yp = zp * TMath::Tan(thecen);
499   gMC->Gspos("BXEM", 1, "SLEM", xp, yp, zp, 0, "MANY");
500   // **> Place the core fibre in the clad 
501   xp = 0.;
502   yp = 0.;
503   zp = 0.;
504   gMC->Gspos("COEM", 1, "CLEM", xp, yp, zp, 0, "MANY");
505   // **> Put the fiber in its air box 
506   gMC->Gspos("CLEM", 1, "FXEM", xp, yp, zp, idrotm[0], "MANY");
507   // **> Internal structure of the Hadronic section starts here.  <--- 
508   gMC->Gsdvn("SLHA", "HAD ", fLayersHad, 3);
509   gMC->Gsatt("SLHA", "SEEN", 0);
510   // **> Construct the air section where the fibers are 
511   dhad[0] = 0.5*kFibersEM*kDiamCladding;
512   gMC->Gsvolu("AIHA", "TRAP", idtmed[1501], dhad, 11);
513   // **> Divide along z in the appropriate number of layers 
514   gMC->Gsdvn("SAHA", "AIHA", 4, 3);
515   //**> Construct the (imaginary) rectangular box embedding one lauer of fibres
516   // **> Fill with air, make it invisible on the drawings. 
517   dbxha[0] = xxuthi / 2.;
518   dbxha[2] = 0.5*kFibersHad*kDiamCladding;
519   dbxha[1] = faceut / 2. + dbxha[2] * TMath::Tan(thecen);
520   if (debugFlag > 0) {
521     printf(" DbxHa(1-3) = ");
522     for (i = 1; i <= 3; ++i) {
523       printf("%f, ",dbxem[i - 1]);
524     }
525     printf("   \n");
526   }
527   gMC->Gsvolu("BXHA", "BOX ", idtmed[1501], dbxha, 3);
528   gMC->Gsatt("BXHA", "SEEN", 0);
529   // **> Divide along Z to obtain one layer 
530   gMC->Gsdvn("RWHA", "BXHA", 4, 3);
531   gMC->Gsatt("RWHA", "SEEN", 0);
532   // **> Divide along X' to accomodate the maximum number of individual 
533   //**> fibres packed along X', make the divisions invisible on the drawings.
534   nfx = Int_t(xxuthi / .045);
535   if (debugFlag > 0) {
536     printf(" NfxHad = %d\n",nfx);
537   }
538   gMC->Gsdvn("FXHA", "RWHA", nfx, 1);
539   gMC->Gsatt("FXHA", "SEEN", 0);
540   // **> Construct one fiber cladding 
541   dclha[0] = 0.;
542   dclha[1] = 0.5*kDiamCladding;
543   dclha[2] = dbxha[1];
544   if (debugFlag > 0) {
545     printf(" DclHa(1-3) = ");
546     for (i = 1; i <= 3; ++i) {
547       printf("%f, ",dclha[i - 1]);
548     }
549     printf("   \n");
550   }
551   gMC->Gsvolu("CLHA", "TUBE", idtmed[fOdCladding - 1], dclha,3);
552   gMC->Gsatt("CLHA", "SEEN", 0);
553   //**> Construct the cylindrical volume for a fibre core in the Had section.
554   //**> Fill with selected fibre material, make it invisible on the drawings.
555   dcoha[0] = 0.;
556   dcoha[1] = 0.5*kDiamCore;
557   dcoha[2] = dbxha[1];
558   if (debugFlag > 0) {
559     printf(" DcoHa(1-3) = ");
560     for (i = 1; i <= 3; ++i) {
561       printf("%f, ",dcoha[i - 1]);
562     }
563     printf("   \n");
564   }
565   gMC->Gsvolu("COHA", "TUBE", idtmed[fOdFiber - 1], dcoha,3);
566   gMC->Gsatt("COHA", "SEEN", 0);
567   // **> Position the volumes 
568   // **> Put the air section inside one sampling module 
569   // **> Use MANY to obtain clipping of protruding edges. 
570   xp = 0.;
571   zp = dlayha / 2. - 0.5*kFibersHad*kDiamCladding;
572   yp = zp * TMath::Tan(thecen);
573   gMC->Gspos("BXHA", 1, "SLHA", xp, yp, zp, 0, "MANY");
574   // **> Place the core fibre in the clad 
575   xp = 0.;
576   yp = 0.;
577   zp = 0.;
578   gMC->Gspos("COHA", 1, "CLHA", xp, yp, zp, 0, "MANY");
579   // **> Place the fibre in its air box 
580   gMC->Gspos("CLHA", 1, "FXHA", xp, yp, zp, idrotm[0], "MANY");
581   // **> Rotation matrices for consecutive calorimeter octants 
582   // **> filling the imaginary box. 
583   AliMatrix(idrotm[1], 90., -90., 45., 0., 45., 180.);
584   // **> Place the EM and Hadronic sections inside the Octant. 
585   rzlow = (doct[5] + doct[6]) * .5;
586   rzhig = (doct[8] + doct[9]) * .5;
587   zp = doct[7] - (faceut * TMath::Cos(beta) + doctha * fact3) * .5;
588   yp = 0.;
589   xp = rzlow + (rzhig - rzlow) * .5 * (zp - doct[4]) / doct[7];
590   gMC->Gspos("HAD ", 1, "OCT ", xp, yp, zp, idrotm[1], "ONLY");
591   yp = 0.;
592   zp = doct[7] - faceut * TMath::Cos(beta) * .5 - doctha * fact3 - doctem * fact3 * .5;
593   xp = rzlow + (rzhig - rzlow) * .5 * (zp - doct[4]) / doct[7];
594   gMC->Gspos("EM  ", 1, "OCT ", xp, yp, zp, idrotm[1], "ONLY");
595   // **> An imaginary box to hold the complete calorimeter. 
596   dcal[0] = (faceut + zendha * fact2) * TMath::Sin(beta);
597   dcal[1] = dcal[0];
598   dcal[2] = (zendha - kZbegem + faceut * TMath::Cos(beta)) / 2.;
599   if (debugFlag > 0) {
600     printf(" Dcal(1-3) = ");
601     for (i = 1; i <= 3; ++i) {
602       printf("%f, ",dcal[i - 1]);
603     }
604     printf("   \n");
605   }
606   gMC->Gsvolu("CAL ", "BOX ", idtmed[1501], dcal, 3);
607   // Fill with air 
608   rinbeg = TMath::Tan(alfa2) * kZbegem;
609   rutbeg = TMath::Tan(alfa1) * kZbegem;
610   dztotl = dcal[2] * 2.;
611   rinend = (dztotl + kZbegem) * TMath::Tan(alfa2);
612   rutend = (dztotl + kZbegem) * TMath::Tan(alfa1);
613   if (debugFlag > 0) {
614     printf(" RinBeg=%f, RoutBeg=%f\n",rinbeg,rutbeg);
615     printf(" RinEnd=%f, RoutEnd=%f\n",rinend,rutend);
616     printf(" DeltaZtotal = %f\n",dztotl);
617   }
618   // **> Build the calorimeter inside the imaginary box. 
619   rxyin = (fact2 + fact1 / 2.) * kZbegem; // Radius to centre of octant in X'Y' 
620   // plane at calorimeter entrance. 
621   rxyut = zendha * (fact2 + fact1 / 2.);  // Radius to centre of octant in X'Y'
622   // plane at calorimeter exit. 
623   rxy   = (rxyin + rxyut) / 2.;           // Radius to geometrical centre of octant in 
624   rxy  *= TMath::Sin(beta);               // projected to the XY plane. 
625   if (debugFlag > 0) {
626     printf(" \n");
627   }
628   gMC->Gspos("OCTA", 1, "CAL ", 0., 0., 0., 0, "ONLY");
629   //**> Construct the narrow stainless steel conical beam tube traversing the
630   // **> calorimeter and its vacuum filling:  WallThickness = 0.1 cm, 
631   // **> Router = touching the inner side of the calorimeter, 
632   // **> DeltaZ = all through the calorimeter box. 
633   dcalt[0] = dcal[2];
634   dcalt[2] = TMath::Tan(alfa2) * kZbegem;
635   dcalt[1] = dcalt[2] - .1 / TMath::Cos(alfa2);
636   dcalt[4] = (dcalt[0] * 2. + kZbegem) * TMath::Tan(alfa2);
637   dcalt[3] = dcalt[4] - .1 / TMath::Cos(alfa2);
638   dcalv[0] = dcalt[0];
639   dcalv[2] = dcalt[1];
640   dcalv[1] = 0.;
641   dcalv[4] = dcalt[3];
642   dcalv[3] = 0.;
643   gMC->Gsvolu("CALT", "CONE", idtmed[1506], dcalt, 5);
644   // Fe (steel a 
645   gMC->Gsvolu("CALV", "CONE", idtmed[1500], dcalv, 5);
646   // Vacuum. 
647   gMC->Gsatt("CALV", "SEEN", 0);
648   // **> Position at centre of calorimeter box. 
649   zp = 0.;
650   gMC->Gspos("CALT", 1, "CAL ", 0., 0., zp, 0, "ONLY");
651   gMC->Gspos("CALV", 1, "CAL ", 0., 0., zp, 0, "ONLY");
652   if (debugFlag > 0) {
653     printf(" Dcalt,Zp,-/+ = ");
654     for (i = 1; i <= 5; ++i) {
655       printf("%f, ",dcalt[i - 1]);
656     }
657     printf("%f, %f, %f\n",zp, zp - dcalt[0], zp + dcalt[0]);
658     printf(" Dcalt,Zp,-/+ = ");
659     for (i = 1; i <= 5; ++i) {
660       printf("%f, ",dcalt[i - 1]);
661     }
662     printf("%f, %f, %f\n",zp, zp - dcalt[0], zp + dcalt[0]);
663   }
664   // **> Rotate the imaginary box carrying the calorimeter and place it 
665   // **> in the ALICE volume on the -Z side. 
666   xp = 0.;
667   yp = 0.;
668   zp = dcal[2] + kZbegem;
669   AliMatrix(idrotm[2], 90., 180., 90., 90., 180., 0.);
670   // -X theta and phi w.r.t. to box XYZ. 
671   //  Y theta and phi w.r.t. to box XYZ. 
672   // -Z theta and phi w.r.t. to box XYZ. 
673   gMC->Gspos("CAL ", 1, "ALIC", xp, yp, -zp, idrotm[2], "ONLY");
674   if (debugFlag > 0) {
675     printf(" Dcal,Zp,-/+ = ");
676     for (i = 1; i <= 3; ++i) {
677       printf("%f, ",dcal[i - 1]);
678     }
679     printf("%f, %f, %f\n",zp, zp - dcal[2], zp + dcal[2]);
680   }
681 }
682
683 //_____________________________________________________________________________
684 void AliCASTORv1::DrawModule()
685 {
686   //
687   // Draw a shaded view of CASTOR version 1
688   //
689
690   
691   gMC->Gsatt("*", "seen", -1);
692   gMC->Gsatt("alic", "seen", 0);
693   //
694   // Set visibility of elements
695   gMC->Gsatt("OCTA","seen",0);
696   gMC->Gsatt("EM  ","seen",0);
697   gMC->Gsatt("HAD ","seen",0);
698   gMC->Gsatt("CAL ","seen",0);
699   gMC->Gsatt("CALT","seen",1);
700   gMC->Gsatt("OCT ","seen",0);
701   gMC->Gsatt("SLEM","seen",1);
702   gMC->Gsatt("SLHA","seen",1);
703   gMC->Gsatt("SAHA","seen",1);
704   //
705   gMC->Gdopt("hide", "on");
706   gMC->Gdopt("shad", "on");
707   gMC->Gsatt("*", "fill", 7);
708   gMC->SetClipBox(".");
709   gMC->SetClipBox("*", 0, 20, -20, 20, -1900, -1700);
710   gMC->DefaultRange();
711   gMC->Gdraw("alic", 40, 30, 0, -191.5, -78, .19, .19);
712   gMC->Gdhead(1111, "CASTOR Version 1");
713   gMC->Gdman(15,-2, "MAN");
714   gMC->Gdopt("hide", "off");
715 }
716
717 //_____________________________________________________________________________
718 void AliCASTORv1::CreateMaterials()
719 {
720   //
721   // Create materials for CASTOR version 1
722   //
723   //   30 March 1997   27 November 1997              Aris L. S. Angelis   * 
724   // >--------------------------------------------------------------------<* 
725   Int_t   ISXFLD = gAlice->Field()->Integ();
726   Float_t SXMGMX = gAlice->Field()->Max();
727   
728   Int_t *idtmed = fIdtmed->GetArray()-1499;
729   
730   Float_t cute, ubuf[1], cutg, epsil, awmix[3], dwmix, stmin;
731   Int_t isvol;
732   Float_t wwmix[3], zwmix[3], aq[2], dq, zq[2], wq[2];
733   Float_t tmaxfd, stemax, deemax;
734   Int_t kod;
735   
736   
737   // **> Quartz and Wmixture. 
738   // **> UBUF is the value of r0, used for calculation of the radii of 
739   // **> the nuclei and the Woods-Saxon potential. 
740   ubuf[0] = .68;
741   AliMaterial(1, "Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16, ubuf, 1);
742   ubuf[0] = .68;
743   AliMaterial(2, "Air   $", 14.61, 7.3, .001205, 30420., 67500., ubuf, 1);
744   //**> Quartz (SiO2) and fluorinated (?) quartz for cladding (insensitive).
745   dq    = 2.64;
746   aq[0] = 28.086;
747   aq[1] = 15.9994;
748   zq[0] = 14.;
749   zq[1] = 8.;
750   wq[0] = 1.;
751   wq[1] = 2.;
752   AliMixture(3, "Quartz$", aq, zq, dq, -2, wq);
753   // After a call with ratios by number (negative number of elements), 
754   // the ratio array is changed to the ratio by weight, so all successive 
755   // calls with the same array must specify the number of elements as 
756   // positive 
757   AliMixture(4, "FQuartz$", aq, zq, dq, 2, wq);
758   // **> W mixture (90% W + 7.5% Ni + 2.5% Cu). 
759   awmix[0] = 183.85;
760   zwmix[0] = 74.;
761   wwmix[0] = .9;
762   awmix[1] = 58.69;
763   zwmix[1] = 28.;
764   wwmix[1] = .075;
765   awmix[2] = 63.55;
766   zwmix[2] = 29.;
767   wwmix[2] = .025;
768   dwmix    = 17.2;
769   // **> (Pure W and W mixture are given the same material number 
770   // **> so that they can be used interchangeably). 
771   ubuf[0] = 1.1;
772   AliMixture(5, "W Mix $", awmix, zwmix, dwmix, 3, wwmix);
773   // **> Lead. 
774   ubuf[0] = 1.12;
775   AliMaterial(6, "Pb208 $", 207.19, 82., 11.35, .56, 18.5, ubuf, 1);
776   // **> Iron. 
777   ubuf[0] = .99;
778   AliMaterial(7, "Fe56  $", 55.85, 26., 7.87, 1.76, 16.7, ubuf, 1);
779   // **> Copper. 
780   ubuf[0] = 1.01;
781   AliMaterial(8, "Cu63  $", 63.54, 29., 8.96, 1.43, 15., ubuf, 1);
782   // **> Debug Printout. 
783   //      CALL GPRINT('MATE',0) 
784   // **> (Negative values for automatic calculation in case of AUTO=0). 
785   isvol  = 0;    // Sensitive volume flag. 
786   tmaxfd = .1;   // Max allowed angular deviation in 1 step due to field 
787   stemax = -.5;  // Maximum permitted step size (cm). 
788   deemax = -.2;  // Maximum permitted fractional energy loss. 
789   epsil  = .01;  // Boundary crossing precision (cm). 
790   stmin  = -.1;  // Minimum permitted step size inside absorber (cm). 
791   AliMedium(1, "Vacuum$", 1, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
792   AliMedium(2, "Air   $", 2, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
793   
794   // **> Options for Cherenkov fibres and cladding. 
795   isvol = 1;    // Declare fibre core as sensitive. 
796   AliMedium(3, "Quartz$", 3, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
797   isvol = 0;    // Declare fibre cladding as not sensitive. 
798   AliMedium(4, "FQuartz$", 4, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
799   
800   // **> Options for absorber material (not sensitive). 
801   isvol  = 0;   // Sensitive volume flag. 
802   stemax = .5;  // Maximum permitted step size (cm). 
803   deemax = .5;  // Maximum permitted fractional energy loss. 
804   stmin  = .1;  // Minimum permitted step size inside absorber (cm). 
805   AliMedium(5, "W Mix $",  5, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
806   AliMedium(6, "Pb208 $",  6, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
807   AliMedium(7, "Fe56  $ ", 7, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
808   AliMedium(8, "Cu63  $ ", 8, isvol, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
809   
810   // **> Select material for the Cherenkov fibres. 
811   fOdFiber    = 1503;
812   //      CALL GPTMED(IDTMED(KODFBR)) 
813   // **> Select material for the fibre cladding. 
814   // Quartz. 
815   fOdCladding = 1504;
816   //      CALL GPTMED(IDTMED(KODCLD)) 
817   // **> Select absorber material. 
818   // FQuartz. 
819   fOdAbsorber = 1505;  // W184/Mix 
820   //      KODABS=1506   ! Pb208. 
821   //      KODABS=1507   ! Fe56. 
822   //      KODABS=1508   ! Cu63. 
823   //      CALL GPTMED(IDTMED(KODABS)) 
824   // **> Set by default all interactions and decays explicitly ON 
825   // **> and redefine the kinetic energy cutoffs: 
826   //      CUTE=0.0031       ! Allow beta >= 0.99 only. 
827   cute = 7e-4;  // Allow beta >= 0.67 only. 
828   cutg = cute * 1.33;
829   
830   // **> Inside the absorber material, 
831   for (kod = 1505; kod <= 1508; ++kod) {
832     Int_t absorber = idtmed[kod - 1];
833     gMC->Gstpar(absorber, "CUTELE", cute);  // Allow beta >= 0.xx 
834     gMC->Gstpar(absorber, "CUTGAM", cutg);  // = 1.33 cutele. 
835     gMC->Gstpar(absorber, "CUTNEU", .01);   // Default. 
836     gMC->Gstpar(absorber, "CUTHAD", .01);   // Default. 
837     gMC->Gstpar(absorber, "CUTMUO", .01);   // Default. 
838     gMC->Gstpar(absorber, "BCUTE", cutg);   // = cutgam. 
839     gMC->Gstpar(absorber, "BCUTM", cutg);   // = cutgam. 
840     gMC->Gstpar(absorber, "DCUTE", cute);   // = cutele. 
841     gMC->Gstpar(absorber, "DCUTM", cute);   // = cutele. 
842     gMC->Gstpar(absorber, "PPCUTM", cutg);  // = 1.33 cutele. 
843     gMC->Gstpar(absorber, "DCAY", 1.);
844     gMC->Gstpar(absorber, "MULS", 1.);
845     gMC->Gstpar(absorber, "PFIS", 1.);
846     gMC->Gstpar(absorber, "MUNU", 1.);
847     gMC->Gstpar(absorber, "LOSS", 1.);
848     gMC->Gstpar(absorber, "PHOT", 1.);
849     gMC->Gstpar(absorber, "COMP", 1.);
850     gMC->Gstpar(absorber, "PAIR", 1.);
851     gMC->Gstpar(absorber, "BREM", 1.);
852     gMC->Gstpar(absorber, "RAYL", 1.);
853     gMC->Gstpar(absorber, "DRAY", 1.);
854     gMC->Gstpar(absorber, "ANNI", 1.);
855     gMC->Gstpar(absorber, "HADR", 1.);
856     gMC->Gstpar(absorber, "LABS", 1.);
857   }
858   // **> Inside the cladding, 
859   Int_t cladding = idtmed[fOdCladding - 1];
860   gMC->Gstpar(cladding, "CUTELE", cute);  // Allow beta >= 0.xx 
861   gMC->Gstpar(cladding, "CUTGAM", cutg);  // = 1.33 cutele. 
862   gMC->Gstpar(cladding, "CUTNEU", .01);   // Default. 
863   gMC->Gstpar(cladding, "CUTHAD", .01);   // Default. 
864   gMC->Gstpar(cladding, "CUTMUO", .01);   // Default. 
865   gMC->Gstpar(cladding, "BCUTE", cutg);   // = cutgam. 
866   gMC->Gstpar(cladding, "BCUTM", cutg);   // = cutgam. 
867   gMC->Gstpar(cladding, "DCUTE", cute);   // = cutele. 
868   gMC->Gstpar(cladding, "DCUTM", cute);   // = cutele. 
869   gMC->Gstpar(cladding, "PPCUTM", cutg);  // = 1.33 cutele. 
870   gMC->Gstpar(cladding, "DCAY", 1.);
871   gMC->Gstpar(cladding, "MULS", 1.);
872   gMC->Gstpar(cladding, "PFIS", 1.);
873   gMC->Gstpar(cladding, "MUNU", 1.);
874   gMC->Gstpar(cladding, "LOSS", 1.);
875   gMC->Gstpar(cladding, "PHOT", 1.);
876   gMC->Gstpar(cladding, "COMP", 1.);
877   gMC->Gstpar(cladding, "PAIR", 1.);
878   gMC->Gstpar(cladding, "BREM", 1.);
879   gMC->Gstpar(cladding, "RAYL", 1.);
880   gMC->Gstpar(cladding, "DRAY", 1.);
881   gMC->Gstpar(cladding, "ANNI", 1.);
882   gMC->Gstpar(cladding, "HADR", 1.);
883   gMC->Gstpar(cladding, "LABS", 1.);
884   
885   // **> and Inside the Cherenkov fibres, 
886   Int_t fiber = idtmed[fOdFiber - 1];
887   gMC->Gstpar(fiber, "CUTELE", cute);  // Allow beta >= 0.xx 
888   gMC->Gstpar(fiber, "CUTGAM", cutg);  // = 1.33 cutele. 
889   gMC->Gstpar(fiber, "CUTNEU", .01);   // Default. 
890   gMC->Gstpar(fiber, "CUTHAD", .01);   // Default. 
891   gMC->Gstpar(fiber, "CUTMUO", .01);   // Default. 
892   gMC->Gstpar(fiber, "BCUTE", cutg);   // = cutgam. 
893   gMC->Gstpar(fiber, "BCUTM", cutg);   // = cutgam. 
894   gMC->Gstpar(fiber, "DCUTE", cute);   // = cutele. 
895   gMC->Gstpar(fiber, "DCUTM", cute);   // = cutele. 
896   gMC->Gstpar(fiber, "PPCUTM", cutg);  // = 1.33 cutele. 
897   gMC->Gstpar(fiber, "DCAY", 1.);
898   gMC->Gstpar(fiber, "MULS", 1.);
899   gMC->Gstpar(fiber, "PFIS", 1.);
900   gMC->Gstpar(fiber, "MUNU", 1.);
901   gMC->Gstpar(fiber, "LOSS", 1.);
902   gMC->Gstpar(fiber, "PHOT", 1.);
903   gMC->Gstpar(fiber, "COMP", 1.);
904   gMC->Gstpar(fiber, "PAIR", 1.);
905   gMC->Gstpar(fiber, "BREM", 1.);
906   gMC->Gstpar(fiber, "RAYL", 1.);
907   gMC->Gstpar(fiber, "DRAY", 1.);
908   gMC->Gstpar(fiber, "ANNI", 1.);
909   gMC->Gstpar(fiber, "HADR", 1.);
910   gMC->Gstpar(fiber, "LABS", 1.);
911 }
912
913 //_____________________________________________________________________________
914 void AliCASTORv1::StepManager()
915 {
916   //
917   // Called at every step in CASTOR
918   //
919 }
920
921 //_____________________________________________________________________________
922 void AliCASTORv1::Init()
923 {
924   //
925   // Initialise CASTOR detector after it has been built
926   //
927   Int_t i;
928   //
929   printf("\n");
930   for(i=0;i<35;i++) printf("*");
931   printf(" CASTOR_INIT ");
932   for(i=0;i<35;i++) printf("*");
933   printf("\n");
934   //
935   // Here the ABSO initialisation code (if any!)
936   for(i=0;i<80;i++) printf("*");
937   printf("\n");
938 }
939
940 ClassImp(AliCASTORhit)
941
942 //_____________________________________________________________________________
943 AliCASTORhit::AliCASTORhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
944 AliHit(shunt, track)
945 {
946   //
947   // Store a CASTOR hit
948   //
949   fVolume  = vol[0];
950   fX=hits[0];
951   fY=hits[1];
952   fZ=hits[2];
953 }
954  
955