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)
24 // : Alexei Pavlinov (WSU)
26 //////////////////////////////////////////////////////////////////////////////
28 // --- ROOT system ---
31 #include <TGeoGlobalMagField.h>
36 #include <TVirtualMC.h>
38 // --- Standard library ---
40 // --- AliRoot header files ---
45 #include "AliRunLoader.h"
46 #include "AliCDBManager.h"
47 #include "AliEMCALLoader.h"
48 #include "AliEMCALSDigitizer.h"
49 #include "AliEMCALDigitizer.h"
50 #include "AliEMCALDigit.h"
51 #include "AliEMCALRawUtils.h"
52 #include "AliCDBManager.h"
53 #include "AliCDBEntry.h"
57 //____________________________________________________________________________
64 fCheckRunNumberAndGeoVersion(kTRUE)
70 // Should call AliEMCALGeometry::GetInstance(EMCAL->GetTitle(),"") for getting EMCAL geometry
73 //____________________________________________________________________________
74 AliEMCAL::AliEMCAL(const char* name, const char* title)
75 : AliDetector(name,title),
80 fCheckRunNumberAndGeoVersion(kTRUE)
82 // ctor : title is used to identify the layout
86 //____________________________________________________________________________
92 //____________________________________________________________________________
93 void AliEMCAL::InitConstants()
95 //initialize EMCAL values
97 fBirkC1 = 0.013/1.032;
98 fBirkC2 = 9.6e-6/(1.032 * 1.032);
101 //Not needed, modify $ALICE_ROOT/data/galice.cuts instead.
102 //Load the modified one in the configuration file with SetTransPar
103 // //____________________________________________________________________________
104 // void AliEMCAL::DefineMediumParameters()
107 // // EMCAL cuts (Geant3)
109 // Int_t * idtmed = fIdtmed->GetArray() - 1599 ;
110 // // --- Set decent energy thresholds for gamma and electron tracking
112 // // Tracking threshold for photons and electrons in Lead
113 // Float_t cutgam=10.e-5; // 100 kev;
114 // Float_t cutele=10.e-5; // 100 kev;
115 // TString ntmp(GetTitle());
117 // if(ntmp.Contains("10KEV")) {
118 // cutele = cutgam = 1.e-5;
119 // } else if(ntmp.Contains("50KEV")) {
120 // cutele = cutgam = 5.e-5;
121 // } else if(ntmp.Contains("100KEV")) {
122 // cutele = cutgam = 1.e-4;
123 // } else if(ntmp.Contains("200KEV")) {
124 // cutele = cutgam = 2.e-4;
125 // } else if(ntmp.Contains("500KEV")) {
126 // cutele = cutgam = 5.e-4;
129 // gMC->Gstpar(idtmed[1600],"CUTGAM", cutgam);
130 // gMC->Gstpar(idtmed[1600],"CUTELE", cutele); // 1MEV -> 0.1MEV; 15-aug-05
131 // gMC->Gstpar(idtmed[1600],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM
132 // gMC->Gstpar(idtmed[1600],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM
133 // // --- Generate explicitly delta rays in Lead ---
134 // gMC->Gstpar(idtmed[1600], "LOSS", 3) ;
135 // gMC->Gstpar(idtmed[1600], "DRAY", 1) ;
136 // gMC->Gstpar(idtmed[1600], "DCUTE", cutele) ;
137 // gMC->Gstpar(idtmed[1600], "DCUTM", cutele) ;
139 // // --- in aluminium parts ---
140 // gMC->Gstpar(idtmed[1602],"CUTGAM", cutgam) ;
141 // gMC->Gstpar(idtmed[1602],"CUTELE", cutele) ;
142 // gMC->Gstpar(idtmed[1602],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM
143 // gMC->Gstpar(idtmed[1602],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM
144 // gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
145 // gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
146 // gMC->Gstpar(idtmed[1602], "DCUTE", cutele) ;
147 // gMC->Gstpar(idtmed[1602], "DCUTM", cutele) ;
149 // // --- and finally thresholds for photons and electrons in the scintillator ---
150 // gMC->Gstpar(idtmed[1601],"CUTGAM", cutgam) ;
151 // gMC->Gstpar(idtmed[1601],"CUTELE", cutele) ;// 1MEV -> 0.1MEV; 15-aug-05
152 // gMC->Gstpar(idtmed[1601],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM
153 // gMC->Gstpar(idtmed[1601],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM
154 // gMC->Gstpar(idtmed[1601], "LOSS",3) ; // generate delta rays
155 // gMC->Gstpar(idtmed[1601], "DRAY",1) ;
156 // gMC->Gstpar(idtmed[1601], "DCUTE", cutele) ;
157 // gMC->Gstpar(idtmed[1601], "DCUTM", cutele) ;
160 // gMC->Gstpar(idtmed[1603],"CUTGAM", cutgam);
161 // gMC->Gstpar(idtmed[1603],"CUTELE", cutele);
162 // gMC->Gstpar(idtmed[1603],"BCUTE", cutgam); // BCUTE and BCUTM start from GUTGUM
163 // gMC->Gstpar(idtmed[1603],"BCUTM", cutgam); // BCUTE and BCUTM start from GUTGUM
164 // // --- Generate explicitly delta rays
165 // gMC->Gstpar(idtmed[1603], "LOSS",3);
166 // gMC->Gstpar(idtmed[1603], "DRAY",1);
167 // gMC->Gstpar(idtmed[1603], "DCUTE", cutele) ;
168 // gMC->Gstpar(idtmed[1603], "DCUTM", cutele) ;
170 // AliEMCALGeometry* geom = GetGeometry();
171 // if(geom->GetILOSS()>=0) {
172 // for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "LOSS", geom->GetILOSS()) ;
174 // if(geom->GetIHADR()>=0) {
175 // for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "HADR", geom->GetIHADR()) ;
179 //____________________________________________________________________________
180 AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
182 //create and return the digitizer
183 return new AliEMCALDigitizer(manager);
186 //____________________________________________________________________________
187 void AliEMCAL::CreateMaterials()
189 // Definitions of materials to build EMCAL and associated tracking media.
190 // media number in idtmed are 1599 to 1698.
192 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
193 Float_t zAir[4]={6.,7.,8.,18.};
194 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
195 Float_t dAir = 1.20479E-3;
196 AliMixture(0, "Air$", aAir, zAir, dAir, 4, wAir) ;
199 AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
202 // --- The polysterene scintillator (CH) ---
203 Float_t aP[2] = {12.011, 1.00794} ;
204 Float_t zP[2] = {6.0, 1.0} ;
205 Float_t wP[2] = {1.0, 1.0} ;
208 AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
211 AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
212 // --- Absorption length is ignored ^
214 // 25-aug-04 by PAI - see PMD/AliPMDv0.cxx for STEEL definition
215 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
216 Float_t zsteel[4] = { 26.,24.,28.,14. };
217 Float_t wsteel[4] = { .715,.18,.1,.005 };
218 AliMixture(4, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
220 // Oct 26,2010 : Multipurpose Copy Paper UNV-21200), weiht 75 g/m**2.
221 // *Cellulose C6H10O5
222 // Component C A=12.01 Z=6. W=6./21.
223 // Component H A=1. Z=1. W=10./21.
224 // Component O A=16. Z=8. W=5./21.
225 Float_t apaper[3] = { 12.01, 1.0, 16.0};
226 Float_t zpaper[3] = { 6.0, 1.0, 8.0};
227 Float_t wpaper[3] = {6./21., 10./21., 5./21.};
228 AliMixture(5, "BondPaper$", apaper, zpaper, 0.75, 3, wpaper);
230 // DEFINITION OF THE TRACKING MEDIA
231 // Look to the $ALICE_ROOT/data/galice.cuts for particular values
233 // Don't forget to add a new tracking medium with non-default cuts
235 // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
236 Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ() ;
237 Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max() ;
239 // Air -> idtmed[1599]
240 AliMedium(0, "Air$", 0, 0,
241 isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
243 // The Lead -> idtmed[1600]
245 AliMedium(1, "Lead$", 1, 0,
246 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
248 // The scintillator of the CPV made of Polystyrene scintillator -> idtmed[1601]
249 float deemax = 0.1; // maximum fractional energy loss in one step (0 < DEEMAX < deemax )
250 AliMedium(2, "Scintillator$", 2, 1,
251 isxfld, sxmgmx, 10.0, 0.001, deemax, 0.001, 0.001, 0, 0) ;
253 // Various Aluminium parts made of Al -> idtmed[1602]
254 AliMedium(3, "Al$", 3, 0,
255 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
257 // 25-aug-04 by PAI : see PMD/AliPMDv0.cxx for STEEL definition -> idtmed[1603]
258 AliMedium(4, "S steel$", 4, 0,
259 isxfld, sxmgmx, 10.0, 0.01, 0.1, 0.001, 0.001, 0, 0) ;
261 // Oct 26,2010; Nov 24,2010 -> idtmed[1604]
263 AliMedium(5, "Paper$", 5, 0,
264 isxfld, sxmgmx, 10.0, deemax, 0.1, 0.001, 0.001, 0, 0) ;
267 //set constants for Birk's Law implentation
270 fBirkC2 = 9.6e-6/(dP * dP);
274 //____________________________________________________________________________
275 void AliEMCAL::Init()
278 //Not needed, modify $ALICE_ROOT/data/galice.cuts instead.
279 //Load the modified one in the configuration file with SetTransPar
280 //DefineMediumParameters();
283 //____________________________________________________________________________
284 void AliEMCAL::Digits2Raw() {
286 static AliEMCALRawUtils rawUtils;
287 rawUtils.Digits2Raw();
290 //____________________________________________________________________________
291 void AliEMCAL::Hits2SDigits()
293 // create summable digits
296 AliEMCALSDigitizer emcalDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
297 emcalDigitizer.SetEventRange(0, -1) ; // do all the events
298 emcalDigitizer.ExecuteTask() ;
301 //____________________________________________________________________________
303 AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
305 //different behaviour than standard (singleton getter)
306 // --> to be discussed and made eventually coherent
307 fLoader = new AliEMCALLoader(GetName(),topfoldername);
311 //____________________________________________________________________________
313 AliEMCALGeometry* AliEMCAL::GetGeometry() const
315 //Initializes and returns geometry
317 //Check if run number and requested geometry correspond to the same geometry as
318 //in real data taking. To prevent errors in official simulation productions
319 if(!(AliEMCALGeometry::GetInstance()))
321 if(!fCheckRunNumberAndGeoVersion){// Set geometry with the name used in the configuration file
322 return AliEMCALGeometry::GetInstance(GetTitle(),"EMCAL") ;
324 else{//Check run number and version and set the corresponding one.
326 //AliRunLoader *rl = AliRunLoader::Instance();
327 //Int_t runNumber = rl->GetRunNumber();
329 AliCDBManager* man = AliCDBManager::Instance();
330 Int_t runNumber = man->GetRun();
332 //Instanciate geometry depending on the run number
333 TString geoName(GetTitle());
334 if(runNumber > 104064 && runNumber <= 140000 ){//2009-2010 runs
335 //First year geometry, 4 SM.
337 if(!geoName.Contains("FIRSTYEARV1")){
338 AliInfo(Form("*** ATTENTION *** \n \t Specified geometry name <<%s>> for run %d is not considered! \n \t In use <<EMCAL_FIRSTYEARV1>>, check run number and year \n ",
339 geoName.Data(),runNumber)); }
341 AliDebug(1,"Initialized geometry with name <<EMCAL_FIRSTYEARV1>>");}
343 return AliEMCALGeometry::GetInstance("EMCAL_FIRSTYEARV1","EMCAL") ;// Set geometry with the name used in the configuration file
345 else{ //Default geometry
346 //Complete EMCAL geometry, 10 SM.
348 if(!geoName.Contains("COMPLETEV1")){
349 AliInfo(Form("*** ATTENTION *** \n \t Specified geometry name <<%s>> for run %d is not considered! \n \t In use <<EMCAL_COMPLETEV1>>, check run number and year \n ",
350 geoName.Data(),runNumber));}
352 AliDebug(1,"Initialized geometry with name <<EMCAL_COMPLETEV1>>");}
354 return AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1","EMCAL") ;// Set geometry with the name used in the configuration file
357 }// Init geometry for the first time
359 return AliEMCALGeometry::GetInstance();