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:
22 //*-- Author: Yves Schutz (SUBATECH)
23 //////////////////////////////////////////////////////////////////////////////
25 // --- Standard library ---
26 #include <strstream.h>
28 // --- ROOT system ---
30 #include "TClonesArray.h"
33 // --- AliRoot header files ---
36 #include "AliEMCALGeometry.h"
43 //____________________________________________________________________________
44 AliEMCAL::AliEMCAL():AliDetector()
47 //We do not create objects, because these pointers will be overwritten during reading from file.
50 //____________________________________________________________________________
51 AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title)
53 // ctor : title is used to identify the layout
55 // gets an instance of the geometry parameters class
57 if (strcmp(GetTitle(),"") != 0 )
58 fGeom = AliEMCALGeometry::GetInstance(GetTitle(), "") ;
60 //____________________________________________________________________________
67 //____________________________________________________________________________
68 void AliEMCAL::CreateMaterials()
70 // Definitions of materials to build EMCAL and associated tracking media.
71 // media number in idtmed are 1599 to 1698.
74 AliMaterial(0, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
77 AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
79 // --- Average properties of the active material ---
80 AliMaterial(2, "EmcalMat$", fGeom->GetAmat(),
86 // DEFINITION OF THE TRACKING MEDIA
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() ;
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) ;
97 // The Lead -> idtmed[1600]
99 AliMedium(1, "Lead $", 1, 0,
100 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
102 // The Average properties of the active material -> idtmed[1601]
104 AliMedium(2, "EmcalMat $", 2, 0,
105 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
107 // --- Set decent energy thresholds for gamma and electron tracking
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) ;
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.) ;
122 //____________________________________________________________________________
123 void AliEMCAL::SetTreeAddress()
128 sprintf(branchname,"%s",GetName());
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);
137 // Branch address for digit tree
138 TTree *treeD = gAlice->TreeD();
143 if (treeD && fDigits) {
144 branch = treeD->GetBranch(branchname);
145 if (branch) branch->SetAddress(&fDigits);
151 if (gAlice->TreeS() && fSDigits ) {
152 branch = gAlice->TreeS()->GetBranch("EMCAL");
153 if (branch) branch->SetAddress(&fSDigits) ;