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.1 2002/06/16 17:08:19 hristov
24 ///////////////////////////////////////////////////////////////////////////////
26 // Alice COsmic Ray Trigger //
28 // This class contains the functions for version 0 of the Cosmic Rays ALICE //
33 // Arturo Fernandez <afernand@fcfm.buap.mx>
34 // Enrique Gamez <egamez@fcfm.buap.mx>
36 // Universidad Autonoma de Puebla
41 <img src="picts/AliCRTv0Class.gif">
44 <p>The responsible person for this module is
45 <a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>.
51 ///////////////////////////////////////////////////////////////////////////////
56 #include <TGeometry.h>
59 #include <TLorentzVector.h>
62 #include "AliCRTConstants.h"
72 //_____________________________________________________________________________
73 AliCRTv0::AliCRTv0() : AliCRT()
76 // Default constructor for CRT
81 //_____________________________________________________________________________
82 AliCRTv0::AliCRTv0(const char *name, const char *title)
86 // Standard constructor for CRT
90 <img src="picts/AliCRTv0.gif">
95 //_____________________________________________________________________________
96 void AliCRTv0::BuildGeometry()
101 //_____________________________________________________________________________
102 void AliCRTv0::CreateGeometry()
105 // Create geometry for the CRT array
112 Int_t idrotm[2499]; // The rotation matrix.
114 // idtmed[1099->1198] equivalent to fIdtmed[0->100]
115 Int_t * idtmed = fIdtmed->GetArray() - 1099 ;
117 // In order to generate the more correctly the modules (more datails)
118 // we will create a box (air box) as a (sub)mother volume.
119 // Inside this box we'll put the scintillator tiles, the PMTs the frame
120 // and, maybe, some other things.
123 box[0] = AliCRTConstants::fgCageLenght/2.; // Half Length of the box along the X axis, cm.
124 box[1] = AliCRTConstants::fgCageHeight/2.; // Half Length of the box along the Y axis, cm.
125 box[2] = AliCRTConstants::fgCageWidth/2.; // Half Length of the box along the Z axis, cm.
128 // Define the Scintillators. as a big box.
130 scint[0] = AliCRTConstants::fgActiveAreaLenght/2.; // Half Length in X
131 scint[1] = AliCRTConstants::fgActiveAreaHeight/2.; // Half Length in Y
132 scint[2] = AliCRTConstants::fgActiveAreaWidth/2.; // Half Length in Z
133 gMC->Gsvolu("CRT1", "BOX ", idtmed[1102], scint, 3); // Scintillators
134 // Divide the modules in 2 planes.
135 //gMC->Gsdvn("CRT2", "CRT1", 2, 2);
136 // Now divide each plane in 8 palettes
137 //gMC->Gsdvn("CRT3", "CRT1", 8, 3);
141 // Define the coordinates where the draw will begin.
146 // we'll start dawing from the center.
151 Float_t gapY = 30.; // 30 cms. above the barrel.
152 // For the height we staimate the from the center of the ceiling,
153 // if were a cilinder, must be about 280cm.
154 Float_t barrel = 790.; // Barrel radius.
155 Float_t height = barrel + gapY - 30.;
156 Float_t initY = height;
160 // we'll start dawing from the center.
163 // Put 4 modules on the top of the magnet
165 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
166 gMC->Gspos("CRT1", i, "CRTA", initX, initY, (i-step)*box[2], 0, "ONLY");
170 // Modules on the barrel sides.
171 // Because the openenig angle for each face is 22.5, and if we want to
172 // put the modules right in the middle
173 Float_t xtragap = 10.;
174 Float_t initXside = (height+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side
175 Float_t initYside = (height+xtragap)*TMath::Cos(2*22.5*kDegrad);
177 // Put 4 modules on the left side of the magnet
178 // The rotation matrix parameters, for the left side.
179 AliMatrix(idrotm[232], 90., 315., 90., 45., 0., 337.5);
181 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
182 gMC->Gspos("CRT1", i+4, "CRTA", initXside, initYside, (i-stepl)*box[2],
183 idrotm[232], "ONLY");
187 // Put 4 modules on the right side of the magnet
188 // The rotation matrix parameters for the right side.
189 AliMatrix(idrotm[231], 90., 45., 90., 315., 180., 202.5);
191 for ( Int_t i = 1 ; i <= 4 ; i++ ) {
192 gMC->Gspos("CRT1", i+8, "CRTA", -initXside, initYside, (i-stepr)*box[2],
193 idrotm[231], "ONLY");
199 //_____________________________________________________________________________
200 void AliCRTv0::CreateHall()
204 Float_t phid, phim, pbox[3], h, r, tspar[5];
205 Float_t w1, dh, am, bm, dl,cm, hm, dr, dx, xl;
207 Float_t trdpar[4], trapar[11];
210 Int_t *idtmed = fIdtmed->GetArray()-1899;
212 // Because the BODY, was "filled with vaccum", we're goin to superimpose
213 // a volume with molasse, then using the boolenaq operations with volumes
214 // we are going the replace, with air, the part closed by the hall walls
216 // For the moment, just use the simple mother volume ...
221 gMC->Gsvolu("CRTA", "BOX", idtmed[1905], mola, 3);
222 gMC->Gspos("CRTA", 1, "ALIC", 0., 0., 0., 0, "MANY");
224 // Now make a cilinder with the size of the hall (raughtly)
225 // and fill it with air.
227 hall[0] = 0.; // Inner radius
228 hall[1] = 1170.; // Outer radius
229 hall[2] = 2625. + 200.; // Hall lenght
230 gMC->Gsvolu("CRTB", "TUBE", idtmed[1914], hall, 3);
231 // perform the substraction SMOL - SALL, asigning SMOL as MANY and
233 gMC->Gspos("CRTB", 1, "CRTA", 0., 500., -2*375., 0, "ONLY");
235 // RB24/26 TUNNEL FLOOR
239 phi = TMath::ACos(h / r);
240 xl = r * TMath::Sin(phi);
242 dh = dr * TMath::Cos(phi);
243 dl = dr * TMath::Sin(phi);
245 AliMatrix(idrotm[1900], 90., 0., 0., 0., 90., 90.);
246 AliMatrix(idrotm[1901], 270., 0., 90., 90., 0., 0.);
252 gMC->Gsvolu("CRTC", "BOX ", idtmed[1956], pbox, 3);
253 gMC->Gspos("CRTC", 1, "CRTA", 0., 404., 1960, 0, "ONLY");
255 // hall floor, the interior part (left)
259 trdpar[1] = TMath::Tan(phid * kDegrad) * 190. + 700.;
262 gMC->Gsvolu("CRTD", "TRD1", idtmed[1956], trdpar, 4);
263 gMC->Gspos("CRTD", 1, "CRTA", 0., -801., 1350., idrotm[1900], "ONLY");
265 // hall floor, the outside part
269 trdpar[1] = TMath::Tan(phid * kDegrad) * 190. + 700.;
272 gMC->Gsvolu("CRTE", "TRD1", idtmed[1956], trdpar, 4);
273 gMC->Gspos("CRTE", 2, "CRTA", 0., -801., -2125., idrotm[1900], "ONLY");
281 trapar[3] = 1273.78/2;
284 trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
285 trapar[7] = trapar[3];
286 trapar[8] = trapar[4];
287 trapar[9] = trapar[5];
288 trapar[10] = trapar[6];
289 dx = trapar[4] * 1.5 + 700. - trapar[5] * .5;
290 gMC->Gsvolu("CRTF", "TRAP", idtmed[1956], trapar, 11);// interior wall
291 gMC->Gspos("CRTF", 1, "CRTA", dx, -896+trapar[3], 1350., 0, "ONLY");
292 gMC->Gspos("CRTF", 2, "CRTA",-dx, -896+trapar[3], 1350., idrotm[1901], "ONLY");
297 for ( Int_t i = 1 ; i <= 10 ; i++ ) {
298 trapare[i] = trapar[i];
300 gMC->Gsvolu("CRTG", "TRAP", idtmed[1956], trapare, 11);// exterior wall
301 gMC->Gspos("CRTG", 1, "CRTA", dx, -896+trapar[3], -1075., 0, "ONLY");
302 gMC->Gspos("CRTG", 2, "CRTA",-dx, -896+trapar[3], -1075., idrotm[1901], "ONLY");
305 pbox[1] = (500. - (trapar[3] * 2. - 896.)) / 2.;
307 gMC->Gsvolu("CRTH", "BOX ", idtmed[1956], pbox, 3);
308 gMC->Gspos("CRTH", 1, "CRTA", 1120., 500-pbox[1], 275., 0, "ONLY");
309 gMC->Gspos("CRTH", 2, "CRTA", -1120., 500-pbox[1], 275., 0, "ONLY");
311 // slanted wall close to L3 magnet
315 //rm = hm / TMath::Cos(phim / 2. * kDegrad);
316 am = hm * TMath::Tan(phim / 2. * kDegrad);
317 bm = (hm + 76.) / hm * am;
318 cm = bm * 2. / TMath::Sqrt(2.);
322 trapar[3] = (1273.78 - cm) / 2.;
323 trapar[4] = 235. - cm * TMath::Tan(phid * kDegrad) / 2.;
325 trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
326 trapar[7] = trapar[3];
327 trapar[8] = trapar[4];
328 trapar[9] = trapar[5];
329 trapar[10] = trapar[6];
331 dx = cm*TMath::Tan(phid * kDegrad) + 700. + trapar[4] * 1.5 - trapar[5] * .5;
332 gMC->Gsvolu("CRTI", "TRAP", idtmed[1956], trapar, 11);
333 r2 = cm - 896. + trapar[3];
334 gMC->Gspos("CRTI", 1, "CRTA", dx, r2, 0., 0, "ONLY");
335 gMC->Gspos("CRTI", 2, "CRTA",-dx, r2, 0., idrotm[1901], "ONLY");
337 trapar[4] = w1 + cm / 2.;
339 trapar[6] = TMath::ATan(.5) * kRaddeg;
340 trapar[7] = trapar[3];
341 trapar[8] = trapar[4];
342 trapar[9] = trapar[5];
343 trapar[10] = trapar[6];
344 dx = 1170. - trapar[4] * .5 - trapar[5] * .5;
345 gMC->Gsvolu("CRTJ", "TRAP", idtmed[1956], trapar, 11);
346 r2 = trapar[3] - 896.;
347 gMC->Gspos("CRTJ", 1, "CRTA", dx, r2, 0., 0, "ONLY");
348 gMC->Gspos("CRTJ", 2, "CRTA",-dx, r2, 0., idrotm[1901], "ONLY");
355 gMC->Gsvolu("CRTK", "TUBS", idtmed[1956], tspar, 5);
356 gMC->Gspos("CRTK", 1, "CRTA", 0., 500., 300., 0, "ONLY");
357 trdpar[0] = 1170 - trapar[4] * 2.;
358 trdpar[1] = trdpar[0] + TMath::Tan(phim * kDegrad) * 76.;
361 gMC->Gsvolu("CRTL", "TRD1", idtmed[1956], trdpar, 4);
362 gMC->Gspos("CRTL", 1, "CRTA", 0., -858., 0., idrotm[1900], "ONLY");
366 // Define the setion tube of the PX24, at the same level of hall
367 // rotate the tubes around X, Z'=Y, Y'=-Z
368 AliMatrix(idrotm[2001], 0., 0., 90., 0., 90., 90.);
370 pxi[0] = 1150.; // inside radius
371 pxi[1] = 1250.; // outside radius
372 pxi[2] = 1300.; // half lenght in Z
373 pxi[3] = kRaddeg*TMath::ASin(tspar[0]/pxi[0]);//starting angle of the segment
374 pxi[4] = 360.-pxi[3]; // ending angle of the segment
375 gMC->Gsvolu("CRTM", "TUBS", idtmed[1956], pxi, 5);
376 gMC->Gspos("CRTM", 1, "CRTA", 0., 404., -2300., idrotm[2001], "MANY");
378 // Define the setion tube of the PX24, above the hall
382 pxa[2] = 2550. - pxi[2]; // Half lenght
383 gMC->Gsvolu("CRTN", "TUBE", idtmed[1956], pxa, 3);
384 gMC->Gspos("CRTN", 1, "CRTA", 0.,pxi[2]+404+pxa[2], -2300., idrotm[2001], "MANY");
385 // Fill this section with air.
390 gMC->Gsvolu("CRTO", "TUBE", idtmed[1914], pxb, 3);
391 gMC->Gspos("CRTO", 1, "CRTA", 0., pxi[2]+404+pxa[2], -2300., idrotm[2001], "ONLY");
396 pma[0] = 910./2.;// Inner radius
397 pma[1] = pma[0] + 100.; // Outer Radius
398 pma[2] = 5100./2.; // Half lenght
399 gMC->Gsvolu("CRTP", "TUBE", idtmed[1956], pma, 3);
400 gMC->Gspos("CRTP", 1, "CRTA", -2100., 1654., 0., idrotm[2001], "ONLY");
406 gMC->Gsvolu("CRTQ", "TUBE", idtmed[1914], pmb, 3);
407 gMC->Gspos("CRTQ", 1, "CRTA", -2100., 1654., 0., idrotm[2001], "ONLY");
412 pgc[0] = 1200./2.;// Inner Radius
413 pgc[1] = pgc[0] + 100.; // outer Radius
414 pgc[2] = 5100./2.; // Half lenght
415 gMC->Gsvolu("CRTR", "TUBE", idtmed[1956], pgc, 3);
416 gMC->Gspos("CRTR", 1, "CRTA", 375., 1654., 4850., idrotm[2001], "ONLY");
422 gMC->Gsvolu("CRTS", "TUBE", idtmed[1914], pgd, 3);
423 gMC->Gspos("CRTS", 1, "CRTA", 375., 1654., 4850., idrotm[2001], "ONLY");
426 //_____________________________________________________________________________
427 void AliCRTv0::CreateMaterials()
433 // Use the standard materials.
434 AliCRT::CreateMaterials();
438 //_____________________________________________________________________________
439 void AliCRTv0::DrawDetector()
444 //_____________________________________________________________________________
445 void AliCRTv0::DrawModule()
448 // Draw a shaded view of the L3 magnet
450 cout << "AliCRTv0::DrawModule() : Drawing the module" << endl;
452 gMC->Gsatt("*", "seen", -1);
453 gMC->Gsatt("alic", "seen", 0);
455 gMC->Gsatt("ALIC","seen",0); // Mother volume, pit ceiling
456 gMC->Gsatt("L3MO","seen",1); // L3 Magnet
457 gMC->Gsatt("CRT1","seen",1); // Scintillators (air) box.
459 // Draw the volumes for all the hall.
460 gMC->Gsatt("CRTA","seen",1);
461 gMC->Gsatt("CRTB","seen",1);
462 gMC->Gsatt("CRTC","seen",1);
463 gMC->Gsatt("CRTD","seen",1);
464 gMC->Gsatt("CRTE","seen",1);
465 gMC->Gsatt("CRTF","seen",1);
466 gMC->Gsatt("CRTG","seen",1);
467 gMC->Gsatt("CRTH","seen",1);
468 gMC->Gsatt("CRTI","seen",1);
469 gMC->Gsatt("CRTJ","seen",1);
470 gMC->Gsatt("CRTK","seen",1);
471 gMC->Gsatt("CRTL","seen",1);
472 gMC->Gsatt("CRTM","seen",1);
473 gMC->Gsatt("CRTN","seen",1);
474 gMC->Gsatt("CRTO","seen",1);
475 gMC->Gsatt("CRTP","seen",1);
476 gMC->Gsatt("CRTQ","seen",1);
477 gMC->Gsatt("CRTR","seen",1);
478 gMC->Gsatt("CRTS","seen",1);
481 gMC->Gdopt("hide", "on");
482 gMC->Gdopt("edge","off");
483 gMC->Gdopt("shad", "on");
484 gMC->Gsatt("*", "fill", 7);
485 gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
487 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
488 gMC->Gdhead(1111, "View of CRT(ACORDE)");
489 gMC->Gdman(18, 4, "MAN");
494 //_____________________________________________________________________________
495 void AliCRTv0::Init()
498 // Initialise L3 magnet after it has been built
502 printf("\n%s: ",ClassName());
503 for(i=0;i<35;i++) printf("*");
504 printf(" CRTv0_INIT ");
505 for(i=0;i<35;i++) printf("*");
506 printf("\n%s: ",ClassName());
508 // Here the CRTv0 initialisation code (if any!)
509 for(i=0;i<80;i++) printf("*");
515 //_____________________________________________________________________________
516 void AliCRTv0::StepManager()
519 // Called for every step in the CRT Detector
524 // Check if this is the last step of the track in the current volume
525 Bool_t laststepvol = gMC->IsTrackEntering();
528 gMC->TrackPosition(xyz);
530 gMC->TrackMomentum(pxyz);
532 if ( laststepvol && (strcmp(gMC->CurrentVolName(),"CRT1") == 0) ) {
533 if ( gMC->TrackCharge() != 0 || gMC->TrackPid() == kGamma ) {
538 if ( (gMC->TrackPid() != kMuonPlus) && (gMC->TrackPid() != kMuonMinus)) {
539 hits[1] = -(Float_t)gMC->TrackPid();
541 hits[1] = (Float_t)gMC->TrackPid();
545 gMC->TrackPosition(xyz);
547 gMC->TrackMomentum(pxyz);
549 hits[2] = xyz[0]; // X pit
550 hits[3] = xyz[1]; // Y pit
551 hits[4] = xyz[2]; // Z pit
552 hits[5] = pxyz[0]; // pxug
553 hits[6] = pxyz[1]; // pyug
554 hits[7] = pxyz[2]; // pzug
556 hits[8] = gMC->GetMedium(); // layer
557 hits[9] = vert[0]; // xver
558 hits[10] = vert[1]; // yver
559 hits[11] = vert[2]; // zver
564 AddHit(gAlice->CurrentTrack(),vol, hits);