]>
Commit | Line | Data |
---|---|---|
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$ */ | |
4884333f | 17 | /* History of cvs commits: |
18 | * | |
19 | * $Log$ | |
ee299369 | 20 | * Revision 1.52 2007/03/10 22:19:01 pavlinov |
21 | * move one varibels from AliEMCALv2 to AliEMCAL | |
22 | * | |
23ef18ac | 23 | * Revision 1.51 2007/02/24 20:42:35 pavlinov |
24 | * fixed error of Geant3 parameters initialisation | |
25 | * | |
91e5f344 | 26 | * Revision 1.50 2007/02/05 10:43:25 hristov |
27 | * Changes for correct initialization of Geant4 (Mihaela) | |
28 | * | |
7235aed2 | 29 | * Revision 1.49 2007/01/22 17:29:12 pavlinov |
30 | * EMCAL geometry can be created independently form anything now | |
31 | * | |
89557f6d | 32 | * Revision 1.48 2006/12/19 02:34:13 pavlinov |
33 | * clean up the EMCAL name scheme : super module -> module -> tower (or cell) | |
34 | * | |
2bb3725c | 35 | * Revision 1.47 2006/12/05 17:12:03 gustavo |
36 | * Updated AliEMCAL::Digits2Raw, reads first provisional RCU mapping files to make Raw data with new AliCaloAltroMapping and AliCaloRawStream | |
37 | * | |
4884333f | 38 | * |
39 | */ | |
2012850d | 40 | //_________________________________________________________________________ |
41 | // Base Class for EMCAL description: | |
ffa6d63b | 42 | // This class contains material definitions |
43 | // for the EMCAL - It does not place the detector in Alice | |
2012850d | 44 | //*-- Author: Yves Schutz (SUBATECH) |
b13bbe81 | 45 | // |
46 | //*-- Additional Contributions: Sahal Yacoob (LBNL/UCT) | |
47 | // | |
2012850d | 48 | ////////////////////////////////////////////////////////////////////////////// |
49 | ||
2012850d | 50 | // --- ROOT system --- |
b13bbe81 | 51 | class TFile; |
88cb7938 | 52 | #include <TFolder.h> |
88cb7938 | 53 | #include <TTree.h> |
54 | #include <TVirtualMC.h> | |
046ae904 | 55 | #include <TH1F.h> |
046ae904 | 56 | #include <TRandom.h> |
2d5d9e60 | 57 | #include <TGraph.h> |
2012850d | 58 | |
05a92d59 | 59 | // --- Standard library --- |
2012850d | 60 | |
05a92d59 | 61 | // --- AliRoot header files --- |
2012850d | 62 | #include "AliMagF.h" |
88cb7938 | 63 | #include "AliEMCAL.h" |
85a5290f | 64 | #include "AliRun.h" |
5dee926e | 65 | #include "AliEMCALLoader.h" |
85a5290f | 66 | #include "AliEMCALSDigitizer.h" |
67 | #include "AliEMCALDigitizer.h" | |
5dee926e | 68 | #include "AliEMCALDigit.h" |
ee299369 | 69 | #include "AliEMCALRawUtils.h" |
2012850d | 70 | |
71 | ClassImp(AliEMCAL) | |
4884333f | 72 | |
2012850d | 73 | //____________________________________________________________________________ |
18a21c7c | 74 | AliEMCAL::AliEMCAL() |
75 | : AliDetector(), | |
76 | fBirkC0(0), | |
77 | fBirkC1(0.), | |
78 | fBirkC2(0.), | |
23ef18ac | 79 | fGeometry(0) |
2012850d | 80 | { |
05a92d59 | 81 | // Default ctor |
046ae904 | 82 | fName = "EMCAL" ; |
7235aed2 | 83 | InitConstants(); |
23ef18ac | 84 | // Should call AliEMCALGeometry::GetInstance(EMCAL->GetTitle(),"") for getting EMCAL geometry |
2012850d | 85 | } |
05a92d59 | 86 | |
2012850d | 87 | //____________________________________________________________________________ |
18a21c7c | 88 | AliEMCAL::AliEMCAL(const char* name, const char* title) |
89 | : AliDetector(name,title), | |
90 | fBirkC0(0), | |
91 | fBirkC1(0.), | |
92 | fBirkC2(0.), | |
23ef18ac | 93 | fGeometry(0) |
05a92d59 | 94 | { |
95 | // ctor : title is used to identify the layout | |
7235aed2 | 96 | InitConstants(); |
0a4cb131 | 97 | } |
98 | ||
2012850d | 99 | //____________________________________________________________________________ |
05a92d59 | 100 | AliEMCAL::~AliEMCAL() |
101 | { | |
14ce0a6e | 102 | //dtor |
2012850d | 103 | } |
104 | ||
0a4cb131 | 105 | //____________________________________________________________________________ |
7235aed2 | 106 | void AliEMCAL::InitConstants() |
0a4cb131 | 107 | { |
108 | //initialize EMCAL values | |
109 | fBirkC0 = 1; | |
110 | fBirkC1 = 0.013/1.032; | |
111 | fBirkC2 = 9.6e-6/(1.032 * 1.032); | |
ee299369 | 112 | } |
0a4cb131 | 113 | |
8367ce9a | 114 | //____________________________________________________________________________ |
91e5f344 | 115 | void AliEMCAL::DefineMediumParameters() |
05a92d59 | 116 | { |
91e5f344 | 117 | // |
118 | // EMCAL cuts (Geant3) | |
119 | // | |
2012850d | 120 | Int_t * idtmed = fIdtmed->GetArray() - 1599 ; |
b13bbe81 | 121 | // --- Set decent energy thresholds for gamma and electron tracking |
2012850d | 122 | |
123 | // Tracking threshold for photons and electrons in Lead | |
905263da | 124 | Float_t cutgam=10.e-5; // 100 kev; |
125 | Float_t cutele=10.e-5; // 100 kev; | |
126 | TString ntmp(GetTitle()); | |
127 | ntmp.ToUpper(); | |
128 | if(ntmp.Contains("10KEV")) { | |
129 | cutele = cutgam = 1.e-5; | |
130 | } else if(ntmp.Contains("50KEV")) { | |
131 | cutele = cutgam = 5.e-5; | |
132 | } else if(ntmp.Contains("100KEV")) { | |
133 | cutele = cutgam = 1.e-4; | |
134 | } else if(ntmp.Contains("200KEV")) { | |
135 | cutele = cutgam = 2.e-4; | |
136 | } else if(ntmp.Contains("500KEV")) { | |
137 | cutele = cutgam = 5.e-4; | |
138 | } | |
2012850d | 139 | |
905263da | 140 | gMC->Gstpar(idtmed[1600],"CUTGAM", cutgam); |
141 | gMC->Gstpar(idtmed[1600],"CUTELE", cutele); // 1MEV -> 0.1MEV; 15-aug-05 | |
142 | gMC->Gstpar(idtmed[1600],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM | |
143 | gMC->Gstpar(idtmed[1600],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM | |
2012850d | 144 | // --- Generate explicitly delta rays in Lead --- |
89557f6d | 145 | gMC->Gstpar(idtmed[1600], "LOSS", 3) ; |
146 | gMC->Gstpar(idtmed[1600], "DRAY", 1) ; | |
905263da | 147 | gMC->Gstpar(idtmed[1600], "DCUTE", cutele) ; |
148 | gMC->Gstpar(idtmed[1600], "DCUTM", cutele) ; | |
05a92d59 | 149 | |
a63e0d5e | 150 | // --- in aluminium parts --- |
905263da | 151 | gMC->Gstpar(idtmed[1602],"CUTGAM", cutgam) ; |
152 | gMC->Gstpar(idtmed[1602],"CUTELE", cutele) ; | |
153 | gMC->Gstpar(idtmed[1602],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM | |
154 | gMC->Gstpar(idtmed[1602],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM | |
b13bbe81 | 155 | gMC->Gstpar(idtmed[1602], "LOSS",3.) ; |
156 | gMC->Gstpar(idtmed[1602], "DRAY",1.) ; | |
905263da | 157 | gMC->Gstpar(idtmed[1602], "DCUTE", cutele) ; |
158 | gMC->Gstpar(idtmed[1602], "DCUTM", cutele) ; | |
b13bbe81 | 159 | |
ffa6d63b | 160 | // --- and finally thresholds for photons and electrons in the scintillator --- |
905263da | 161 | gMC->Gstpar(idtmed[1601],"CUTGAM", cutgam) ; |
162 | gMC->Gstpar(idtmed[1601],"CUTELE", cutele) ;// 1MEV -> 0.1MEV; 15-aug-05 | |
163 | gMC->Gstpar(idtmed[1601],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM | |
164 | gMC->Gstpar(idtmed[1601],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM | |
89557f6d | 165 | gMC->Gstpar(idtmed[1601], "LOSS",3) ; // generate delta rays |
166 | gMC->Gstpar(idtmed[1601], "DRAY",1) ; | |
905263da | 167 | gMC->Gstpar(idtmed[1601], "DCUTE", cutele) ; |
168 | gMC->Gstpar(idtmed[1601], "DCUTM", cutele) ; | |
169 | ||
170 | // S steel - | |
171 | gMC->Gstpar(idtmed[1603],"CUTGAM", cutgam); | |
172 | gMC->Gstpar(idtmed[1603],"CUTELE", cutele); | |
173 | gMC->Gstpar(idtmed[1603],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM | |
174 | gMC->Gstpar(idtmed[1603],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM | |
175 | // --- Generate explicitly delta rays | |
89557f6d | 176 | gMC->Gstpar(idtmed[1603], "LOSS",3); |
177 | gMC->Gstpar(idtmed[1603], "DRAY",1); | |
905263da | 178 | gMC->Gstpar(idtmed[1603], "DCUTE", cutele) ; |
179 | gMC->Gstpar(idtmed[1603], "DCUTM", cutele) ; | |
1963b290 | 180 | |
7235aed2 | 181 | AliEMCALGeometry* geom = GetGeometry(); |
89557f6d | 182 | if(geom->GetILOSS()>=0) { |
183 | for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "LOSS", geom->GetILOSS()) ; | |
184 | } | |
185 | if(geom->GetIHADR()>=0) { | |
186 | for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "HADR", geom->GetIHADR()) ; | |
187 | } | |
7235aed2 | 188 | } |
189 | ||
190 | //____________________________________________________________________________ | |
191 | AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const | |
192 | { | |
193 | //create and return the digitizer | |
194 | return new AliEMCALDigitizer(manager); | |
195 | } | |
196 | ||
197 | //____________________________________________________________________________ | |
198 | void AliEMCAL::CreateMaterials() | |
199 | { | |
200 | // Definitions of materials to build EMCAL and associated tracking media. | |
201 | // media number in idtmed are 1599 to 1698. | |
202 | // --- Air --- | |
203 | Float_t aAir[4]={12.0107,14.0067,15.9994,39.948}; | |
204 | Float_t zAir[4]={6.,7.,8.,18.}; | |
205 | Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827}; | |
206 | Float_t dAir = 1.20479E-3; | |
207 | AliMixture(0, "Air$", aAir, zAir, dAir, 4, wAir) ; | |
208 | ||
209 | // --- Lead --- | |
210 | AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ; | |
211 | ||
212 | ||
213 | // --- The polysterene scintillator (CH) --- | |
214 | Float_t aP[2] = {12.011, 1.00794} ; | |
215 | Float_t zP[2] = {6.0, 1.0} ; | |
216 | Float_t wP[2] = {1.0, 1.0} ; | |
217 | Float_t dP = 1.032 ; | |
218 | ||
219 | AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ; | |
220 | ||
221 | // --- Aluminium --- | |
222 | AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ; | |
223 | // --- Absorption length is ignored ^ | |
224 | ||
225 | // 25-aug-04 by PAI - see PMD/AliPMDv0.cxx for STEEL definition | |
226 | Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 }; | |
227 | Float_t zsteel[4] = { 26.,24.,28.,14. }; | |
228 | Float_t wsteel[4] = { .715,.18,.1,.005 }; | |
229 | AliMixture(4, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel); | |
230 | ||
231 | // DEFINITION OF THE TRACKING MEDIA | |
232 | ||
233 | // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100] | |
234 | Int_t isxfld = gAlice->Field()->Integ() ; | |
235 | Float_t sxmgmx = gAlice->Field()->Max() ; | |
236 | ||
237 | // Air -> idtmed[1599] | |
238 | AliMedium(0, "Air$", 0, 0, | |
239 | isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ; | |
240 | ||
241 | // The Lead -> idtmed[1600] | |
242 | ||
243 | AliMedium(1, "Lead$", 1, 0, | |
244 | isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ; | |
245 | ||
246 | // The scintillator of the CPV made of Polystyrene scintillator -> idtmed[1601] | |
ee299369 | 247 | float deemax = 0.1; // maximum fractional energy loss in one step (0 < DEEMAX < deemax ) |
7235aed2 | 248 | AliMedium(2, "Scintillator$", 2, 1, |
249 | isxfld, sxmgmx, 10.0, 0.001, deemax, 0.001, 0.001, 0, 0) ; | |
250 | ||
251 | // Various Aluminium parts made of Al -> idtmed[1602] | |
252 | AliMedium(3, "Al$", 3, 0, | |
253 | isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ; | |
254 | ||
255 | // 25-aug-04 by PAI : see PMD/AliPMDv0.cxx for STEEL definition -> idtmed[1603] | |
256 | AliMedium(4, "S steel$", 4, 0, | |
257 | isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ; | |
258 | ||
89557f6d | 259 | |
ab37d09c | 260 | //set constants for Birk's Law implentation |
261 | fBirkC0 = 1; | |
262 | fBirkC1 = 0.013/dP; | |
263 | fBirkC2 = 9.6e-6/(dP * dP); | |
264 | ||
91e5f344 | 265 | // Call just in case of Geant3; What to do in case of Geant4 ? |
266 | if(gMC->InheritsFrom("TGeant3")) DefineMediumParameters(); // Feb 20, 2007 | |
2012850d | 267 | } |
2d5d9e60 | 268 | //____________________________________________________________________________ |
ee299369 | 269 | void AliEMCAL::Digits2Raw() { |
270 | static AliEMCALRawUtils rawUtil; | |
271 | rawUtil.Digits2Raw(); | |
2d5d9e60 | 272 | } |
8367ce9a | 273 | //____________________________________________________________________________ |
274 | void AliEMCAL::Hits2SDigits() | |
275 | { | |
276 | // create summable digits | |
277 | ||
ddca522a | 278 | GetGeometry(); |
4d33c797 | 279 | AliEMCALSDigitizer emcalDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ; |
280 | emcalDigitizer.SetEventRange(0, -1) ; // do all the events | |
281 | emcalDigitizer.ExecuteTask() ; | |
da480a28 | 282 | } |
283 | ||
8367ce9a | 284 | //____________________________________________________________________________ |
5dee926e | 285 | |
8367ce9a | 286 | AliLoader* AliEMCAL::MakeLoader(const char* topfoldername) |
287 | { | |
288 | //different behaviour than standard (singleton getter) | |
289 | // --> to be discussed and made eventually coherent | |
290 | fLoader = new AliEMCALLoader(GetName(),topfoldername); | |
291 | return fLoader; | |
292 | } |