]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCAL.cxx
Protection against wrong name added
[u/mrichter/AliRoot.git] / EMCAL / AliEMCAL.cxx
CommitLineData
2012850d 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/* $Id$ */
17
18//_________________________________________________________________________
19// Base Class for EMCAL description:
ffa6d63b 20// This class contains material definitions
21// for the EMCAL - It does not place the detector in Alice
2012850d 22//*-- Author: Yves Schutz (SUBATECH)
b13bbe81 23//
24//*-- Additional Contributions: Sahal Yacoob (LBNL/UCT)
25//
2012850d 26//////////////////////////////////////////////////////////////////////////////
27
28// --- Standard library ---
29#include <strstream.h>
30
31// --- ROOT system ---
b13bbe81 32class TFile;
2012850d 33#include "TBranch.h"
34#include "TClonesArray.h"
35#include "TTree.h"
36
37// --- AliRoot header files ---
38
39#include "AliEMCAL.h"
40#include "AliEMCALGeometry.h"
41#include "AliMC.h"
42#include "AliRun.h"
43#include "AliMagF.h"
44
45ClassImp(AliEMCAL)
46
47//____________________________________________________________________________
48AliEMCAL::AliEMCAL():AliDetector()
49{
50 // ctor
51 //We do not create objects, because these pointers will be overwritten during reading from file.
b13bbe81 52 fGeom = 0;
2012850d 53}
54//____________________________________________________________________________
b13bbe81 55AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title) {
56// ctor : title is used to identify the layout
57 fGeom = 0;
58// gets an instance of the geometry parameters class
2012850d 59}
60//____________________________________________________________________________
b13bbe81 61AliEMCAL::~AliEMCAL(){
2012850d 62 // dtor
b13bbe81 63 delete fHits;
2012850d 64}
65
66//____________________________________________________________________________
b13bbe81 67void AliEMCAL::CreateMaterials(){
2012850d 68 // Definitions of materials to build EMCAL and associated tracking media.
69 // media number in idtmed are 1599 to 1698.
70
71 // --- Air ---
72 AliMaterial(0, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
73
b13bbe81 74
2012850d 75 // --- Lead ---
76 AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
77
b13bbe81 78
79 // --- The polysterene scintillator (CH) ---
80 Float_t aP[2] = {12.011, 1.00794} ;
81 Float_t zP[2] = {6.0, 1.0} ;
82 Float_t wP[2] = {1.0, 1.0} ;
83 Float_t dP = 1.032 ;
84
85 AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
86
87 // --- Aluminium ---
88 AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
89 // --- Absorption length is ignored ^
90
91
2012850d 92
93 // DEFINITION OF THE TRACKING MEDIA
94
95 // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
96 Int_t * idtmed = fIdtmed->GetArray() - 1599 ;
97 Int_t isxfld = gAlice->Field()->Integ() ;
98 Float_t sxmgmx = gAlice->Field()->Max() ;
b13bbe81 99
100
2012850d 101
102 // Air -> idtmed[1599]
103 AliMedium(0, "Air $", 0, 0,
104 isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
105
106 // The Lead -> idtmed[1600]
107
108 AliMedium(1, "Lead $", 1, 0,
109 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
110
b13bbe81 111
112 // The scintillator of the CPV made of Polystyrene scintillator -> idtmed[1601]
113 AliMedium(2, "CPV scint. $", 2, 1,
61e0abb5 114 isxfld, sxmgmx, 10.0, 0.001, 0.1, 0.001, 0.001, 0, 0) ;
b13bbe81 115
116 // Various Aluminium parts made of Al -> idtmed[1602]
117 AliMedium(3, "Al parts $", 3, 0,
118 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
119
120
2012850d 121
2012850d 122
b13bbe81 123// --- Set decent energy thresholds for gamma and electron tracking
2012850d 124
125 // Tracking threshold for photons and electrons in Lead
ffa6d63b 126 gMC->Gstpar(idtmed[1600],"CUTGAM",0.00008) ;
127 gMC->Gstpar(idtmed[1600],"CUTELE",0.001) ;
128 gMC->Gstpar(idtmed[1600],"BCUTE",0.0001) ;
2012850d 129
130 // --- Generate explicitly delta rays in Lead ---
131 gMC->Gstpar(idtmed[1600], "LOSS",3.) ;
132 gMC->Gstpar(idtmed[1600], "DRAY",1.) ;
2012850d 133
b13bbe81 134// --- and in aluminium parts ---
135 gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
136 gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
137
61e0abb5 138
ffa6d63b 139// --- and finally thresholds for photons and electrons in the scintillator ---
61e0abb5 140 gMC->Gstpar(idtmed[1601],"CUTGAM",0.00008) ;
141 gMC->Gstpar(idtmed[1601],"CUTELE",0.001) ;
142 gMC->Gstpar(idtmed[1601],"BCUTE",0.0001) ;
143
144
2012850d 145}
146//____________________________________________________________________________
147void AliEMCAL::SetTreeAddress()
148{
149
150 TBranch *branch;
151 char branchname[20];
152 sprintf(branchname,"%s",GetName());
153
154 // Branch address for hit tree
155 TTree *treeH = gAlice->TreeH();
156 if (treeH && fHits) {
157 branch = treeH->GetBranch(branchname);
158 if (branch) branch->SetAddress(&fHits);
159 }
160
2012850d 161}
162
163