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