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