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 ///////////////////////////////////////////////////////////////////////////////
20 // ALICE Cosmic Ray Trigger //
22 // This class contains the functions for version 0 of the ALICE Cosmic Ray //
23 // Trigger. This version will be used to simulation comic rays in alice //
24 // with all the detectors. //
28 // Arturo Fernandez <afernand@fcfm.buap.mx>
29 // Enrique Gamez <egamez@fcfm.buap.mx>
31 // Universidad Autonoma de Puebla
36 <img src="picts/AliCRTv0Class.gif">
39 <p>The responsible person for this module is
40 <a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>.
46 ///////////////////////////////////////////////////////////////////////////////
48 #include <TGeometry.h>
51 #include <TVirtualMC.h>
57 #include "AliCRTConstants.h"
61 //_____________________________________________________________________________
66 // Default constructor
70 //_____________________________________________________________________________
71 AliCRTv0::AliCRTv0(const char *name, const char *title)
75 // Standard constructor
79 <img src="picts/AliCRTv0.gif">
87 //_____________________________________________________________________________
88 AliCRTv0::AliCRTv0(const AliCRTv0& crt)
97 //_____________________________________________________________________________
101 // Default destructor
105 //_____________________________________________________________________________
106 AliCRTv0& AliCRTv0::operator=(const AliCRTv0& crt)
109 // Asingment operator.
115 //_____________________________________________________________________________
116 void AliCRTv0::BuildGeometry()
119 // Create the ROOT TNode geometry for the CRT
124 const Int_t kColorCRT = kRed;
126 // Find the top node alice.
127 top = gAlice->GetGeometry()->GetNode("alice");
129 new TBRIK("S_CRT_A", "CRT box", "void",
130 AliCRTConstants::fgActiveAreaLenght/2.,
131 AliCRTConstants::fgActiveAreaHeight/2.,
132 AliCRTConstants::fgActiveAreaWidth/2.);
135 new TRotMatrix("Left", "Left", 90., 315., 90., 45., 0., 337.5);
136 new TRotMatrix("Right", "Right", 90., 45., 90., 315., 180., 202.5);
137 new TRotMatrix("Up", "Up", 90., 0., 90., 90., 0., 90.);
141 // Put 4 modules on the top of the magnet
142 Float_t box = AliCRTConstants::fgCageWidth/2.;
144 node = new TNode("upper1", "upper1", "S_CRT_A", 0., 790., 3.*box, "Up");
145 node->SetLineColor(kColorCRT);
149 node = new TNode("upper2", "upper2", "S_CRT_A", 0., 790., box, "Up");
150 node->SetLineColor(kColorCRT);
154 node = new TNode("upper3", "upper3", "S_CRT_A", 0., 790., -1.*box, "Up");
155 node->SetLineColor(kColorCRT);
159 node = new TNode("upper4", "upper4", "S_CRT_A", 0., 790., -3.*box, "Up");
160 node->SetLineColor(kColorCRT);
164 // Modules on the left side.
165 Float_t xtragap = 10.;
166 Float_t initXside = (790.+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side
167 Float_t initYside = (790.+xtragap)*TMath::Cos(2*22.5*kDegrad);
169 node = new TNode("upper5", "upper5", "S_CRT_A", initXside, initYside, 3.*box, "Left");
170 node->SetLineColor(kColorCRT);
174 node = new TNode("upper6", "upper6", "S_CRT_A", initXside, initYside, box, "Left");
175 node->SetLineColor(kColorCRT);
179 node = new TNode("upper7", "upper7", "S_CRT_A", initXside, initYside, -1.*box, "Left");
180 node->SetLineColor(kColorCRT);
184 node = new TNode("upper8", "upper8", "S_CRT_A", initXside, initYside, -3.*box, "Left");
185 node->SetLineColor(kColorCRT);
189 // Modules on the right side.
191 node = new TNode("upper9", "upper9", "S_CRT_A", -initXside, initYside, 3.*box, "Right");
192 node->SetLineColor(kColorCRT);
196 node = new TNode("upper10", "upper10", "S_CRT_A", -initXside, initYside, box, "Right");
197 node->SetLineColor(kColorCRT);
201 node = new TNode("upper11","upper11", "S_CRT_A", -initXside, initYside, -1.*box, "Right");
202 node->SetLineColor(kColorCRT);
206 node = new TNode("upper12","upper12", "S_CRT_A", -initXside, initYside, -3.*box, "Right");
207 node->SetLineColor(kColorCRT);
212 //_____________________________________________________________________________
213 void AliCRTv0::CreateGeometry()
216 // Create geometry for the CRT array
219 Int_t idrotm[2499]; // The rotation matrix.
220 Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
222 // Create a mother volume.
224 //pbox[0] = AliCRTConstants::fgDepth*TMath::Tan(67.5*kDegrad);
226 pbox[1] = AliCRTConstants::fgDepth;
228 gMC->Gsvolu("CRT", "BOX", idtmed[1114], pbox, 3);
229 gMC->Gspos("CRT", 1, "ALIC", 0, 0, 0, 0, "ONLY");
231 // Create a big volume with air barrel above the magnet
233 Float_t magnetSides = 3.;
234 Float_t planesPerpendicularToZ = 2.;
236 barrel[1] = 45*magnetSides;
237 barrel[2] = magnetSides;
238 barrel[3] = planesPerpendicularToZ;
240 barrel[5] = AliCRTConstants::fgMagMinRadius;
241 barrel[6] = AliCRTConstants::fgMagMinRadius + 2.; // 2 cm width
242 barrel[7] = -barrel[4];
243 barrel[8] = barrel[5];
244 barrel[9] = barrel[6];
245 gMC->Gsvolu("CRT4", "PGON", idtmed[1112], barrel, 10);
246 gMC->Gspos("CRT4", 1 , "CRT", 0., -30., 0., 0, "MANY");
250 box[0] = AliCRTConstants::fgSinglePaletteLenght/4;
251 box[1] = AliCRTConstants::fgSinglePaletteHeight/2;
252 box[2] = AliCRTConstants::fgSinglePaletteWidth/2;
253 gMC->Gsvolu("CRT6", "BOX", idtmed[1112], box, 3);
255 // In the right side side of the magnet
256 AliMatrix(idrotm[231], 90., 45., 90., 315., 180., 202.5);
258 // In the left side side of the magnet
259 AliMatrix(idrotm[232], 90., 315., 90., 315., 0.0000040, 263.0707092);
261 // Now put them into the volume created above
262 // First above the magnet.
263 const Float_t away = (2.*barrel[5]*TMath::Sin(kDegrad*22.5))/4.;
264 const Int_t nModules = 10;
265 for (Int_t i = 0; i < nModules; i++) {
266 Float_t zCoordinate = i*100 - 450;
268 gMC->Gspos("CRT6", i, "CRT4", -away, barrel[5]+1., zCoordinate, 0, "MANY");
270 gMC->Gspos("CRT6",i+10,"CRT4", away, barrel[5]+1., zCoordinate, 0, "MANY");
272 // The most away part (left side)
273 gMC->Gspos("CRT6", i+20, "CRT4", 3*away, barrel[5]+31 - away, zCoordinate, idrotm[232], "MANY");
274 // The inner part (left side)
275 gMC->Gspos("CRT6", i+30, "CRT4", 4*away, barrel[5]+31 - 2*away, zCoordinate, idrotm[232], "MANY");
277 // The most away part (rigth side)
278 gMC->Gspos("CRT6", i+40, "CRT4", -3*away, barrel[5]+31 - away, zCoordinate, idrotm[231], "MANY");
279 // The inner part (rigth side)
280 gMC->Gspos("CRT6", i+50, "CRT4", -4*away, barrel[5]+31 - 2*away, zCoordinate, idrotm[231], "MANY");
283 // Now the magnet doors
285 barrel[1] = 45*magnetSides;
286 barrel[2] = magnetSides;
290 barrel[7] = barrel[4] + 2.;
291 barrel[8] = barrel[5];
292 barrel[9] = barrel[6];
293 gMC->Gsvolu("CRT5", "PGON", idtmed[1111], barrel, 10);
294 gMC->Gspos("CRT5", 1, "CRT", 0., -30., 0., 0, "ONLY");
296 AliMatrix(idrotm[300], 90., 0., 90., 90., 180., 0.);
297 gMC->Gspos("CRT5", 2, "CRT", 0., -30., 0., idrotm[300], "ONLY");
301 //_____________________________________________________________________________
302 void AliCRTv0::DrawDetector()
305 // Draw a shaded view of the L3 magnet
308 Info("DrawDetector", "Drawing the module");
310 gMC->Gsatt("*", "seen", -1);
311 gMC->Gsatt("alic", "seen", 0);
313 gMC->Gsatt("ALIC","seen",0);
314 gMC->Gsatt("L3MO","seen",1); // L3 Magnet
315 gMC->Gsatt("CRT1","seen",1); // Scintillators
317 // Draw the molasse volumes
318 gMC->Gsatt("CMO1","seen",0); // Exactly above the HALL
319 gMC->Gsatt("CMO2","seen",0); // Molasse, along the PM25
320 gMC->Gsatt("CMO3","seen",0); // molasse along the PGC2
321 gMC->Gsatt("CMO4","seen",0); // Molasse, behind the PX24 upper part
322 gMC->Gsatt("CMO5","seen",0); // molasse behind px24, lower part
323 gMC->Gsatt("CMO6","seen",0); // behind the PX24
324 gMC->Gsatt("CMO7","seen",0); // behind the PGC2
325 gMC->Gsatt("CMO8","seen",0); // on the right side.
326 gMC->Gsatt("CMO9","seen",0); // on the left side.
327 gMC->Gsatt("CM10","seen",0); // betwen PX24 & PM25.
328 gMC->Gsatt("CM11","seen",0); // betwen PGC2 & PM25.
329 gMC->Gsatt("CM12","seen",0); // box above the hall.
331 gMC->Gdopt("hide", "on");
332 gMC->Gdopt("edge","off");
333 gMC->Gdopt("shad", "on");
334 gMC->Gsatt("*", "fill", 7);
335 gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
337 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
338 gMC->Gdhead(1111, "View of CRT(ACORDE)");
339 gMC->Gdman(18, 4, "MAN");