]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCAL.cxx
Introducing the AliEMCALReconstructor class driving from AliReconstructor
[u/mrichter/AliRoot.git] / EMCAL / AliEMCAL.cxx
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$ */
17
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) 
23 //
24 //*-- Additional Contributions: Sahal Yacoob (LBNL/UCT)
25 //
26 //////////////////////////////////////////////////////////////////////////////
27
28 // --- ROOT system ---
29 class TFile;
30 #include <TFolder.h> 
31 #include <TTree.h>
32 #include <TVirtualMC.h> 
33
34 // --- Standard library ---
35
36 // --- AliRoot header files ---
37 #include "AliMagF.h"
38 #include "AliESDCaloTrack.h" 
39 #include "AliESD.h"
40 #include "AliEMCAL.h"
41 #include "AliEMCALGetter.h"
42 #include "AliRun.h"
43 #include "AliEMCALSDigitizer.h"
44 #include "AliEMCALDigitizer.h"
45
46 ClassImp(AliEMCAL)
47 //____________________________________________________________________________
48 AliEMCAL::AliEMCAL():AliDetector()
49 {
50   // Default ctor 
51   fName="EMCAL";
52   fGeom = 0 ; 
53 }
54
55 //____________________________________________________________________________
56 AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title)
57 {
58   //   ctor : title is used to identify the layout
59   fGeom = 0;
60 }
61
62 //____________________________________________________________________________
63 AliEMCAL::~AliEMCAL()
64 {
65
66 }
67
68 //____________________________________________________________________________
69 void AliEMCAL::Copy(AliEMCAL & emcal)
70 {
71   TObject::Copy(emcal) ; 
72 }
73
74 //____________________________________________________________________________
75 AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
76 {
77   return new AliEMCALDigitizer(manager);
78 }
79
80 //____________________________________________________________________________
81 void AliEMCAL::CreateMaterials()
82 {
83   // Definitions of materials to build EMCAL and associated tracking media.
84   // media number in idtmed are 1599 to 1698.
85
86   // --- Air ---
87   AliMaterial(0, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
88
89
90   // --- Lead ---                                                                     
91   AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
92
93
94   // --- The polysterene scintillator (CH) ---
95   Float_t aP[2] = {12.011, 1.00794} ;
96   Float_t zP[2] = {6.0, 1.0} ;
97   Float_t wP[2] = {1.0, 1.0} ;
98   Float_t dP = 1.032 ;
99
100   AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
101
102   // --- Aluminium ---
103   AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
104   // ---         Absorption length is ignored ^
105
106   // DEFINITION OF THE TRACKING MEDIA
107
108   // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
109   Int_t * idtmed = fIdtmed->GetArray() - 1599 ; 
110   Int_t   isxfld = gAlice->Field()->Integ() ;
111   Float_t sxmgmx = gAlice->Field()->Max() ;
112  
113
114
115    // Air                                                                           -> idtmed[1599] 
116   AliMedium(0, "Air          $", 0, 0,
117              isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
118
119   // The Lead                                                                      -> idtmed[1600]
120  
121   AliMedium(1, "Lead      $", 1, 0,
122              isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
123
124  // The scintillator of the CPV made of Polystyrene scintillator                   -> idtmed[1601]
125   AliMedium(2, "CPV scint.   $", 2, 1,
126             isxfld, sxmgmx, 10.0, 0.001, 0.1, 0.001, 0.001, 0, 0) ;
127
128   // Various Aluminium parts made of Al                                            -> idtmed[1602]
129   AliMedium(3, "Al parts     $", 3, 0,
130              isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
131
132
133 // --- Set decent energy thresholds for gamma and electron tracking
134
135   // Tracking threshold for photons and electrons in Lead 
136   gMC->Gstpar(idtmed[1600],"CUTGAM",0.00008) ;
137   gMC->Gstpar(idtmed[1600],"CUTELE",0.001) ;
138   gMC->Gstpar(idtmed[1600],"BCUTE",0.0001) ;
139
140   // --- Generate explicitly delta rays in Lead ---
141   gMC->Gstpar(idtmed[1600], "LOSS",3.) ;
142   gMC->Gstpar(idtmed[1600], "DRAY",1.) ;
143   gMC->Gstpar(idtmed[1600], "DCUTE",0.00001) ;
144   gMC->Gstpar(idtmed[1600], "DCUTM",0.00001) ;
145
146 // --- in aluminium parts ---
147   gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
148   gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
149   gMC->Gstpar(idtmed[1602], "DCUTE",0.00001) ;
150   gMC->Gstpar(idtmed[1602], "DCUTM",0.00001) ;
151
152 // --- and finally thresholds for photons and electrons in the scintillator ---
153   gMC->Gstpar(idtmed[1601],"CUTGAM",0.00008) ;
154   gMC->Gstpar(idtmed[1601],"CUTELE",0.001) ;
155   gMC->Gstpar(idtmed[1601],"BCUTE",0.0001) ;
156
157 }
158       
159 //____________________________________________________________________________
160 void AliEMCAL::Hits2SDigits()  
161
162 // create summable digits
163
164   AliEMCALSDigitizer* emcalDigitizer = 
165     new AliEMCALSDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
166   emcalDigitizer->SetEventRange(0, -1) ; // do all the events
167   emcalDigitizer->ExecuteTask() ;
168 }
169
170 //____________________________________________________________________________
171 AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
172 {
173 //different behaviour than standard (singleton getter)
174 // --> to be discussed and made eventually coherent
175  fLoader = new AliEMCALLoader(GetName(),topfoldername);
176  return fLoader;
177 }
178
179 //____________________________________________________________________________
180 void AliEMCAL::SetTreeAddress()
181
182   // Linking Hits in Tree to Hits array
183   TBranch *branch;
184   char branchname[20];
185   sprintf(branchname,"%s",GetName());
186   
187   // Branch address for hit tree
188   TTree *treeH = TreeH();
189   if (treeH) {
190     branch = treeH->GetBranch(branchname);
191     if (branch) 
192       { 
193         if (fHits == 0x0) 
194           fHits= new TClonesArray("AliEMCALHit",1000);
195         branch->SetAddress(&fHits);
196       }
197     else
198       {
199         Warning("SetTreeAddress","<%s> Failed",GetName());
200       }
201   }
202 }
203
204
205
206
207