]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCAL.cxx
suppress off-line finders ( vertex etc.)
[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 // 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) 
22 //
23 //*-- Additional Contributions: Sahal Yacoob (LBNL/UCT)
24 //                            : Alexei Pavlinov (WSU) 
25 //
26 //////////////////////////////////////////////////////////////////////////////
27
28 // --- ROOT system ---
29 class TFile;
30 #include <TFolder.h> 
31 #include <TGeoGlobalMagField.h>
32 #include <TGraph.h> 
33 #include <TH1F.h> 
34 #include <TRandom.h> 
35 #include <TTree.h>
36 #include <TVirtualMC.h> 
37
38 // --- Standard library ---
39
40 // --- AliRoot header files ---
41 #include "AliMagF.h"
42 #include "AliEMCAL.h"
43 #include "AliRun.h"
44 #include "AliEMCALLoader.h"
45 #include "AliEMCALSDigitizer.h"
46 #include "AliEMCALDigitizer.h"
47 #include "AliEMCALDigit.h"
48 #include "AliEMCALRawUtils.h"
49 #include "AliCDBManager.h"
50 #include "AliCDBEntry.h"
51
52 ClassImp(AliEMCAL)
53
54 //____________________________________________________________________________
55 AliEMCAL::AliEMCAL()
56   : AliDetector(),
57     fBirkC0(0),
58     fBirkC1(0.),
59     fBirkC2(0.),
60     fGeometry(0)
61 {
62   // Default ctor 
63   fName = "EMCAL" ;
64   InitConstants();
65
66   // Should call  AliEMCALGeometry::GetInstance(EMCAL->GetTitle(),"") for getting EMCAL geometry
67 }
68
69 //____________________________________________________________________________
70 AliEMCAL::AliEMCAL(const char* name, const char* title)
71   : AliDetector(name,title),
72     fBirkC0(0),
73     fBirkC1(0.),
74     fBirkC2(0.),
75     fGeometry(0)
76 {
77   //   ctor : title is used to identify the layout
78   InitConstants();
79 }
80
81 //____________________________________________________________________________
82 AliEMCAL::~AliEMCAL()
83 {
84   //dtor
85 }
86
87 //____________________________________________________________________________
88 void AliEMCAL::InitConstants()
89 {
90   //initialize EMCAL values
91   fBirkC0 = 1;
92   fBirkC1 = 0.013/1.032;
93   fBirkC2 = 9.6e-6/(1.032 * 1.032);
94   }
95
96 //Not needed, modify $ALICE_ROOT/data/galice.cuts instead.
97 //Load the modified one in the configuration file with SetTransPar
98 // //____________________________________________________________________________
99 // void AliEMCAL::DefineMediumParameters()
100 // {
101 //   //
102 //   // EMCAL cuts (Geant3) 
103 //   // 
104 //   Int_t * idtmed = fIdtmed->GetArray() - 1599 ; 
105 // // --- Set decent energy thresholds for gamma and electron tracking
106
107 //   // Tracking threshold for photons and electrons in Lead 
108 //   Float_t cutgam=10.e-5; // 100 kev;
109 //   Float_t cutele=10.e-5; // 100 kev;
110 //   TString ntmp(GetTitle()); 
111 //   ntmp.ToUpper();
112 //   if(ntmp.Contains("10KEV")) {
113 //     cutele = cutgam = 1.e-5;
114 //   } else if(ntmp.Contains("50KEV")) {
115 //     cutele = cutgam = 5.e-5;
116 //   } else if(ntmp.Contains("100KEV")) {
117 //     cutele = cutgam = 1.e-4;
118 //   } else if(ntmp.Contains("200KEV")) {
119 //     cutele = cutgam = 2.e-4;
120 //   } else if(ntmp.Contains("500KEV")) {
121 //     cutele = cutgam = 5.e-4;
122 //   }
123
124 //   gMC->Gstpar(idtmed[1600],"CUTGAM", cutgam);
125 //   gMC->Gstpar(idtmed[1600],"CUTELE", cutele); // 1MEV -> 0.1MEV; 15-aug-05
126 //   gMC->Gstpar(idtmed[1600],"BCUTE",  cutgam);  // BCUTE and BCUTM start from GUTGUM
127 //   gMC->Gstpar(idtmed[1600],"BCUTM",  cutgam);  // BCUTE and BCUTM start from GUTGUM
128 //   // --- Generate explicitly delta rays in Lead ---
129 //   gMC->Gstpar(idtmed[1600], "LOSS", 3) ;
130 //   gMC->Gstpar(idtmed[1600], "DRAY", 1) ;
131 //   gMC->Gstpar(idtmed[1600], "DCUTE", cutele) ;
132 //   gMC->Gstpar(idtmed[1600], "DCUTM", cutele) ;
133
134 // // --- in aluminium parts ---
135 //   gMC->Gstpar(idtmed[1602],"CUTGAM", cutgam) ;
136 //   gMC->Gstpar(idtmed[1602],"CUTELE", cutele) ;
137 //   gMC->Gstpar(idtmed[1602],"BCUTE",  cutgam);  // BCUTE and BCUTM start from GUTGUM
138 //   gMC->Gstpar(idtmed[1602],"BCUTM",  cutgam);  // BCUTE and BCUTM start from GUTGUM
139 //   gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
140 //   gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
141 //   gMC->Gstpar(idtmed[1602], "DCUTE", cutele) ;
142 //   gMC->Gstpar(idtmed[1602], "DCUTM", cutele) ;
143
144 // // --- and finally thresholds for photons and electrons in the scintillator ---
145 //   gMC->Gstpar(idtmed[1601],"CUTGAM", cutgam) ;
146 //   gMC->Gstpar(idtmed[1601],"CUTELE", cutele) ;// 1MEV -> 0.1MEV; 15-aug-05
147 //   gMC->Gstpar(idtmed[1601],"BCUTE",  cutgam);  // BCUTE and BCUTM start from GUTGUM
148 //   gMC->Gstpar(idtmed[1601],"BCUTM",  cutgam);  // BCUTE and BCUTM start from GUTGUM
149 //   gMC->Gstpar(idtmed[1601], "LOSS",3) ; // generate delta rays 
150 //   gMC->Gstpar(idtmed[1601], "DRAY",1) ;
151 //   gMC->Gstpar(idtmed[1601], "DCUTE", cutele) ;
152 //   gMC->Gstpar(idtmed[1601], "DCUTM", cutele) ;
153
154 //   // S steel - 
155 //   gMC->Gstpar(idtmed[1603],"CUTGAM", cutgam);
156 //   gMC->Gstpar(idtmed[1603],"CUTELE", cutele);
157 //   gMC->Gstpar(idtmed[1603],"BCUTE",  cutgam);  // BCUTE and BCUTM start from GUTGUM
158 //   gMC->Gstpar(idtmed[1603],"BCUTM",  cutgam);  // BCUTE and BCUTM start from GUTGUM
159 //   // --- Generate explicitly delta rays 
160 //   gMC->Gstpar(idtmed[1603], "LOSS",3);
161 //   gMC->Gstpar(idtmed[1603], "DRAY",1);
162 //   gMC->Gstpar(idtmed[1603], "DCUTE", cutele) ;
163 //   gMC->Gstpar(idtmed[1603], "DCUTM", cutele) ;
164
165 //   AliEMCALGeometry* geom = GetGeometry();
166 //   if(geom->GetILOSS()>=0) {
167 //     for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "LOSS", geom->GetILOSS()) ; 
168 //   } 
169 //   if(geom->GetIHADR()>=0) {
170 //     for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "HADR", geom->GetIHADR()) ; 
171 //   }
172 // }
173
174 //____________________________________________________________________________
175 AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
176 {
177   //create and return the digitizer
178   return new AliEMCALDigitizer(manager);
179 }
180
181 //____________________________________________________________________________
182 void AliEMCAL::CreateMaterials()
183 {
184   // Definitions of materials to build EMCAL and associated tracking media.
185   // media number in idtmed are 1599 to 1698.
186   // --- Air ---               
187   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
188   Float_t zAir[4]={6.,7.,8.,18.};
189   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
190   Float_t dAir = 1.20479E-3;
191   AliMixture(0, "Air$", aAir, zAir, dAir, 4, wAir) ;
192
193   // --- Lead ---                                                                     
194   AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
195
196
197   // --- The polysterene scintillator (CH) ---
198   Float_t aP[2] = {12.011, 1.00794} ;
199   Float_t zP[2] = {6.0, 1.0} ;
200   Float_t wP[2] = {1.0, 1.0} ;
201   Float_t dP = 1.032 ;
202
203   AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
204
205   // --- Aluminium ---
206   AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
207   // ---         Absorption length is ignored ^
208
209   // 25-aug-04 by PAI - see  PMD/AliPMDv0.cxx for STEEL definition
210   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
211   Float_t zsteel[4] = { 26.,24.,28.,14. };
212   Float_t wsteel[4] = { .715,.18,.1,.005 };
213   AliMixture(4, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
214
215   // Oct 26,2010 : Multipurpose Copy Paper UNV-21200), weiht 75 g/m**2. 
216   // *Cellulose C6H10O5
217   //    Component C  A=12.01   Z=6.    W=6./21.
218   //    Component H  A=1.      Z=1.    W=10./21.
219   //    Component O  A=16.     Z=8.    W=5./21.
220   Float_t apaper[3] = { 12.01, 1.0, 16.0};
221   Float_t zpaper[3] = {  6.0,  1.0,  8.0};
222   Float_t wpaper[3] = {6./21., 10./21., 5./21.};
223   AliMixture(5, "BondPaper$", apaper, zpaper, 0.75, 3, wpaper);
224  
225   // DEFINITION OF THE TRACKING MEDIA
226   // Look to the $ALICE_ROOT/data/galice.cuts for particular values
227   // of cuts.
228   // Don't forget to add a new tracking medium with non-default cuts
229
230   // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
231   Int_t   isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ() ;
232   Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max() ;
233
234   // Air                                                                         -> idtmed[1599]
235  AliMedium(0, "Air$", 0, 0,
236              isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
237
238   // The Lead                                                                      -> idtmed[1600]
239  
240   AliMedium(1, "Lead$", 1, 0,
241              isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
242
243  // The scintillator of the CPV made of Polystyrene scintillator                   -> idtmed[1601]
244   float deemax = 0.1; // maximum fractional energy loss in one step (0 < DEEMAX < deemax )
245   AliMedium(2, "Scintillator$", 2, 1,
246             isxfld, sxmgmx, 10.0, 0.001, deemax, 0.001, 0.001, 0, 0) ;
247
248   // Various Aluminium parts made of Al                                            -> idtmed[1602]
249   AliMedium(3, "Al$", 3, 0,
250              isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
251
252   // 25-aug-04 by PAI : see  PMD/AliPMDv0.cxx for STEEL definition                 -> idtmed[1603]
253   AliMedium(4, "S steel$", 4, 0, 
254              isxfld, sxmgmx, 10.0, 0.01, 0.1, 0.001, 0.001, 0, 0) ;
255
256   // Oct 26,2010; Nov 24,2010                                                      -> idtmed[1604]
257   deemax = 0.01;
258   AliMedium(5, "Paper$", 5, 0, 
259              isxfld, sxmgmx, 10.0, deemax, 0.1, 0.001, 0.001, 0, 0) ;
260
261
262   //set constants for Birk's Law implentation
263   fBirkC0 =  1;
264   fBirkC1 =  0.013/dP;
265   fBirkC2 =  9.6e-6/(dP * dP);
266
267 }
268
269 //____________________________________________________________________________
270 void  AliEMCAL::Init()
271
272   // Init
273   //Not needed, modify $ALICE_ROOT/data/galice.cuts instead.
274   //Load the modified one in the configuration file with SetTransPar
275   //DefineMediumParameters(); 
276 }     
277
278 //____________________________________________________________________________
279 void AliEMCAL::Digits2Raw() {
280
281   static AliEMCALRawUtils rawUtils;
282   rawUtils.Digits2Raw();
283
284 }
285 //____________________________________________________________________________
286 void AliEMCAL::Hits2SDigits()  
287
288 // create summable digits
289
290   GetGeometry();
291   AliEMCALSDigitizer emcalDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
292   emcalDigitizer.SetEventRange(0, -1) ; // do all the events
293   emcalDigitizer.ExecuteTask() ;
294 }
295
296 //____________________________________________________________________________
297
298 AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
299 {
300 //different behaviour than standard (singleton getter)
301 // --> to be discussed and made eventually coherent
302  fLoader = new AliEMCALLoader(GetName(),topfoldername);
303  return fLoader;
304 }