]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ACORDE/AliACORDEv0.cxx
- Aod file is not opened locally
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEv0.cxx
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
16 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 // ALICE Cosmic Ray Trigger                                                  //
21 //                                                                           //
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.                                                  //
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/AliACORDEv0Class.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
48 #include "AliACORDEv0.h"
49
50 #include <TGeometry.h>
51 #include <TBRIK.h>
52 #include <TNode.h>
53 #include <TVirtualMC.h>
54
55 #include "AliRun.h"
56 #include "AliConst.h"
57
58 #include "AliACORDEConstants.h"
59 #include "AliACORDEModule.h"
60
61 ClassImp(AliACORDEv0)
62  
63 //_____________________________________________________________________________
64 AliACORDEv0::AliACORDEv0()
65   : AliACORDE()
66 {
67   //
68   // Default constructor
69   //
70 }
71  
72 //_____________________________________________________________________________
73 AliACORDEv0::AliACORDEv0(const char *name, const char *title)
74   : AliACORDE(name, title)
75 {
76   //
77   // Standard constructor
78   //
79   //Begin_Html
80   /*
81     <img src="picts/AliACORDEv0.gif">
82   */
83   //End_Html
84   //PH  SetMarkerColor(kRed);
85   //PH  SetMarkerStyle(kRed);
86   //PH  SetMarkerSize(0.4);
87 }
88
89 //_____________________________________________________________________________
90 AliACORDEv0::~AliACORDEv0()
91 {
92   //
93   // Default destructor
94   //
95 }
96
97 //_____________________________________________________________________________
98 void AliACORDEv0::BuildGeometry()
99 {
100   //
101   // Create the ROOT TNode geometry for the ACORDE
102   //
103
104   TNode *node, *top;
105
106   const Int_t kColorACORDE = kRed;
107
108   // Find the top node alice.
109   top = gAlice->GetGeometry()->GetNode("alice");
110
111   AliACORDEConstants* crtConstants = AliACORDEConstants::Instance();
112
113   new TBRIK("S_ACORDE_A", "ACORDE box", "void", 
114             crtConstants->ActiveAreaLenght()/2., 
115             crtConstants->ActiveAreaHeight()/2., 
116             crtConstants->ActiveAreaWidth()/2.);
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
126   Float_t box = crtConstants->CageWidth()/2.;
127   top->cd();
128   node = new TNode("upper1", "upper1", "S_ACORDE_A", 0., 790.,  3.*box, "Up");
129   node->SetLineColor(kColorACORDE);
130   fNodes->Add(node);
131
132   top->cd();
133   node = new TNode("upper2", "upper2", "S_ACORDE_A", 0., 790.,    box, "Up");
134   node->SetLineColor(kColorACORDE);
135   fNodes->Add(node);
136
137   top->cd();
138   node = new TNode("upper3", "upper3", "S_ACORDE_A", 0., 790., -1.*box, "Up");
139   node->SetLineColor(kColorACORDE);
140   fNodes->Add(node);
141
142   top->cd();
143   node = new TNode("upper4", "upper4", "S_ACORDE_A", 0., 790., -3.*box, "Up");
144   node->SetLineColor(kColorACORDE);
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_ACORDE_A", initXside, initYside,  3.*box, "Left");
154   node->SetLineColor(kColorACORDE);
155   fNodes->Add(node);
156
157   top->cd();
158   node = new TNode("upper6", "upper6", "S_ACORDE_A", initXside, initYside,    box, "Left");
159   node->SetLineColor(kColorACORDE);
160   fNodes->Add(node);
161
162   top->cd();
163   node = new TNode("upper7", "upper7", "S_ACORDE_A", initXside, initYside, -1.*box, "Left");
164   node->SetLineColor(kColorACORDE);
165   fNodes->Add(node);
166
167   top->cd();
168   node = new TNode("upper8", "upper8", "S_ACORDE_A", initXside, initYside, -3.*box, "Left");
169   node->SetLineColor(kColorACORDE);
170   fNodes->Add(node);
171
172
173   // Modules on the right side.
174   top->cd();
175   node = new TNode("upper9", "upper9", "S_ACORDE_A", -initXside, initYside,  3.*box, "Right");
176   node->SetLineColor(kColorACORDE);
177   fNodes->Add(node);
178
179   top->cd();
180   node = new TNode("upper10", "upper10", "S_ACORDE_A", -initXside, initYside,    box, "Right");
181   node->SetLineColor(kColorACORDE);
182   fNodes->Add(node);
183
184   top->cd();
185   node = new TNode("upper11","upper11", "S_ACORDE_A", -initXside, initYside, -1.*box, "Right");
186   node->SetLineColor(kColorACORDE);
187   fNodes->Add(node);
188
189   top->cd();
190   node = new TNode("upper12","upper12", "S_ACORDE_A", -initXside, initYside, -3.*box, "Right");
191   node->SetLineColor(kColorACORDE);
192   fNodes->Add(node);
193
194 }
195
196 //_____________________________________________________________________________
197 void AliACORDEv0::CreateGeometry()
198 {
199   //
200   // Create geometry for the ACORDE array
201   //
202
203   Int_t  idrotm[2499];    // The rotation matrix.
204   Int_t* idtmed = fIdtmed->GetArray() - 1099;
205   AliACORDEConstants* crtConstants = AliACORDEConstants::Instance();
206
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.
212   Float_t box[3];
213   //box[0] = 2*crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
214   box[0] = crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
215   box[1] = crtConstants->MagMaxRadius() - crtConstants->MagMinRadius();
216   box[2] = crtConstants->MagnetLenght()/2;
217   gMC->Gsvolu("ACORDE1", "BOX", idtmed[1112], box, 3);
218
219   // Check if the AliACORDEModule instance have been set, otherwise
220   // use the default values
221   if ( !fModule ) {
222     Info("CreateGeometry", "Using default dimensions");
223     fModule = new AliACORDEModule("ACORDEmod", "Default module dimensions");
224   }
225
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;
231   box[2] = fModule->FrameWidth()/2;
232   gMC->Gsvolu("ACORDE2", "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("ACORDE3", "BOX", idtmed[1112], box, 3);
239   gMC->Gspos("ACORDE3", 1, "ACORDE2", 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("ACORDE4", "BOX", idtmed[1108], box, 3);
246   gMC->Gspos("ACORDE4", 1, "ACORDE2", 0, 0,  13 - box[2], 0, "MANY");
247   gMC->Gspos("ACORDE4", 2, "ACORDE2", 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("ACORDE5", "BOX", idtmed[1108], box, 3);
253   gMC->Gspos("ACORDE5", 1, "ACORDE2",  140 - box[0], 0, 0, 0, "MANY");
254   gMC->Gspos("ACORDE5", 2, "ACORDE2", -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("ACORDE6", "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++ ) {
267     Float_t zCoordinate = k*fModule->ZGap() - 450;
268     gMC->Gspos("ACORDE2",++copyNumber,"ACORDE1",-150, 15, zCoordinate, 0, "MANY");
269     gMC->Gspos("ACORDE2",++copyNumber,"ACORDE1",150, 15, zCoordinate, 0, "MANY");
270
271   }
272
273   // Put the support bars
274   gMC->Gspos("ACORDE6", 1, "ACORDE1",  -75, 5, 0, 0, "ONLY");
275   gMC->Gspos("ACORDE6", 2, "ACORDE1", -225, 5, 0, 0, "ONLY");
276   gMC->Gspos("ACORDE6", 3, "ACORDE1",   75, 5, 0, 0, "ONLY");
277   gMC->Gspos("ACORDE6", 4, "ACORDE1",  225, 5, 0, 0, "ONLY");
278
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);
282   // In the left side side of the magnet
283   AliMatrix(idrotm[232], 90, 315, 90, 45, 0, 0);
284
285   Float_t x = crtConstants->MagMinRadius()+10;
286   gMC->Gspos("ACORDE1", 1, "ALIC", 0, x, 0, 0, "MANY");
287   gMC->Gspos("ACORDE1", 2, "ALIC", -x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[231], "MANY");
288   gMC->Gspos("ACORDE1", 3, "ALIC",  x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[232], "MANY");
289
290 }
291
292 //_____________________________________________________________________________
293 void AliACORDEv0::DrawDetector() const
294 {
295   //
296   // Draw a shaded view of the L3 magnet
297   //
298
299   Info("DrawDetector", "Drawing the module");
300
301   gMC->Gsatt("*", "seen", -1);
302
303   gMC->Gsatt("ALIC","seen",0);
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("ACORDE1", "seen", 0); // ACORDE Mother
316   gMC->Gsatt("ACORDE2", "seen", 0); // Module air box
317   gMC->Gsatt("ACORDE3", "seen", 1); // Scintillators
318   gMC->Gsatt("ACORDE3", "colo", 2); // Scintillators
319   gMC->Gsatt("ACORDE4", "seen", 1); // Aluminium frame (long bars)
320   gMC->Gsatt("ACORDE4", "colo", 3); //
321   gMC->Gsatt("ACORDE5", "seen", 1); // Aluminium frame (short bars)
322   gMC->Gsatt("ACORDE5", "colo", 3); //
323   gMC->Gsatt("ACORDE6", "seen", 1); // Module support
324   gMC->Gsatt("ACORDE6", "colo", 3); //
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();
332   //gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
333   gMC->Gdraw("alic", 30, 40, 0, -30, -60, .09, .09);
334   gMC->Gdhead(1111, "View of ACORDE(ACORDE)");
335   gMC->Gdman(18, 4, "MAN");
336 }