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 //_________________________________________________________________________
18 // Base Class for EMCAL description:
19 // This class contains material definitions
20 // for the EMCAL - It does not place the detector in Alice
21 //*-- Author: Yves Schutz (SUBATECH)
23 //*-- Additional Contributions: Sahal Yacoob (LBNL/UCT)
25 //////////////////////////////////////////////////////////////////////////////
27 // --- ROOT system ---
30 #include <TGeoGlobalMagField.h>
35 #include <TVirtualMC.h>
37 // --- Standard library ---
39 // --- AliRoot header files ---
43 #include "AliEMCALLoader.h"
44 #include "AliEMCALSDigitizer.h"
45 #include "AliEMCALDigitizer.h"
46 #include "AliEMCALDigit.h"
47 #include "AliEMCALRawUtils.h"
48 #include "AliCDBManager.h"
49 #include "AliCDBEntry.h"
53 //____________________________________________________________________________
65 // Should call AliEMCALGeometry::GetInstance(EMCAL->GetTitle(),"") for getting EMCAL geometry
68 //____________________________________________________________________________
69 AliEMCAL::AliEMCAL(const char* name, const char* title)
70 : AliDetector(name,title),
76 // ctor : title is used to identify the layout
80 //____________________________________________________________________________
86 //____________________________________________________________________________
87 void AliEMCAL::InitConstants()
89 //initialize EMCAL values
91 fBirkC1 = 0.013/1.032;
92 fBirkC2 = 9.6e-6/(1.032 * 1.032);
95 //Not needed, modify $ALICE_ROOT/data/galice.cuts instead.
96 //Load the modified one in the configuration file with SetTransPar
97 // //____________________________________________________________________________
98 // void AliEMCAL::DefineMediumParameters()
101 // // EMCAL cuts (Geant3)
103 // Int_t * idtmed = fIdtmed->GetArray() - 1599 ;
104 // // --- Set decent energy thresholds for gamma and electron tracking
106 // // Tracking threshold for photons and electrons in Lead
107 // Float_t cutgam=10.e-5; // 100 kev;
108 // Float_t cutele=10.e-5; // 100 kev;
109 // TString ntmp(GetTitle());
111 // if(ntmp.Contains("10KEV")) {
112 // cutele = cutgam = 1.e-5;
113 // } else if(ntmp.Contains("50KEV")) {
114 // cutele = cutgam = 5.e-5;
115 // } else if(ntmp.Contains("100KEV")) {
116 // cutele = cutgam = 1.e-4;
117 // } else if(ntmp.Contains("200KEV")) {
118 // cutele = cutgam = 2.e-4;
119 // } else if(ntmp.Contains("500KEV")) {
120 // cutele = cutgam = 5.e-4;
123 // gMC->Gstpar(idtmed[1600],"CUTGAM", cutgam);
124 // gMC->Gstpar(idtmed[1600],"CUTELE", cutele); // 1MEV -> 0.1MEV; 15-aug-05
125 // gMC->Gstpar(idtmed[1600],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM
126 // gMC->Gstpar(idtmed[1600],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM
127 // // --- Generate explicitly delta rays in Lead ---
128 // gMC->Gstpar(idtmed[1600], "LOSS", 3) ;
129 // gMC->Gstpar(idtmed[1600], "DRAY", 1) ;
130 // gMC->Gstpar(idtmed[1600], "DCUTE", cutele) ;
131 // gMC->Gstpar(idtmed[1600], "DCUTM", cutele) ;
133 // // --- in aluminium parts ---
134 // gMC->Gstpar(idtmed[1602],"CUTGAM", cutgam) ;
135 // gMC->Gstpar(idtmed[1602],"CUTELE", cutele) ;
136 // gMC->Gstpar(idtmed[1602],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM
137 // gMC->Gstpar(idtmed[1602],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM
138 // gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
139 // gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
140 // gMC->Gstpar(idtmed[1602], "DCUTE", cutele) ;
141 // gMC->Gstpar(idtmed[1602], "DCUTM", cutele) ;
143 // // --- and finally thresholds for photons and electrons in the scintillator ---
144 // gMC->Gstpar(idtmed[1601],"CUTGAM", cutgam) ;
145 // gMC->Gstpar(idtmed[1601],"CUTELE", cutele) ;// 1MEV -> 0.1MEV; 15-aug-05
146 // gMC->Gstpar(idtmed[1601],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM
147 // gMC->Gstpar(idtmed[1601],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM
148 // gMC->Gstpar(idtmed[1601], "LOSS",3) ; // generate delta rays
149 // gMC->Gstpar(idtmed[1601], "DRAY",1) ;
150 // gMC->Gstpar(idtmed[1601], "DCUTE", cutele) ;
151 // gMC->Gstpar(idtmed[1601], "DCUTM", cutele) ;
154 // gMC->Gstpar(idtmed[1603],"CUTGAM", cutgam);
155 // gMC->Gstpar(idtmed[1603],"CUTELE", cutele);
156 // gMC->Gstpar(idtmed[1603],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM
157 // gMC->Gstpar(idtmed[1603],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM
158 // // --- Generate explicitly delta rays
159 // gMC->Gstpar(idtmed[1603], "LOSS",3);
160 // gMC->Gstpar(idtmed[1603], "DRAY",1);
161 // gMC->Gstpar(idtmed[1603], "DCUTE", cutele) ;
162 // gMC->Gstpar(idtmed[1603], "DCUTM", cutele) ;
164 // AliEMCALGeometry* geom = GetGeometry();
165 // if(geom->GetILOSS()>=0) {
166 // for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "LOSS", geom->GetILOSS()) ;
168 // if(geom->GetIHADR()>=0) {
169 // for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "HADR", geom->GetIHADR()) ;
173 //____________________________________________________________________________
174 AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
176 //create and return the digitizer
177 return new AliEMCALDigitizer(manager);
180 //____________________________________________________________________________
181 void AliEMCAL::CreateMaterials()
183 // Definitions of materials to build EMCAL and associated tracking media.
184 // media number in idtmed are 1599 to 1698.
186 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
187 Float_t zAir[4]={6.,7.,8.,18.};
188 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
189 Float_t dAir = 1.20479E-3;
190 AliMixture(0, "Air$", aAir, zAir, dAir, 4, wAir) ;
193 AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
196 // --- The polysterene scintillator (CH) ---
197 Float_t aP[2] = {12.011, 1.00794} ;
198 Float_t zP[2] = {6.0, 1.0} ;
199 Float_t wP[2] = {1.0, 1.0} ;
202 AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
205 AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
206 // --- Absorption length is ignored ^
208 // 25-aug-04 by PAI - see PMD/AliPMDv0.cxx for STEEL definition
209 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
210 Float_t zsteel[4] = { 26.,24.,28.,14. };
211 Float_t wsteel[4] = { .715,.18,.1,.005 };
212 AliMixture(4, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
214 // DEFINITION OF THE TRACKING MEDIA
216 // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
217 Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ() ;
218 Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max() ;
220 // Air -> idtmed[1599]
221 AliMedium(0, "Air$", 0, 0,
222 isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
224 // The Lead -> idtmed[1600]
226 AliMedium(1, "Lead$", 1, 0,
227 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
229 // The scintillator of the CPV made of Polystyrene scintillator -> idtmed[1601]
230 float deemax = 0.1; // maximum fractional energy loss in one step (0 < DEEMAX < deemax )
231 AliMedium(2, "Scintillator$", 2, 1,
232 isxfld, sxmgmx, 10.0, 0.001, deemax, 0.001, 0.001, 0, 0) ;
234 // Various Aluminium parts made of Al -> idtmed[1602]
235 AliMedium(3, "Al$", 3, 0,
236 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
238 // 25-aug-04 by PAI : see PMD/AliPMDv0.cxx for STEEL definition -> idtmed[1603]
239 AliMedium(4, "S steel$", 4, 0,
240 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
243 //set constants for Birk's Law implentation
246 fBirkC2 = 9.6e-6/(dP * dP);
250 //____________________________________________________________________________
251 void AliEMCAL::Init()
254 //Not needed, modify $ALICE_ROOT/data/galice.cuts instead.
255 //Load the modified one in the configuration file with SetTransPar
256 //DefineMediumParameters();
259 //____________________________________________________________________________
260 void AliEMCAL::Digits2Raw() {
262 static AliEMCALRawUtils rawUtils;
263 rawUtils.Digits2Raw();
266 //____________________________________________________________________________
267 void AliEMCAL::Hits2SDigits()
269 // create summable digits
272 AliEMCALSDigitizer emcalDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
273 emcalDigitizer.SetEventRange(0, -1) ; // do all the events
274 emcalDigitizer.ExecuteTask() ;
277 //____________________________________________________________________________
279 AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
281 //different behaviour than standard (singleton getter)
282 // --> to be discussed and made eventually coherent
283 fLoader = new AliEMCALLoader(GetName(),topfoldername);