]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CRT/AliCRTv0.cxx
Use new naming conventions from QuadSet.
[u/mrichter/AliRoot.git] / CRT / AliCRTv0.cxx
CommitLineData
fb7a1f55 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
88cb7938 16/* $Id$ */
fb7a1f55 17
18///////////////////////////////////////////////////////////////////////////////
19// //
6e9adb00 20// ALICE Cosmic Ray Trigger //
fb7a1f55 21// //
6e9adb00 22// This class contains the functions for version 0 of the ALICE Cosmic Ray //
778e67bd 23// Trigger. This version will be used to simulation comic rays in alice //
24// with all the detectors. //
fb7a1f55 25//
26// Authors:
27//
28// Arturo Fernandez <afernand@fcfm.buap.mx>
29// Enrique Gamez <egamez@fcfm.buap.mx>
30//
31// Universidad Autonoma de Puebla
32//
33//
34//Begin_Html
35/*
36<img src="picts/AliCRTv0Class.gif">
37</pre>
38<br clear=left>
39<p>The responsible person for this module is
40<a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>.
41</font>
42<pre>
43*/
44//End_Html
45// //
46///////////////////////////////////////////////////////////////////////////////
47
846389b7 48#include "AliCRTv0.h"
49
88cb7938 50#include <TGeometry.h>
bb5ce8b0 51#include <TBRIK.h>
88cb7938 52#include <TNode.h>
5d12ce38 53#include <TVirtualMC.h>
fb7a1f55 54
88cb7938 55#include "AliRun.h"
bb5ce8b0 56#include "AliConst.h"
57
bb5ce8b0 58#include "AliCRTConstants.h"
846389b7 59#include "AliCRTModule.h"
778e67bd 60
fb7a1f55 61ClassImp(AliCRTv0)
62
63//_____________________________________________________________________________
bb5ce8b0 64AliCRTv0::AliCRTv0()
65 : AliCRT()
fb7a1f55 66{
67 //
bb5ce8b0 68 // Default constructor
fb7a1f55 69 //
fb7a1f55 70}
71
72//_____________________________________________________________________________
73AliCRTv0::AliCRTv0(const char *name, const char *title)
bb5ce8b0 74 : AliCRT(name, title)
fb7a1f55 75{
76 //
bb5ce8b0 77 // Standard constructor
fb7a1f55 78 //
79 //Begin_Html
80 /*
81 <img src="picts/AliCRTv0.gif">
82 */
83 //End_Html
e939a978 84 //PH SetMarkerColor(kRed);
85 //PH SetMarkerStyle(kRed);
86 //PH SetMarkerSize(0.4);
778e67bd 87}
88
89//_____________________________________________________________________________
bb5ce8b0 90AliCRTv0::~AliCRTv0()
91{
92 //
93 // Default destructor
94 //
95}
96
fb7a1f55 97//_____________________________________________________________________________
98void AliCRTv0::BuildGeometry()
99{
778e67bd 100 //
101 // Create the ROOT TNode geometry for the CRT
102 //
103
104 TNode *node, *top;
105
106 const Int_t kColorCRT = kRed;
107
108 // Find the top node alice.
109 top = gAlice->GetGeometry()->GetNode("alice");
110
846389b7 111 AliCRTConstants* crtConstants = AliCRTConstants::Instance();
112
778e67bd 113 new TBRIK("S_CRT_A", "CRT box", "void",
846389b7 114 crtConstants->ActiveAreaLenght()/2.,
115 crtConstants->ActiveAreaHeight()/2.,
116 crtConstants->ActiveAreaWidth()/2.);
778e67bd 117
118
119 new TRotMatrix("Left", "Left", 90., 315., 90., 45., 0., 337.5);
120 new TRotMatrix("Right", "Right", 90., 45., 90., 315., 180., 202.5);
121 new TRotMatrix("Up", "Up", 90., 0., 90., 90., 0., 90.);
122 top->cd();
123
124 //
125 // Put 4 modules on the top of the magnet
846389b7 126 Float_t box = crtConstants->CageWidth()/2.;
778e67bd 127 top->cd();
128 node = new TNode("upper1", "upper1", "S_CRT_A", 0., 790., 3.*box, "Up");
129 node->SetLineColor(kColorCRT);
130 fNodes->Add(node);
131
132 top->cd();
133 node = new TNode("upper2", "upper2", "S_CRT_A", 0., 790., box, "Up");
134 node->SetLineColor(kColorCRT);
135 fNodes->Add(node);
136
137 top->cd();
138 node = new TNode("upper3", "upper3", "S_CRT_A", 0., 790., -1.*box, "Up");
139 node->SetLineColor(kColorCRT);
140 fNodes->Add(node);
141
142 top->cd();
143 node = new TNode("upper4", "upper4", "S_CRT_A", 0., 790., -3.*box, "Up");
144 node->SetLineColor(kColorCRT);
145 fNodes->Add(node);
146
147
148 // Modules on the left side.
149 Float_t xtragap = 10.;
150 Float_t initXside = (790.+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side
151 Float_t initYside = (790.+xtragap)*TMath::Cos(2*22.5*kDegrad);
152 top->cd();
153 node = new TNode("upper5", "upper5", "S_CRT_A", initXside, initYside, 3.*box, "Left");
154 node->SetLineColor(kColorCRT);
155 fNodes->Add(node);
156
157 top->cd();
158 node = new TNode("upper6", "upper6", "S_CRT_A", initXside, initYside, box, "Left");
159 node->SetLineColor(kColorCRT);
160 fNodes->Add(node);
161
162 top->cd();
163 node = new TNode("upper7", "upper7", "S_CRT_A", initXside, initYside, -1.*box, "Left");
164 node->SetLineColor(kColorCRT);
165 fNodes->Add(node);
166
167 top->cd();
168 node = new TNode("upper8", "upper8", "S_CRT_A", initXside, initYside, -3.*box, "Left");
169 node->SetLineColor(kColorCRT);
170 fNodes->Add(node);
171
172
173 // Modules on the right side.
174 top->cd();
175 node = new TNode("upper9", "upper9", "S_CRT_A", -initXside, initYside, 3.*box, "Right");
176 node->SetLineColor(kColorCRT);
177 fNodes->Add(node);
178
179 top->cd();
180 node = new TNode("upper10", "upper10", "S_CRT_A", -initXside, initYside, box, "Right");
181 node->SetLineColor(kColorCRT);
182 fNodes->Add(node);
183
184 top->cd();
185 node = new TNode("upper11","upper11", "S_CRT_A", -initXside, initYside, -1.*box, "Right");
186 node->SetLineColor(kColorCRT);
187 fNodes->Add(node);
188
189 top->cd();
190 node = new TNode("upper12","upper12", "S_CRT_A", -initXside, initYside, -3.*box, "Right");
191 node->SetLineColor(kColorCRT);
192 fNodes->Add(node);
193
fb7a1f55 194}
195
196//_____________________________________________________________________________
197void AliCRTv0::CreateGeometry()
198{
199 //
200 // Create geometry for the CRT array
201 //
778e67bd 202
bb5ce8b0 203 Int_t idrotm[2499]; // The rotation matrix.
846389b7 204 Int_t* idtmed = fIdtmed->GetArray() - 1099;
205 AliCRTConstants* crtConstants = AliCRTConstants::Instance();
7b213e3c 206
846389b7 207 // Create the mother volume.
208 // This volume can be seen as the volume which ACORDE will ocupate
209 // above the upper face of the L3 magnet. Inside this volume the detectors
210 // aboce the magnet will be, then there will be two copies of this volume,
211 // one for each side.
778e67bd 212 Float_t box[3];
7b213e3c 213 //box[0] = 2*crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
214 box[0] = crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
846389b7 215 box[1] = crtConstants->MagMaxRadius() - crtConstants->MagMinRadius();
7b213e3c 216 box[2] = crtConstants->MagnetLenght()/2;
846389b7 217 gMC->Gsvolu("CRT1", "BOX", idtmed[1112], box, 3);
218
7b213e3c 219 // Check if the AliCRTModule instance have been set, otherwise
846389b7 220 // use the default values
221 if ( !fModule ) {
222 Info("CreateGeometry", "Using default dimensions");
223 fModule = new AliCRTModule("CRTmod", "Default module dimensions");
224 }
778e67bd 225
846389b7 226 // The full module volume.
227 // This volume will be ocupied by all the material of the module
228 // the scintillators, the aluminium frame, etc.
229 box[0] = fModule->FrameLength()/2;
230 box[1] = fModule->FrameThickness()/2;
7c231de5 231 box[2] = fModule->FrameWidth()/2;
846389b7 232 gMC->Gsvolu("CRT2", "BOX", idtmed[1114], box, 3);
233
234 // The scintillators
235 box[0] = crtConstants->SinglePaletteLenght()/4;
236 box[1] = crtConstants->SinglePaletteHeight();
237 box[2] = crtConstants->SinglePaletteWidth()/2;
238 gMC->Gsvolu("CRT3", "BOX", idtmed[1112], box, 3);
239 gMC->Gspos("CRT3", 1, "CRT2", 0, 2, 0, 0, "ONLY");
240
241 // The metallic frame
242 box[0] = fModule->FrameLength()/2;
243 box[1] = fModule->FrameThickness()/2;
244 box[2] = 2;
245 gMC->Gsvolu("CRT4", "BOX", idtmed[1108], box, 3);
246 gMC->Gspos("CRT4", 1, "CRT2", 0, 0, 13 - box[2], 0, "MANY");
247 gMC->Gspos("CRT4", 2, "CRT2", 0, 0, -13 + box[2], 0, "MANY");
248
249 box[0] = 2;
250 box[1] = fModule->FrameThickness()/2;
251 box[2] = fModule->FrameWidth()/2;
252 gMC->Gsvolu("CRT5", "BOX", idtmed[1108], box, 3);
253 gMC->Gspos("CRT5", 1, "CRT2", 140 - box[0], 0, 0, 0, "MANY");
254 gMC->Gspos("CRT5", 2, "CRT2", -140 + box[0], 0, 0, 0, "MANY");
255
256 // The support bars
257 box[0] = 2;
258 box[1] = fModule->FrameThickness()/2;
259 box[2] = 500;
260 gMC->Gsvolu("CRT6", "BOX", idtmed[1108], box, 3);
261
262 // Now put into the volume CR11 all the above volumes.
263 // 20 scintillation modules
264 // 4 support bars
265 Int_t copyNumber = 0;
266 for ( Int_t k = 0; k < fModule->NumberOfRows(); k++ ) {
846389b7 267 Float_t zCoordinate = k*fModule->ZGap() - 450;
268 gMC->Gspos("CRT2",++copyNumber,"CRT1",-150, 15, zCoordinate, 0, "MANY");
269 gMC->Gspos("CRT2",++copyNumber,"CRT1",150, 15, zCoordinate, 0, "MANY");
7b213e3c 270
846389b7 271 }
7b213e3c 272
273 // Put the support bars
846389b7 274 gMC->Gspos("CRT6", 1, "CRT1", -75, 5, 0, 0, "ONLY");
275 gMC->Gspos("CRT6", 2, "CRT1", -225, 5, 0, 0, "ONLY");
276 gMC->Gspos("CRT6", 3, "CRT1", 75, 5, 0, 0, "ONLY");
277 gMC->Gspos("CRT6", 4, "CRT1", 225, 5, 0, 0, "ONLY");
fb7a1f55 278
846389b7 279 // Now put a copy of CR11 on the 3 upper faces of the magnet
280 // In the right side side of the magnet
281 AliMatrix(idrotm[231], 90, 45, 90, 135, 0, 0);
bb5ce8b0 282 // In the left side side of the magnet
846389b7 283 AliMatrix(idrotm[232], 90, 315, 90, 45, 0, 0);
fb7a1f55 284
846389b7 285 Float_t x = crtConstants->MagMinRadius()+10;
286 gMC->Gspos("CRT1", 1, "ALIC", 0, x, 0, 0, "MANY");
287 gMC->Gspos("CRT1", 2, "ALIC", -x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[231], "MANY");
288 gMC->Gspos("CRT1", 3, "ALIC", x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[232], "MANY");
778e67bd 289
fb7a1f55 290}
291
fb7a1f55 292//_____________________________________________________________________________
846389b7 293void AliCRTv0::DrawDetector() const
fb7a1f55 294{
295 //
296 // Draw a shaded view of the L3 magnet
297 //
fb7a1f55 298
bb5ce8b0 299 Info("DrawDetector", "Drawing the module");
300
301 gMC->Gsatt("*", "seen", -1);
bb5ce8b0 302
303 gMC->Gsatt("ALIC","seen",0);
846389b7 304
305 gMC->Gsatt("L3MO","seen",0); // L3 Magnet, Mother
306 gMC->Gsatt("L3CO","seen",1); // Coils
307 gMC->Gsatt("L3C1","seen",1); // Coils
308 gMC->Gsatt("L3YO","seen",1); // Yoke
309 gMC->Gsatt("L3DO","seen",0); // return Yoke (DOOR)
310 gMC->Gsatt("L3FR","seen",1); // DOOR
311 gMC->Gsatt("L3IR","seen",0); // Inner layer
312 gMC->Gsatt("L3O1","seen",1); // Door opening
313 gMC->Gsatt("L3O2","seen",1); // Door opening
314
315 gMC->Gsatt("CRT1", "seen", 0); // CRT Mother
316 gMC->Gsatt("CRT2", "seen", 0); // Module air box
317 gMC->Gsatt("CRT3", "seen", 1); // Scintillators
318 gMC->Gsatt("CRT3", "colo", 2); // Scintillators
319 gMC->Gsatt("CRT4", "seen", 1); // Aluminium frame (long bars)
320 gMC->Gsatt("CRT4", "colo", 3); //
321 gMC->Gsatt("CRT5", "seen", 1); // Aluminium frame (short bars)
322 gMC->Gsatt("CRT5", "colo", 3); //
323 gMC->Gsatt("CRT6", "seen", 1); // Module support
324 gMC->Gsatt("CRT6", "colo", 3); //
bb5ce8b0 325
326 gMC->Gdopt("hide", "on");
327 gMC->Gdopt("edge","off");
328 gMC->Gdopt("shad", "on");
329 gMC->Gsatt("*", "fill", 7);
330 gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
331 gMC->DefaultRange();
846389b7 332 //gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
333 gMC->Gdraw("alic", 30, 40, 0, -30, -60, .09, .09);
bb5ce8b0 334 gMC->Gdhead(1111, "View of CRT(ACORDE)");
335 gMC->Gdman(18, 4, "MAN");
fb7a1f55 336}