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.2.2 2002/10/10 14:40:31 hristov
19 Updating VirtualMC to v3-09-02
21 Revision 1.5 2002/10/07 11:12:26 gamez
24 Revision 1.4 2002/07/12 12:56:18 gamez
25 Material numbers, correction
27 Revision 1.3.2.1 2002/07/12 12:31:30 gamez
28 Material numbers, correction
30 Revision 1.3 2002/07/10 15:53:10 gamez
33 Revision 1.2 2002/07/09 08:45:35 hristov
34 Old style include files needed on HP (aCC)
36 Revision 1.1 2002/06/16 17:08:19 hristov
42 ///////////////////////////////////////////////////////////////////////////////
44 // Cosmic Rays ALICE Trigger //
45 // This class contains the basic functions for the Cosmic Ray ALICE //
46 // detector. Functions specific to one particular geometry are //
47 // contained in the derived classes //
51 <img src="picts/AliCRTClass.gif">
53 <p>The responsible person for this module is
54 <a href="mailto:Enrique.Gamez.Flores@cern.ch">Enrique Gamez Flores</a>.
62 ///////////////////////////////////////////////////////////////////////////////
71 #include "AliCRTConstants.h"
72 #include "AliCRThit.h"
77 //_____________________________________________________________________________
81 // Default constructor for the CRT
89 //_____________________________________________________________________________
90 AliCRT::AliCRT(const char *name, const char *title)
91 : AliDetector(name,title)
94 // Standard constructor for the CRT module
97 fIshunt = 1; // All hits are associated with primary particles
99 fHits = new TClonesArray("AliCRThit",400) ;
101 gAlice->AddHitList(fHits);
109 //_____________________________________________________________________________
110 AliCRT::AliCRT(const AliCRT& crt)
118 //_____________________________________________________________________________
119 AliCRT& AliCRT::operator= (const AliCRT& crt)
122 // Asingment operator.
128 //_____________________________________________________________________________
132 // Standar destructor.
140 //_____________________________________________________________________________
141 void AliCRT::AddHit(Int_t track, Int_t *vol, Float_t *hits)
146 TClonesArray &lhits = *fHits;
147 new(lhits[fNhits++]) AliCRThit(fIshunt,track,vol,hits);
150 //_____________________________________________________________________________
151 void AliCRT::AddDigit(Int_t *tracks,Int_t *digits)
154 // Add a CRT digit to the list. Dummy function.
158 //_____________________________________________________________________________
159 void AliCRT::Init() const
168 printf("\n%s: ",ClassName());
169 for(i=0;i<35;i++) printf("*");
170 printf(" CRT_INIT ");
171 for(i=0;i<35;i++) printf("*");
172 printf("\n%s: ",ClassName());
174 // Here the CRT initialisation code (if any!)
175 for(i=0;i<80;i++) printf("*");
180 //_____________________________________________________________________________
181 void AliCRT::ResetHits()
183 // Reset number of clusters and the cluster array for this detector
184 AliDetector::ResetHits();
187 //_____________________________________________________________________________
188 void AliCRT::ResetDigits()
191 // Reset number of digits and the digits array for this detector
192 AliDetector::ResetDigits();
195 //____________________________________________________________________________
196 void AliCRT::FinishEvent()
201 //_____________________________________________________________________________
202 void AliCRT::BuildGeometry()
205 // Build simple ROOT TNode geometry for event display
209 //_____________________________________________________________________________
210 void AliCRT::CreateGeometry()
213 // Build simple ROOT TNode geometry for GEANT simulations
217 //_____________________________________________________________________________
218 void AliCRT::CreateMaterials()
220 // Magnatic field inside the pit
221 Int_t isxfld = gAlice->Field()->Integ();
222 Float_t sxmgmx = gAlice->Field()->Max();
224 //Magnetic field above the Magnet.
225 Int_t xfield = 0; // no Magnetic field.
227 Float_t xepsil = 0.1; // Tracking precission in cm. obove the pit
229 // --- Define the various materials for GEANT ---
230 Float_t epsil, stmin, tmaxfd, deemax, stemax;
233 AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
234 AliMaterial(29, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
235 AliMaterial(49, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
238 AliMaterial(10, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
239 AliMaterial(30, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
240 AliMaterial(50, "IRON$ ", 55.85, 26., 7.87, 1.76, 17.1);
243 AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
244 AliMaterial(35, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
245 AliMaterial(55, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
246 AliMaterial(75, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
247 AliMaterial(95, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500.);
250 // Scintillator material polystyrene
251 Float_t aP[2] = {12.011, 1.00794};
252 Float_t zP[2] = {6.0, 1.0};
253 Float_t wP[2] = {1.0, 1.0};
255 AliMixture(13, "Polystyrene$", aP, zP, dP, -2, wP);
256 // Subalpine Molasse over the ALICE hall.
257 Float_t aMolasse[10] = { 1., 12.01, 15.994, 22.99, 24.305, 26.98, 28.086, 39.1, 40.08, 55.85 };
258 Float_t zMolasse[10] = {1., 6., 8., 11., 12., 13., 14., 19., 20., 26.};
259 Float_t wMolasse[10] = {0.008, 0.043, 0.485, 0.007, 0.042, 0.037, 0.215, 0.023, 0.1, 0.04};
260 Float_t dMolasse = 2.40;
261 AliMixture(24, "Molasse$", aMolasse, zMolasse, dMolasse, 10, wMolasse);
264 // Defines tracking media parameters.
265 // Les valeurs sont commentees pour laisser le defaut
266 // a GEANT (version 3-21, page CONS200), f.m.
267 epsil = .001; // Tracking precision, Inside the pit
268 stemax = -1.; // Maximum displacement for multiple scattering
269 tmaxfd = -20.; // Maximum angle due to field deflection
270 deemax = -.3; // Maximum fractional energy loss, DLS
274 Float_t atmaxfd = 10.;
275 Float_t adeemax = -0.1;
276 Float_t aepsil = 0.1;
277 Float_t astmin = -10.;
281 AliMedium(9, "ALU_C0 ", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
282 AliMedium(29, "ALU_C1 ", 29, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
283 AliMedium(49, "ALU_C2 ", 49, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
286 AliMedium(10, "FE_C0 ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
287 AliMedium(30, "FE_C1 ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
288 AliMedium(50, "FE_C2 ", 50, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
291 AliMedium(15, "AIR_C0 ", 15, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
292 AliMedium(35, "AIR_C1 ", 35, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
293 AliMedium(55, "AIR_C2 ", 55, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
294 AliMedium(75, "AIR_C4 ", 75, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
295 AliMedium(75, "AIR_C5 ", 95, 0, isxfld, sxmgmx, atmaxfd, stemax, adeemax, aepsil, astmin);
299 // The scintillator of the CPV made of Polystyrene
300 // scintillator -> idtmed[1112]
301 AliMedium(13 , "CPV scint. ", 13, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
303 // Molasse -> idtmed[1123]
304 AliMedium(24 , "Molasse ", 24, 0, xfield, xfieldm, tmaxfd, stemax, deemax, xepsil, stmin);
306 // Concrete, in case if we need to put hte shafts by ourselves.
308 Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
309 Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
310 Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
312 AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
314 AliMedium(17, "CC_C0 ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
318 //_____________________________________________________________________________
319 void AliCRT::MakeBranch(Option_t* option, const char *file)
322 // Specific CRT branches
324 // Create Tree branches for the CRT.
325 Int_t buffersize = 400;
327 sprintf(branchname,"%s",GetName());
329 AliDetector::MakeBranch(option,file);
331 const char *cD = strstr(option,"D");
334 digits = new AliCRTdigit();
335 MakeBranchInTree(gAlice->TreeD(), branchname, "AliCRTdigit",
336 digits, buffersize, 1, file);
341 //_____________________________________________________________________________
342 void AliCRT::SetTreeAddress()
347 sprintf(branchname,"%s",GetName());
349 // Branch address for hit tree
350 TTree *treeH = gAlice->TreeH();
351 if (treeH && fHits) {
352 branch = treeH->GetBranch(branchname);
353 if (branch) branch->SetAddress(&fHits);