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):
53 cout << " $Id$ " << endl ;
57 //____________________________________________________________________________
58 void AliEMCALv0::BuildGeometry()
61 const Int_t kColorArm1 = kBlue ;
62 const Int_t kColorArm2 = kBlue ;
63 const Int_t kColorArm1Active = kRed ;
64 const Int_t kColorArm2Active = kRed ;
66 // make the container of Arm1
68 new TTUBS("Envelop1", "Tubs that contains arm 1", "void",
69 fGeom->GetEnvelop(0), // rmin
70 fGeom->GetEnvelop(1), // rmax
71 fGeom->GetEnvelop(2)/2.0, // half length in Z
72 fGeom->GetArm1PhiMin(), // minimun phi angle
73 fGeom->GetArm1PhiMax() // maximun phi angle
75 // Active material of Arm1
77 new TTUBS("Arm1", "Active material of arm 1", "void",
78 fGeom->GetEnvelop(0) + fGeom->GetGap2Active(), // rmin
79 fGeom->GetEnvelop(0) + fGeom->GetGap2Active() + fGeom->GetLmat(),// rmax
80 fGeom->GetEnvelop(2)/2.0, // half length in Z
81 fGeom->GetArm1PhiMin(), // minimun phi angle
82 fGeom->GetArm1PhiMax() // maximun phi angle
84 // make the container of Arm2
86 new TTUBS("Envelop2", "Tubs that contains arm 2", "void",
87 fGeom->GetEnvelop(0), // rmin
88 fGeom->GetEnvelop(1), // rmax
89 fGeom->GetEnvelop(2)/2.0, // half length in Z
90 fGeom->GetArm2PhiMin(), // minimun phi angle
91 fGeom->GetArm2PhiMax() // maximun phi angle
94 // Active material of Arm2
96 new TTUBS("Arm2", "Active material of arm 2", "void",
97 fGeom->GetEnvelop(0) + fGeom->GetGap2Active(), // rmin
98 fGeom->GetEnvelop(0) + fGeom->GetGap2Active() + fGeom->GetLmat(),// rmax
99 fGeom->GetEnvelop(2)/2.0, // half length in Z
100 fGeom->GetArm2PhiMin(), // minimun phi angle
101 fGeom->GetArm2PhiMax() // maximun phi angle
104 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
107 // Arm 1 inside alice
108 TNode * envelop1node = new TNode("Envelop1", "Arm1 Envelop", "Envelop1") ;
109 envelop1node->SetLineColor(kColorArm1) ;
110 fNodes->Add(envelop1node) ;
112 // Arm 2 inside alice
113 TNode * envelop2node = new TNode("Envelop2", "Arm2 Envelop", "Envelop2") ;
114 envelop2node->SetLineColor(kColorArm2) ;
115 fNodes->Add(envelop2node) ;
117 // active material inside Arm 1
119 TNode * arm1node = new TNode("Arm1", "Arm1 with Mat", "Arm1") ;
120 arm1node->SetLineColor(kColorArm1Active) ;
121 fNodes->Add(arm1node) ;
123 // active material inside Arm 2
125 TNode * arm2node = new TNode("Arm2", "Arm2 with Mat", "Arm2") ;
126 arm2node->SetLineColor(kColorArm2Active) ;
127 fNodes->Add(arm2node) ;
131 //____________________________________________________________________________
132 void AliEMCALv0::CreateGeometry()
134 // Create the EMCAL geometry for Geant
136 AliEMCALv0 *emcaltmp = (AliEMCALv0*)gAlice->GetModule("EMCAL") ;
138 if ( emcaltmp == NULL ) {
140 fprintf(stderr, "EMCAL detector not found!\n") ;
144 // Get pointer to the array containing media indices
145 Int_t *idtmed = fIdtmed->GetArray() - 1599 ;
148 // Create tube sectors that contains Arm 1 & 2
150 Float_t envelopA[5] ;
151 envelopA[0] = fGeom->GetEnvelop(0) ; // rmin
152 envelopA[1] = fGeom->GetEnvelop(1) ; // rmax
153 envelopA[2] = fGeom->GetEnvelop(2) / 2.0 ; // dz
154 envelopA[3] = fGeom->GetArm1PhiMin() ; // minimun phi angle
155 envelopA[4] = fGeom->GetArm1PhiMax() ; // maximun phi angle
157 gMC->Gsvolu("XEN1", "TUBS ", idtmed[1599], envelopA, 5) ; // filled with air
159 envelopA[3] = fGeom->GetArm2PhiMin() ; // minimun phi angle
160 envelopA[4] = fGeom->GetArm2PhiMax() ; // maximun phi angle
162 gMC->Gsvolu("XEN2", "TUBS ", idtmed[1599], envelopA, 5) ; // filled with air
164 // Create a tube sector that contains active material Arm 1 & 2
166 envelopA[0] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active() ;
167 envelopA[1] = envelopA[0] + fGeom->GetLmat() ;
168 envelopA[3] = fGeom->GetArm1PhiMin() ; // minimun phi angle
169 envelopA[4] = fGeom->GetArm1PhiMax() ; // maximun phi angle
171 gMC->Gsvolu("XAR1", "TUBS ", idtmed[1601], envelopA, 5) ; // filled with active material (average)
173 envelopA[3] = fGeom->GetArm2PhiMin() ; // minimun phi angle
174 envelopA[4] = fGeom->GetArm2PhiMax() ; // maximun phi angle
176 gMC->Gsvolu("XAR2", "TUBS ", idtmed[1601], envelopA, 5) ; // filled with active material (average)
179 AliMatrix(idrotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
181 // Position ENV1 container in ALIC
182 gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
184 // Position ARM1 into ENV1
185 gMC->Gspos("XAR1", 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
187 // Position ENV2 container in ALIC
188 gMC->Gspos("XEN2", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
190 // Position ARM2 into ENV2
191 gMC->Gspos("XAR2", 1, "XEN2", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
195 //____________________________________________________________________________
196 void AliEMCALv0::Init(void)
198 // Just prints an information message
203 for(i=0;i<35;i++) printf("*");
204 printf(" EMCAL_INIT ");
205 for(i=0;i<35;i++) printf("*");
208 // Here the EMCAL initialisation code (if any!)
211 cout << "AliEMCAL" << Version() << " : EMCAL geometry intialized for " << fGeom->GetName() << endl ;
213 cout << "AliEMCAL" << Version() << " : EMCAL geometry initialization failed !" << endl ;
215 for(i=0;i<80;i++) printf("*");