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 // Implementation version v0 of EMCAL Manager class
20 // An object of this class does not produce hits nor digits
21 // It is the one to use if you do not want to produce outputs in TREEH or TREED
23 //*-- Author: Yves Schutz (SUBATECH)
26 // --- ROOT system ---
31 #include "TGeometry.h"
34 // --- Standard library ---
38 // --- AliRoot header files ---
40 #include "AliEMCALv0.h"
41 #include "AliEMCALGeometry.h"
47 //____________________________________________________________________________
48 AliEMCALv0::AliEMCALv0(const char *name, const char *title):
55 //____________________________________________________________________________
56 void AliEMCALv0::BuildGeometry()
59 const Int_t kColorArm1 = kBlue ;
60 const Int_t kColorArm2 = kBlue ;
61 const Int_t kColorArm1Active = kRed ;
62 const Int_t kColorArm2Active = kRed ;
64 // make the container of Arm1
66 new TTUBS("Envelop1", "Tubs that contains arm 1", "void",
67 fGeom->GetEnvelop(0), // rmin
68 fGeom->GetEnvelop(1), // rmax
69 fGeom->GetEnvelop(2)/2.0, // half length in Z
70 fGeom->GetArm1PhiMin(), // minimun phi angle
71 fGeom->GetArm1PhiMax() // maximun phi angle
73 // Active material of Arm1
75 new TTUBS("Arm1", "Active material of arm 1", "void",
76 fGeom->GetEnvelop(0) + fGeom->GetGap2Active(), // rmin
77 fGeom->GetEnvelop(0) + fGeom->GetGap2Active() + fGeom->GetLmat(),// rmax
78 fGeom->GetLmat()/2.0, // half length in Z
79 fGeom->GetArm1PhiMin(), // minimun phi angle
80 fGeom->GetArm1PhiMax() // maximun phi angle
82 // make the container of Arm2
84 new TTUBS("Envelop2", "Tubs that contains arm 2", "void",
85 fGeom->GetEnvelop(0), // rmin
86 fGeom->GetEnvelop(1), // rmax
87 fGeom->GetEnvelop(2)/2.0, // half length in Z
88 fGeom->GetArm2PhiMin(), // minimun phi angle
89 fGeom->GetArm2PhiMax() // maximun phi angle
92 // Active material of Arm2
94 new TTUBS("Arm2", "Active material of arm 2", "void",
95 fGeom->GetEnvelop(0) + fGeom->GetGap2Active(), // rmin
96 fGeom->GetEnvelop(0) + fGeom->GetGap2Active() + fGeom->GetLmat(),// rmax
97 fGeom->GetLmat()/2.0, // half length in Z
98 fGeom->GetArm2PhiMin(), // minimun phi angle
99 fGeom->GetArm2PhiMax() // maximun phi angle
102 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
105 // Arm 1 inside alice
106 TNode * envelop1node = new TNode("Envelop1", "Arm1 Envelop", "Envelop1") ;
107 envelop1node->SetLineColor(kColorArm1) ;
108 fNodes->Add(envelop1node) ;
110 // Arm 2 inside alice
111 TNode * envelop2node = new TNode("Envelop2", "Arm2 Envelop", "Envelop2") ;
112 envelop2node->SetLineColor(kColorArm2) ;
113 fNodes->Add(envelop2node) ;
115 // active material inside Arm 1
117 TNode * arm1node = new TNode("Arm1", "Arm1 with Mat", "Arm1") ;
118 arm1node->SetLineColor(kColorArm1Active) ;
119 fNodes->Add(arm1node) ;
121 // active material inside Arm 2
123 TNode * arm2node = new TNode("Arm2", "Arm2 with Mat", "Arm2") ;
124 arm2node->SetLineColor(kColorArm2Active) ;
125 fNodes->Add(arm2node) ;
129 //____________________________________________________________________________
130 void AliEMCALv0::CreateGeometry()
132 // Create the EMCAL geometry for Geant
134 AliEMCALv0 *emcaltmp = (AliEMCALv0*)gAlice->GetModule("EMCAL") ;
136 if ( emcaltmp == NULL ) {
138 fprintf(stderr, "EMCAL detector not found!\n") ;
142 // Get pointer to the array containing media indices
143 Int_t *idtmed = fIdtmed->GetArray() - 1599 ;
146 // Create tube sectors that contains Arm 1 & 2
148 Float_t envelopA[5] ;
149 envelopA[0] = fGeom->GetEnvelop(0) ; // rmin
150 envelopA[1] = fGeom->GetEnvelop(1) ; // rmax
151 envelopA[2] = fGeom->GetEnvelop(2) / 2.0 ; // dz
152 envelopA[3] = fGeom->GetArm1PhiMin() ; // minimun phi angle
153 envelopA[4] = fGeom->GetArm1PhiMax() ; // maximun phi angle
155 gMC->Gsvolu("XEN1", "TUBS ", idtmed[1599], envelopA, 5) ; // filled with air
157 envelopA[3] = fGeom->GetArm2PhiMin() ; // minimun phi angle
158 envelopA[4] = fGeom->GetArm2PhiMax() ; // maximun phi angle
160 gMC->Gsvolu("XEN2", "TUBS ", idtmed[1599], envelopA, 5) ; // filled with air
162 // Create a tube sector that contains active material Arm 1 & 2
164 envelopA[0] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active() ;
165 envelopA[1] = envelopA[0] + fGeom->GetLmat() ;
166 envelopA[3] = fGeom->GetArm1PhiMin() ; // minimun phi angle
167 envelopA[4] = fGeom->GetArm1PhiMax() ; // maximun phi angle
169 gMC->Gsvolu("XAR1", "TUBS ", idtmed[1601], envelopA, 5) ; // filled with active material (average)
171 envelopA[3] = fGeom->GetArm2PhiMin() ; // minimun phi angle
172 envelopA[4] = fGeom->GetArm2PhiMax() ; // maximun phi angle
174 gMC->Gsvolu("XAR2", "TUBS ", idtmed[1601], envelopA, 5) ; // filled with active material (average)
177 AliMatrix(idrotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
179 // Position ENV1 container in ALIC
180 gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
182 // Position ARM1 into ENV1
183 gMC->Gspos("XAR1", 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
185 // Position ENV2 container in ALIC
186 gMC->Gspos("XEN2", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
188 // Position ARM2 into ENV2
189 gMC->Gspos("XAR2", 1, "XEN2", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
193 //____________________________________________________________________________
194 void AliEMCALv0::Init(void)
196 // Just prints an information message
201 for(i=0;i<35;i++) printf("*");
202 printf(" EMCAL_INIT ");
203 for(i=0;i<35;i++) printf("*");
206 // Here the EMCAL initialisation code (if any!)
209 cout << "AliEMCAL" << Version() << " : EMCAL geometry intialized for " << fGeom->GetName() << endl ;
211 cout << "AliEMCAL" << Version() << " : EMCAL geometry initialization failed !" << endl ;
213 for(i=0;i<80;i++) printf("*");