]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCAL.cxx
Ion pump and bellows moved out by 15 cm to make space for forward
[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 //    
21 // 
22 //*-- Author: Yves Schutz (SUBATECH) 
23 //////////////////////////////////////////////////////////////////////////////
24
25 // --- Standard library ---
26 #include <strstream.h>
27
28 // --- ROOT system ---
29 #include "TBranch.h" 
30 #include "TClonesArray.h" 
31 #include "TTree.h" 
32
33 // --- AliRoot header files ---
34
35 #include "AliEMCAL.h"
36 #include "AliEMCALGeometry.h"
37 #include "AliMC.h"
38 #include "AliRun.h"
39 #include "AliMagF.h"
40
41 ClassImp(AliEMCAL)
42
43 //____________________________________________________________________________
44 AliEMCAL::AliEMCAL():AliDetector()
45 {
46   // ctor 
47   //We do not create objects, because these pointers will be overwritten during reading from file.
48   fSDigits       = 0 ;
49 }
50 //____________________________________________________________________________
51 AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title) 
52 {
53   // ctor : title is used to identify the layout
54   
55   // gets an instance of the geometry parameters class  
56  
57   if (strcmp(GetTitle(),"") != 0 ) 
58     fGeom =  AliEMCALGeometry::GetInstance(GetTitle(), "") ; 
59 }
60 //____________________________________________________________________________
61 AliEMCAL::~AliEMCAL()
62 {
63   // dtor
64
65 }
66
67 //____________________________________________________________________________
68 void AliEMCAL::CreateMaterials()
69 {
70   // Definitions of materials to build EMCAL and associated tracking media.
71   // media number in idtmed are 1599 to 1698.
72
73   // --- Air ---
74   AliMaterial(0, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
75
76   // --- Lead ---                                                                     
77   AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
78
79   // --- Average properties of the active material ---                                                                     
80   AliMaterial(2, "EmcalMat$", fGeom->GetAmat(), 
81                               fGeom->GetZmat(),
82                               fGeom->GetDmat(),
83                               fGeom->GetRmat(), 
84                               0) ;
85
86   // DEFINITION OF THE TRACKING MEDIA
87
88   // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
89   Int_t * idtmed = fIdtmed->GetArray() - 1599 ; 
90   Int_t   isxfld = gAlice->Field()->Integ() ;
91   Float_t sxmgmx = gAlice->Field()->Max() ;
92
93    // Air                                                                           -> idtmed[1599] 
94   AliMedium(0, "Air          $", 0, 0,
95              isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
96
97   // The Lead                                                                       -> idtmed[1600]
98  
99   AliMedium(1, "Lead      $", 1, 0,
100              isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
101
102   // The Average properties of the active material                                  -> idtmed[1601]
103
104   AliMedium(2, "EmcalMat  $", 2, 0,
105              isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
106
107  // --- Set decent energy thresholds for gamma and electron tracking
108
109   // Tracking threshold for photons and electrons in Lead 
110   gMC->Gstpar(idtmed[1600], "CUTGAM",0.5E-4) ; 
111   gMC->Gstpar(idtmed[1600], "CUTELE",1.0E-4) ;
112   gMC->Gstpar(idtmed[1601], "CUTGAM",0.5E-4) ; 
113   gMC->Gstpar(idtmed[1601], "CUTELE",1.0E-4) ;
114
115   // --- Generate explicitly delta rays in Lead ---
116   gMC->Gstpar(idtmed[1600], "LOSS",3.) ;
117   gMC->Gstpar(idtmed[1600], "DRAY",1.) ;
118   gMC->Gstpar(idtmed[1601], "LOSS",3.) ;
119   gMC->Gstpar(idtmed[1601], "DRAY",1.) ;
120  
121 }
122 //____________________________________________________________________________
123 void AliEMCAL::SetTreeAddress()
124
125
126   TBranch *branch;
127   char branchname[20];
128   sprintf(branchname,"%s",GetName());
129   
130   // Branch address for hit tree
131   TTree *treeH = gAlice->TreeH();
132   if (treeH && fHits) {
133     branch = treeH->GetBranch(branchname);
134     if (branch) branch->SetAddress(&fHits);
135   }
136  
137   // Branch address for digit tree
138   TTree *treeD = gAlice->TreeD();
139   
140   if(fDigits)
141     fDigits->Clear();
142
143   if (treeD && fDigits) {
144     branch = treeD->GetBranch(branchname);
145     if (branch) branch->SetAddress(&fDigits);
146   }
147
148   if(fSDigits)
149     fSDigits->Clear();
150
151   if (gAlice->TreeS()  && fSDigits ) {
152     branch = gAlice->TreeS()->GetBranch("EMCAL");
153     if (branch) branch->SetAddress(&fSDigits) ;
154   } 
155 }
156
157