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 **************************************************************************/
18 //_________________________________________________________________________
19 // Base Class for EMCAL description:
20 // This class contains material definitions
21 // for the EMCAL - It does not place the detector in Alice
22 //*-- Author: Yves Schutz (SUBATECH)
24 //*-- Additional Contributions: Sahal Yacoob (LBNL/UCT)
26 //////////////////////////////////////////////////////////////////////////////
28 // --- ROOT system ---
32 #include <TVirtualMC.h>
34 // --- Standard library ---
36 // --- AliRoot header files ---
39 #include "AliEMCALLoader.h"
41 #include "AliEMCALSDigitizer.h"
42 #include "AliEMCALDigitizer.h"
45 //____________________________________________________________________________
46 AliEMCAL::AliEMCAL():AliDetector()
53 //____________________________________________________________________________
54 AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title)
56 // ctor : title is used to identify the layout
60 //____________________________________________________________________________
66 //____________________________________________________________________________
67 void AliEMCAL::Copy(AliEMCAL & emcal)
69 TObject::Copy(emcal) ;
72 //____________________________________________________________________________
73 AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
75 return new AliEMCALDigitizer(manager);
78 //____________________________________________________________________________
79 void AliEMCAL::CreateMaterials()
81 // Definitions of materials to build EMCAL and associated tracking media.
82 // media number in idtmed are 1599 to 1698.
85 AliMaterial(0, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
89 AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
92 // --- The polysterene scintillator (CH) ---
93 Float_t aP[2] = {12.011, 1.00794} ;
94 Float_t zP[2] = {6.0, 1.0} ;
95 Float_t wP[2] = {1.0, 1.0} ;
98 AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
101 AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
102 // --- Absorption length is ignored ^
104 // DEFINITION OF THE TRACKING MEDIA
106 // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
107 Int_t * idtmed = fIdtmed->GetArray() - 1599 ;
108 Int_t isxfld = gAlice->Field()->Integ() ;
109 Float_t sxmgmx = gAlice->Field()->Max() ;
113 // Air -> idtmed[1599]
114 AliMedium(0, "Air $", 0, 0,
115 isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
117 // The Lead -> idtmed[1600]
119 AliMedium(1, "Lead $", 1, 0,
120 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
122 // The scintillator of the CPV made of Polystyrene scintillator -> idtmed[1601]
123 AliMedium(2, "CPV scint. $", 2, 1,
124 isxfld, sxmgmx, 10.0, 0.001, 0.1, 0.001, 0.001, 0, 0) ;
126 // Various Aluminium parts made of Al -> idtmed[1602]
127 AliMedium(3, "Al parts $", 3, 0,
128 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
131 // --- Set decent energy thresholds for gamma and electron tracking
133 // Tracking threshold for photons and electrons in Lead
134 gMC->Gstpar(idtmed[1600],"CUTGAM",0.00008) ;
135 gMC->Gstpar(idtmed[1600],"CUTELE",0.001) ;
136 gMC->Gstpar(idtmed[1600],"BCUTE",0.0001) ;
138 // --- Generate explicitly delta rays in Lead ---
139 gMC->Gstpar(idtmed[1600], "LOSS",3.) ;
140 gMC->Gstpar(idtmed[1600], "DRAY",1.) ;
141 gMC->Gstpar(idtmed[1600], "DCUTE",0.00001) ;
142 gMC->Gstpar(idtmed[1600], "DCUTM",0.00001) ;
144 // --- in aluminium parts ---
145 gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
146 gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
147 gMC->Gstpar(idtmed[1602], "DCUTE",0.00001) ;
148 gMC->Gstpar(idtmed[1602], "DCUTM",0.00001) ;
150 // --- and finally thresholds for photons and electrons in the scintillator ---
151 gMC->Gstpar(idtmed[1601],"CUTGAM",0.00008) ;
152 gMC->Gstpar(idtmed[1601],"CUTELE",0.001) ;
153 gMC->Gstpar(idtmed[1601],"BCUTE",0.0001) ;
155 //set constants for Birk's Law implentation
158 fBirkC2 = 9.6e-6/(dP * dP);
163 //____________________________________________________________________________
164 void AliEMCAL::Hits2SDigits()
166 // create summable digits
168 AliEMCALSDigitizer* emcalDigitizer =
169 new AliEMCALSDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
170 emcalDigitizer->SetEventRange(0, -1) ; // do all the events
171 emcalDigitizer->ExecuteTask() ;
174 //____________________________________________________________________________
175 AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
177 //different behaviour than standard (singleton getter)
178 // --> to be discussed and made eventually coherent
179 fLoader = new AliEMCALLoader(GetName(),topfoldername);
183 //____________________________________________________________________________
184 void AliEMCAL::SetTreeAddress()
186 // Linking Hits in Tree to Hits array
189 sprintf(branchname,"%s",GetName());
191 // Branch address for hit tree
192 TTree *treeH = TreeH();
194 branch = treeH->GetBranch(branchname);
198 fHits= new TClonesArray("AliEMCALHit",1000);
199 branch->SetAddress(&fHits);
203 Warning("SetTreeAddress","<%s> Failed",GetName());