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.
52 //____________________________________________________________________________
53 AliEMCAL::AliEMCAL(const char* name, const char* title): AliDetector(name,title)
55 // ctor : title is used to identify the layout
57 // gets an instance of the geometry parameters class
59 if (strcmp(GetTitle(),"") != 0 )
60 fGeom = AliEMCALGeometry::GetInstance(GetTitle(), "") ;
62 //____________________________________________________________________________
69 //____________________________________________________________________________
70 void AliEMCAL::CreateMaterials()
72 // Definitions of materials to build EMCAL and associated tracking media.
73 // media number in idtmed are 1599 to 1698.
76 AliMaterial(0, "Air$", 14.61, 7.3, 0.001205, 30420., 67500., 0, 0) ;
79 AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
81 // --- Average properties of the active material ---
82 AliMaterial(2, "EmcalMat$", fGeom->GetAmat(),
88 // DEFINITION OF THE TRACKING MEDIA
90 // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
91 Int_t * idtmed = fIdtmed->GetArray() - 1599 ;
92 Int_t isxfld = gAlice->Field()->Integ() ;
93 Float_t sxmgmx = gAlice->Field()->Max() ;
95 // Air -> idtmed[1599]
96 AliMedium(0, "Air $", 0, 0,
97 isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
99 // The Lead -> idtmed[1600]
101 AliMedium(1, "Lead $", 1, 0,
102 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
104 // The Average properties of the active material -> idtmed[1601]
106 AliMedium(2, "EmcalMat $", 2, 0,
107 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
109 // --- Set decent energy thresholds for gamma and electron tracking
111 // Tracking threshold for photons and electrons in Lead
112 gMC->Gstpar(idtmed[1600], "CUTGAM",0.5E-4) ;
113 gMC->Gstpar(idtmed[1600], "CUTELE",1.0E-4) ;
114 gMC->Gstpar(idtmed[1601], "CUTGAM",0.5E-4) ;
115 gMC->Gstpar(idtmed[1601], "CUTELE",1.0E-4) ;
117 // --- Generate explicitly delta rays in Lead ---
118 gMC->Gstpar(idtmed[1600], "LOSS",3.) ;
119 gMC->Gstpar(idtmed[1600], "DRAY",1.) ;
120 gMC->Gstpar(idtmed[1601], "LOSS",3.) ;
121 gMC->Gstpar(idtmed[1601], "DRAY",1.) ;
124 //____________________________________________________________________________
125 void AliEMCAL::SetTreeAddress()
130 sprintf(branchname,"%s",GetName());
132 // Branch address for hit tree
133 TTree *treeH = gAlice->TreeH();
134 if (treeH && fHits) {
135 branch = treeH->GetBranch(branchname);
136 if (branch) branch->SetAddress(&fHits);
139 // Branch address for digit tree
140 TTree *treeD = gAlice->TreeD();
145 if (treeD && fDigits) {
146 branch = treeD->GetBranch(branchname);
147 if (branch) branch->SetAddress(&fDigits);
153 if (gAlice->TreeS() && fSDigits ) {
154 branch = gAlice->TreeS()->GetBranch("EMCAL");
155 if (branch) branch->SetAddress(&fSDigits) ;