Old style include files needed on HP (aCC)
[u/mrichter/AliRoot.git] / CRT / AliCRT.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
16/*
17$Log$
b73f53b3 18Revision 1.1 2002/06/16 17:08:19 hristov
19First version of CRT
20
fb7a1f55 21
22*/
23
24///////////////////////////////////////////////////////////////////////////////
25// //
26// Cosmic Rays ALICE Trigger //
27// This class contains the basic functions for the Cosmic Ray ALICE //
28// detector. Functions specific to one particular geometry are //
29// contained in the derived classes //
30//
31// Begin_Html
32/*
33<img src="picts/AliCRTClass.gif">
34</pre>
35<p>The responsible person for this module is
36<a href="mailto:Enrique.Gamez.Flores@cern.ch">Enrique Gamez Flores</a>.
37</font>
38<pre>
39*/
40//End_Html
41//
42//
43// //
44///////////////////////////////////////////////////////////////////////////////
45
46
b73f53b3 47#include <iostream.h>
48#include <fstream.h>
fb7a1f55 49
50#include <TTree.h>
51
52
53#include "AliMC.h"
54#include "AliRun.h"
55#include "AliMagF.h"
56
57#include "AliCRT.h"
58#include "AliCRTConstants.h"
59#include "AliCRTdigit.h"
60#include "AliCRThit.h"
61
62
63ClassImp(AliCRT)
64
65
66static AliCRTdigit *digits;
67
68//_____________________________________________________________________________
69AliCRT::AliCRT()
70{
71 //
72 // Default constructor for L3 magnet
73 //
74
75 fIshunt = 1;
76 fHits = 0;
77 fDigits = 0;
78}
79
80//_____________________________________________________________________________
81AliCRT::AliCRT(const char *name, const char *title)
82 : AliDetector(name,title)
83{
84 //
85 // Standard constructor for the CRT module
86 //
87
88 fIshunt = 1; // All hits are associated with primary particles
89
90 fHits = new TClonesArray("AliCRThit",400) ;
91 fDigits = new TClonesArray("AliCRTdigit",400) ;
92
93 gAlice->AddHitList(fHits);
94
95 SetMarkerColor(7);
96 SetMarkerStyle(2);
97 SetMarkerSize(0.4);
98
99}
100
101//_____________________________________________________________________________
102AliCRT::~AliCRT()
103{
104 //
105 // Standar destructor.
106 //
107 if (fHits) {
108 fHits->Delete();
109 delete fHits;
110 }
111}
112
113//_____________________________________________________________________________
114void AliCRT::AddHit(Int_t track, Int_t *vol, Float_t *hits)
115{
116 //
117 // Add a CRT hit
118 //
119 TClonesArray &lhits = *fHits;
120 new(lhits[fNhits++]) AliCRThit(fIshunt,track,vol,hits);
121}
122
123//_____________________________________________________________________________
124void AliCRT::AddDigit(Int_t *tracks,Int_t *digits)
125{
126
127 // Add a CRT digit to the list. Dummy function.
128
129}
130
131//_____________________________________________________________________________
132void AliCRT::Init() const
133{
134 //
135 // Initialise ...
136 //
137
138 Int_t i;
139 //
140 if(fDebug) {
141 printf("\n%s: ",ClassName());
142 for(i=0;i<35;i++) printf("*");
143 printf(" CRT_INIT ");
144 for(i=0;i<35;i++) printf("*");
145 printf("\n%s: ",ClassName());
146 //
147 // Here the CRT initialisation code (if any!)
148 for(i=0;i<80;i++) printf("*");
149 printf("\n");
150 }
151}
152
153//_____________________________________________________________________________
154void AliCRT::ResetHits ()
155{
156 // Reset number of clusters and the cluster array for this detector
157 AliDetector::ResetHits ();
158}
159
160//_____________________________________________________________________________
161void AliCRT::ResetDigits ()
162{
163 //
164 // Reset number of digits and the digits array for this detector
165 AliDetector::ResetDigits ();
166 //
167}
168
169//____________________________________________________________________________
170void AliCRT::FinishEvent()
171{
172// do nothing
173}
174
175//_____________________________________________________________________________
176void AliCRT::BuildGeometry()
177{
178 //
179 // Build simple ROOT TNode geometry for event display
180 //
181}
182
183//_____________________________________________________________________________
184void AliCRT::CreateGeometry()
185{
186 //
187 // Build simple ROOT TNode geometry for GEANT simulations
188 //
189}
190
191//_____________________________________________________________________________
192void AliCRT::CreateMaterials()
193{
194 // Magnatic field inside the pit
195 Int_t isxfld = gAlice->Field()->Integ();
196 Float_t sxmgmx = gAlice->Field()->Max();
197
198 //Magnetic field above the Magnet.
199 Int_t xfield = 0; // no Magnetic field.
200 Float_t xfieldm = 0;
201 Float_t xepsil = 0.1; // Tracking precission in cm. obove the pit
202
203 // --- Define the various materials for GEANT ---
204 Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
205 Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
206 Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
207
208 Float_t epsil, stmin, tmaxfd, deemax, stemax;
209 //
210 // Aluminum
211 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
212 AliMaterial(29, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
213 AliMaterial(49, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
214 //
215 // Iron
216 AliMaterial(10, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
217 AliMaterial(30, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
218 AliMaterial(50, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
219 //
220 // Air
221 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
222 AliMaterial(35, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
223 AliMaterial(55, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
224 //
225 // Vacuum
226 AliMaterial(16, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
227 AliMaterial(36, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
228 AliMaterial(56, "VACUUM$ ", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
229 //
230 // Concrete
231 AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
232 AliMixture(37, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
233 AliMixture(57, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
234
235
236 // Scintillator material polystyrene
237 Float_t aP[2] = {12.011, 1.00794};
238 Float_t zP[2] = {6.0, 1.0};
239 Float_t wP[2] = {1.0, 1.0};
240 Float_t dP = 1.032;
241 AliMixture(3, "Polystyrene$", aP, zP, dP, -2, wP);
242 // Standard ROCK, ROCK1 and molasse.
243 Float_t aRock[1] = {22.};
244 Float_t zRock[1] = {11.};
245 Float_t wRock[1] = {1.};
246 Float_t dRock = 2.65;
247 AliMixture(4, "Standard Rock$", aRock, zRock, dRock, 1, wRock);
248 Float_t dRock1 = 2.2;
249 AliMixture(5, "Rock1$", aRock, zRock, dRock1, 1, wRock);
250 Float_t dMolasse = 2.50;
251 AliMixture(6, "Molasse$", aRock, zRock, dMolasse, 1, wRock);
252
253 // ****************
254 // Defines tracking media parameters.
255 // Les valeurs sont commentees pour laisser le defaut
256 // a GEANT (version 3-21, page CONS200), f.m.
257 epsil = .001; // Tracking precision, Inside the pit
258 stemax = -1.; // Maximum displacement for multiple scattering
259 tmaxfd = -20.; // Maximum angle due to field deflection
260 deemax = -.3; // Maximum fractional energy loss, DLS
261 stmin = -.8;
262 // ***************
263
264 //
265 // Aluminum
266 AliMedium(9, "ALU_C0 ", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
267 AliMedium(29, "ALU_C1 ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
268 AliMedium(49, "ALU_C2 ", 49, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
269 //
270 // Iron
271 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
272 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
273 AliMedium(50, "FE_C2 ", 50, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
274 //
275 // Air
276 AliMedium(15, "AIR_C0 ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
277 AliMedium(35, "AIR_C1 ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
278 AliMedium(55, "AIR_C2 ", 55, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
279 //
280 // Vacuum
281 AliMedium(16, "VA_C0 ", 16, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
282 AliMedium(36, "VA_C1 ", 36, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
283 AliMedium(56, "VA_C2 ", 56, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
284 //
285 // Concrete
286 AliMedium(17, "CC_C0 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
287 AliMedium(37, "CC_C1 ", 37, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
288 AliMedium(57, "CC_C2 ", 57, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
289
290
291 // The scintillator of the CPV made of Polystyrene
292 // scintillator -> idtmed[1102]
293 AliMedium(3, "CPV scint. ", 3, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
294
295 // Standard ROCK -> idtmed[1103]
296 AliMedium(4, "Standard Rock ", 4, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
297
298 // ROCK1 -> idtmed[1104]
299 AliMedium(5, "Rock 1 ", 5, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
300
301
302 // Molasse -> idtmed[1105]
303 AliMedium(6, "Molasse ", 6, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
304
305
306}
307
308//_____________________________________________________________________________
309void AliCRT::MakeBranch(Option_t* option, const char *file)
310{
311 //
312 // Specific CRT branches
313 //
314 // Create Tree branches for the CRT.
315 Int_t buffersize = 400;
316 char branchname[10];
317 sprintf(branchname,"%s",GetName());
318
319 AliDetector::MakeBranch(option,file);
320
321 const char *cD = strstr(option,"D");
322
323 if (cD) {
324 digits = new AliCRTdigit();
325 MakeBranchInTree(gAlice->TreeD(), branchname, "AliCRTdigit",
326 digits, buffersize, 1, file);
327 }
328
329}
330//_____________________________________________________________________________