]> git.uio.no Git - u/mrichter/AliRoot.git/blame - CRT/AliCRTv0.cxx
Clean up compilation warnings
[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
88cb7938 48#include <TGeometry.h>
bb5ce8b0 49#include <TBRIK.h>
88cb7938 50#include <TNode.h>
fb7a1f55 51
88cb7938 52#include "AliRun.h"
bb5ce8b0 53#include "AliConst.h"
54
55#include "AliCRTv0.h"
56#include "AliCRTConstants.h"
778e67bd 57
fb7a1f55 58ClassImp(AliCRTv0)
59
60//_____________________________________________________________________________
bb5ce8b0 61AliCRTv0::AliCRTv0()
62 : AliCRT()
fb7a1f55 63{
64 //
bb5ce8b0 65 // Default constructor
fb7a1f55 66 //
fb7a1f55 67}
68
69//_____________________________________________________________________________
70AliCRTv0::AliCRTv0(const char *name, const char *title)
bb5ce8b0 71 : AliCRT(name, title)
fb7a1f55 72{
73 //
bb5ce8b0 74 // Standard constructor
fb7a1f55 75 //
76 //Begin_Html
77 /*
78 <img src="picts/AliCRTv0.gif">
79 */
80 //End_Html
bb5ce8b0 81 SetMarkerColor(kRed);
82 SetMarkerStyle(kRed);
83 SetMarkerSize(0.4);
fb7a1f55 84}
85
778e67bd 86//_____________________________________________________________________________
87AliCRTv0::AliCRTv0(const AliCRTv0& crt)
bb5ce8b0 88 : AliCRT(crt)
778e67bd 89{
90 //
bb5ce8b0 91 // Copy constructor
778e67bd 92 //
93 crt.Copy(*this);
94}
95
96//_____________________________________________________________________________
bb5ce8b0 97AliCRTv0::~AliCRTv0()
98{
99 //
100 // Default destructor
101 //
102}
103
104//_____________________________________________________________________________
105AliCRTv0& AliCRTv0::operator=(const AliCRTv0& crt)
778e67bd 106{
107 //
108 // Asingment operator.
109 //
110 crt.Copy(*this);
111 return *this;
112}
113
fb7a1f55 114//_____________________________________________________________________________
115void AliCRTv0::BuildGeometry()
116{
778e67bd 117 //
118 // Create the ROOT TNode geometry for the CRT
119 //
120
121 TNode *node, *top;
122
123 const Int_t kColorCRT = kRed;
124
125 // Find the top node alice.
126 top = gAlice->GetGeometry()->GetNode("alice");
127
128 new TBRIK("S_CRT_A", "CRT box", "void",
129 AliCRTConstants::fgActiveAreaLenght/2.,
130 AliCRTConstants::fgActiveAreaHeight/2.,
131 AliCRTConstants::fgActiveAreaWidth/2.);
132
133
134 new TRotMatrix("Left", "Left", 90., 315., 90., 45., 0., 337.5);
135 new TRotMatrix("Right", "Right", 90., 45., 90., 315., 180., 202.5);
136 new TRotMatrix("Up", "Up", 90., 0., 90., 90., 0., 90.);
137 top->cd();
138
139 //
140 // Put 4 modules on the top of the magnet
141 Float_t box = AliCRTConstants::fgCageWidth/2.;
142 top->cd();
143 node = new TNode("upper1", "upper1", "S_CRT_A", 0., 790., 3.*box, "Up");
144 node->SetLineColor(kColorCRT);
145 fNodes->Add(node);
146
147 top->cd();
148 node = new TNode("upper2", "upper2", "S_CRT_A", 0., 790., box, "Up");
149 node->SetLineColor(kColorCRT);
150 fNodes->Add(node);
151
152 top->cd();
153 node = new TNode("upper3", "upper3", "S_CRT_A", 0., 790., -1.*box, "Up");
154 node->SetLineColor(kColorCRT);
155 fNodes->Add(node);
156
157 top->cd();
158 node = new TNode("upper4", "upper4", "S_CRT_A", 0., 790., -3.*box, "Up");
159 node->SetLineColor(kColorCRT);
160 fNodes->Add(node);
161
162
163 // Modules on the left side.
164 Float_t xtragap = 10.;
165 Float_t initXside = (790.+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side
166 Float_t initYside = (790.+xtragap)*TMath::Cos(2*22.5*kDegrad);
167 top->cd();
168 node = new TNode("upper5", "upper5", "S_CRT_A", initXside, initYside, 3.*box, "Left");
169 node->SetLineColor(kColorCRT);
170 fNodes->Add(node);
171
172 top->cd();
173 node = new TNode("upper6", "upper6", "S_CRT_A", initXside, initYside, box, "Left");
174 node->SetLineColor(kColorCRT);
175 fNodes->Add(node);
176
177 top->cd();
178 node = new TNode("upper7", "upper7", "S_CRT_A", initXside, initYside, -1.*box, "Left");
179 node->SetLineColor(kColorCRT);
180 fNodes->Add(node);
181
182 top->cd();
183 node = new TNode("upper8", "upper8", "S_CRT_A", initXside, initYside, -3.*box, "Left");
184 node->SetLineColor(kColorCRT);
185 fNodes->Add(node);
186
187
188 // Modules on the right side.
189 top->cd();
190 node = new TNode("upper9", "upper9", "S_CRT_A", -initXside, initYside, 3.*box, "Right");
191 node->SetLineColor(kColorCRT);
192 fNodes->Add(node);
193
194 top->cd();
195 node = new TNode("upper10", "upper10", "S_CRT_A", -initXside, initYside, box, "Right");
196 node->SetLineColor(kColorCRT);
197 fNodes->Add(node);
198
199 top->cd();
200 node = new TNode("upper11","upper11", "S_CRT_A", -initXside, initYside, -1.*box, "Right");
201 node->SetLineColor(kColorCRT);
202 fNodes->Add(node);
203
204 top->cd();
205 node = new TNode("upper12","upper12", "S_CRT_A", -initXside, initYside, -3.*box, "Right");
206 node->SetLineColor(kColorCRT);
207 fNodes->Add(node);
208
fb7a1f55 209}
210
211//_____________________________________________________________________________
212void AliCRTv0::CreateGeometry()
213{
214 //
215 // Create geometry for the CRT array
216 //
778e67bd 217
bb5ce8b0 218 Int_t idrotm[2499]; // The rotation matrix.
219 Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
778e67bd 220
bb5ce8b0 221 // Create a mother volume.
222 Float_t pbox[3];
223 //pbox[0] = AliCRTConstants::fgDepth*TMath::Tan(67.5*kDegrad);
224 pbox[0] = 12073.;
225 pbox[1] = AliCRTConstants::fgDepth;
226 pbox[2] = pbox[0];
227 gMC->Gsvolu("CRT", "BOX", idtmed[1114], pbox, 3);
228 gMC->Gspos("CRT", 1, "ALIC", 0, 0, 0, 0, "ONLY");
229
230 // Create a big volume with air barrel above the magnet
231 Float_t barrel[10];
232 Float_t magnetSides = 3.;
233 Float_t planesPerpendicularToZ = 2.;
234 barrel[0] = 22.5;
235 barrel[1] = 45*magnetSides;
236 barrel[2] = magnetSides;
237 barrel[3] = planesPerpendicularToZ;
238 barrel[4] = -700.;
239 barrel[5] = AliCRTConstants::fgMagMinRadius;
240 barrel[6] = AliCRTConstants::fgMagMinRadius + 2.; // 2 cm width
241 barrel[7] = -barrel[4];
242 barrel[8] = barrel[5];
243 barrel[9] = barrel[6];
244 gMC->Gsvolu("CRT4", "PGON", idtmed[1112], barrel, 10);
245 gMC->Gspos("CRT4", 1 , "CRT", 0., -30., 0., 0, "MANY");
778e67bd 246
247 //
778e67bd 248 Float_t box[3];
bb5ce8b0 249 box[0] = AliCRTConstants::fgSinglePaletteLenght/4;
250 box[1] = AliCRTConstants::fgSinglePaletteHeight/2;
251 box[2] = AliCRTConstants::fgSinglePaletteWidth/2;
252 gMC->Gsvolu("CRT6", "BOX", idtmed[1112], box, 3);
778e67bd 253
bb5ce8b0 254 // In the right side side of the magnet
778e67bd 255 AliMatrix(idrotm[231], 90., 45., 90., 315., 180., 202.5);
fb7a1f55 256
bb5ce8b0 257 // In the left side side of the magnet
258 AliMatrix(idrotm[232], 90., 315., 90., 315., 0.0000040, 263.0707092);
259
260 // Now put them into the volume created above
261 // First above the magnet.
262 const Float_t away = (2.*barrel[5]*TMath::Sin(kDegrad*22.5))/4.;
263 const Int_t nModules = 10;
264 for (Int_t i = 0; i < nModules; i++) {
265 Float_t zCoordinate = i*100 - 450;
266 // In the lef side
267 gMC->Gspos("CRT6", i, "CRT4", -away, barrel[5]+1., zCoordinate, 0, "MANY");
268 // In the rigth side
269 gMC->Gspos("CRT6",i+10,"CRT4", away, barrel[5]+1., zCoordinate, 0, "MANY");
270
271 // The most away part (left side)
272 gMC->Gspos("CRT6", i+20, "CRT4", 3*away, barrel[5]+31 - away, zCoordinate, idrotm[232], "MANY");
273 // The inner part (left side)
274 gMC->Gspos("CRT6", i+30, "CRT4", 4*away, barrel[5]+31 - 2*away, zCoordinate, idrotm[232], "MANY");
275
276 // The most away part (rigth side)
277 gMC->Gspos("CRT6", i+40, "CRT4", -3*away, barrel[5]+31 - away, zCoordinate, idrotm[231], "MANY");
278 // The inner part (rigth side)
279 gMC->Gspos("CRT6", i+50, "CRT4", -4*away, barrel[5]+31 - 2*away, zCoordinate, idrotm[231], "MANY");
280 }
fb7a1f55 281
bb5ce8b0 282 // Now the magnet doors
283 magnetSides = 8.;
284 barrel[1] = 45*magnetSides;
285 barrel[2] = magnetSides;
286 barrel[4] = 700.;
287 barrel[5] = 0;
288 barrel[6] = 790;
289 barrel[7] = barrel[4] + 2.;
290 barrel[8] = barrel[5];
291 barrel[9] = barrel[6];
292 gMC->Gsvolu("CRT5", "PGON", idtmed[1111], barrel, 10);
293 gMC->Gspos("CRT5", 1, "CRT", 0., -30., 0., 0, "ONLY");
294
295 AliMatrix(idrotm[300], 90., 0., 90., 90., 180., 0.);
296 gMC->Gspos("CRT5", 2, "CRT", 0., -30., 0., idrotm[300], "ONLY");
778e67bd 297
fb7a1f55 298}
299
fb7a1f55 300//_____________________________________________________________________________
301void AliCRTv0::DrawDetector()
fb7a1f55 302{
303 //
304 // Draw a shaded view of the L3 magnet
305 //
fb7a1f55 306
bb5ce8b0 307 Info("DrawDetector", "Drawing the module");
308
309 gMC->Gsatt("*", "seen", -1);
310 gMC->Gsatt("alic", "seen", 0);
311
312 gMC->Gsatt("ALIC","seen",0);
313 gMC->Gsatt("L3MO","seen",1); // L3 Magnet
314 gMC->Gsatt("CRT1","seen",1); // Scintillators
315
316 // Draw the molasse volumes
317 gMC->Gsatt("CMO1","seen",0); // Exactly above the HALL
318 gMC->Gsatt("CMO2","seen",0); // Molasse, along the PM25
319 gMC->Gsatt("CMO3","seen",0); // molasse along the PGC2
320 gMC->Gsatt("CMO4","seen",0); // Molasse, behind the PX24 upper part
321 gMC->Gsatt("CMO5","seen",0); // molasse behind px24, lower part
322 gMC->Gsatt("CMO6","seen",0); // behind the PX24
323 gMC->Gsatt("CMO7","seen",0); // behind the PGC2
324 gMC->Gsatt("CMO8","seen",0); // on the right side.
325 gMC->Gsatt("CMO9","seen",0); // on the left side.
326 gMC->Gsatt("CM10","seen",0); // betwen PX24 & PM25.
327 gMC->Gsatt("CM11","seen",0); // betwen PGC2 & PM25.
328 gMC->Gsatt("CM12","seen",0); // box above the hall.
329
330 gMC->Gdopt("hide", "on");
331 gMC->Gdopt("edge","off");
332 gMC->Gdopt("shad", "on");
333 gMC->Gsatt("*", "fill", 7);
334 gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
335 gMC->DefaultRange();
336 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
337 gMC->Gdhead(1111, "View of CRT(ACORDE)");
338 gMC->Gdman(18, 4, "MAN");
fb7a1f55 339}