1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.4 2002/07/12 12:56:18 gamez
19 Material numbers, correction
21 Revision 1.3.2.1 2002/07/12 12:31:30 gamez
22 Material numbers, correction
24 Revision 1.3 2002/07/10 15:53:10 gamez
27 Revision 1.2 2002/07/09 08:45:35 hristov
28 Old style include files needed on HP (aCC)
30 Revision 1.1 2002/06/16 17:08:19 hristov
36 ///////////////////////////////////////////////////////////////////////////////
38 // Cosmic Rays ALICE Trigger //
39 // This class contains the basic functions for the Cosmic Ray ALICE //
40 // detector. Functions specific to one particular geometry are //
41 // contained in the derived classes //
45 <img src="picts/AliCRTClass.gif">
47 <p>The responsible person for this module is
48 <a href="mailto:Enrique.Gamez.Flores@cern.ch">Enrique Gamez Flores</a>.
56 ///////////////////////////////////////////////////////////////////////////////
65 #include "AliCRTConstants.h"
66 #include "AliCRThit.h"
71 //_____________________________________________________________________________
75 // Default constructor for the CRT
83 //_____________________________________________________________________________
84 AliCRT::AliCRT(const char *name, const char *title)
85 : AliDetector(name,title)
88 // Standard constructor for the CRT module
91 fIshunt = 1; // All hits are associated with primary particles
93 fHits = new TClonesArray("AliCRThit",400) ;
95 gAlice->AddHitList(fHits);
103 //_____________________________________________________________________________
104 AliCRT::AliCRT(const AliCRT& crt)
112 //_____________________________________________________________________________
113 AliCRT& AliCRT::operator= (const AliCRT& crt)
116 // Asingment operator.
122 //_____________________________________________________________________________
126 // Standar destructor.
134 //_____________________________________________________________________________
135 void AliCRT::AddHit(Int_t track, Int_t *vol, Float_t *hits)
140 TClonesArray &lhits = *fHits;
141 new(lhits[fNhits++]) AliCRThit(fIshunt,track,vol,hits);
144 //_____________________________________________________________________________
145 void AliCRT::AddDigit(Int_t *tracks,Int_t *digits)
148 // Add a CRT digit to the list. Dummy function.
152 //_____________________________________________________________________________
153 void AliCRT::Init() const
162 printf("\n%s: ",ClassName());
163 for(i=0;i<35;i++) printf("*");
164 printf(" CRT_INIT ");
165 for(i=0;i<35;i++) printf("*");
166 printf("\n%s: ",ClassName());
168 // Here the CRT initialisation code (if any!)
169 for(i=0;i<80;i++) printf("*");
174 //_____________________________________________________________________________
175 void AliCRT::ResetHits()
177 // Reset number of clusters and the cluster array for this detector
178 AliDetector::ResetHits();
181 //_____________________________________________________________________________
182 void AliCRT::ResetDigits()
185 // Reset number of digits and the digits array for this detector
186 AliDetector::ResetDigits();
189 //____________________________________________________________________________
190 void AliCRT::FinishEvent()
195 //_____________________________________________________________________________
196 void AliCRT::BuildGeometry()
199 // Build simple ROOT TNode geometry for event display
203 //_____________________________________________________________________________
204 void AliCRT::CreateGeometry()
207 // Build simple ROOT TNode geometry for GEANT simulations
211 //_____________________________________________________________________________
212 void AliCRT::CreateMaterials()
214 // Magnatic field inside the pit
215 Int_t isxfld = gAlice->Field()->Integ();
216 Float_t sxmgmx = gAlice->Field()->Max();
218 //Magnetic field above the Magnet.
219 Int_t xfield = 0; // no Magnetic field.
221 Float_t xepsil = 0.1; // Tracking precission in cm. obove the pit
223 // --- Define the various materials for GEANT ---
224 Float_t epsil, stmin, tmaxfd, deemax, stemax;
227 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
228 AliMaterial(29, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
229 AliMaterial(49, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
232 AliMaterial(10, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
233 AliMaterial(30, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
234 AliMaterial(50, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
237 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
238 AliMaterial(35, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
239 AliMaterial(55, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
240 AliMaterial(75, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
241 AliMaterial(95, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
244 // Scintillator material polystyrene
245 Float_t aP[2] = {12.011, 1.00794};
246 Float_t zP[2] = {6.0, 1.0};
247 Float_t wP[2] = {1.0, 1.0};
249 AliMixture(13, "Polystyrene$", aP, zP, dP, -2, wP);
250 // Subalpine Molasse over the ALICE hall.
251 Float_t aMolasse[10] = { 1., 12.01, 15.994, 22.99, 24.305, 26.98, 28.086, 39.1, 40.08, 55.85 };
252 Float_t zMolasse[10] = {1., 6., 8., 11., 12., 13., 14., 19., 20., 26.};
253 Float_t wMolasse[10] = {0.008, 0.043, 0.485, 0.007, 0.042, 0.037, 0.215, 0.023, 0.1, 0.04};
254 Float_t dMolasse = 2.40;
255 AliMixture(24, "Molasse$", aMolasse, zMolasse, dMolasse, 10, wMolasse);
258 // Defines tracking media parameters.
259 // Les valeurs sont commentees pour laisser le defaut
260 // a GEANT (version 3-21, page CONS200), f.m.
261 epsil = .001; // Tracking precision, Inside the pit
262 stemax = -1.; // Maximum displacement for multiple scattering
263 tmaxfd = -20.; // Maximum angle due to field deflection
264 deemax = -.3; // Maximum fractional energy loss, DLS
268 Float_t atmaxfd = 10.;
269 Float_t adeemax = -0.1;
270 Float_t aepsil = 0.1;
271 Float_t astmin = -10.;
275 AliMedium(9, "ALU_C0 ", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
276 AliMedium(29, "ALU_C1 ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
277 AliMedium(49, "ALU_C2 ", 49, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
280 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
281 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
282 AliMedium(50, "FE_C2 ", 50, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
285 AliMedium(15, "AIR_C0 ", 15, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
286 AliMedium(35, "AIR_C1 ", 35, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
287 AliMedium(55, "AIR_C2 ", 55, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
288 AliMedium(75, "AIR_C4 ", 75, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
289 AliMedium(75, "AIR_C5 ", 95, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
293 // The scintillator of the CPV made of Polystyrene
294 // scintillator -> idtmed[1112]
295 AliMedium(13 , "CPV scint. ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
297 // Molasse -> idtmed[1123]
298 AliMedium(24 , "Molasse ", 24, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
300 // Concrete, in case if we need to put hte shafts by ourselves.
302 Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
303 Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
304 Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
306 AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
308 AliMedium(17, "CC_C0 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
312 //_____________________________________________________________________________
313 void AliCRT::MakeBranch(Option_t* option, const char *file)
316 // Specific CRT branches
318 // Create Tree branches for the CRT.
319 Int_t buffersize = 400;
321 sprintf(branchname,"%s",GetName());
323 AliDetector::MakeBranch(option,file);
325 const char *cD = strstr(option,"D");
328 digits = new AliCRTdigit();
329 MakeBranchInTree(gAlice->TreeD(), branchname, "AliCRTdigit",
330 digits, buffersize, 1, file);
335 //_____________________________________________________________________________
336 void AliCRT::SetTreeAddress()
341 sprintf(branchname,"%s",GetName());
343 // Branch address for hit tree
344 TTree *treeH = gAlice->TreeH();
345 if (treeH && fHits) {
346 branch = treeH->GetBranch(branchname);
347 if (branch) branch->SetAddress(&fHits);