Implemented 30ns time cut
[u/mrichter/AliRoot.git] / EMCAL / AliEMCAL.cxx
CommitLineData
2012850d 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:
ffa6d63b 20// This class contains material definitions
21// for the EMCAL - It does not place the detector in Alice
2012850d 22//*-- Author: Yves Schutz (SUBATECH)
b13bbe81 23//
24//*-- Additional Contributions: Sahal Yacoob (LBNL/UCT)
25//
2012850d 26//////////////////////////////////////////////////////////////////////////////
27
2012850d 28// --- ROOT system ---
b13bbe81 29class TFile;
88cb7938 30#include <TFolder.h>
88cb7938 31#include <TTree.h>
32#include <TVirtualMC.h>
2012850d 33
05a92d59 34// --- Standard library ---
2012850d 35
05a92d59 36// --- AliRoot header files ---
2012850d 37#include "AliMagF.h"
88cb7938 38#include "AliEMCAL.h"
7f78a025 39#include "AliEMCALLoader.h"
85a5290f 40#include "AliRun.h"
41#include "AliEMCALSDigitizer.h"
42#include "AliEMCALDigitizer.h"
2012850d 43
44ClassImp(AliEMCAL)
2012850d 45//____________________________________________________________________________
46AliEMCAL::AliEMCAL():AliDetector()
47{
05a92d59 48 // Default ctor
49 fName="EMCAL";
1d7b3dd6 50 fGeom = 0 ;
2012850d 51}
05a92d59 52
2012850d 53//____________________________________________________________________________
05a92d59 54AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title)
55{
56 // ctor : title is used to identify the layout
1fe0f889 57 fGeom = 0;
2012850d 58}
05a92d59 59
2012850d 60//____________________________________________________________________________
05a92d59 61AliEMCAL::~AliEMCAL()
62{
63
2012850d 64}
65
66//____________________________________________________________________________
8367ce9a 67void AliEMCAL::Copy(AliEMCAL & emcal)
68{
69 TObject::Copy(emcal) ;
70}
71
72//____________________________________________________________________________
73AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
74{
75 return new AliEMCALDigitizer(manager);
76}
77
78//____________________________________________________________________________
05a92d59 79void AliEMCAL::CreateMaterials()
80{
2012850d 81 // Definitions of materials to build EMCAL and associated tracking media.
82 // media number in idtmed are 1599 to 1698.
83
84 // --- Air ---
85 AliMaterial(0, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
86
b13bbe81 87
2012850d 88 // --- Lead ---
89 AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
90
b13bbe81 91
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} ;
96 Float_t dP = 1.032 ;
97
98 AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
99
100 // --- Aluminium ---
101 AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
102 // --- Absorption length is ignored ^
103
2012850d 104 // DEFINITION OF THE TRACKING MEDIA
105
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() ;
110
211c54f0 111 // Air -> idtmed[1599]
112 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
113 Float_t zAir[4]={6.,7.,8.,18.};
114 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
115 Float_t dAir = 1.20479E-3;
116 AliMixture(0, "Air$", aAir, zAir, dAir, 4, wAir) ;
2012850d 117
a63e0d5e 118 // The Lead -> idtmed[1600]
2012850d 119
120 AliMedium(1, "Lead $", 1, 0,
121 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
122
b13bbe81 123 // The scintillator of the CPV made of Polystyrene scintillator -> idtmed[1601]
124 AliMedium(2, "CPV scint. $", 2, 1,
61e0abb5 125 isxfld, sxmgmx, 10.0, 0.001, 0.1, 0.001, 0.001, 0, 0) ;
b13bbe81 126
a63e0d5e 127 // Various Aluminium parts made of Al -> idtmed[1602]
b13bbe81 128 AliMedium(3, "Al parts $", 3, 0,
129 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
130
2012850d 131
b13bbe81 132// --- Set decent energy thresholds for gamma and electron tracking
2012850d 133
134 // Tracking threshold for photons and electrons in Lead
ffa6d63b 135 gMC->Gstpar(idtmed[1600],"CUTGAM",0.00008) ;
136 gMC->Gstpar(idtmed[1600],"CUTELE",0.001) ;
137 gMC->Gstpar(idtmed[1600],"BCUTE",0.0001) ;
2012850d 138
139 // --- Generate explicitly delta rays in Lead ---
140 gMC->Gstpar(idtmed[1600], "LOSS",3.) ;
141 gMC->Gstpar(idtmed[1600], "DRAY",1.) ;
05a92d59 142 gMC->Gstpar(idtmed[1600], "DCUTE",0.00001) ;
143 gMC->Gstpar(idtmed[1600], "DCUTM",0.00001) ;
144
a63e0d5e 145// --- in aluminium parts ---
b13bbe81 146 gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
147 gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
05a92d59 148 gMC->Gstpar(idtmed[1602], "DCUTE",0.00001) ;
149 gMC->Gstpar(idtmed[1602], "DCUTM",0.00001) ;
b13bbe81 150
ffa6d63b 151// --- and finally thresholds for photons and electrons in the scintillator ---
61e0abb5 152 gMC->Gstpar(idtmed[1601],"CUTGAM",0.00008) ;
153 gMC->Gstpar(idtmed[1601],"CUTELE",0.001) ;
154 gMC->Gstpar(idtmed[1601],"BCUTE",0.0001) ;
155
ab37d09c 156 //set constants for Birk's Law implentation
157 fBirkC0 = 1;
158 fBirkC1 = 0.013/dP;
159 fBirkC2 = 9.6e-6/(dP * dP);
160
161
2012850d 162}
f6019cda 163
8367ce9a 164//____________________________________________________________________________
165void AliEMCAL::Hits2SDigits()
166{
167// create summable digits
168
169 AliEMCALSDigitizer* emcalDigitizer =
da480a28 170 new AliEMCALSDigitizer(fLoader->GetRunLoader()->GetFileName().Data()) ;
171 emcalDigitizer->SetEventRange(0, -1) ; // do all the events
172 emcalDigitizer->ExecuteTask() ;
173}
174
175//____________________________________________________________________________
8367ce9a 176AliLoader* AliEMCAL::MakeLoader(const char* topfoldername)
177{
178//different behaviour than standard (singleton getter)
179// --> to be discussed and made eventually coherent
180 fLoader = new AliEMCALLoader(GetName(),topfoldername);
181 return fLoader;
182}
183
184//____________________________________________________________________________
2012850d 185void AliEMCAL::SetTreeAddress()
186{
d64c959b 187 // Linking Hits in Tree to Hits array
2012850d 188 TBranch *branch;
189 char branchname[20];
190 sprintf(branchname,"%s",GetName());
191
192 // Branch address for hit tree
88cb7938 193 TTree *treeH = TreeH();
194 if (treeH) {
2012850d 195 branch = treeH->GetBranch(branchname);
88cb7938 196 if (branch)
197 {
d64c959b 198 if (fHits == 0x0)
199 fHits= new TClonesArray("AliEMCALHit",1000);
88cb7938 200 branch->SetAddress(&fHits);
201 }
202 else
203 {
204 Warning("SetTreeAddress","<%s> Failed",GetName());
205 }
2012850d 206 }
2012850d 207}
2012850d 208
85a5290f 209
85a5290f 210
85a5290f 211
8367ce9a 212