Removing inheritances from TAttLine, TAttMarker and AliRndm in AliModule. The copy...
[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
88cb7938 16/* $Id$ */
fb7a1f55 17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// Cosmic Rays ALICE Trigger //
21// This class contains the basic functions for the Cosmic Ray ALICE //
22// detector. Functions specific to one particular geometry are //
23// contained in the derived classes //
24//
25// Begin_Html
26/*
27<img src="picts/AliCRTClass.gif">
28</pre>
29<p>The responsible person for this module is
30<a href="mailto:Enrique.Gamez.Flores@cern.ch">Enrique Gamez Flores</a>.
31</font>
32<pre>
33*/
34//End_Html
35//
36//
37// //
38///////////////////////////////////////////////////////////////////////////////
39
fddb5247 40#include "AliCRT.h"
41
fb7a1f55 42#include <TTree.h>
192ec4f4 43#include <TVirtualMC.h>
fb7a1f55 44
88cb7938 45#include "AliRun.h"
387cc25e 46#include "AliMagF.h"
192ec4f4 47//#include "AliMC.h"
387cc25e 48
192ec4f4 49//#include "AliCRThit.h"
fddb5247 50#include "AliCRTModule.h"
387cc25e 51
fb7a1f55 52ClassImp(AliCRT)
53
fb7a1f55 54//_____________________________________________________________________________
55AliCRT::AliCRT()
fddb5247 56 : AliDetector(),
57 fModule(0)
fb7a1f55 58{
59 //
387cc25e 60 // Default constructor
fb7a1f55 61 //
fb7a1f55 62}
63
64//_____________________________________________________________________________
65AliCRT::AliCRT(const char *name, const char *title)
fddb5247 66 : AliDetector(name, title),
67 fModule(0)
fb7a1f55 68{
69 //
387cc25e 70 // Standard constructor
fb7a1f55 71 //
192ec4f4 72 //fHits = new TClonesArray("AliCRThit", 400);
73 //gAlice->GetMCApp()->AddHitList(fHits);
fb7a1f55 74}
75
76//_____________________________________________________________________________
77AliCRT::~AliCRT()
78{
79 //
387cc25e 80 // Default destructor
fb7a1f55 81 //
fddb5247 82 if ( fModule ) { delete fModule; fModule = 0; }
fb7a1f55 83}
84
85//_____________________________________________________________________________
fb7a1f55 86void AliCRT::CreateMaterials()
87{
88 // Magnatic field inside the pit
89 Int_t isxfld = gAlice->Field()->Integ();
90 Float_t sxmgmx = gAlice->Field()->Max();
91
92 //Magnetic field above the Magnet.
93 Int_t xfield = 0; // no Magnetic field.
94 Float_t xfieldm = 0;
95 Float_t xepsil = 0.1; // Tracking precission in cm. obove the pit
96
97 // --- Define the various materials for GEANT ---
fb7a1f55 98 Float_t epsil, stmin, tmaxfd, deemax, stemax;
99 //
100 // Aluminum
4a9de4af 101 AliMaterial(9, "ALUMINIUM0$", 26.98, 13., 2.7, 8.9, 37.2);
102 AliMaterial(29, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2);
103 AliMaterial(49, "ALUMINIUM2$", 26.98, 13., 2.7, 8.9, 37.2);
fb7a1f55 104 //
105 // Iron
4a9de4af 106 AliMaterial(10, "IRON0$ ", 55.85, 26., 7.87, 1.76, 17.1);
107 AliMaterial(30, "IRON1$ ", 55.85, 26., 7.87, 1.76, 17.1);
108 AliMaterial(50, "IRON2$ ", 55.85, 26., 7.87, 1.76, 17.1);
fb7a1f55 109 //
110 // Air
4a9de4af 111 AliMaterial(15, "AIR0$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
112 AliMaterial(35, "AIR1$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
113 AliMaterial(55, "AIR2$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
114 AliMaterial(75, "AIR3$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
115 AliMaterial(95, "AIR4$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
d2293f45 116
fb7a1f55 117
118 // Scintillator material polystyrene
119 Float_t aP[2] = {12.011, 1.00794};
120 Float_t zP[2] = {6.0, 1.0};
121 Float_t wP[2] = {1.0, 1.0};
122 Float_t dP = 1.032;
2c3b33cd 123 AliMixture(13, "Polystyrene$", aP, zP, dP, -2, wP);
c8a19f01 124 // Subalpine Molasse over the ALICE hall.
2c3b33cd 125 Float_t aMolasse[10] = { 1., 12.01, 15.994, 22.99, 24.305, 26.98, 28.086, 39.1, 40.08, 55.85 };
c8a19f01 126 Float_t zMolasse[10] = {1., 6., 8., 11., 12., 13., 14., 19., 20., 26.};
2c3b33cd 127 Float_t wMolasse[10] = {0.008, 0.043, 0.485, 0.007, 0.042, 0.037, 0.215, 0.023, 0.1, 0.04};
c8a19f01 128 Float_t dMolasse = 2.40;
2c3b33cd 129 AliMixture(24, "Molasse$", aMolasse, zMolasse, dMolasse, 10, wMolasse);
387cc25e 130
fb7a1f55 131 // ****************
132 // Defines tracking media parameters.
133 // Les valeurs sont commentees pour laisser le defaut
134 // a GEANT (version 3-21, page CONS200), f.m.
135 epsil = .001; // Tracking precision, Inside the pit
136 stemax = -1.; // Maximum displacement for multiple scattering
137 tmaxfd = -20.; // Maximum angle due to field deflection
138 deemax = -.3; // Maximum fractional energy loss, DLS
139 stmin = -.8;
140 // ***************
141
d2293f45 142 Float_t atmaxfd = 10.;
143 Float_t adeemax = -0.1;
144 Float_t aepsil = 0.1;
145 Float_t astmin = -10.;
146
fb7a1f55 147 //
148 // Aluminum
149 AliMedium(9, "ALU_C0 ", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
150 AliMedium(29, "ALU_C1 ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
151 AliMedium(49, "ALU_C2 ", 49, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
152 //
153 // Iron
154 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
155 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
156 AliMedium(50, "FE_C2 ", 50, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
157 //
158 // Air
d2293f45 159 AliMedium(15, "AIR_C0 ", 15, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
160 AliMedium(35, "AIR_C1 ", 35, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
161 AliMedium(55, "AIR_C2 ", 55, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
162 AliMedium(75, "AIR_C4 ", 75, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
387cc25e 163 AliMedium(95, "AIR_C5 ", 95, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
d2293f45 164
fb7a1f55 165
166
167 // The scintillator of the CPV made of Polystyrene
2c3b33cd 168 // scintillator -> idtmed[1112]
4a9de4af 169 AliMedium(12 , "CPV scint.0 ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
170 AliMedium(13 , "CPV scint.1 ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
171 AliMedium(14 , "CPV scint.2 ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
387cc25e 172
2c3b33cd 173 // Molasse -> idtmed[1123]
174 AliMedium(24 , "Molasse ", 24, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
fb7a1f55 175
d2293f45 176 // Concrete, in case if we need to put hte shafts by ourselves.
fb7a1f55 177
d2293f45 178 Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
179 Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
180 Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
387cc25e 181
d2293f45 182 AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
183 // Concrete
184 AliMedium(17, "CC_C0 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
387cc25e 185 AliMedium(27, "CC_C1 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // MX24
186 AliMedium(37, "CC_C2 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // PM25
187 AliMedium(47, "CC_C3 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin); // PGC2
fb7a1f55 188
d2293f45 189}
fb7a1f55 190
fb7a1f55 191//_____________________________________________________________________________
d2293f45 192void AliCRT::SetTreeAddress()
193{
194
195 TBranch *branch;
196 char branchname[20];
197 sprintf(branchname,"%s",GetName());
d2293f45 198 // Branch address for hit tree
88cb7938 199 TTree *treeH = fLoader->TreeH();
192ec4f4 200 if (treeH ) {
d2293f45 201 branch = treeH->GetBranch(branchname);
202 if (branch) branch->SetAddress(&fHits);
203 }
d2293f45 204}
192ec4f4 205
206//_____________________________________________________________________________
207void AliCRT::MakeBranch(Option_t* opt)
208{
209 //
210 // Initializes the branches of the CRT inside the trees written
211 // for each event.
212 //
213 const char* oH = strstr(opt, "H");
214 if ( fLoader->TreeH() && oH && (fHits == 0x0) ) {
215 fHits = new TClonesArray("AliCRThit", 1000);
216 fNhits = 0;
217 }
218 AliDetector::MakeBranch(opt);
219}