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