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 **************************************************************************/
17 /* History of cvs commits:
20 * Revision 1.52 2007/03/10 22:19:01 pavlinov
21 * move one varibels from AliEMCALv2 to AliEMCAL
23 * Revision 1.51 2007/02/24 20:42:35 pavlinov
24 * fixed error of Geant3 parameters initialisation
26 * Revision 1.50 2007/02/05 10:43:25 hristov
27 * Changes for correct initialization of Geant4 (Mihaela)
29 * Revision 1.49 2007/01/22 17:29:12 pavlinov
30 * EMCAL geometry can be created independently form anything now
32 * Revision 1.48 2006/12/19 02:34:13 pavlinov
33 * clean up the EMCAL name scheme : super module -> module -> tower (or cell)
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
40 //_________________________________________________________________________
41 // Base Class for EMCAL description:
42 // This class contains material definitions
43 // for the EMCAL - It does not place the detector in Alice
44 //*-- Author: Yves Schutz (SUBATECH)
46 //*-- Additional Contributions: Sahal Yacoob (LBNL/UCT)
48 //////////////////////////////////////////////////////////////////////////////
50 // --- ROOT system ---
54 #include <TVirtualMC.h>
59 // --- Standard library ---
61 // --- AliRoot header files ---
65 #include "AliEMCALLoader.h"
66 #include "AliEMCALSDigitizer.h"
67 #include "AliEMCALDigitizer.h"
68 #include "AliEMCALDigit.h"
69 #include "AliEMCALRawUtils.h"
73 //____________________________________________________________________________
84 // Should call AliEMCALGeometry::GetInstance(EMCAL->GetTitle(),"") for getting EMCAL geometry
87 //____________________________________________________________________________
88 AliEMCAL::AliEMCAL(const char* name, const char* title)
89 : AliDetector(name,title),
95 // ctor : title is used to identify the layout
99 //____________________________________________________________________________
100 AliEMCAL::~AliEMCAL()
105 //____________________________________________________________________________
106 void AliEMCAL::InitConstants()
108 //initialize EMCAL values
110 fBirkC1 = 0.013/1.032;
111 fBirkC2 = 9.6e-6/(1.032 * 1.032);
114 //____________________________________________________________________________
115 void AliEMCAL::DefineMediumParameters()
118 // EMCAL cuts (Geant3)
120 Int_t * idtmed = fIdtmed->GetArray() - 1599 ;
121 // --- Set decent energy thresholds for gamma and electron tracking
123 // Tracking threshold for photons and electrons in Lead
124 Float_t cutgam=10.e-5; // 100 kev;
125 Float_t cutele=10.e-5; // 100 kev;
126 TString ntmp(GetTitle());
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;
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
144 // --- Generate explicitly delta rays in Lead ---
145 gMC->Gstpar(idtmed[1600], "LOSS", 3) ;
146 gMC->Gstpar(idtmed[1600], "DRAY", 1) ;
147 gMC->Gstpar(idtmed[1600], "DCUTE", cutele) ;
148 gMC->Gstpar(idtmed[1600], "DCUTM", cutele) ;
150 // --- in aluminium parts ---
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
155 gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
156 gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
157 gMC->Gstpar(idtmed[1602], "DCUTE", cutele) ;
158 gMC->Gstpar(idtmed[1602], "DCUTM", cutele) ;
160 // --- and finally thresholds for photons and electrons in the scintillator ---
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
165 gMC->Gstpar(idtmed[1601], "LOSS",3) ; // generate delta rays
166 gMC->Gstpar(idtmed[1601], "DRAY",1) ;
167 gMC->Gstpar(idtmed[1601], "DCUTE", cutele) ;
168 gMC->Gstpar(idtmed[1601], "DCUTM", cutele) ;
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
176 gMC->Gstpar(idtmed[1603], "LOSS",3);
177 gMC->Gstpar(idtmed[1603], "DRAY",1);
178 gMC->Gstpar(idtmed[1603], "DCUTE", cutele) ;
179 gMC->Gstpar(idtmed[1603], "DCUTM", cutele) ;
181 AliEMCALGeometry* geom = GetGeometry();
182 if(geom->GetILOSS()>=0) {
183 for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "LOSS", geom->GetILOSS()) ;
185 if(geom->GetIHADR()>=0) {
186 for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "HADR", geom->GetIHADR()) ;
190 //____________________________________________________________________________
191 AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
193 //create and return the digitizer
194 return new AliEMCALDigitizer(manager);
197 //____________________________________________________________________________
198 void AliEMCAL::CreateMaterials()
200 // Definitions of materials to build EMCAL and associated tracking media.
201 // media number in idtmed are 1599 to 1698.
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) ;
210 AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
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} ;
219 AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
222 AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
223 // --- Absorption length is ignored ^
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);
231 // DEFINITION OF THE TRACKING MEDIA
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() ;
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) ;
241 // The Lead -> idtmed[1600]
243 AliMedium(1, "Lead$", 1, 0,
244 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
246 // The scintillator of the CPV made of Polystyrene scintillator -> idtmed[1601]
247 float deemax = 0.1; // maximum fractional energy loss in one step (0 < DEEMAX < deemax )
248 AliMedium(2, "Scintillator$", 2, 1,
249 isxfld, sxmgmx, 10.0, 0.001, deemax, 0.001, 0.001, 0, 0) ;
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) ;
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) ;
260 //set constants for Birk's Law implentation
263 fBirkC2 = 9.6e-6/(dP * dP);
265 // Call just in case of Geant3; What to do in case of Geant4 ?
266 if(gMC->InheritsFrom("TGeant3")) DefineMediumParameters(); // Feb 20, 2007
268 //____________________________________________________________________________
269 void AliEMCAL::Digits2Raw() {
270 static AliEMCALRawUtils rawUtil;
271 rawUtil.Digits2Raw();
273 //____________________________________________________________________________
274 void AliEMCAL::Hits2SDigits()
276 // create summable digits
279 AliEMCALSDigitizer emcalDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
280 emcalDigitizer.SetEventRange(0, -1) ; // do all the events
281 emcalDigitizer.ExecuteTask() ;
284 //____________________________________________________________________________
286 AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
288 //different behaviour than standard (singleton getter)
289 // --> to be discussed and made eventually coherent
290 fLoader = new AliEMCALLoader(GetName(),topfoldername);