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 **************************************************************************/
21 ///////////////////////////////////////////////////////////////////////////////
23 // Alice COsmic Ray Trigger //
25 // This class contains the functions for version 0 of the Cosmic Rays ALICE //
30 // Arturo Fernandez <afernand@fcfm.buap.mx>
31 // Enrique Gamez <egamez@fcfm.buap.mx>
33 // Universidad Autonoma de Puebla
38 <img src="picts/AliCRTv0Class.gif">
41 <p>The responsible person for this module is
42 <a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>.
48 ///////////////////////////////////////////////////////////////////////////////
53 #include <TGeometry.h>
56 #include <TLorentzVector.h>
59 #include "AliCRTConstants.h"
69 //_____________________________________________________________________________
70 AliCRTv0::AliCRTv0() : AliCRT()
73 // Default constructor for CRT
78 //_____________________________________________________________________________
79 AliCRTv0::AliCRTv0(const char *name, const char *title)
83 // Standard constructor for CRT
87 <img src="picts/AliCRTv0.gif">
92 //_____________________________________________________________________________
93 void AliCRTv0::BuildGeometry()
98 //_____________________________________________________________________________
99 void AliCRTv0::CreateGeometry()
102 // Create geometry for the CRT array
109 Int_t idrotm[2499]; // The rotation matrix.
111 // idtmed[1099->1198] equivalent to fIdtmed[0->100]
112 Int_t * idtmed = fIdtmed->GetArray() - 1099 ;
114 // In order to generate the more correctly the modules (more datails)
115 // we will create a box (air box) as a (sub)mother volume.
116 // Inside this box we'll put the scintillator tiles, the PMTs the frame
117 // and, maybe, some other things.
120 box[0] = AliCRTConstants::fgCageLenght/2.; // Half Length of the box along the X axis, cm.
121 box[1] = AliCRTConstants::fgCageHeight/2.; // Half Length of the box along the Y axis, cm.
122 box[2] = AliCRTConstants::fgCageWidth/2.; // Half Length of the box along the Z axis, cm.
125 // Define the Scintillators. as a big box.
127 scint[0] = AliCRTConstants::fgActiveAreaLenght/2.; // Half Length in X
128 scint[1] = AliCRTConstants::fgActiveAreaHeight/2.; // Half Length in Y
129 scint[2] = AliCRTConstants::fgActiveAreaWidth/2.; // Half Length in Z
130 gMC->Gsvolu("CRT1", "BOX ", idtmed[1102], scint, 3); // Scintillators
131 // Divide the modules in 2 planes.
132 //gMC->Gsdvn("CRT2", "CRT1", 2, 2);
133 // Now divide each plane in 8 palettes
134 //gMC->Gsdvn("CRT3", "CRT1", 8, 3);
138 // Define the coordinates where the draw will begin.
143 // we'll start dawing from the center.
148 Float_t gapY = 30.; // 30 cms. above the barrel.
149 // For the height we staimate the from the center of the ceiling,
150 // if were a cilinder, must be about 280cm.
151 Float_t barrel = 790.; // Barrel radius.
152 Float_t height = barrel + gapY - 30.;
153 Float_t initY = height;
157 // we'll start dawing from the center.
160 // Put 4 modules on the top of the magnet
162 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
163 gMC->Gspos("CRT1", i, "CRTA", initX, initY, (i-step)*box[2], 0, "ONLY");
167 // Modules on the barrel sides.
168 // Because the openenig angle for each face is 22.5, and if we want to
169 // put the modules right in the middle
170 Float_t xtragap = 10.;
171 Float_t initXside = (height+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side
172 Float_t initYside = (height+xtragap)*TMath::Cos(2*22.5*kDegrad);
174 // Put 4 modules on the left side of the magnet
175 // The rotation matrix parameters, for the left side.
176 AliMatrix(idrotm[232], 90., 315., 90., 45., 0., 337.5);
178 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
179 gMC->Gspos("CRT1", i+4, "CRTA", initXside, initYside, (i-stepl)*box[2],
180 idrotm[232], "ONLY");
184 // Put 4 modules on the right side of the magnet
185 // The rotation matrix parameters for the right side.
186 AliMatrix(idrotm[231], 90., 45., 90., 315., 180., 202.5);
188 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
189 gMC->Gspos("CRT1", i+8, "CRTA", -initXside, initYside, (i-stepr)*box[2],
190 idrotm[231], "ONLY");
196 //_____________________________________________________________________________
197 void AliCRTv0::CreateHall()
201 Float_t phid, phim, pbox[3], h, r, tspar[5];
202 Float_t w1, dh, am, bm, dl,cm, hm, dr, dx, xl;
204 Float_t trdpar[4], trapar[11];
207 Int_t *idtmed = fIdtmed->GetArray()-1899;
209 // Because the BODY, was "filled with vaccum", we're goin to superimpose
210 // a volume with molasse, then using the boolenaq operations with volumes
211 // we are going the replace, with air, the part closed by the hall walls
213 // For the moment, just use the simple mother volume ...
218 gMC->Gsvolu("CRTA", "BOX", idtmed[1905], mola, 3);
219 gMC->Gspos("CRTA", 1, "ALIC", 0., 0., 0., 0, "MANY");
221 // Now make a cilinder with the size of the hall (raughtly)
222 // and fill it with air.
224 hall[0] = 0.; // Inner radius
225 hall[1] = 1170.; // Outer radius
226 hall[2] = 2625. + 200.; // Hall lenght
227 gMC->Gsvolu("CRTB", "TUBE", idtmed[1914], hall, 3);
228 // perform the substraction SMOL - SALL, asigning SMOL as MANY and
230 gMC->Gspos("CRTB", 1, "CRTA", 0., 500., -2*375., 0, "ONLY");
232 // RB24/26 TUNNEL FLOOR
236 phi = TMath::ACos(h / r);
237 xl = r * TMath::Sin(phi);
239 dh = dr * TMath::Cos(phi);
240 dl = dr * TMath::Sin(phi);
242 AliMatrix(idrotm[1900], 90., 0., 0., 0., 90., 90.);
243 AliMatrix(idrotm[1901], 270., 0., 90., 90., 0., 0.);
249 gMC->Gsvolu("CRTC", "BOX ", idtmed[1956], pbox, 3);
250 gMC->Gspos("CRTC", 1, "CRTA", 0., 404., 1960, 0, "ONLY");
252 // hall floor, the interior part (left)
256 trdpar[1] = TMath::Tan(phid * kDegrad) * 190. + 700.;
259 gMC->Gsvolu("CRTD", "TRD1", idtmed[1956], trdpar, 4);
260 gMC->Gspos("CRTD", 1, "CRTA", 0., -801., 1350., idrotm[1900], "ONLY");
262 // hall floor, the outside part
266 trdpar[1] = TMath::Tan(phid * kDegrad) * 190. + 700.;
269 gMC->Gsvolu("CRTE", "TRD1", idtmed[1956], trdpar, 4);
270 gMC->Gspos("CRTE", 2, "CRTA", 0., -801., -2125., idrotm[1900], "ONLY");
278 trapar[3] = 1273.78/2;
281 trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
282 trapar[7] = trapar[3];
283 trapar[8] = trapar[4];
284 trapar[9] = trapar[5];
285 trapar[10] = trapar[6];
286 dx = trapar[4] * 1.5 + 700. - trapar[5] * .5;
287 gMC->Gsvolu("CRTF", "TRAP", idtmed[1956], trapar, 11);// interior wall
288 gMC->Gspos("CRTF", 1, "CRTA", dx, -896+trapar[3], 1350., 0, "ONLY");
289 gMC->Gspos("CRTF", 2, "CRTA",-dx, -896+trapar[3], 1350., idrotm[1901], "ONLY");
294 for ( Int_t i = 1 ; i <= 10 ; i++ ) {
295 trapare[i] = trapar[i];
297 gMC->Gsvolu("CRTG", "TRAP", idtmed[1956], trapare, 11);// exterior wall
298 gMC->Gspos("CRTG", 1, "CRTA", dx, -896+trapar[3], -1075., 0, "ONLY");
299 gMC->Gspos("CRTG", 2, "CRTA",-dx, -896+trapar[3], -1075., idrotm[1901], "ONLY");
302 pbox[1] = (500. - (trapar[3] * 2. - 896.)) / 2.;
304 gMC->Gsvolu("CRTH", "BOX ", idtmed[1956], pbox, 3);
305 gMC->Gspos("CRTH", 1, "CRTA", 1120., 500-pbox[1], 275., 0, "ONLY");
306 gMC->Gspos("CRTH", 2, "CRTA", -1120., 500-pbox[1], 275., 0, "ONLY");
308 // slanted wall close to L3 magnet
312 //rm = hm / TMath::Cos(phim / 2. * kDegrad);
313 am = hm * TMath::Tan(phim / 2. * kDegrad);
314 bm = (hm + 76.) / hm * am;
315 cm = bm * 2. / TMath::Sqrt(2.);
319 trapar[3] = (1273.78 - cm) / 2.;
320 trapar[4] = 235. - cm * TMath::Tan(phid * kDegrad) / 2.;
322 trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
323 trapar[7] = trapar[3];
324 trapar[8] = trapar[4];
325 trapar[9] = trapar[5];
326 trapar[10] = trapar[6];
328 dx = cm*TMath::Tan(phid * kDegrad) + 700. + trapar[4] * 1.5 - trapar[5] * .5;
329 gMC->Gsvolu("CRTI", "TRAP", idtmed[1956], trapar, 11);
330 r2 = cm - 896. + trapar[3];
331 gMC->Gspos("CRTI", 1, "CRTA", dx, r2, 0., 0, "ONLY");
332 gMC->Gspos("CRTI", 2, "CRTA",-dx, r2, 0., idrotm[1901], "ONLY");
334 trapar[4] = w1 + cm / 2.;
336 trapar[6] = TMath::ATan(.5) * kRaddeg;
337 trapar[7] = trapar[3];
338 trapar[8] = trapar[4];
339 trapar[9] = trapar[5];
340 trapar[10] = trapar[6];
341 dx = 1170. - trapar[4] * .5 - trapar[5] * .5;
342 gMC->Gsvolu("CRTJ", "TRAP", idtmed[1956], trapar, 11);
343 r2 = trapar[3] - 896.;
344 gMC->Gspos("CRTJ", 1, "CRTA", dx, r2, 0., 0, "ONLY");
345 gMC->Gspos("CRTJ", 2, "CRTA",-dx, r2, 0., idrotm[1901], "ONLY");
352 gMC->Gsvolu("CRTK", "TUBS", idtmed[1956], tspar, 5);
353 gMC->Gspos("CRTK", 1, "CRTA", 0., 500., 300., 0, "ONLY");
354 trdpar[0] = 1170 - trapar[4] * 2.;
355 trdpar[1] = trdpar[0] + TMath::Tan(phim * kDegrad) * 76.;
358 gMC->Gsvolu("CRTL", "TRD1", idtmed[1956], trdpar, 4);
359 gMC->Gspos("CRTL", 1, "CRTA", 0., -858., 0., idrotm[1900], "ONLY");
363 // Define the setion tube of the PX24, at the same level of hall
364 // rotate the tubes around X, Z'=Y, Y'=-Z
365 AliMatrix(idrotm[2001], 0., 0., 90., 0., 90., 90.);
367 pxi[0] = 1150.; // inside radius
368 pxi[1] = 1250.; // outside radius
369 pxi[2] = 1300.; // half lenght in Z
370 pxi[3] = kRaddeg*TMath::ASin(tspar[0]/pxi[0]);//starting angle of the segment
371 pxi[4] = 360.-pxi[3]; // ending angle of the segment
372 gMC->Gsvolu("CRTM", "TUBS", idtmed[1956], pxi, 5);
373 gMC->Gspos("CRTM", 1, "CRTA", 0., 404., -2300., idrotm[2001], "MANY");
375 // Define the setion tube of the PX24, above the hall
379 pxa[2] = 2550. - pxi[2]; // Half lenght
380 gMC->Gsvolu("CRTN", "TUBE", idtmed[1956], pxa, 3);
381 gMC->Gspos("CRTN", 1, "CRTA", 0.,pxi[2]+404+pxa[2], -2300., idrotm[2001], "MANY");
382 // Fill this section with air.
387 gMC->Gsvolu("CRTO", "TUBE", idtmed[1914], pxb, 3);
388 gMC->Gspos("CRTO", 1, "CRTA", 0., pxi[2]+404+pxa[2], -2300., idrotm[2001], "ONLY");
393 pma[0] = 910./2.;// Inner radius
394 pma[1] = pma[0] + 100.; // Outer Radius
395 pma[2] = 5100./2.; // Half lenght
396 gMC->Gsvolu("CRTP", "TUBE", idtmed[1956], pma, 3);
397 gMC->Gspos("CRTP", 1, "CRTA", -2100., 1654., 0., idrotm[2001], "ONLY");
403 gMC->Gsvolu("CRTQ", "TUBE", idtmed[1914], pmb, 3);
404 gMC->Gspos("CRTQ", 1, "CRTA", -2100., 1654., 0., idrotm[2001], "ONLY");
409 pgc[0] = 1200./2.;// Inner Radius
410 pgc[1] = pgc[0] + 100.; // outer Radius
411 pgc[2] = 5100./2.; // Half lenght
412 gMC->Gsvolu("CRTR", "TUBE", idtmed[1956], pgc, 3);
413 gMC->Gspos("CRTR", 1, "CRTA", 375., 1654., 4850., idrotm[2001], "ONLY");
419 gMC->Gsvolu("CRTS", "TUBE", idtmed[1914], pgd, 3);
420 gMC->Gspos("CRTS", 1, "CRTA", 375., 1654., 4850., idrotm[2001], "ONLY");
423 //_____________________________________________________________________________
424 void AliCRTv0::CreateMaterials()
430 // Use the standard materials.
431 AliCRT::CreateMaterials();
435 //_____________________________________________________________________________
436 void AliCRTv0::DrawDetector()
441 //_____________________________________________________________________________
442 void AliCRTv0::DrawModule()
445 // Draw a shaded view of the L3 magnet
447 cout << "AliCRTv0::DrawModule() : Drawing the module" << endl;
449 gMC->Gsatt("*", "seen", -1);
450 gMC->Gsatt("alic", "seen", 0);
452 gMC->Gsatt("ALIC","seen",0); // Mother volume, pit ceiling
453 gMC->Gsatt("L3MO","seen",1); // L3 Magnet
454 gMC->Gsatt("CRT1","seen",1); // Scintillators (air) box.
456 // Draw the volumes for all the hall.
457 gMC->Gsatt("CRTA","seen",1);
458 gMC->Gsatt("CRTB","seen",1);
459 gMC->Gsatt("CRTC","seen",1);
460 gMC->Gsatt("CRTD","seen",1);
461 gMC->Gsatt("CRTE","seen",1);
462 gMC->Gsatt("CRTF","seen",1);
463 gMC->Gsatt("CRTG","seen",1);
464 gMC->Gsatt("CRTH","seen",1);
465 gMC->Gsatt("CRTI","seen",1);
466 gMC->Gsatt("CRTJ","seen",1);
467 gMC->Gsatt("CRTK","seen",1);
468 gMC->Gsatt("CRTL","seen",1);
469 gMC->Gsatt("CRTM","seen",1);
470 gMC->Gsatt("CRTN","seen",1);
471 gMC->Gsatt("CRTO","seen",1);
472 gMC->Gsatt("CRTP","seen",1);
473 gMC->Gsatt("CRTQ","seen",1);
474 gMC->Gsatt("CRTR","seen",1);
475 gMC->Gsatt("CRTS","seen",1);
478 gMC->Gdopt("hide", "on");
479 gMC->Gdopt("edge","off");
480 gMC->Gdopt("shad", "on");
481 gMC->Gsatt("*", "fill", 7);
482 gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
484 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
485 gMC->Gdhead(1111, "View of CRT(ACORDE)");
486 gMC->Gdman(18, 4, "MAN");
491 //_____________________________________________________________________________
492 void AliCRTv0::Init()
495 // Initialise L3 magnet after it has been built
499 printf("\n%s: ",ClassName());
500 for(i=0;i<35;i++) printf("*");
501 printf(" CRTv0_INIT ");
502 for(i=0;i<35;i++) printf("*");
503 printf("\n%s: ",ClassName());
505 // Here the CRTv0 initialisation code (if any!)
506 for(i=0;i<80;i++) printf("*");
512 //_____________________________________________________________________________
513 void AliCRTv0::StepManager()
516 // Called for every step in the CRT Detector
521 // Check if this is the last step of the track in the current volume
522 Bool_t laststepvol = gMC->IsTrackEntering();
525 gMC->TrackPosition(xyz);
527 gMC->TrackMomentum(pxyz);
529 if ( laststepvol && (strcmp(gMC->CurrentVolName(),"CRT1") == 0) ) {
530 if ( gMC->TrackCharge() != 0 || gMC->TrackPid() == kGamma ) {
535 if ( (gMC->TrackPid() != kMuonPlus) && (gMC->TrackPid() != kMuonMinus)) {
536 hits[1] = -(Float_t)gMC->TrackPid();
538 hits[1] = (Float_t)gMC->TrackPid();
542 gMC->TrackPosition(xyz);
544 gMC->TrackMomentum(pxyz);
546 hits[2] = xyz[0]; // X pit
547 hits[3] = xyz[1]; // Y pit
548 hits[4] = xyz[2]; // Z pit
549 hits[5] = pxyz[0]; // pxug
550 hits[6] = pxyz[1]; // pyug
551 hits[7] = pxyz[2]; // pzug
553 hits[8] = gMC->GetMedium(); // layer
554 hits[9] = vert[0]; // xver
555 hits[10] = vert[1]; // yver
556 hits[11] = vert[2]; // zver
561 AddHit(gAlice->CurrentTrack(),vol, hits);