]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSv0.cxx
Abort in case unexisting geometry is invoked
[u/mrichter/AliRoot.git] / PHOS / AliPHOSv0.cxx
CommitLineData
4c039060 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 **************************************************************************/
b2a60966 15/* $Id$ */
16
7b7c1533 17
d15a28e7 18//_________________________________________________________________________
b2a60966 19// Implementation version v0 of PHOS Manager class
20// Layout EMC + PPSD has name GPS2
a3dfe79c 21// Layout EMC + CPV has name IHEP
5f20d3fb 22// An object of this class does not produce hits nor digits
23// It is the one to use if you do not want to produce outputs in TREEH or TREED
b2a60966 24//
25//*-- Author: Yves Schutz (SUBATECH)
26
d2cf0e38 27
fe4da5cc 28// --- ROOT system ---
d15a28e7 29
fe4da5cc 30#include "TBRIK.h"
31#include "TNode.h"
0869cea5 32#include "TRandom.h"
94de3818 33#include "TGeometry.h"
7367f709 34#include "TFolder.h"
35#include "TROOT.h"
7b7c1533 36#include "TTree.h"
fe4da5cc 37
81e92872 38
d15a28e7 39// --- Standard library ---
40
de9ec31b 41#include <stdio.h>
42#include <string.h>
43#include <stdlib.h>
44#include <strstream.h>
d15a28e7 45
46// --- AliRoot header files ---
47
fe4da5cc 48#include "AliPHOSv0.h"
49#include "AliRun.h"
d15a28e7 50#include "AliConst.h"
94de3818 51#include "AliMC.h"
13add4de 52#include "AliPHOSGeometry.h"
7b7c1533 53#include "AliPHOSGetter.h"
fe4da5cc 54
55ClassImp(AliPHOSv0)
56
d15a28e7 57//____________________________________________________________________________
58AliPHOSv0::AliPHOSv0(const char *name, const char *title):
59 AliPHOS(name,title)
60{
b2a60966 61 // ctor : title is used to identify the layout
ed4205d8 62 // GPS2 = 5 modules (EMC + PPSD)
63 // IHEP = 5 modules (EMC + CPV)
64 // MIXT = 4 modules (EMC + CPV) and 1 module (EMC + PPSD)
fe4da5cc 65
7367f709 66 // create the geometry parameters object
7b7c1533 67 // and post it to a folder (Post retrieves the correct geometry)
c4864d2c 68 AliPHOSGetter::GetInstance(gDirectory->GetName(), 0)->PostGeometry() ;
e04976bd 69
d15a28e7 70}
71
d15a28e7 72//____________________________________________________________________________
73void AliPHOSv0::BuildGeometry()
fe4da5cc 74{
b2a60966 75 // Build the PHOS geometry for the ROOT display
76 //BEGIN_HTML
77 /*
78 <H2>
79 PHOS in ALICE displayed by root
80 </H2>
81 <UL>
82 <LI> All Views
83 <P>
84 <CENTER>
85 <IMG Align=BOTTOM ALT="All Views" SRC="../images/AliPHOSv0AllViews.gif">
86 </CENTER></P></LI>
87 <LI> Front View
88 <P>
89 <CENTER>
90 <IMG Align=BOTTOM ALT="Front View" SRC="../images/AliPHOSv0FrontView.gif">
91 </CENTER></P></LI>
92 <LI> 3D View 1
93 <P>
94 <CENTER>
95 <IMG Align=BOTTOM ALT="3D View 1" SRC="../images/AliPHOSv03DView1.gif">
96 </CENTER></P></LI>
97 <LI> 3D View 2
98 <P>
99 <CENTER>
100 <IMG Align=BOTTOM ALT="3D View 2" SRC="../images/AliPHOSv03DView2.gif">
101 </CENTER></P></LI>
102 </UL>
103 */
104 //END_HTML
7367f709 105
106 AliPHOSGeometry * geom = GetGeometry() ;
d15a28e7 107
108 this->BuildGeometryforPHOS() ;
7367f709 109 if (strcmp(geom->GetName(),"GPS2") == 0)
d15a28e7 110 this->BuildGeometryforPPSD() ;
7367f709 111 else if (strcmp(geom->GetName(),"IHEP") == 0)
bacd0b23 112 this->BuildGeometryforCPV() ;
7367f709 113 else if (strcmp(geom->GetName(),"MIXT") == 0) {
ed4205d8 114 this->BuildGeometryforPPSD() ;
115 this->BuildGeometryforCPV() ;
116 }
d15a28e7 117 else
ed4205d8 118 cout << "AliPHOSv0::BuildGeometry : no charged particle identification system installed: "
7367f709 119 << "Geometry name = " << geom->GetName() << endl;
d15a28e7 120
fe4da5cc 121}
d15a28e7 122
123//____________________________________________________________________________
124void AliPHOSv0:: BuildGeometryforPHOS(void)
125{
b2a60966 126 // Build the PHOS-EMC geometry for the ROOT display
d15a28e7 127
128 const Int_t kColorPHOS = kRed ;
129 const Int_t kColorXTAL = kBlue ;
130
92862013 131 Double_t const kRADDEG = 180.0 / kPI ;
7367f709 132
133 AliPHOSGeometry * geom = GetGeometry() ;
134
135 new TBRIK( "OuterBox", "PHOS box", "void", geom->GetOuterBoxSize(0)/2,
136 geom->GetOuterBoxSize(1)/2,
137 geom->GetOuterBoxSize(2)/2 );
d15a28e7 138
139 // Textolit Wall box, position inside PHOS
140
7367f709 141 new TBRIK( "TextolitBox", "PHOS Textolit box ", "void", geom->GetTextolitBoxSize(0)/2,
142 geom->GetTextolitBoxSize(1)/2,
143 geom->GetTextolitBoxSize(2)/2);
d15a28e7 144
145 // Polystyrene Foam Plate
146
7367f709 147 new TBRIK( "UpperFoamPlate", "PHOS Upper foam plate", "void", geom->GetTextolitBoxSize(0)/2,
148 geom->GetSecondUpperPlateThickness()/2,
149 geom->GetTextolitBoxSize(2)/2 ) ;
d15a28e7 150
151 // Air Filled Box
fe4da5cc 152
7367f709 153 new TBRIK( "AirFilledBox", "PHOS air filled box", "void", geom->GetAirFilledBoxSize(0)/2,
154 geom->GetAirFilledBoxSize(1)/2,
155 geom->GetAirFilledBoxSize(2)/2 );
d15a28e7 156
157 // Crystals Box
158
7367f709 159 Float_t xtlX = geom->GetCrystalSize(0) ;
160 Float_t xtlY = geom->GetCrystalSize(1) ;
161 Float_t xtlZ = geom->GetCrystalSize(2) ;
d15a28e7 162
7367f709 163 Float_t xl = geom->GetNPhi() * ( xtlX + 2 * geom->GetGapBetweenCrystals() ) / 2.0 + geom->GetModuleBoxThickness() ;
164 Float_t yl = ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() + geom->GetCrystalHolderThickness() ) / 2.0
165 + geom->GetModuleBoxThickness() / 2.0 ;
166 Float_t zl = geom->GetNZ() * ( xtlZ + 2 * geom->GetGapBetweenCrystals() ) / 2.0 + geom->GetModuleBoxThickness() ;
d15a28e7 167
92862013 168 new TBRIK( "CrystalsBox", "PHOS crystals box", "void", xl, yl, zl ) ;
d15a28e7 169
170// position PHOS into ALICE
171
7367f709 172 Float_t r = geom->GetIPtoOuterCoverDistance() + geom->GetOuterBoxSize(1) / 2.0 ;
d15a28e7 173 Int_t number = 988 ;
7367f709 174 Float_t pphi = TMath::ATan( geom->GetOuterBoxSize(0) / ( 2.0 * geom->GetIPtoOuterCoverDistance() ) ) ;
92862013 175 pphi *= kRADDEG ;
176 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
d15a28e7 177
178 char * nodename = new char[20] ;
179 char * rotname = new char[20] ;
180
7367f709 181 for( Int_t i = 1; i <= geom->GetNModules(); i++ ) {
182 Float_t angle = pphi * 2 * ( i - geom->GetNModules() / 2.0 - 0.5 ) ;
d15a28e7 183 sprintf(rotname, "%s%d", "rot", number++) ;
184 new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0);
92862013 185 top->cd();
d15a28e7 186 sprintf(nodename,"%s%d", "Module", i) ;
92862013 187 Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
188 Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
189 TNode * outerboxnode = new TNode(nodename, nodename, "OuterBox", x, y, 0, rotname ) ;
190 outerboxnode->SetLineColor(kColorPHOS) ;
191 fNodes->Add(outerboxnode) ;
192 outerboxnode->cd() ;
d15a28e7 193 // now inside the outer box the textolit box
7367f709 194 y = ( geom->GetOuterBoxThickness(1) - geom->GetUpperPlateThickness() ) / 2. ;
d15a28e7 195 sprintf(nodename,"%s%d", "TexBox", i) ;
92862013 196 TNode * textolitboxnode = new TNode(nodename, nodename, "TextolitBox", 0, y, 0) ;
197 textolitboxnode->SetLineColor(kColorPHOS) ;
198 fNodes->Add(textolitboxnode) ;
d15a28e7 199 // upper foam plate inside outre box
92862013 200 outerboxnode->cd() ;
d15a28e7 201 sprintf(nodename, "%s%d", "UFPlate", i) ;
7367f709 202 y = ( geom->GetTextolitBoxSize(1) - geom->GetSecondUpperPlateThickness() ) / 2.0 ;
92862013 203 TNode * upperfoamplatenode = new TNode(nodename, nodename, "UpperFoamPlate", 0, y, 0) ;
204 upperfoamplatenode->SetLineColor(kColorPHOS) ;
205 fNodes->Add(upperfoamplatenode) ;
d15a28e7 206 // air filled box inside textolit box (not drawn)
92862013 207 textolitboxnode->cd();
7367f709 208 y = ( geom->GetTextolitBoxSize(1) - geom->GetAirFilledBoxSize(1) ) / 2.0 - geom->GetSecondUpperPlateThickness() ;
d15a28e7 209 sprintf(nodename, "%s%d", "AFBox", i) ;
92862013 210 TNode * airfilledboxnode = new TNode(nodename, nodename, "AirFilledBox", 0, y, 0) ;
211 fNodes->Add(airfilledboxnode) ;
d15a28e7 212 // crystals box inside air filled box
92862013 213 airfilledboxnode->cd() ;
7367f709 214 y = geom->GetAirFilledBoxSize(1) / 2.0 - yl
215 - ( geom->GetIPtoCrystalSurface() - geom->GetIPtoOuterCoverDistance() - geom->GetModuleBoxThickness()
216 - geom->GetUpperPlateThickness() - geom->GetSecondUpperPlateThickness() ) ;
d15a28e7 217 sprintf(nodename, "%s%d", "XTBox", i) ;
92862013 218 TNode * crystalsboxnode = new TNode(nodename, nodename, "CrystalsBox", 0, y, 0) ;
219 crystalsboxnode->SetLineColor(kColorXTAL) ;
220 fNodes->Add(crystalsboxnode) ;
d15a28e7 221 }
b27d82c8 222
223 delete[] rotname ;
224 delete[] nodename ;
d15a28e7 225}
226
227//____________________________________________________________________________
228void AliPHOSv0:: BuildGeometryforPPSD(void)
fe4da5cc 229{
b2a60966 230 // Build the PHOS-PPSD geometry for the ROOT display
231 //BEGIN_HTML
232 /*
233 <H2>
234 PPSD displayed by root
235 </H2>
236 <UL>
237 <LI> Zoom on PPSD: Front View
238 <P>
239 <CENTER>
240 <IMG Align=BOTTOM ALT="PPSD Front View" SRC="../images/AliPHOSv0PPSDFrontView.gif">
241 </CENTER></P></LI>
242 <LI> Zoom on PPSD: Perspective View
243 <P>
244 <CENTER>
245 <IMG Align=BOTTOM ALT="PPSD Prespective View" SRC="../images/AliPHOSv0PPSDPerspectiveView.gif">
246 </CENTER></P></LI>
247 </UL>
248 */
249 //END_HTML
92862013 250 Double_t const kRADDEG = 180.0 / kPI ;
d15a28e7 251
252 const Int_t kColorPHOS = kRed ;
253 const Int_t kColorPPSD = kGreen ;
254 const Int_t kColorGas = kBlue ;
255 const Int_t kColorAir = kYellow ;
256
7367f709 257 AliPHOSGeometry * geom = GetGeometry() ;
258
d15a28e7 259 // Box for a full PHOS module
260
7367f709 261 new TBRIK( "PPSDBox", "PPSD box", "void", geom->GetCPVBoxSize(0)/2,
262 geom->GetCPVBoxSize(1)/2,
263 geom->GetCPVBoxSize(2)/2 );
d15a28e7 264
265 // Box containing one micromegas module
266
7367f709 267 new TBRIK( "PPSDModule", "PPSD module", "void", geom->GetPPSDModuleSize(0)/2,
268 geom->GetPPSDModuleSize(1)/2,
269 geom->GetPPSDModuleSize(2)/2 );
d15a28e7 270 // top lid
271
7367f709 272 new TBRIK ( "TopLid", "Micromegas top lid", "void", geom->GetPPSDModuleSize(0)/2,
273 geom->GetLidThickness()/2,
274 geom->GetPPSDModuleSize(2)/2 ) ;
d15a28e7 275 // composite panel (top and bottom)
276
7367f709 277 new TBRIK ( "TopPanel", "Composite top panel", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2,
278 geom->GetCompositeThickness()/2,
279 ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ;
d15a28e7 280
7367f709 281 new TBRIK ( "BottomPanel", "Composite bottom panel", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2,
282 geom->GetCompositeThickness()/2,
283 ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ;
d15a28e7 284 // gas gap (conversion and avalanche)
285
7367f709 286 new TBRIK ( "GasGap", "gas gap", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2,
287 ( geom->GetConversionGap() + geom->GetAvalancheGap() )/2,
288 ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ;
d15a28e7 289
290 // anode and cathode
291
7367f709 292 new TBRIK ( "Anode", "Anode", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2,
293 geom->GetAnodeThickness()/2,
294 ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ;
d15a28e7 295
7367f709 296 new TBRIK ( "Cathode", "Cathode", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2,
297 geom->GetCathodeThickness()/2,
298 ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ;
d15a28e7 299 // PC
300
7367f709 301 new TBRIK ( "PCBoard", "Printed Circuit", "void", ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() )/2,
302 geom->GetPCThickness()/2,
303 ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() )/2 ) ;
d15a28e7 304 // Gap between Lead and top micromegas
305
7367f709 306 new TBRIK ( "LeadToM", "Air Gap top", "void", geom->GetCPVBoxSize(0)/2,
307 geom->GetMicro1ToLeadGap()/2,
308 geom->GetCPVBoxSize(2)/2 ) ;
d15a28e7 309
310// Gap between Lead and bottom micromegas
311
7367f709 312 new TBRIK ( "MToLead", "Air Gap bottom", "void", geom->GetCPVBoxSize(0)/2,
313 geom->GetLeadToMicro2Gap()/2,
314 geom->GetCPVBoxSize(2)/2 ) ;
d15a28e7 315 // Lead converter
316
7367f709 317 new TBRIK ( "Lead", "Lead converter", "void", geom->GetCPVBoxSize(0)/2,
318 geom->GetLeadConverterThickness()/2,
319 geom->GetCPVBoxSize(2)/2 ) ;
d15a28e7 320
321 // position PPSD into ALICE
322
323 char * nodename = new char[20] ;
324 char * rotname = new char[20] ;
325
7367f709 326 Float_t r = geom->GetIPtoTopLidDistance() + geom->GetCPVBoxSize(1) / 2.0 ;
d15a28e7 327 Int_t number = 988 ;
92862013 328 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
d15a28e7 329
ed4205d8 330 Int_t firstModule = 0 ;
7367f709 331 if (strcmp(geom->GetName(),"GPS2") == 0)
ed4205d8 332 firstModule = 1;
7367f709 333 else if (strcmp(geom->GetName(),"MIXT") == 0)
334 firstModule = geom->GetNModules() - geom->GetNPPSDModules() + 1;
ed4205d8 335
7367f709 336 for( Int_t i = firstModule; i <= geom->GetNModules(); i++ ) { // the number of PHOS modules
337 Float_t angle = geom->GetPHOSAngle(i) ;
ed4205d8 338 sprintf(rotname, "%s%d", "rotg", number+i) ;
d15a28e7 339 new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0);
92862013 340 top->cd();
d15a28e7 341 sprintf(nodename, "%s%d", "Moduleg", i) ;
92862013 342 Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
343 Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
344 TNode * ppsdboxnode = new TNode(nodename , nodename ,"PPSDBox", x, y, 0, rotname ) ;
345 ppsdboxnode->SetLineColor(kColorPPSD) ;
346 fNodes->Add(ppsdboxnode) ;
347 ppsdboxnode->cd() ;
d15a28e7 348 // inside the PPSD box:
349 // 1. fNumberOfModulesPhi x fNumberOfModulesZ top micromegas
7367f709 350 x = ( geom->GetCPVBoxSize(0) - geom->GetPPSDModuleSize(0) ) / 2. ;
31aa6d6c 351 {
7367f709 352 for ( Int_t iphi = 1; iphi <= geom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module
353 Float_t z = ( geom->GetCPVBoxSize(2) - geom->GetPPSDModuleSize(2) ) / 2. ;
31aa6d6c 354 TNode * micro1node ;
7367f709 355 for ( Int_t iz = 1; iz <= geom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module
356 y = ( geom->GetCPVBoxSize(1) - geom->GetMicromegas1Thickness() ) / 2. ;
31aa6d6c 357 sprintf(nodename, "%s%d%d%d", "Mic1", i, iphi, iz) ;
358 micro1node = new TNode(nodename, nodename, "PPSDModule", x, y, z) ;
359 micro1node->SetLineColor(kColorPPSD) ;
360 fNodes->Add(micro1node) ;
361 // inside top micromegas
362 micro1node->cd() ;
363 // a. top lid
7367f709 364 y = ( geom->GetMicromegas1Thickness() - geom->GetLidThickness() ) / 2. ;
31aa6d6c 365 sprintf(nodename, "%s%d%d%d", "Lid", i, iphi, iz) ;
366 TNode * toplidnode = new TNode(nodename, nodename, "TopLid", 0, y, 0) ;
367 toplidnode->SetLineColor(kColorPPSD) ;
368 fNodes->Add(toplidnode) ;
369 // b. composite panel
7367f709 370 y = y - geom->GetLidThickness() / 2. - geom->GetCompositeThickness() / 2. ;
31aa6d6c 371 sprintf(nodename, "%s%d%d%d", "CompU", i, iphi, iz) ;
372 TNode * compupnode = new TNode(nodename, nodename, "TopPanel", 0, y, 0) ;
373 compupnode->SetLineColor(kColorPPSD) ;
374 fNodes->Add(compupnode) ;
375 // c. anode
7367f709 376 y = y - geom->GetCompositeThickness() / 2. - geom->GetAnodeThickness() / 2. ;
31aa6d6c 377 sprintf(nodename, "%s%d%d%d", "Ano", i, iphi, iz) ;
378 TNode * anodenode = new TNode(nodename, nodename, "Anode", 0, y, 0) ;
379 anodenode->SetLineColor(kColorPHOS) ;
380 fNodes->Add(anodenode) ;
381 // d. gas
7367f709 382 y = y - geom->GetAnodeThickness() / 2. - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. ;
31aa6d6c 383 sprintf(nodename, "%s%d%d%d", "GGap", i, iphi, iz) ;
384 TNode * ggapnode = new TNode(nodename, nodename, "GasGap", 0, y, 0) ;
385 ggapnode->SetLineColor(kColorGas) ;
386 fNodes->Add(ggapnode) ;
d15a28e7 387 // f. cathode
7367f709 388 y = y - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. - geom->GetCathodeThickness() / 2. ;
31aa6d6c 389 sprintf(nodename, "%s%d%d%d", "Cathode", i, iphi, iz) ;
390 TNode * cathodenode = new TNode(nodename, nodename, "Cathode", 0, y, 0) ;
391 cathodenode->SetLineColor(kColorPHOS) ;
392 fNodes->Add(cathodenode) ;
393 // g. printed circuit
7367f709 394 y = y - geom->GetCathodeThickness() / 2. - geom->GetPCThickness() / 2. ;
31aa6d6c 395 sprintf(nodename, "%s%d%d%d", "PC", i, iphi, iz) ;
396 TNode * pcnode = new TNode(nodename, nodename, "PCBoard", 0, y, 0) ;
397 pcnode->SetLineColor(kColorPPSD) ;
398 fNodes->Add(pcnode) ;
399 // h. composite panel
7367f709 400 y = y - geom->GetPCThickness() / 2. - geom->GetCompositeThickness() / 2. ;
31aa6d6c 401 sprintf(nodename, "%s%d%d%d", "CompDown", i, iphi, iz) ;
402 TNode * compdownnode = new TNode(nodename, nodename, "BottomPanel", 0, y, 0) ;
403 compdownnode->SetLineColor(kColorPPSD) ;
404 fNodes->Add(compdownnode) ;
7367f709 405 z = z - geom->GetPPSDModuleSize(2) ;
31aa6d6c 406 ppsdboxnode->cd() ;
407 } // end of Z module loop
7367f709 408 x = x - geom->GetPPSDModuleSize(0) ;
92862013 409 ppsdboxnode->cd() ;
31aa6d6c 410 } // end of phi module loop
411 }
d15a28e7 412 // 2. air gap
92862013 413 ppsdboxnode->cd() ;
7367f709 414 y = ( geom->GetCPVBoxSize(1) - 2 * geom->GetMicromegas1Thickness() - geom->GetMicro1ToLeadGap() ) / 2. ;
d15a28e7 415 sprintf(nodename, "%s%d", "GapUp", i) ;
92862013 416 TNode * gapupnode = new TNode(nodename, nodename, "LeadToM", 0, y, 0) ;
417 gapupnode->SetLineColor(kColorAir) ;
418 fNodes->Add(gapupnode) ;
d15a28e7 419 // 3. lead converter
7367f709 420 y = y - geom->GetMicro1ToLeadGap() / 2. - geom->GetLeadConverterThickness() / 2. ;
d15a28e7 421 sprintf(nodename, "%s%d", "LeadC", i) ;
92862013 422 TNode * leadcnode = new TNode(nodename, nodename, "Lead", 0, y, 0) ;
423 leadcnode->SetLineColor(kColorPPSD) ;
424 fNodes->Add(leadcnode) ;
d15a28e7 425 // 4. air gap
7367f709 426 y = y - geom->GetLeadConverterThickness() / 2. - geom->GetLeadToMicro2Gap() / 2. ;
d15a28e7 427 sprintf(nodename, "%s%d", "GapDown", i) ;
92862013 428 TNode * gapdownnode = new TNode(nodename, nodename, "MToLead", 0, y, 0) ;
429 gapdownnode->SetLineColor(kColorAir) ;
430 fNodes->Add(gapdownnode) ;
d15a28e7 431 // 5. fNumberOfModulesPhi x fNumberOfModulesZ bottom micromegas
7367f709 432 x = ( geom->GetCPVBoxSize(0) - geom->GetPPSDModuleSize(0) ) / 2. - geom->GetPhiDisplacement() ;
31aa6d6c 433 {
7367f709 434 for ( Int_t iphi = 1; iphi <= geom->GetNumberOfModulesPhi(); iphi++ ) {
435 Float_t z = ( geom->GetCPVBoxSize(2) - geom->GetPPSDModuleSize(2) ) / 2. - geom->GetZDisplacement() ;;
31aa6d6c 436 TNode * micro2node ;
7367f709 437 for ( Int_t iz = 1; iz <= geom->GetNumberOfModulesZ(); iz++ ) {
438 y = - ( geom->GetCPVBoxSize(1) - geom->GetMicromegas2Thickness() ) / 2. ;
31aa6d6c 439 sprintf(nodename, "%s%d%d%d", "Mic2", i, iphi, iz) ;
440 micro2node = new TNode(nodename, nodename, "PPSDModule", x, y, z) ;
441 micro2node->SetLineColor(kColorPPSD) ;
442 fNodes->Add(micro2node) ;
443 // inside bottom micromegas
444 micro2node->cd() ;
d15a28e7 445 // a. top lid
7b7c1533 446
7367f709 447 y = ( geom->GetMicromegas2Thickness() - geom->GetLidThickness() ) / 2. ;
6f2d42c1 448 sprintf(nodename, "%s%d%d%d", "Lidb", i, iphi, iz) ;
7b7c1533 449
92862013 450 TNode * toplidbnode = new TNode(nodename, nodename, "TopLid", 0, y, 0) ;
451 toplidbnode->SetLineColor(kColorPPSD) ;
452 fNodes->Add(toplidbnode) ;
d15a28e7 453 // b. composite panel
7b7c1533 454
7367f709 455 y = y - geom->GetLidThickness() / 2. - geom->GetCompositeThickness() / 2. ;
6f2d42c1 456 sprintf(nodename, "%s%d%d%d", "CompUb", i, iphi, iz) ;
7b7c1533 457
92862013 458 TNode * compupbnode = new TNode(nodename, nodename, "TopPanel", 0, y, 0) ;
459 compupbnode->SetLineColor(kColorPPSD) ;
460 fNodes->Add(compupbnode) ;
d15a28e7 461 // c. anode
7b7c1533 462
7367f709 463 y = y - geom->GetCompositeThickness() / 2. - geom->GetAnodeThickness() / 2. ;
6f2d42c1 464 sprintf(nodename, "%s%d%d%d", "Anob", i, iphi, iz) ;
7b7c1533 465
92862013 466 TNode * anodebnode = new TNode(nodename, nodename, "Anode", 0, y, 0) ;
467 anodebnode->SetLineColor(kColorPPSD) ;
468 fNodes->Add(anodebnode) ;
d15a28e7 469 // d. conversion gas
7b7c1533 470
7367f709 471 y = y - geom->GetAnodeThickness() / 2. - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. ;
6f2d42c1 472 sprintf(nodename, "%s%d%d%d", "GGapb", i, iphi, iz) ;
7b7c1533 473
92862013 474 TNode * ggapbnode = new TNode(nodename, nodename, "GasGap", 0, y, 0) ;
475 ggapbnode->SetLineColor(kColorGas) ;
476 fNodes->Add(ggapbnode) ;
d15a28e7 477 // f. cathode
7b7c1533 478
7367f709 479 y = y - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. - geom->GetCathodeThickness() / 2. ;
6f2d42c1 480 sprintf(nodename, "%s%d%d%d", "Cathodeb", i, iphi, iz) ;
7b7c1533 481
92862013 482 TNode * cathodebnode = new TNode(nodename, nodename, "Cathode", 0, y, 0) ;
483 cathodebnode->SetLineColor(kColorPPSD) ;
484 fNodes->Add(cathodebnode) ;
d15a28e7 485 // g. printed circuit
7367f709 486 y = y - geom->GetCathodeThickness() / 2. - geom->GetPCThickness() / 2. ;
6f2d42c1 487 sprintf(nodename, "%s%d%d%d", "PCb", i, iphi, iz) ;
92862013 488 TNode * pcbnode = new TNode(nodename, nodename, "PCBoard", 0, y, 0) ;
489 pcbnode->SetLineColor(kColorPPSD) ;
490 fNodes->Add(pcbnode) ;
d15a28e7 491 // h. composite pane
7367f709 492 y = y - geom->GetPCThickness() / 2. - geom->GetCompositeThickness() / 2. ;
6f2d42c1 493 sprintf(nodename, "%s%d%d%d", "CompDownb", i, iphi, iz) ;
92862013 494 TNode * compdownbnode = new TNode(nodename, nodename, "BottomPanel", 0, y, 0) ;
495 compdownbnode->SetLineColor(kColorPPSD) ;
496 fNodes->Add(compdownbnode) ;
7367f709 497 z = z - geom->GetPPSDModuleSize(2) ;
92862013 498 ppsdboxnode->cd() ;
d15a28e7 499 } // end of Z module loop
7367f709 500 x = x - geom->GetPPSDModuleSize(0) ;
92862013 501 ppsdboxnode->cd() ;
31aa6d6c 502 } // end of phi module loop
503 }
504 } // PHOS modules
505
e126816e 506 delete[] rotname ;
507 delete[] nodename ;
31aa6d6c 508
fe4da5cc 509}
510
bacd0b23 511//____________________________________________________________________________
512void AliPHOSv0:: BuildGeometryforCPV(void)
513{
514 // Build the PHOS-CPV geometry for the ROOT display
515 // Author: Yuri Kharlov 11 September 2000
516 //
517 //BEGIN_HTML
518 /*
519 <H2>
520 CPV displayed by root
521 </H2>
522 <table width=700>
523
524 <tr>
525 <td>CPV perspective view</td>
526 <td>CPV front view </td>
527 </tr>
528
529 <tr>
530 <td> <img height=300 width=290 src="../images/CPVRootPersp.gif"> </td>
531 <td> <img height=300 width=290 src="../images/CPVRootFront.gif"> </td>
532 </tr>
533
534 </table>
535
536 */
537 //END_HTML
538
539 const Double_t kRADDEG = 180.0 / kPI ;
540 const Int_t kColorCPV = kGreen ;
541 const Int_t kColorFrame = kYellow ;
542 const Int_t kColorGassiplex = kRed;
543 const Int_t kColorPCB = kCyan;
544
7367f709 545 AliPHOSGeometry * geom = GetGeometry() ;
546
bacd0b23 547 // Box for a full PHOS module
548
7367f709 549 new TBRIK ("CPVBox", "CPV box", "void", geom->GetCPVBoxSize(0)/2,
550 geom->GetCPVBoxSize(1)/2,
551 geom->GetCPVBoxSize(2)/2 );
552 new TBRIK ("CPVFrameLR", "CPV frame Left-Right", "void", geom->GetCPVFrameSize(0)/2,
553 geom->GetCPVFrameSize(1)/2,
554 geom->GetCPVBoxSize(2)/2 );
555 new TBRIK ("CPVFrameUD", "CPV frame Up-Down", "void", geom->GetCPVBoxSize(0)/2 - geom->GetCPVFrameSize(0),
556 geom->GetCPVFrameSize(1)/2,
557 geom->GetCPVFrameSize(2)/2);
558 new TBRIK ("CPVPCB", "CPV PCB", "void", geom->GetCPVActiveSize(0)/2,
559 geom->GetCPVTextoliteThickness()/2,
560 geom->GetCPVActiveSize(1)/2);
561 new TBRIK ("CPVGassiplex", "CPV Gassiplex PCB", "void", geom->GetGassiplexChipSize(0)/2,
562 geom->GetGassiplexChipSize(1)/2,
563 geom->GetGassiplexChipSize(2)/2);
bacd0b23 564
565 // position CPV into ALICE
566
567 char * nodename = new char[25] ;
568 char * rotname = new char[25] ;
569
7367f709 570 Float_t r = geom->GetIPtoCPVDistance() + geom->GetCPVBoxSize(1) / 2.0 ;
bacd0b23 571 Int_t number = 988 ;
572 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
ed4205d8 573
574 Int_t lastModule = 0 ;
7367f709 575 if (strcmp(geom->GetName(),"IHEP") == 0)
576 lastModule = geom->GetNModules();
577 else if (strcmp(geom->GetName(),"MIXT") == 0)
578 lastModule = geom->GetNModules() - geom->GetNPPSDModules();
ed4205d8 579
580 for( Int_t i = 1; i <= lastModule; i++ ) { // the number of PHOS modules
bacd0b23 581
582 // One CPV module
583
7367f709 584 Float_t angle = geom->GetPHOSAngle(i) ;
ed4205d8 585 sprintf(rotname, "%s%d", "rotg", number+i) ;
bacd0b23 586 new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0);
587 top->cd();
588 sprintf(nodename, "%s%d", "CPVModule", i) ;
589 Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
590 Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
591 Float_t z;
592 TNode * cpvBoxNode = new TNode(nodename , nodename ,"CPVBox", x, y, 0, rotname ) ;
593 cpvBoxNode->SetLineColor(kColorCPV) ;
594 fNodes->Add(cpvBoxNode) ;
595 cpvBoxNode->cd() ;
596
597 // inside each CPV box:
598
599 // Frame around CPV
cd461ab8 600 Int_t j;
601 for (j=0; j<=1; j++) {
bacd0b23 602 sprintf(nodename, "CPVModule%d Frame%d", i, j+1) ;
7367f709 603 x = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(0) - geom->GetCPVFrameSize(0)) / 2;
bacd0b23 604 TNode * cpvFrameNode = new TNode(nodename , nodename ,"CPVFrameLR", x, 0, 0) ;
605 cpvFrameNode->SetLineColor(kColorFrame) ;
606 fNodes->Add(cpvFrameNode) ;
607
608 sprintf(nodename, "CPVModule%d Frame%d", i, j+3) ;
7367f709 609 z = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(2) - geom->GetCPVFrameSize(2)) / 2;
bacd0b23 610 cpvFrameNode = new TNode(nodename , nodename ,"CPVFrameUD", 0, 0, z) ;
611 cpvFrameNode->SetLineColor(kColorFrame) ;
612 fNodes->Add(cpvFrameNode) ;
613 }
614
615 // 4 printed circuit boards
cd461ab8 616 for (j=0; j<4; j++) {
bacd0b23 617 sprintf(nodename, "CPVModule%d PCB%d", i, j+1) ;
7367f709 618 y = geom->GetCPVFrameSize(1) / 2 - geom->GetFTPosition(j) + geom->GetCPVTextoliteThickness()/2;
bacd0b23 619 TNode * cpvPCBNode = new TNode(nodename , nodename ,"CPVPCB", 0, y, 0) ;
620 cpvPCBNode->SetLineColor(kColorPCB) ;
621 fNodes->Add(cpvPCBNode) ;
622 }
623
624 // Gassiplex chips
7367f709 625 Float_t xStep = geom->GetCPVActiveSize(0) / (geom->GetNumberOfCPVChipsPhi() + 1);
626 Float_t zStep = geom->GetCPVActiveSize(1) / (geom->GetNumberOfCPVChipsZ() + 1);
627 y = geom->GetCPVFrameSize(1)/2 - geom->GetFTPosition(0) +
628 geom->GetCPVTextoliteThickness() / 2 + geom->GetGassiplexChipSize(1) / 2 + 0.1;
629 for (Int_t ix=0; ix<geom->GetNumberOfCPVChipsPhi(); ix++) {
630 x = xStep * (ix+1) - geom->GetCPVActiveSize(0)/2;
631 for (Int_t iz=0; iz<geom->GetNumberOfCPVChipsZ(); iz++) {
632 z = zStep * (iz+1) - geom->GetCPVActiveSize(1)/2;
bacd0b23 633 sprintf(nodename, "CPVModule%d Chip(%dx%d)", i, ix+1,iz+1) ;
634 TNode * cpvGassiplexNode = new TNode(nodename , nodename ,"CPVGassiplex", x, y, z) ;
635 cpvGassiplexNode->SetLineColor(kColorGassiplex) ;
636 fNodes->Add(cpvGassiplexNode) ;
637 }
638 }
639
640 } // PHOS modules
641
642 delete[] rotname ;
643 delete[] nodename ;
644}
645
d15a28e7 646//____________________________________________________________________________
fe4da5cc 647void AliPHOSv0::CreateGeometry()
648{
b2a60966 649 // Create the PHOS geometry for Geant
d15a28e7 650
92862013 651 AliPHOSv0 *phostmp = (AliPHOSv0*)gAlice->GetModule("PHOS") ;
d15a28e7 652
92862013 653 if ( phostmp == NULL ) {
d15a28e7 654
655 fprintf(stderr, "PHOS detector not found!\n") ;
656 return;
fe4da5cc 657
d15a28e7 658 }
7367f709 659
660 AliPHOSGeometry * geom = GetGeometry() ;
661
d15a28e7 662 // Get pointer to the array containing media indeces
92862013 663 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
d15a28e7 664
ed4205d8 665 // Create a box a PHOS module.
666 // In case of MIXT geometry 2 different boxes are needed
667
92862013 668 Float_t bigbox[3] ;
7367f709 669 bigbox[0] = geom->GetOuterBoxSize(0) / 2.0 ;
670 bigbox[1] = ( geom->GetOuterBoxSize(1) + geom->GetCPVBoxSize(1) ) / 2.0 ;
671 bigbox[2] = geom->GetOuterBoxSize(2) / 2.0 ;
d15a28e7 672
ed4205d8 673 gMC->Gsvolu("PHOS", "BOX ", idtmed[798], bigbox, 3) ;
674
7367f709 675 if ( strcmp( geom->GetName(),"MIXT") == 0 && geom->GetNPPSDModules() > 0)
ed4205d8 676 gMC->Gsvolu("PHO1", "BOX ", idtmed[798], bigbox, 3) ;
d15a28e7 677
ed4205d8 678 this->CreateGeometryforPHOS() ;
7367f709 679 if ( strcmp( geom->GetName(), "GPS2") == 0 )
d15a28e7 680 this->CreateGeometryforPPSD() ;
7367f709 681 else if ( strcmp( geom->GetName(), "IHEP") == 0 )
bacd0b23 682 this->CreateGeometryforCPV() ;
7367f709 683 else if ( strcmp( geom->GetName(), "MIXT") == 0 ) {
ed4205d8 684 this->CreateGeometryforPPSD() ;
685 this->CreateGeometryforCPV() ;
686 }
d15a28e7 687 else
688 cout << "AliPHOSv0::CreateGeometry : no charged particle identification system installed" << endl;
ed4205d8 689
b73f246d 690 this->CreateGeometryforSupport() ;
d15a28e7 691
692 // --- Position PHOS mdules in ALICE setup ---
693
92862013 694 Int_t idrotm[99] ;
695 Double_t const kRADDEG = 180.0 / kPI ;
d15a28e7 696
ed4205d8 697 Int_t lastModule;
7367f709 698 if (strcmp(geom->GetName(),"MIXT") == 0)
699 lastModule = geom->GetNModules() - geom->GetNPPSDModules();
ed4205d8 700 else
7367f709 701 lastModule = geom->GetNModules();
ed4205d8 702
703 Int_t i;
704 for( i = 1; i <= lastModule ; i++ ) {
d15a28e7 705
7367f709 706 Float_t angle = geom->GetPHOSAngle(i) ;
92862013 707 AliMatrix(idrotm[i-1], 90.0, angle, 90.0, 90.0+angle, 0.0, 0.0) ;
d15a28e7 708
7367f709 709 Float_t r = geom->GetIPtoOuterCoverDistance() + ( geom->GetOuterBoxSize(1) + geom->GetCPVBoxSize(1) ) / 2.0 ;
d15a28e7 710
ed4205d8 711 Float_t xP1 = r * TMath::Sin( angle / kRADDEG ) ;
92862013 712 Float_t yP1 = -r * TMath::Cos( angle / kRADDEG ) ;
d15a28e7 713
92862013 714 gMC->Gspos("PHOS", i, "ALIC", xP1, yP1, 0.0, idrotm[i-1], "ONLY") ;
d15a28e7 715
716 } // for GetNModules
717
7367f709 718 for( i = lastModule+1; i <= geom->GetNModules(); i++ ) {
ed4205d8 719
7367f709 720 Float_t angle = geom->GetPHOSAngle(i) ;
ed4205d8 721 AliMatrix(idrotm[i-1], 90.0, angle, 90.0, 90.0+angle, 0.0, 0.0) ;
722
7367f709 723 Float_t r = geom->GetIPtoOuterCoverDistance() + ( geom->GetOuterBoxSize(1) + geom->GetCPVBoxSize(1) ) / 2.0 ;
ed4205d8 724
725 Float_t xP1 = r * TMath::Sin( angle / kRADDEG ) ;
726 Float_t yP1 = -r * TMath::Cos( angle / kRADDEG ) ;
727
728 gMC->Gspos("PHO1", i-lastModule, "ALIC", xP1, yP1, 0.0, idrotm[i-1], "ONLY") ;
729
730 } // for GetNModules
731
fe4da5cc 732}
d15a28e7 733
734//____________________________________________________________________________
735void AliPHOSv0::CreateGeometryforPHOS()
736{
b2a60966 737 // Create the PHOS-EMC geometry for GEANT
738 //BEGIN_HTML
739 /*
740 <H2>
741 Geant3 geometry tree of PHOS-EMC in ALICE
742 </H2>
743 <P><CENTER>
744 <IMG Align=BOTTOM ALT="EMC geant tree" SRC="../images/EMCinAlice.gif">
745 </CENTER><P>
746 */
747 //END_HTML
748
749 // Get pointer to the array containing media indexes
92862013 750 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
d15a28e7 751
7367f709 752 AliPHOSGeometry * geom = GetGeometry() ;
753
d15a28e7 754 // ---
755 // --- Define PHOS box volume, fPUFPill with thermo insulating foam ---
756 // --- Foam Thermo Insulating outer cover dimensions ---
92862013 757 // --- Put it in bigbox = PHOS
d15a28e7 758
92862013 759 Float_t dphos[3] ;
7367f709 760 dphos[0] = geom->GetOuterBoxSize(0) / 2.0 ;
761 dphos[1] = geom->GetOuterBoxSize(1) / 2.0 ;
762 dphos[2] = geom->GetOuterBoxSize(2) / 2.0 ;
d15a28e7 763
13add4de 764 gMC->Gsvolu("PEMC", "BOX ", idtmed[706], dphos, 3) ;
d15a28e7 765
7367f709 766 Float_t yO = - geom->GetCPVBoxSize(1) / 2.0 ;
d15a28e7 767
13add4de 768 gMC->Gspos("PEMC", 1, "PHOS", 0.0, yO, 0.0, 0, "ONLY") ;
7367f709 769 if ( strcmp( geom->GetName(),"MIXT") == 0 && geom->GetNPPSDModules() > 0)
13add4de 770 gMC->Gspos("PEMC", 1, "PHO1", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 771
772 // ---
13add4de 773 // --- Define Textolit Wall box, position inside PEMC ---
d15a28e7 774 // --- Textolit Wall box dimentions ---
775
776
92862013 777 Float_t dptxw[3];
7367f709 778 dptxw[0] = geom->GetTextolitBoxSize(0) / 2.0 ;
779 dptxw[1] = geom->GetTextolitBoxSize(1) / 2.0 ;
780 dptxw[2] = geom->GetTextolitBoxSize(2) / 2.0 ;
d15a28e7 781
92862013 782 gMC->Gsvolu("PTXW", "BOX ", idtmed[707], dptxw, 3);
d15a28e7 783
7367f709 784 yO = ( geom->GetOuterBoxThickness(1) - geom->GetUpperPlateThickness() ) / 2. ;
d15a28e7 785
13add4de 786 gMC->Gspos("PTXW", 1, "PEMC", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 787
788 // ---
789 // --- Define Upper Polystyrene Foam Plate, place inside PTXW ---
790 // --- immediately below Foam Thermo Insulation Upper plate ---
791
792 // --- Upper Polystyrene Foam plate thickness ---
793
92862013 794 Float_t dpufp[3] ;
7367f709 795 dpufp[0] = geom->GetTextolitBoxSize(0) / 2.0 ;
796 dpufp[1] = geom->GetSecondUpperPlateThickness() / 2. ;
797 dpufp[2] = geom->GetTextolitBoxSize(2) /2.0 ;
d15a28e7 798
92862013 799 gMC->Gsvolu("PUFP", "BOX ", idtmed[703], dpufp, 3) ;
d15a28e7 800
7367f709 801 yO = ( geom->GetTextolitBoxSize(1) - geom->GetSecondUpperPlateThickness() ) / 2.0 ;
d15a28e7 802
92862013 803 gMC->Gspos("PUFP", 1, "PTXW", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 804
805 // ---
806 // --- Define air-filled box, place inside PTXW ---
807 // --- Inner AIR volume dimensions ---
fe4da5cc 808
d15a28e7 809
92862013 810 Float_t dpair[3] ;
7367f709 811 dpair[0] = geom->GetAirFilledBoxSize(0) / 2.0 ;
812 dpair[1] = geom->GetAirFilledBoxSize(1) / 2.0 ;
813 dpair[2] = geom->GetAirFilledBoxSize(2) / 2.0 ;
d15a28e7 814
92862013 815 gMC->Gsvolu("PAIR", "BOX ", idtmed[798], dpair, 3) ;
d15a28e7 816
7367f709 817 yO = ( geom->GetTextolitBoxSize(1) - geom->GetAirFilledBoxSize(1) ) / 2.0 - geom->GetSecondUpperPlateThickness() ;
d15a28e7 818
92862013 819 gMC->Gspos("PAIR", 1, "PTXW", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 820
821// --- Dimensions of PbWO4 crystal ---
822
7367f709 823 Float_t xtlX = geom->GetCrystalSize(0) ;
824 Float_t xtlY = geom->GetCrystalSize(1) ;
825 Float_t xtlZ = geom->GetCrystalSize(2) ;
d15a28e7 826
92862013 827 Float_t dptcb[3] ;
7367f709 828 dptcb[0] = geom->GetNPhi() * ( xtlX + 2 * geom->GetGapBetweenCrystals() ) / 2.0 + geom->GetModuleBoxThickness() ;
829 dptcb[1] = ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() + geom->GetCrystalHolderThickness() ) / 2.0
830 + geom->GetModuleBoxThickness() / 2.0 ;
831 dptcb[2] = geom->GetNZ() * ( xtlZ + 2 * geom->GetGapBetweenCrystals() ) / 2.0 + geom->GetModuleBoxThickness() ;
d15a28e7 832
92862013 833 gMC->Gsvolu("PTCB", "BOX ", idtmed[706], dptcb, 3) ;
d15a28e7 834
7367f709 835 yO = geom->GetAirFilledBoxSize(1) / 2.0 - dptcb[1]
836 - ( geom->GetIPtoCrystalSurface() - geom->GetIPtoOuterCoverDistance() - geom->GetModuleBoxThickness()
837 - geom->GetUpperPlateThickness() - geom->GetSecondUpperPlateThickness() ) ;
d15a28e7 838
92862013 839 gMC->Gspos("PTCB", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 840
841 // ---
842 // --- Define Crystal BLock filled with air, position it inside PTCB ---
92862013 843 Float_t dpcbl[3] ;
d15a28e7 844
7367f709 845 dpcbl[0] = geom->GetNPhi() * ( xtlX + 2 * geom->GetGapBetweenCrystals() ) / 2.0 ;
846 dpcbl[1] = ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() + geom->GetCrystalHolderThickness() ) / 2.0 ;
847 dpcbl[2] = geom->GetNZ() * ( xtlZ + 2 * geom->GetGapBetweenCrystals() ) / 2.0 ;
d15a28e7 848
92862013 849 gMC->Gsvolu("PCBL", "BOX ", idtmed[798], dpcbl, 3) ;
d15a28e7 850
851 // --- Divide PCBL in X (phi) and Z directions --
7367f709 852 gMC->Gsdvn("PROW", "PCBL", Int_t (geom->GetNPhi()), 1) ;
853 gMC->Gsdvn("PCEL", "PROW", Int_t (geom->GetNZ()), 3) ;
d15a28e7 854
7367f709 855 yO = -geom->GetModuleBoxThickness() / 2.0 ;
d15a28e7 856
92862013 857 gMC->Gspos("PCBL", 1, "PTCB", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 858
859 // ---
860 // --- Define STeel (actually, it's titanium) Cover volume, place inside PCEL
92862013 861 Float_t dpstc[3] ;
d15a28e7 862
7367f709 863 dpstc[0] = ( xtlX + 2 * geom->GetCrystalWrapThickness() ) / 2.0 ;
864 dpstc[1] = ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() + geom->GetCrystalHolderThickness() ) / 2.0 ;
865 dpstc[2] = ( xtlZ + 2 * geom->GetCrystalWrapThickness() + 2 * geom->GetCrystalHolderThickness() ) / 2.0 ;
d15a28e7 866
92862013 867 gMC->Gsvolu("PSTC", "BOX ", idtmed[704], dpstc, 3) ;
d15a28e7 868
869 gMC->Gspos("PSTC", 1, "PCEL", 0.0, 0.0, 0.0, 0, "ONLY") ;
870
871 // ---
872 // --- Define Tyvek volume, place inside PSTC ---
92862013 873 Float_t dppap[3] ;
d15a28e7 874
7367f709 875 dppap[0] = xtlX / 2.0 + geom->GetCrystalWrapThickness() ;
876 dppap[1] = ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() ) / 2.0 ;
877 dppap[2] = xtlZ / 2.0 + geom->GetCrystalWrapThickness() ;
d15a28e7 878
92862013 879 gMC->Gsvolu("PPAP", "BOX ", idtmed[702], dppap, 3) ;
d15a28e7 880
7367f709 881 yO = ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() ) / 2.0
882 - ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() + geom->GetCrystalHolderThickness() ) / 2.0 ;
d15a28e7 883
92862013 884 gMC->Gspos("PPAP", 1, "PSTC", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 885
886 // ---
887 // --- Define PbWO4 crystal volume, place inside PPAP ---
92862013 888 Float_t dpxtl[3] ;
d15a28e7 889
92862013 890 dpxtl[0] = xtlX / 2.0 ;
891 dpxtl[1] = xtlY / 2.0 ;
892 dpxtl[2] = xtlZ / 2.0 ;
d15a28e7 893
92862013 894 gMC->Gsvolu("PXTL", "BOX ", idtmed[699], dpxtl, 3) ;
d15a28e7 895
7367f709 896 yO = ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() ) / 2.0 - xtlY / 2.0 - geom->GetCrystalWrapThickness() ;
d15a28e7 897
92862013 898 gMC->Gspos("PXTL", 1, "PPAP", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 899
900 // ---
901 // --- Define crystal support volume, place inside PPAP ---
92862013 902 Float_t dpsup[3] ;
d15a28e7 903
7367f709 904 dpsup[0] = xtlX / 2.0 + geom->GetCrystalWrapThickness() ;
905 dpsup[1] = geom->GetCrystalSupportHeight() / 2.0 ;
906 dpsup[2] = xtlZ / 2.0 + geom->GetCrystalWrapThickness() ;
d15a28e7 907
92862013 908 gMC->Gsvolu("PSUP", "BOX ", idtmed[798], dpsup, 3) ;
d15a28e7 909
7367f709 910 yO = geom->GetCrystalSupportHeight() / 2.0 - ( xtlY + geom->GetCrystalSupportHeight() + geom->GetCrystalWrapThickness() ) / 2.0 ;
d15a28e7 911
92862013 912 gMC->Gspos("PSUP", 1, "PPAP", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 913
914 // ---
915 // --- Define PIN-diode volume and position it inside crystal support ---
916 // --- right behind PbWO4 crystal
917
918 // --- PIN-diode dimensions ---
919
920
92862013 921 Float_t dppin[3] ;
7367f709 922 dppin[0] = geom->GetPinDiodeSize(0) / 2.0 ;
923 dppin[1] = geom->GetPinDiodeSize(1) / 2.0 ;
924 dppin[2] = geom->GetPinDiodeSize(2) / 2.0 ;
d15a28e7 925
92862013 926 gMC->Gsvolu("PPIN", "BOX ", idtmed[705], dppin, 3) ;
d15a28e7 927
7367f709 928 yO = geom->GetCrystalSupportHeight() / 2.0 - geom->GetPinDiodeSize(1) / 2.0 ;
d15a28e7 929
92862013 930 gMC->Gspos("PPIN", 1, "PSUP", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 931
932 // ---
933 // --- Define Upper Cooling Panel, place it on top of PTCB ---
92862013 934 Float_t dpucp[3] ;
d15a28e7 935 // --- Upper Cooling Plate thickness ---
936
92862013 937 dpucp[0] = dptcb[0] ;
7367f709 938 dpucp[1] = geom->GetUpperCoolingPlateThickness() ;
92862013 939 dpucp[2] = dptcb[2] ;
d15a28e7 940
92862013 941 gMC->Gsvolu("PUCP", "BOX ", idtmed[701], dpucp,3) ;
d15a28e7 942
7367f709 943 yO = geom->GetAirFilledBoxSize(1) / 2.
944 -( geom->GetIPtoCrystalSurface() - geom->GetIPtoOuterCoverDistance() - geom->GetModuleBoxThickness()
945 -geom->GetUpperPlateThickness() - geom->GetSecondUpperPlateThickness() - geom->GetUpperCoolingPlateThickness() ) ;
d15a28e7 946
92862013 947 gMC->Gspos("PUCP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 948
949 // ---
950 // --- Define Al Support Plate, position it inside PAIR ---
951 // --- right beneath PTCB ---
952 // --- Al Support Plate thickness ---
953
92862013 954 Float_t dpasp[3] ;
7367f709 955 dpasp[0] = geom->GetAirFilledBoxSize(0) / 2.0 ;
956 dpasp[1] = geom->GetSupportPlateThickness() / 2.0 ;
957 dpasp[2] = geom->GetAirFilledBoxSize(2) / 2.0 ;
d15a28e7 958
92862013 959 gMC->Gsvolu("PASP", "BOX ", idtmed[701], dpasp, 3) ;
d15a28e7 960
7367f709 961 yO = ( geom->GetAirFilledBoxSize(1) - geom->GetSupportPlateThickness() ) / 2.
962 - ( geom->GetIPtoCrystalSurface() - geom->GetIPtoOuterCoverDistance()
963 - geom->GetUpperPlateThickness() - geom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 ) ;
d15a28e7 964
92862013 965 gMC->Gspos("PASP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 966
967 // ---
968 // --- Define Thermo Insulating Plate, position it inside PAIR ---
969 // --- right beneath PASP ---
970 // --- Lower Thermo Insulating Plate thickness ---
971
92862013 972 Float_t dptip[3] ;
7367f709 973 dptip[0] = geom->GetAirFilledBoxSize(0) / 2.0 ;
974 dptip[1] = geom->GetLowerThermoPlateThickness() / 2.0 ;
975 dptip[2] = geom->GetAirFilledBoxSize(2) / 2.0 ;
d15a28e7 976
92862013 977 gMC->Gsvolu("PTIP", "BOX ", idtmed[706], dptip, 3) ;
d15a28e7 978
7367f709 979 yO = ( geom->GetAirFilledBoxSize(1) - geom->GetLowerThermoPlateThickness() ) / 2.
980 - ( geom->GetIPtoCrystalSurface() - geom->GetIPtoOuterCoverDistance() - geom->GetUpperPlateThickness()
981 - geom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 + geom->GetSupportPlateThickness() ) ;
d15a28e7 982
92862013 983 gMC->Gspos("PTIP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 984
985 // ---
986 // --- Define Textolit Plate, position it inside PAIR ---
987 // --- right beneath PTIP ---
988 // --- Lower Textolit Plate thickness ---
989
92862013 990 Float_t dptxp[3] ;
7367f709 991 dptxp[0] = geom->GetAirFilledBoxSize(0) / 2.0 ;
992 dptxp[1] = geom->GetLowerTextolitPlateThickness() / 2.0 ;
993 dptxp[2] = geom->GetAirFilledBoxSize(2) / 2.0 ;
d15a28e7 994
92862013 995 gMC->Gsvolu("PTXP", "BOX ", idtmed[707], dptxp, 3) ;
d15a28e7 996
7367f709 997 yO = ( geom->GetAirFilledBoxSize(1) - geom->GetLowerTextolitPlateThickness() ) / 2.
998 - ( geom->GetIPtoCrystalSurface() - geom->GetIPtoOuterCoverDistance() - geom->GetUpperPlateThickness()
999 - geom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 + geom->GetSupportPlateThickness()
1000 + geom->GetLowerThermoPlateThickness() ) ;
d15a28e7 1001
92862013 1002 gMC->Gspos("PTXP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 1003
1004}
1005
1006//____________________________________________________________________________
1007void AliPHOSv0::CreateGeometryforPPSD()
fe4da5cc 1008{
b2a60966 1009 // Create the PHOS-PPSD geometry for GEANT
b2a60966 1010 //BEGIN_HTML
1011 /*
1012 <H2>
1013 Geant3 geometry tree of PHOS-PPSD in ALICE
1014 </H2>
1015 <P><CENTER>
1016 <IMG Align=BOTTOM ALT="PPSD geant tree" SRC="../images/PPSDinAlice.gif">
1017 </CENTER><P>
1018 */
1019 //END_HTML
1020
1021 // Get pointer to the array containing media indexes
92862013 1022 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
7367f709 1023
1024 AliPHOSGeometry * geom = GetGeometry() ;
1025
92862013 1026 // The box containing all ppsd's for one PHOS module filled with air
1027 Float_t ppsd[3] ;
7367f709 1028 ppsd[0] = geom->GetCPVBoxSize(0) / 2.0 ;
1029 ppsd[1] = geom->GetCPVBoxSize(1) / 2.0 ;
1030 ppsd[2] = geom->GetCPVBoxSize(2) / 2.0 ;
fe4da5cc 1031
92862013 1032 gMC->Gsvolu("PPSD", "BOX ", idtmed[798], ppsd, 3) ;
d15a28e7 1033
7367f709 1034 Float_t yO = geom->GetOuterBoxSize(1) / 2.0 ;
d15a28e7 1035
7367f709 1036 if ( strcmp( geom->GetName(),"MIXT") == 0 && geom->GetNPPSDModules() > 0)
ed4205d8 1037 gMC->Gspos("PPSD", 1, "PHO1", 0.0, yO, 0.0, 0, "ONLY") ;
1038 else
1039 gMC->Gspos("PPSD", 1, "PHOS", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 1040
1041 // Now we build a micromegas module
1042 // The box containing the whole module filled with epoxy (FR4)
1043
92862013 1044 Float_t mppsd[3] ;
7367f709 1045 mppsd[0] = geom->GetPPSDModuleSize(0) / 2.0 ;
1046 mppsd[1] = geom->GetPPSDModuleSize(1) / 2.0 ;
1047 mppsd[2] = geom->GetPPSDModuleSize(2) / 2.0 ;
d15a28e7 1048
13add4de 1049 gMC->Gsvolu("PMPP", "BOX ", idtmed[708], mppsd, 3) ;
d15a28e7 1050
92862013 1051 // Inside mppsd :
d15a28e7 1052 // 1. The Top Lid made of epoxy (FR4)
1053
92862013 1054 Float_t tlppsd[3] ;
7367f709 1055 tlppsd[0] = geom->GetPPSDModuleSize(0) / 2.0 ;
1056 tlppsd[1] = geom->GetLidThickness() / 2.0 ;
1057 tlppsd[2] = geom->GetPPSDModuleSize(2) / 2.0 ;
d15a28e7 1058
13add4de 1059 gMC->Gsvolu("PTLP", "BOX ", idtmed[708], tlppsd, 3) ;
d15a28e7 1060
7367f709 1061 Float_t y0 = ( geom->GetMicromegas1Thickness() - geom->GetLidThickness() ) / 2. ;
d15a28e7 1062
13add4de 1063 gMC->Gspos("PTLP", 1, "PMPP", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1064
1065 // 2. the upper panel made of composite material
1066
92862013 1067 Float_t upppsd[3] ;
7367f709 1068 upppsd[0] = ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() ) / 2.0 ;
1069 upppsd[1] = geom->GetCompositeThickness() / 2.0 ;
1070 upppsd[2] = ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 1071
13add4de 1072 gMC->Gsvolu("PUPP", "BOX ", idtmed[709], upppsd, 3) ;
d15a28e7 1073
7367f709 1074 y0 = y0 - geom->GetLidThickness() / 2. - geom->GetCompositeThickness() / 2. ;
d15a28e7 1075
13add4de 1076 gMC->Gspos("PUPP", 1, "PMPP", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1077
1078 // 3. the anode made of Copper
1079
92862013 1080 Float_t anppsd[3] ;
7367f709 1081 anppsd[0] = ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() ) / 2.0 ;
1082 anppsd[1] = geom->GetAnodeThickness() / 2.0 ;
1083 anppsd[2] = ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 1084
13add4de 1085 gMC->Gsvolu("PANP", "BOX ", idtmed[710], anppsd, 3) ;
d15a28e7 1086
7367f709 1087 y0 = y0 - geom->GetCompositeThickness() / 2. - geom->GetAnodeThickness() / 2. ;
d15a28e7 1088
13add4de 1089 gMC->Gspos("PANP", 1, "PMPP", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1090
1091 // 4. the conversion gap + avalanche gap filled with gas
1092
92862013 1093 Float_t ggppsd[3] ;
7367f709 1094 ggppsd[0] = ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() ) / 2.0 ;
1095 ggppsd[1] = ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2.0 ;
1096 ggppsd[2] = ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 1097
13add4de 1098 gMC->Gsvolu("PGGP", "BOX ", idtmed[715], ggppsd, 3) ;
d15a28e7 1099
1100 // --- Divide GGPP in X (phi) and Z directions --
7367f709 1101 gMC->Gsdvn("PPRO", "PGGP", geom->GetNumberOfPadsPhi(), 1) ;
1102 gMC->Gsdvn("PPCE", "PPRO", geom->GetNumberOfPadsZ() , 3) ;
d15a28e7 1103
7367f709 1104 y0 = y0 - geom->GetAnodeThickness() / 2. - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. ;
d15a28e7 1105
13add4de 1106 gMC->Gspos("PGGP", 1, "PMPP", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1107
1108
1109 // 6. the cathode made of Copper
1110
92862013 1111 Float_t cappsd[3] ;
7367f709 1112 cappsd[0] = ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() ) / 2.0 ;
1113 cappsd[1] = geom->GetCathodeThickness() / 2.0 ;
1114 cappsd[2] = ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 1115
13add4de 1116 gMC->Gsvolu("PCAP", "BOX ", idtmed[710], cappsd, 3) ;
d15a28e7 1117
7367f709 1118 y0 = y0 - ( geom->GetConversionGap() + geom->GetAvalancheGap() ) / 2. - geom->GetCathodeThickness() / 2. ;
d15a28e7 1119
13add4de 1120 gMC->Gspos("PCAP", 1, "PMPP", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1121
1122 // 7. the printed circuit made of G10
1123
92862013 1124 Float_t pcppsd[3] ;
7367f709 1125 pcppsd[0] = ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() ) / 2,.0 ;
1126 pcppsd[1] = geom->GetPCThickness() / 2.0 ;
1127 pcppsd[2] = ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 1128
92862013 1129 gMC->Gsvolu("PCPS", "BOX ", idtmed[711], cappsd, 3) ;
d15a28e7 1130
7367f709 1131 y0 = y0 - geom->GetCathodeThickness() / 2. - geom->GetPCThickness() / 2. ;
d15a28e7 1132
13add4de 1133 gMC->Gspos("PCPS", 1, "PMPP", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1134
1135 // 8. the lower panel made of composite material
1136
92862013 1137 Float_t lpppsd[3] ;
7367f709 1138 lpppsd[0] = ( geom->GetPPSDModuleSize(0) - geom->GetMicromegasWallThickness() ) / 2.0 ;
1139 lpppsd[1] = geom->GetCompositeThickness() / 2.0 ;
1140 lpppsd[2] = ( geom->GetPPSDModuleSize(2) - geom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 1141
13add4de 1142 gMC->Gsvolu("PLPP", "BOX ", idtmed[709], lpppsd, 3) ;
d15a28e7 1143
7367f709 1144 y0 = y0 - geom->GetPCThickness() / 2. - geom->GetCompositeThickness() / 2. ;
d15a28e7 1145
13add4de 1146 gMC->Gspos("PLPP", 1, "PMPP", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1147
92862013 1148 // Position the fNumberOfModulesPhi x fNumberOfModulesZ modules (mppsd) inside PPSD to cover a PHOS module
d15a28e7 1149 // the top and bottom one's (which are assumed identical) :
1150
7367f709 1151 Float_t yt = ( geom->GetCPVBoxSize(1) - geom->GetMicromegas1Thickness() ) / 2. ;
1152 Float_t yb = - ( geom->GetCPVBoxSize(1) - geom->GetMicromegas2Thickness() ) / 2. ;
d15a28e7 1153
92862013 1154 Int_t copyNumbertop = 0 ;
7367f709 1155 Int_t copyNumberbot = geom->GetNumberOfModulesPhi() * geom->GetNumberOfModulesZ() ;
d15a28e7 1156
7367f709 1157 Float_t x = ( geom->GetCPVBoxSize(0) - geom->GetPPSDModuleSize(0) ) / 2. ;
d15a28e7 1158
7367f709 1159 for ( Int_t iphi = 1; iphi <= geom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module
1160 Float_t z = ( geom->GetCPVBoxSize(2) - geom->GetPPSDModuleSize(2) ) / 2. ;
d15a28e7 1161
7367f709 1162 for ( Int_t iz = 1; iz <= geom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module
13add4de 1163 gMC->Gspos("PMPP", ++copyNumbertop, "PPSD", x, yt, z, 0, "ONLY") ;
1164 gMC->Gspos("PMPP", ++copyNumberbot, "PPSD", x, yb, z, 0, "ONLY") ;
7367f709 1165 z = z - geom->GetPPSDModuleSize(2) ;
d15a28e7 1166 } // end of Z module loop
7367f709 1167 x = x - geom->GetPPSDModuleSize(0) ;
d15a28e7 1168 } // end of phi module loop
1169
1170 // The Lead converter between two air gaps
1171 // 1. Upper air gap
1172
92862013 1173 Float_t uappsd[3] ;
7367f709 1174 uappsd[0] = geom->GetCPVBoxSize(0) / 2.0 ;
1175 uappsd[1] = geom->GetMicro1ToLeadGap() / 2.0 ;
1176 uappsd[2] = geom->GetCPVBoxSize(2) / 2.0 ;
d15a28e7 1177
13add4de 1178 gMC->Gsvolu("PUAPPS", "BOX ", idtmed[798], uappsd, 3) ;
d15a28e7 1179
7367f709 1180 y0 = ( geom->GetCPVBoxSize(1) - 2 * geom->GetMicromegas1Thickness() - geom->GetMicro1ToLeadGap() ) / 2. ;
d15a28e7 1181
13add4de 1182 gMC->Gspos("PUAPPS", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1183
1184 // 2. Lead converter
1185
92862013 1186 Float_t lcppsd[3] ;
7367f709 1187 lcppsd[0] = geom->GetCPVBoxSize(0) / 2.0 ;
1188 lcppsd[1] = geom->GetLeadConverterThickness() / 2.0 ;
1189 lcppsd[2] = geom->GetCPVBoxSize(2) / 2.0 ;
d15a28e7 1190
13add4de 1191 gMC->Gsvolu("PLCPPS", "BOX ", idtmed[712], lcppsd, 3) ;
d15a28e7 1192
7367f709 1193 y0 = y0 - geom->GetMicro1ToLeadGap() / 2. - geom->GetLeadConverterThickness() / 2. ;
d15a28e7 1194
13add4de 1195 gMC->Gspos("PLCPPS", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1196
1197 // 3. Lower air gap
1198
92862013 1199 Float_t lappsd[3] ;
7367f709 1200 lappsd[0] = geom->GetCPVBoxSize(0) / 2.0 ;
1201 lappsd[1] = geom->GetLeadToMicro2Gap() / 2.0 ;
1202 lappsd[2] = geom->GetCPVBoxSize(2) / 2.0 ;
d15a28e7 1203
13add4de 1204 gMC->Gsvolu("PLAPPS", "BOX ", idtmed[798], lappsd, 3) ;
fe4da5cc 1205
7367f709 1206 y0 = y0 - geom->GetLeadConverterThickness() / 2. - geom->GetLeadToMicro2Gap() / 2. ;
d15a28e7 1207
13add4de 1208 gMC->Gspos("PLAPPS", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 1209
fe4da5cc 1210}
1211
d15a28e7 1212
bacd0b23 1213//____________________________________________________________________________
1214void AliPHOSv0::CreateGeometryforCPV()
1215{
1216 // Create the PHOS-CPV geometry for GEANT
1217 // Author: Yuri Kharlov 11 September 2000
bacd0b23 1218 //BEGIN_HTML
1219 /*
1220 <H2>
1221 Geant3 geometry of PHOS-CPV in ALICE
1222 </H2>
1223 <table width=700>
1224
1225 <tr>
1226 <td>CPV perspective view</td>
1227 <td>CPV front view </td>
1228 </tr>
1229
1230 <tr>
1231 <td> <img height=300 width=290 src="../images/CPVallPersp.gif"> </td>
1232 <td> <img height=300 width=290 src="../images/CPVallFront.gif"> </td>
1233 </tr>
1234
1235 <tr>
1236 <td>One CPV module, perspective view </td>
1237 <td>One CPV module, front view (extended in vertical direction) </td>
1238 </tr>
1239
1240 <tr>
1241 <td><img height=300 width=290 src="../images/CPVmodulePers.gif"></td>
1242 <td><img height=300 width=290 src="../images/CPVmoduleSide.gif"></td>
1243 </tr>
1244
1245 </table>
1246
1247 <H2>
1248 Geant3 geometry tree of PHOS-CPV in ALICE
1249 </H2>
1250 <center>
1251 <img height=300 width=290 src="../images/CPVtree.gif">
1252 </center>
1253 */
1254 //END_HTML
1255
1256 Float_t par[3], x,y,z;
1257
1258 // Get pointer to the array containing media indexes
1259 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
7367f709 1260
1261 AliPHOSGeometry * geom = GetGeometry() ;
1262
bacd0b23 1263 // The box containing all CPV for one PHOS module filled with air
7367f709 1264 par[0] = geom->GetCPVBoxSize(0) / 2.0 ;
1265 par[1] = geom->GetCPVBoxSize(1) / 2.0 ;
1266 par[2] = geom->GetCPVBoxSize(2) / 2.0 ;
13add4de 1267 gMC->Gsvolu("PCPV", "BOX ", idtmed[798], par, 3) ;
bacd0b23 1268
7367f709 1269 y = geom->GetOuterBoxSize(1) / 2.0 ;
13add4de 1270 gMC->Gspos("PCPV", 1, "PHOS", 0.0, y, 0.0, 0, "ONLY") ;
bacd0b23 1271
1272 // Gassiplex board
1273
7367f709 1274 par[0] = geom->GetGassiplexChipSize(0)/2.;
1275 par[1] = geom->GetGassiplexChipSize(1)/2.;
1276 par[2] = geom->GetGassiplexChipSize(2)/2.;
13add4de 1277 gMC->Gsvolu("PCPC","BOX ",idtmed[707],par,3);
bacd0b23 1278
1279 // Cu+Ni foil covers Gassiplex board
1280
7367f709 1281 par[1] = geom->GetCPVCuNiFoilThickness()/2;
13add4de 1282 gMC->Gsvolu("PCPD","BOX ",idtmed[710],par,3);
7367f709 1283 y = -(geom->GetGassiplexChipSize(1)/2 - par[1]);
13add4de 1284 gMC->Gspos("PCPD",1,"PCPC",0,y,0,0,"ONLY");
bacd0b23 1285
1286 // Position of the chip inside CPV
1287
7367f709 1288 Float_t xStep = geom->GetCPVActiveSize(0) / (geom->GetNumberOfCPVChipsPhi() + 1);
1289 Float_t zStep = geom->GetCPVActiveSize(1) / (geom->GetNumberOfCPVChipsZ() + 1);
bacd0b23 1290 Int_t copy = 0;
7367f709 1291 y = geom->GetCPVFrameSize(1)/2 - geom->GetFTPosition(0) +
1292 geom->GetCPVTextoliteThickness() / 2 + geom->GetGassiplexChipSize(1) / 2 + 0.1;
1293 for (Int_t ix=0; ix<geom->GetNumberOfCPVChipsPhi(); ix++) {
1294 x = xStep * (ix+1) - geom->GetCPVActiveSize(0)/2;
1295 for (Int_t iz=0; iz<geom->GetNumberOfCPVChipsZ(); iz++) {
bacd0b23 1296 copy++;
7367f709 1297 z = zStep * (iz+1) - geom->GetCPVActiveSize(1)/2;
13add4de 1298 gMC->Gspos("PCPC",copy,"PCPV",x,y,z,0,"ONLY");
bacd0b23 1299 }
1300 }
1301
1302 // Foiled textolite (1 mm of textolite + 50 mkm of Cu + 6 mkm of Ni)
1303
7367f709 1304 par[0] = geom->GetCPVActiveSize(0) / 2;
1305 par[1] = geom->GetCPVTextoliteThickness() / 2;
1306 par[2] = geom->GetCPVActiveSize(1) / 2;
13add4de 1307 gMC->Gsvolu("PCPF","BOX ",idtmed[707],par,3);
bacd0b23 1308
1309 // Argon gas volume
1310
7367f709 1311 par[1] = (geom->GetFTPosition(2) - geom->GetFTPosition(1) - geom->GetCPVTextoliteThickness()) / 2;
13add4de 1312 gMC->Gsvolu("PCPG","BOX ",idtmed[715],par,3);
bacd0b23 1313
1314 for (Int_t i=0; i<4; i++) {
7367f709 1315 y = geom->GetCPVFrameSize(1) / 2 - geom->GetFTPosition(i) + geom->GetCPVTextoliteThickness()/2;
13add4de 1316 gMC->Gspos("PCPF",i+1,"PCPV",0,y,0,0,"ONLY");
bacd0b23 1317 if(i==1){
7367f709 1318 y-= (geom->GetFTPosition(2) - geom->GetFTPosition(1)) / 2;
13add4de 1319 gMC->Gspos("PCPG",1,"PCPV ",0,y,0,0,"ONLY");
bacd0b23 1320 }
1321 }
1322
1323 // Dummy sensitive plane in the middle of argone gas volume
1324
1325 par[1]=0.001;
13add4de 1326 gMC->Gsvolu("PCPQ","BOX ",idtmed[715],par,3);
1327 gMC->Gspos ("PCPQ",1,"PCPG",0,0,0,0,"ONLY");
bacd0b23 1328
1329 // Cu+Ni foil covers textolite
1330
7367f709 1331 par[1] = geom->GetCPVCuNiFoilThickness() / 2;
13add4de 1332 gMC->Gsvolu("PCP1","BOX ",idtmed[710],par,3);
7367f709 1333 y = geom->GetCPVTextoliteThickness()/2 - par[1];
13add4de 1334 gMC->Gspos ("PCP1",1,"PCPF",0,y,0,0,"ONLY");
bacd0b23 1335
1336 // Aluminum frame around CPV
1337
7367f709 1338 par[0] = geom->GetCPVFrameSize(0)/2;
1339 par[1] = geom->GetCPVFrameSize(1)/2;
1340 par[2] = geom->GetCPVBoxSize(2) /2;
13add4de 1341 gMC->Gsvolu("PCF1","BOX ",idtmed[701],par,3);
bacd0b23 1342
7367f709 1343 par[0] = geom->GetCPVBoxSize(0)/2 - geom->GetCPVFrameSize(0);
1344 par[1] = geom->GetCPVFrameSize(1)/2;
1345 par[2] = geom->GetCPVFrameSize(2)/2;
13add4de 1346 gMC->Gsvolu("PCF2","BOX ",idtmed[701],par,3);
bacd0b23 1347
1348 for (Int_t j=0; j<=1; j++) {
7367f709 1349 x = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(0) - geom->GetCPVFrameSize(0)) / 2;
13add4de 1350 gMC->Gspos("PCF1",j+1,"PCPV", x,0,0,0,"ONLY");
7367f709 1351 z = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(2) - geom->GetCPVFrameSize(2)) / 2;
13add4de 1352 gMC->Gspos("PCF2",j+1,"PCPV",0, 0,z,0,"ONLY");
bacd0b23 1353 }
1354
1355}
1356
1357
6a5795b4 1358//____________________________________________________________________________
1359void AliPHOSv0::CreateGeometryforSupport()
1360{
1361 // Create the PHOS' support geometry for GEANT
1362 //BEGIN_HTML
1363 /*
1364 <H2>
1365 Geant3 geometry of the PHOS's support
1366 </H2>
1367 <P><CENTER>
1368 <IMG Align=BOTTOM ALT="EMC geant tree" SRC="../images/PHOS_support.gif">
1369 </CENTER><P>
1370 */
1371 //END_HTML
1372
1373 Float_t par[5], x0,y0,z0 ;
1374 Int_t i,j,copy;
1375
1376 // Get pointer to the array containing media indexes
1377 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
1378
7367f709 1379 AliPHOSGeometry * geom = GetGeometry() ;
1380
6a5795b4 1381 // --- Dummy box containing two rails on which PHOS support moves
1382 // --- Put these rails to the bottom of the L3 magnet
1383
7367f709 1384 par[0] = geom->GetRailRoadSize(0) / 2.0 ;
1385 par[1] = geom->GetRailRoadSize(1) / 2.0 ;
1386 par[2] = geom->GetRailRoadSize(2) / 2.0 ;
6a5795b4 1387 gMC->Gsvolu("PRRD", "BOX ", idtmed[798], par, 3) ;
1388
7367f709 1389 y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) / 2.0) ;
6a5795b4 1390 gMC->Gspos("PRRD", 1, "ALIC", 0.0, y0, 0.0, 0, "ONLY") ;
1391
1392 // --- Dummy box containing one rail
1393
7367f709 1394 par[0] = geom->GetRailOuterSize(0) / 2.0 ;
1395 par[1] = geom->GetRailOuterSize(1) / 2.0 ;
1396 par[2] = geom->GetRailOuterSize(2) / 2.0 ;
6a5795b4 1397 gMC->Gsvolu("PRAI", "BOX ", idtmed[798], par, 3) ;
1398
1399 for (i=0; i<2; i++) {
7367f709 1400 x0 = (2*i-1) * geom->GetDistanceBetwRails() / 2.0 ;
6a5795b4 1401 gMC->Gspos("PRAI", i, "PRRD", x0, 0.0, 0.0, 0, "ONLY") ;
1402 }
1403
1404 // --- Upper and bottom steel parts of the rail
1405
7367f709 1406 par[0] = geom->GetRailPart1(0) / 2.0 ;
1407 par[1] = geom->GetRailPart1(1) / 2.0 ;
1408 par[2] = geom->GetRailPart1(2) / 2.0 ;
6a5795b4 1409 gMC->Gsvolu("PRP1", "BOX ", idtmed[716], par, 3) ;
1410
7367f709 1411 y0 = - (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 ;
6a5795b4 1412 gMC->Gspos("PRP1", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
7367f709 1413 y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 - geom->GetRailPart3(1);
6a5795b4 1414 gMC->Gspos("PRP1", 2, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
1415
1416 // --- The middle vertical steel parts of the rail
1417
7367f709 1418 par[0] = geom->GetRailPart2(0) / 2.0 ;
1419 par[1] = geom->GetRailPart2(1) / 2.0 ;
1420 par[2] = geom->GetRailPart2(2) / 2.0 ;
6a5795b4 1421 gMC->Gsvolu("PRP2", "BOX ", idtmed[716], par, 3) ;
1422
7367f709 1423 y0 = - geom->GetRailPart3(1) / 2.0 ;
6a5795b4 1424 gMC->Gspos("PRP2", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
1425
1426 // --- The most upper steel parts of the rail
1427
7367f709 1428 par[0] = geom->GetRailPart3(0) / 2.0 ;
1429 par[1] = geom->GetRailPart3(1) / 2.0 ;
1430 par[2] = geom->GetRailPart3(2) / 2.0 ;
6a5795b4 1431 gMC->Gsvolu("PRP3", "BOX ", idtmed[716], par, 3) ;
1432
7367f709 1433 y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart3(1)) / 2.0 ;
6a5795b4 1434 gMC->Gspos("PRP3", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
1435
1436 // --- The wall of the cradle
1437 // --- The wall is empty: steel thin walls and air inside
1438
1439 par[1] = TMath::Sqrt(
7367f709 1440 TMath::Power((geom->GetIPtoOuterCoverDistance() + geom->GetOuterBoxSize(1)),2) +
1441 TMath::Power((geom->GetOuterBoxSize(0)/2),2)) + 10.;
1442 par[0] = par[1] - geom->GetCradleWall(1) ;
1443 par[2] = geom->GetCradleWall(2) / 2.0 ;
1444 par[3] = geom->GetCradleWall(3) ;
1445 par[4] = geom->GetCradleWall(4) ;
6a5795b4 1446 gMC->Gsvolu("PCRA", "TUBS", idtmed[716], par, 5) ;
1447
7367f709 1448 par[0] -= geom->GetCradleWallThickness() ;
1449 par[1] -= geom->GetCradleWallThickness() ;
1450 par[2] -= geom->GetCradleWallThickness() ;
6a5795b4 1451 gMC->Gsvolu("PCRE", "TUBS", idtmed[798], par, 5) ;
1452 gMC->Gspos ("PCRE", 1, "PCRA", 0.0, 0.0, 0.0, 0, "ONLY") ;
1453
1454 for (i=0; i<2; i++) {
7367f709 1455 z0 = (2*i-1) * (geom->GetOuterBoxSize(2) + geom->GetCradleWall(2)) / 2.0 ;
6a5795b4 1456 gMC->Gspos("PCRA", i, "ALIC", 0.0, 0.0, z0, 0, "ONLY") ;
1457 }
1458
1459 // --- The "wheels" of the cradle
1460
7367f709 1461 par[0] = geom->GetCradleWheel(0) / 2;
1462 par[1] = geom->GetCradleWheel(1) / 2;
1463 par[2] = geom->GetCradleWheel(2) / 2;
6a5795b4 1464 gMC->Gsvolu("PWHE", "BOX ", idtmed[716], par, 3) ;
1465
7367f709 1466 y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) -
1467 geom->GetCradleWheel(1)/2) ;
6a5795b4 1468 for (i=0; i<2; i++) {
7367f709 1469 z0 = (2*i-1) * ((geom->GetOuterBoxSize(2) + geom->GetCradleWheel(2)) / 2.0 +
1470 geom->GetCradleWall(2));
6a5795b4 1471 for (j=0; j<2; j++) {
1472 copy = 2*i + j;
7367f709 1473 x0 = (2*j-1) * geom->GetDistanceBetwRails() / 2.0 ;
6a5795b4 1474 gMC->Gspos("PWHE", copy, "ALIC", x0, y0, z0, 0, "ONLY") ;
1475 }
1476 }
1477
1478}
1479
ed4205d8 1480//____________________________________________________________________________
1481Float_t AliPHOSv0::ZMin(void) const
1482{
1483 // Overall dimension of the PHOS (min)
1484 // Take it twice more than the PHOS module size
7367f709 1485
1486 AliPHOSGeometry * geom = GetGeometry() ;
1487
1488 return -geom->GetOuterBoxSize(2);
ed4205d8 1489}
1490
1491//____________________________________________________________________________
1492Float_t AliPHOSv0::ZMax(void) const
1493{
1494 // Overall dimension of the PHOS (max)
1495 // Take it twice more than the PHOS module size
7367f709 1496
1497 AliPHOSGeometry * geom = GetGeometry() ;
1498
1499 return geom->GetOuterBoxSize(2);
ed4205d8 1500}
1501
d15a28e7 1502//____________________________________________________________________________
1503void AliPHOSv0::Init(void)
1504{
b2a60966 1505 // Just prints an information message
1506
d15a28e7 1507 Int_t i;
1508
9e1a0ddb 1509 if(fDebug) {
1510 printf("\n%s: ",ClassName());
1511 for(i=0;i<35;i++) printf("*");
1512 printf(" PHOS_INIT ");
1513 for(i=0;i<35;i++) printf("*");
1514 printf("\n%s: ",ClassName());
1515
1516
1517 // Here the PHOS initialisation code (if any!)
7367f709 1518
1519 AliPHOSGeometry * geom = GetGeometry() ;
1520
1521 if (geom!=0)
1522 cout << "AliPHOS" << Version() << " : PHOS geometry intialized for " << geom->GetName() << endl ;
9e1a0ddb 1523 else
1524 cout << "AliPHOS" << Version() << " : PHOS geometry initialization failed !" << endl ;
1525
1526 for(i=0;i<80;i++) printf("*");
1527 printf("\n");
1528 }
d15a28e7 1529}
1530
7b7c1533 1531