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 ///////////////////////////////////////////////////////////////////////////////
50 #include <TGeometry.h>
53 #include <TVirtualMC.h>
58 #include "AliCRTConstants.h"
59 #include "AliCRTModule.h"
63 //_____________________________________________________________________________
68 // Default constructor
72 //_____________________________________________________________________________
73 AliCRTv0::AliCRTv0(const char *name, const char *title)
77 // Standard constructor
81 <img src="picts/AliCRTv0.gif">
89 //_____________________________________________________________________________
90 AliCRTv0::AliCRTv0(const AliCRTv0& crt)
99 //_____________________________________________________________________________
100 AliCRTv0::~AliCRTv0()
103 // Default destructor
107 //_____________________________________________________________________________
108 AliCRTv0& AliCRTv0::operator=(const AliCRTv0& crt)
111 // Asingment operator.
117 //_____________________________________________________________________________
118 void AliCRTv0::BuildGeometry()
121 // Create the ROOT TNode geometry for the CRT
126 const Int_t kColorCRT = kRed;
128 // Find the top node alice.
129 top = gAlice->GetGeometry()->GetNode("alice");
131 AliCRTConstants* crtConstants = AliCRTConstants::Instance();
133 new TBRIK("S_CRT_A", "CRT box", "void",
134 crtConstants->ActiveAreaLenght()/2.,
135 crtConstants->ActiveAreaHeight()/2.,
136 crtConstants->ActiveAreaWidth()/2.);
139 new TRotMatrix("Left", "Left", 90., 315., 90., 45., 0., 337.5);
140 new TRotMatrix("Right", "Right", 90., 45., 90., 315., 180., 202.5);
141 new TRotMatrix("Up", "Up", 90., 0., 90., 90., 0., 90.);
145 // Put 4 modules on the top of the magnet
146 Float_t box = crtConstants->CageWidth()/2.;
148 node = new TNode("upper1", "upper1", "S_CRT_A", 0., 790., 3.*box, "Up");
149 node->SetLineColor(kColorCRT);
153 node = new TNode("upper2", "upper2", "S_CRT_A", 0., 790., box, "Up");
154 node->SetLineColor(kColorCRT);
158 node = new TNode("upper3", "upper3", "S_CRT_A", 0., 790., -1.*box, "Up");
159 node->SetLineColor(kColorCRT);
163 node = new TNode("upper4", "upper4", "S_CRT_A", 0., 790., -3.*box, "Up");
164 node->SetLineColor(kColorCRT);
168 // Modules on the left side.
169 Float_t xtragap = 10.;
170 Float_t initXside = (790.+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side
171 Float_t initYside = (790.+xtragap)*TMath::Cos(2*22.5*kDegrad);
173 node = new TNode("upper5", "upper5", "S_CRT_A", initXside, initYside, 3.*box, "Left");
174 node->SetLineColor(kColorCRT);
178 node = new TNode("upper6", "upper6", "S_CRT_A", initXside, initYside, box, "Left");
179 node->SetLineColor(kColorCRT);
183 node = new TNode("upper7", "upper7", "S_CRT_A", initXside, initYside, -1.*box, "Left");
184 node->SetLineColor(kColorCRT);
188 node = new TNode("upper8", "upper8", "S_CRT_A", initXside, initYside, -3.*box, "Left");
189 node->SetLineColor(kColorCRT);
193 // Modules on the right side.
195 node = new TNode("upper9", "upper9", "S_CRT_A", -initXside, initYside, 3.*box, "Right");
196 node->SetLineColor(kColorCRT);
200 node = new TNode("upper10", "upper10", "S_CRT_A", -initXside, initYside, box, "Right");
201 node->SetLineColor(kColorCRT);
205 node = new TNode("upper11","upper11", "S_CRT_A", -initXside, initYside, -1.*box, "Right");
206 node->SetLineColor(kColorCRT);
210 node = new TNode("upper12","upper12", "S_CRT_A", -initXside, initYside, -3.*box, "Right");
211 node->SetLineColor(kColorCRT);
216 //_____________________________________________________________________________
217 void AliCRTv0::CreateGeometry()
220 // Create geometry for the CRT array
223 Int_t idrotm[2499]; // The rotation matrix.
224 Int_t* idtmed = fIdtmed->GetArray() - 1099;
225 AliCRTConstants* crtConstants = AliCRTConstants::Instance();
227 // Create the mother volume.
228 // This volume can be seen as the volume which ACORDE will ocupate
229 // above the upper face of the L3 magnet. Inside this volume the detectors
230 // aboce the magnet will be, then there will be two copies of this volume,
231 // one for each side.
233 //box[0] = 2*crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
234 box[0] = crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
235 box[1] = crtConstants->MagMaxRadius() - crtConstants->MagMinRadius();
236 box[2] = crtConstants->MagnetLenght()/2;
237 gMC->Gsvolu("CRT1", "BOX", idtmed[1112], box, 3);
239 // Check if the AliCRTModule instance have been set, otherwise
240 // use the default values
242 Info("CreateGeometry", "Using default dimensions");
243 fModule = new AliCRTModule("CRTmod", "Default module dimensions");
246 // The full module volume.
247 // This volume will be ocupied by all the material of the module
248 // the scintillators, the aluminium frame, etc.
249 box[0] = fModule->FrameLength()/2;
250 box[1] = fModule->FrameThickness()/2;
251 box[2] = fModule->FrameWidth()/2;
252 gMC->Gsvolu("CRT2", "BOX", idtmed[1114], box, 3);
255 box[0] = crtConstants->SinglePaletteLenght()/4;
256 box[1] = crtConstants->SinglePaletteHeight();
257 box[2] = crtConstants->SinglePaletteWidth()/2;
258 gMC->Gsvolu("CRT3", "BOX", idtmed[1112], box, 3);
259 gMC->Gspos("CRT3", 1, "CRT2", 0, 2, 0, 0, "ONLY");
261 // The metallic frame
262 box[0] = fModule->FrameLength()/2;
263 box[1] = fModule->FrameThickness()/2;
265 gMC->Gsvolu("CRT4", "BOX", idtmed[1108], box, 3);
266 gMC->Gspos("CRT4", 1, "CRT2", 0, 0, 13 - box[2], 0, "MANY");
267 gMC->Gspos("CRT4", 2, "CRT2", 0, 0, -13 + box[2], 0, "MANY");
270 box[1] = fModule->FrameThickness()/2;
271 box[2] = fModule->FrameWidth()/2;
272 gMC->Gsvolu("CRT5", "BOX", idtmed[1108], box, 3);
273 gMC->Gspos("CRT5", 1, "CRT2", 140 - box[0], 0, 0, 0, "MANY");
274 gMC->Gspos("CRT5", 2, "CRT2", -140 + box[0], 0, 0, 0, "MANY");
278 box[1] = fModule->FrameThickness()/2;
280 gMC->Gsvolu("CRT6", "BOX", idtmed[1108], box, 3);
282 // Now put into the volume CR11 all the above volumes.
283 // 20 scintillation modules
285 Int_t copyNumber = 0;
286 for ( Int_t k = 0; k < fModule->NumberOfRows(); k++ ) {
287 Float_t zCoordinate = k*fModule->ZGap() - 450;
288 gMC->Gspos("CRT2",++copyNumber,"CRT1",-150, 15, zCoordinate, 0, "MANY");
289 gMC->Gspos("CRT2",++copyNumber,"CRT1",150, 15, zCoordinate, 0, "MANY");
293 // Put the support bars
294 gMC->Gspos("CRT6", 1, "CRT1", -75, 5, 0, 0, "ONLY");
295 gMC->Gspos("CRT6", 2, "CRT1", -225, 5, 0, 0, "ONLY");
296 gMC->Gspos("CRT6", 3, "CRT1", 75, 5, 0, 0, "ONLY");
297 gMC->Gspos("CRT6", 4, "CRT1", 225, 5, 0, 0, "ONLY");
299 // Now put a copy of CR11 on the 3 upper faces of the magnet
300 // In the right side side of the magnet
301 AliMatrix(idrotm[231], 90, 45, 90, 135, 0, 0);
302 // In the left side side of the magnet
303 AliMatrix(idrotm[232], 90, 315, 90, 45, 0, 0);
305 Float_t x = crtConstants->MagMinRadius()+10;
306 gMC->Gspos("CRT1", 1, "ALIC", 0, x, 0, 0, "MANY");
307 gMC->Gspos("CRT1", 2, "ALIC", -x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[231], "MANY");
308 gMC->Gspos("CRT1", 3, "ALIC", x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[232], "MANY");
312 //_____________________________________________________________________________
313 void AliCRTv0::DrawDetector() const
316 // Draw a shaded view of the L3 magnet
319 Info("DrawDetector", "Drawing the module");
321 gMC->Gsatt("*", "seen", -1);
323 gMC->Gsatt("ALIC","seen",0);
325 gMC->Gsatt("L3MO","seen",0); // L3 Magnet, Mother
326 gMC->Gsatt("L3CO","seen",1); // Coils
327 gMC->Gsatt("L3C1","seen",1); // Coils
328 gMC->Gsatt("L3YO","seen",1); // Yoke
329 gMC->Gsatt("L3DO","seen",0); // return Yoke (DOOR)
330 gMC->Gsatt("L3FR","seen",1); // DOOR
331 gMC->Gsatt("L3IR","seen",0); // Inner layer
332 gMC->Gsatt("L3O1","seen",1); // Door opening
333 gMC->Gsatt("L3O2","seen",1); // Door opening
335 gMC->Gsatt("CRT1", "seen", 0); // CRT Mother
336 gMC->Gsatt("CRT2", "seen", 0); // Module air box
337 gMC->Gsatt("CRT3", "seen", 1); // Scintillators
338 gMC->Gsatt("CRT3", "colo", 2); // Scintillators
339 gMC->Gsatt("CRT4", "seen", 1); // Aluminium frame (long bars)
340 gMC->Gsatt("CRT4", "colo", 3); //
341 gMC->Gsatt("CRT5", "seen", 1); // Aluminium frame (short bars)
342 gMC->Gsatt("CRT5", "colo", 3); //
343 gMC->Gsatt("CRT6", "seen", 1); // Module support
344 gMC->Gsatt("CRT6", "colo", 3); //
346 gMC->Gdopt("hide", "on");
347 gMC->Gdopt("edge","off");
348 gMC->Gdopt("shad", "on");
349 gMC->Gsatt("*", "fill", 7);
350 gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
352 //gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
353 gMC->Gdraw("alic", 30, 40, 0, -30, -60, .09, .09);
354 gMC->Gdhead(1111, "View of CRT(ACORDE)");
355 gMC->Gdman(18, 4, "MAN");