Put back the two bellows in front of the absorber.
[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
5f20d3fb 21// An object of this class does not produce hits nor digits
22// It is the one to use if you do not want to produce outputs in TREEH or TREED
b2a60966 23//
24//*-- Author: Yves Schutz (SUBATECH)
25
d2cf0e38 26
fe4da5cc 27// --- ROOT system ---
d15a28e7 28
fe4da5cc 29#include "TBRIK.h"
30#include "TNode.h"
0869cea5 31#include "TRandom.h"
fe4da5cc 32
81e92872 33
d15a28e7 34// --- Standard library ---
35
de9ec31b 36#include <stdio.h>
37#include <string.h>
38#include <stdlib.h>
39#include <strstream.h>
d15a28e7 40
41// --- AliRoot header files ---
42
fe4da5cc 43#include "AliPHOSv0.h"
44#include "AliRun.h"
d15a28e7 45#include "AliConst.h"
fe4da5cc 46
47ClassImp(AliPHOSv0)
48
d15a28e7 49//____________________________________________________________________________
d15a28e7 50AliPHOSv0::AliPHOSv0(const char *name, const char *title):
51 AliPHOS(name,title)
52{
b2a60966 53 // ctor : title is used to identify the layout
54 // GPS2 = 5 modules (EMC + PPSD)
fe4da5cc 55
d15a28e7 56 // gets an instance of the geometry parameters class
6ad0bfa0 57
f78d91b7 58 if (strcmp(title,"") != 0 )
59 fGeom = AliPHOSGeometry::GetInstance(title, "") ;
60 if (fGeom!=0)
88bdfa12 61 cout << "AliPHOS" << Version() << " : PHOS geometry intialized for " << fGeom->GetName() << endl ;
d15a28e7 62 else
88bdfa12 63 cout << "AliPHOS" << Version() << " : PHOS geometry initialization failed !" << endl ;
d15a28e7 64}
65
66//____________________________________________________________________________
d15a28e7 67void AliPHOSv0::BuildGeometry()
fe4da5cc 68{
b2a60966 69 // Build the PHOS geometry for the ROOT display
70 //BEGIN_HTML
71 /*
72 <H2>
73 PHOS in ALICE displayed by root
74 </H2>
75 <UL>
76 <LI> All Views
77 <P>
78 <CENTER>
79 <IMG Align=BOTTOM ALT="All Views" SRC="../images/AliPHOSv0AllViews.gif">
80 </CENTER></P></LI>
81 <LI> Front View
82 <P>
83 <CENTER>
84 <IMG Align=BOTTOM ALT="Front View" SRC="../images/AliPHOSv0FrontView.gif">
85 </CENTER></P></LI>
86 <LI> 3D View 1
87 <P>
88 <CENTER>
89 <IMG Align=BOTTOM ALT="3D View 1" SRC="../images/AliPHOSv03DView1.gif">
90 </CENTER></P></LI>
91 <LI> 3D View 2
92 <P>
93 <CENTER>
94 <IMG Align=BOTTOM ALT="3D View 2" SRC="../images/AliPHOSv03DView2.gif">
95 </CENTER></P></LI>
96 </UL>
97 */
98 //END_HTML
d15a28e7 99
100 this->BuildGeometryforPHOS() ;
101 if ( ( strcmp(fGeom->GetName(), "GPS2" ) == 0 ) )
102 this->BuildGeometryforPPSD() ;
103 else
104 cout << "AliPHOSv0::BuildGeometry : no charged particle identification system installed" << endl;
105
fe4da5cc 106}
d15a28e7 107
108//____________________________________________________________________________
109void AliPHOSv0:: BuildGeometryforPHOS(void)
110{
b2a60966 111 // Build the PHOS-EMC geometry for the ROOT display
d15a28e7 112
113 const Int_t kColorPHOS = kRed ;
114 const Int_t kColorXTAL = kBlue ;
115
92862013 116 Double_t const kRADDEG = 180.0 / kPI ;
d15a28e7 117
118 new TBRIK( "OuterBox", "PHOS box", "void", fGeom->GetOuterBoxSize(0)/2,
119 fGeom->GetOuterBoxSize(1)/2,
120 fGeom->GetOuterBoxSize(2)/2 );
121
122 // Textolit Wall box, position inside PHOS
123
124 new TBRIK( "TextolitBox", "PHOS Textolit box ", "void", fGeom->GetTextolitBoxSize(0)/2,
125 fGeom->GetTextolitBoxSize(1)/2,
126 fGeom->GetTextolitBoxSize(2)/2);
127
128 // Polystyrene Foam Plate
129
130 new TBRIK( "UpperFoamPlate", "PHOS Upper foam plate", "void", fGeom->GetTextolitBoxSize(0)/2,
131 fGeom->GetSecondUpperPlateThickness()/2,
132 fGeom->GetTextolitBoxSize(2)/2 ) ;
133
134 // Air Filled Box
fe4da5cc 135
d15a28e7 136 new TBRIK( "AirFilledBox", "PHOS air filled box", "void", fGeom->GetAirFilledBoxSize(0)/2,
137 fGeom->GetAirFilledBoxSize(1)/2,
138 fGeom->GetAirFilledBoxSize(2)/2 );
139
140 // Crystals Box
141
92862013 142 Float_t xtlX = fGeom->GetCrystalSize(0) ;
143 Float_t xtlY = fGeom->GetCrystalSize(1) ;
144 Float_t xtlZ = fGeom->GetCrystalSize(2) ;
d15a28e7 145
92862013 146 Float_t xl = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ;
147 Float_t yl = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0
d15a28e7 148 + fGeom->GetModuleBoxThickness() / 2.0 ;
92862013 149 Float_t zl = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ;
d15a28e7 150
92862013 151 new TBRIK( "CrystalsBox", "PHOS crystals box", "void", xl, yl, zl ) ;
d15a28e7 152
153// position PHOS into ALICE
154
92862013 155 Float_t r = fGeom->GetIPtoOuterCoverDistance() + fGeom->GetOuterBoxSize(1) / 2.0 ;
d15a28e7 156 Int_t number = 988 ;
157 Float_t pphi = TMath::ATan( fGeom->GetOuterBoxSize(0) / ( 2.0 * fGeom->GetIPtoOuterCoverDistance() ) ) ;
92862013 158 pphi *= kRADDEG ;
159 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
d15a28e7 160
161 char * nodename = new char[20] ;
162 char * rotname = new char[20] ;
163
164 for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) {
165 Float_t angle = pphi * 2 * ( i - fGeom->GetNModules() / 2.0 - 0.5 ) ;
166 sprintf(rotname, "%s%d", "rot", number++) ;
167 new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0);
92862013 168 top->cd();
d15a28e7 169 sprintf(nodename,"%s%d", "Module", i) ;
92862013 170 Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
171 Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
172 TNode * outerboxnode = new TNode(nodename, nodename, "OuterBox", x, y, 0, rotname ) ;
173 outerboxnode->SetLineColor(kColorPHOS) ;
174 fNodes->Add(outerboxnode) ;
175 outerboxnode->cd() ;
d15a28e7 176 // now inside the outer box the textolit box
92862013 177 y = ( fGeom->GetOuterBoxThickness(1) - fGeom->GetUpperPlateThickness() ) / 2. ;
d15a28e7 178 sprintf(nodename,"%s%d", "TexBox", i) ;
92862013 179 TNode * textolitboxnode = new TNode(nodename, nodename, "TextolitBox", 0, y, 0) ;
180 textolitboxnode->SetLineColor(kColorPHOS) ;
181 fNodes->Add(textolitboxnode) ;
d15a28e7 182 // upper foam plate inside outre box
92862013 183 outerboxnode->cd() ;
d15a28e7 184 sprintf(nodename, "%s%d", "UFPlate", i) ;
92862013 185 y = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetSecondUpperPlateThickness() ) / 2.0 ;
186 TNode * upperfoamplatenode = new TNode(nodename, nodename, "UpperFoamPlate", 0, y, 0) ;
187 upperfoamplatenode->SetLineColor(kColorPHOS) ;
188 fNodes->Add(upperfoamplatenode) ;
d15a28e7 189 // air filled box inside textolit box (not drawn)
92862013 190 textolitboxnode->cd();
191 y = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetAirFilledBoxSize(1) ) / 2.0 - fGeom->GetSecondUpperPlateThickness() ;
d15a28e7 192 sprintf(nodename, "%s%d", "AFBox", i) ;
92862013 193 TNode * airfilledboxnode = new TNode(nodename, nodename, "AirFilledBox", 0, y, 0) ;
194 fNodes->Add(airfilledboxnode) ;
d15a28e7 195 // crystals box inside air filled box
92862013 196 airfilledboxnode->cd() ;
197 y = fGeom->GetAirFilledBoxSize(1) / 2.0 - yl
d15a28e7 198 - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness()
199 - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() ) ;
200 sprintf(nodename, "%s%d", "XTBox", i) ;
92862013 201 TNode * crystalsboxnode = new TNode(nodename, nodename, "CrystalsBox", 0, y, 0) ;
202 crystalsboxnode->SetLineColor(kColorXTAL) ;
203 fNodes->Add(crystalsboxnode) ;
d15a28e7 204 }
b27d82c8 205
206 delete[] rotname ;
207 delete[] nodename ;
d15a28e7 208}
209
210//____________________________________________________________________________
211void AliPHOSv0:: BuildGeometryforPPSD(void)
fe4da5cc 212{
b2a60966 213 // Build the PHOS-PPSD geometry for the ROOT display
214 //BEGIN_HTML
215 /*
216 <H2>
217 PPSD displayed by root
218 </H2>
219 <UL>
220 <LI> Zoom on PPSD: Front View
221 <P>
222 <CENTER>
223 <IMG Align=BOTTOM ALT="PPSD Front View" SRC="../images/AliPHOSv0PPSDFrontView.gif">
224 </CENTER></P></LI>
225 <LI> Zoom on PPSD: Perspective View
226 <P>
227 <CENTER>
228 <IMG Align=BOTTOM ALT="PPSD Prespective View" SRC="../images/AliPHOSv0PPSDPerspectiveView.gif">
229 </CENTER></P></LI>
230 </UL>
231 */
232 //END_HTML
92862013 233 Double_t const kRADDEG = 180.0 / kPI ;
d15a28e7 234
235 const Int_t kColorPHOS = kRed ;
236 const Int_t kColorPPSD = kGreen ;
237 const Int_t kColorGas = kBlue ;
238 const Int_t kColorAir = kYellow ;
239
240 // Box for a full PHOS module
241
242 new TBRIK( "PPSDBox", "PPSD box", "void", fGeom->GetPPSDBoxSize(0)/2,
243 fGeom->GetPPSDBoxSize(1)/2,
244 fGeom->GetPPSDBoxSize(2)/2 );
245
246 // Box containing one micromegas module
247
248 new TBRIK( "PPSDModule", "PPSD module", "void", fGeom->GetPPSDModuleSize(0)/2,
249 fGeom->GetPPSDModuleSize(1)/2,
250 fGeom->GetPPSDModuleSize(2)/2 );
251 // top lid
252
253 new TBRIK ( "TopLid", "Micromegas top lid", "void", fGeom->GetPPSDModuleSize(0)/2,
254 fGeom->GetLidThickness()/2,
255 fGeom->GetPPSDModuleSize(2)/2 ) ;
256 // composite panel (top and bottom)
257
258 new TBRIK ( "TopPanel", "Composite top panel", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2,
259 fGeom->GetCompositeThickness()/2,
260 ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ;
261
262 new TBRIK ( "BottomPanel", "Composite bottom panel", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2,
263 fGeom->GetCompositeThickness()/2,
264 ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ;
265 // gas gap (conversion and avalanche)
266
267 new TBRIK ( "GasGap", "gas gap", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2,
268 ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() )/2,
269 ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ;
270
271 // anode and cathode
272
273 new TBRIK ( "Anode", "Anode", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2,
274 fGeom->GetAnodeThickness()/2,
275 ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ;
276
277 new TBRIK ( "Cathode", "Cathode", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2,
278 fGeom->GetCathodeThickness()/2,
279 ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ;
280 // PC
281
282 new TBRIK ( "PCBoard", "Printed Circuit", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2,
283 fGeom->GetPCThickness()/2,
284 ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ;
285 // Gap between Lead and top micromegas
286
287 new TBRIK ( "LeadToM", "Air Gap top", "void", fGeom->GetPPSDBoxSize(0)/2,
288 fGeom->GetMicro1ToLeadGap()/2,
289 fGeom->GetPPSDBoxSize(2)/2 ) ;
290
291// Gap between Lead and bottom micromegas
292
293 new TBRIK ( "MToLead", "Air Gap bottom", "void", fGeom->GetPPSDBoxSize(0)/2,
294 fGeom->GetLeadToMicro2Gap()/2,
295 fGeom->GetPPSDBoxSize(2)/2 ) ;
296 // Lead converter
297
298 new TBRIK ( "Lead", "Lead converter", "void", fGeom->GetPPSDBoxSize(0)/2,
299 fGeom->GetLeadConverterThickness()/2,
300 fGeom->GetPPSDBoxSize(2)/2 ) ;
301
302 // position PPSD into ALICE
303
304 char * nodename = new char[20] ;
305 char * rotname = new char[20] ;
306
92862013 307 Float_t r = fGeom->GetIPtoTopLidDistance() + fGeom->GetPPSDBoxSize(1) / 2.0 ;
d15a28e7 308 Int_t number = 988 ;
92862013 309 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
d15a28e7 310
311 for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) { // the number of PHOS modules
312 Float_t angle = fGeom->GetPHOSAngle(i) ;
313 sprintf(rotname, "%s%d", "rotg", number++) ;
314 new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0);
92862013 315 top->cd();
d15a28e7 316 sprintf(nodename, "%s%d", "Moduleg", i) ;
92862013 317 Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
318 Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
319 TNode * ppsdboxnode = new TNode(nodename , nodename ,"PPSDBox", x, y, 0, rotname ) ;
320 ppsdboxnode->SetLineColor(kColorPPSD) ;
321 fNodes->Add(ppsdboxnode) ;
322 ppsdboxnode->cd() ;
d15a28e7 323 // inside the PPSD box:
324 // 1. fNumberOfModulesPhi x fNumberOfModulesZ top micromegas
92862013 325 x = ( fGeom->GetPPSDBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. ;
31aa6d6c 326 {
327 for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module
328 Float_t z = ( fGeom->GetPPSDBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. ;
329 TNode * micro1node ;
330 for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module
331 y = ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas1Thickness() ) / 2. ;
332 sprintf(nodename, "%s%d%d%d", "Mic1", i, iphi, iz) ;
333 micro1node = new TNode(nodename, nodename, "PPSDModule", x, y, z) ;
334 micro1node->SetLineColor(kColorPPSD) ;
335 fNodes->Add(micro1node) ;
336 // inside top micromegas
337 micro1node->cd() ;
338 // a. top lid
339 y = ( fGeom->GetMicromegas1Thickness() - fGeom->GetLidThickness() ) / 2. ;
340 sprintf(nodename, "%s%d%d%d", "Lid", i, iphi, iz) ;
341 TNode * toplidnode = new TNode(nodename, nodename, "TopLid", 0, y, 0) ;
342 toplidnode->SetLineColor(kColorPPSD) ;
343 fNodes->Add(toplidnode) ;
344 // b. composite panel
345 y = y - fGeom->GetLidThickness() / 2. - fGeom->GetCompositeThickness() / 2. ;
346 sprintf(nodename, "%s%d%d%d", "CompU", i, iphi, iz) ;
347 TNode * compupnode = new TNode(nodename, nodename, "TopPanel", 0, y, 0) ;
348 compupnode->SetLineColor(kColorPPSD) ;
349 fNodes->Add(compupnode) ;
350 // c. anode
351 y = y - fGeom->GetCompositeThickness() / 2. - fGeom->GetAnodeThickness() / 2. ;
352 sprintf(nodename, "%s%d%d%d", "Ano", i, iphi, iz) ;
353 TNode * anodenode = new TNode(nodename, nodename, "Anode", 0, y, 0) ;
354 anodenode->SetLineColor(kColorPHOS) ;
355 fNodes->Add(anodenode) ;
356 // d. gas
357 y = y - fGeom->GetAnodeThickness() / 2. - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. ;
358 sprintf(nodename, "%s%d%d%d", "GGap", i, iphi, iz) ;
359 TNode * ggapnode = new TNode(nodename, nodename, "GasGap", 0, y, 0) ;
360 ggapnode->SetLineColor(kColorGas) ;
361 fNodes->Add(ggapnode) ;
d15a28e7 362 // f. cathode
31aa6d6c 363 y = y - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. - fGeom->GetCathodeThickness() / 2. ;
364 sprintf(nodename, "%s%d%d%d", "Cathode", i, iphi, iz) ;
365 TNode * cathodenode = new TNode(nodename, nodename, "Cathode", 0, y, 0) ;
366 cathodenode->SetLineColor(kColorPHOS) ;
367 fNodes->Add(cathodenode) ;
368 // g. printed circuit
369 y = y - fGeom->GetCathodeThickness() / 2. - fGeom->GetPCThickness() / 2. ;
370 sprintf(nodename, "%s%d%d%d", "PC", i, iphi, iz) ;
371 TNode * pcnode = new TNode(nodename, nodename, "PCBoard", 0, y, 0) ;
372 pcnode->SetLineColor(kColorPPSD) ;
373 fNodes->Add(pcnode) ;
374 // h. composite panel
375 y = y - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ;
376 sprintf(nodename, "%s%d%d%d", "CompDown", i, iphi, iz) ;
377 TNode * compdownnode = new TNode(nodename, nodename, "BottomPanel", 0, y, 0) ;
378 compdownnode->SetLineColor(kColorPPSD) ;
379 fNodes->Add(compdownnode) ;
380 z = z - fGeom->GetPPSDModuleSize(2) ;
381 ppsdboxnode->cd() ;
382 } // end of Z module loop
383 x = x - fGeom->GetPPSDModuleSize(0) ;
92862013 384 ppsdboxnode->cd() ;
31aa6d6c 385 } // end of phi module loop
386 }
d15a28e7 387 // 2. air gap
92862013 388 ppsdboxnode->cd() ;
389 y = ( fGeom->GetPPSDBoxSize(1) - 2 * fGeom->GetMicromegas1Thickness() - fGeom->GetMicro1ToLeadGap() ) / 2. ;
d15a28e7 390 sprintf(nodename, "%s%d", "GapUp", i) ;
92862013 391 TNode * gapupnode = new TNode(nodename, nodename, "LeadToM", 0, y, 0) ;
392 gapupnode->SetLineColor(kColorAir) ;
393 fNodes->Add(gapupnode) ;
d15a28e7 394 // 3. lead converter
92862013 395 y = y - fGeom->GetMicro1ToLeadGap() / 2. - fGeom->GetLeadConverterThickness() / 2. ;
d15a28e7 396 sprintf(nodename, "%s%d", "LeadC", i) ;
92862013 397 TNode * leadcnode = new TNode(nodename, nodename, "Lead", 0, y, 0) ;
398 leadcnode->SetLineColor(kColorPPSD) ;
399 fNodes->Add(leadcnode) ;
d15a28e7 400 // 4. air gap
92862013 401 y = y - fGeom->GetLeadConverterThickness() / 2. - fGeom->GetLeadToMicro2Gap() / 2. ;
d15a28e7 402 sprintf(nodename, "%s%d", "GapDown", i) ;
92862013 403 TNode * gapdownnode = new TNode(nodename, nodename, "MToLead", 0, y, 0) ;
404 gapdownnode->SetLineColor(kColorAir) ;
405 fNodes->Add(gapdownnode) ;
d15a28e7 406 // 5. fNumberOfModulesPhi x fNumberOfModulesZ bottom micromegas
92862013 407 x = ( fGeom->GetPPSDBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. - fGeom->GetPhiDisplacement() ;
31aa6d6c 408 {
409 for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) {
410 Float_t z = ( fGeom->GetPPSDBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. - fGeom->GetZDisplacement() ;;
411 TNode * micro2node ;
412 for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) {
413 y = - ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas2Thickness() ) / 2. ;
414 sprintf(nodename, "%s%d%d%d", "Mic2", i, iphi, iz) ;
415 micro2node = new TNode(nodename, nodename, "PPSDModule", x, y, z) ;
416 micro2node->SetLineColor(kColorPPSD) ;
417 fNodes->Add(micro2node) ;
418 // inside bottom micromegas
419 micro2node->cd() ;
d15a28e7 420 // a. top lid
92862013 421 y = ( fGeom->GetMicromegas2Thickness() - fGeom->GetLidThickness() ) / 2. ;
d15a28e7 422 sprintf(nodename, "%s%d", "Lidb", i) ;
92862013 423 TNode * toplidbnode = new TNode(nodename, nodename, "TopLid", 0, y, 0) ;
424 toplidbnode->SetLineColor(kColorPPSD) ;
425 fNodes->Add(toplidbnode) ;
d15a28e7 426 // b. composite panel
92862013 427 y = y - fGeom->GetLidThickness() / 2. - fGeom->GetCompositeThickness() / 2. ;
d15a28e7 428 sprintf(nodename, "%s%d", "CompUb", i) ;
92862013 429 TNode * compupbnode = new TNode(nodename, nodename, "TopPanel", 0, y, 0) ;
430 compupbnode->SetLineColor(kColorPPSD) ;
431 fNodes->Add(compupbnode) ;
d15a28e7 432 // c. anode
92862013 433 y = y - fGeom->GetCompositeThickness() / 2. - fGeom->GetAnodeThickness() / 2. ;
d15a28e7 434 sprintf(nodename, "%s%d", "Anob", i) ;
92862013 435 TNode * anodebnode = new TNode(nodename, nodename, "Anode", 0, y, 0) ;
436 anodebnode->SetLineColor(kColorPPSD) ;
437 fNodes->Add(anodebnode) ;
d15a28e7 438 // d. conversion gas
92862013 439 y = y - fGeom->GetAnodeThickness() / 2. - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. ;
d15a28e7 440 sprintf(nodename, "%s%d", "GGapb", i) ;
92862013 441 TNode * ggapbnode = new TNode(nodename, nodename, "GasGap", 0, y, 0) ;
442 ggapbnode->SetLineColor(kColorGas) ;
443 fNodes->Add(ggapbnode) ;
d15a28e7 444 // f. cathode
92862013 445 y = y - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. - fGeom->GetCathodeThickness() / 2. ;
d15a28e7 446 sprintf(nodename, "%s%d", "Cathodeb", i) ;
92862013 447 TNode * cathodebnode = new TNode(nodename, nodename, "Cathode", 0, y, 0) ;
448 cathodebnode->SetLineColor(kColorPPSD) ;
449 fNodes->Add(cathodebnode) ;
d15a28e7 450 // g. printed circuit
92862013 451 y = y - fGeom->GetCathodeThickness() / 2. - fGeom->GetPCThickness() / 2. ;
d15a28e7 452 sprintf(nodename, "%s%d", "PCb", i) ;
92862013 453 TNode * pcbnode = new TNode(nodename, nodename, "PCBoard", 0, y, 0) ;
454 pcbnode->SetLineColor(kColorPPSD) ;
455 fNodes->Add(pcbnode) ;
d15a28e7 456 // h. composite pane
92862013 457 y = y - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ;
d15a28e7 458 sprintf(nodename, "%s%d", "CompDownb", i) ;
92862013 459 TNode * compdownbnode = new TNode(nodename, nodename, "BottomPanel", 0, y, 0) ;
460 compdownbnode->SetLineColor(kColorPPSD) ;
461 fNodes->Add(compdownbnode) ;
462 z = z - fGeom->GetPPSDModuleSize(2) ;
463 ppsdboxnode->cd() ;
d15a28e7 464 } // end of Z module loop
92862013 465 x = x - fGeom->GetPPSDModuleSize(0) ;
466 ppsdboxnode->cd() ;
31aa6d6c 467 } // end of phi module loop
468 }
469 } // PHOS modules
470
e126816e 471 delete[] rotname ;
472 delete[] nodename ;
31aa6d6c 473
fe4da5cc 474}
475
d15a28e7 476//____________________________________________________________________________
fe4da5cc 477void AliPHOSv0::CreateGeometry()
478{
b2a60966 479 // Create the PHOS geometry for Geant
d15a28e7 480
92862013 481 AliPHOSv0 *phostmp = (AliPHOSv0*)gAlice->GetModule("PHOS") ;
d15a28e7 482
92862013 483 if ( phostmp == NULL ) {
d15a28e7 484
485 fprintf(stderr, "PHOS detector not found!\n") ;
486 return;
fe4da5cc 487
d15a28e7 488 }
d15a28e7 489 // Get pointer to the array containing media indeces
92862013 490 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
d15a28e7 491
92862013 492 Float_t bigbox[3] ;
493 bigbox[0] = fGeom->GetOuterBoxSize(0) / 2.0 ;
494 bigbox[1] = ( fGeom->GetOuterBoxSize(1) + fGeom->GetPPSDBoxSize(1) ) / 2.0 ;
495 bigbox[2] = fGeom->GetOuterBoxSize(2) / 2.0 ;
d15a28e7 496
92862013 497 gMC->Gsvolu("PHOS", "BOX ", idtmed[798], bigbox, 3) ;
d15a28e7 498
499 this->CreateGeometryforPHOS() ;
500 if ( strcmp( fGeom->GetName(), "GPS2") == 0 )
501 this->CreateGeometryforPPSD() ;
502 else
503 cout << "AliPHOSv0::CreateGeometry : no charged particle identification system installed" << endl;
504
505 // --- Position PHOS mdules in ALICE setup ---
506
92862013 507 Int_t idrotm[99] ;
508 Double_t const kRADDEG = 180.0 / kPI ;
d15a28e7 509
510 for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) {
511
512 Float_t angle = fGeom->GetPHOSAngle(i) ;
92862013 513 AliMatrix(idrotm[i-1], 90.0, angle, 90.0, 90.0+angle, 0.0, 0.0) ;
d15a28e7 514
92862013 515 Float_t r = fGeom->GetIPtoOuterCoverDistance() + ( fGeom->GetOuterBoxSize(1) + fGeom->GetPPSDBoxSize(1) ) / 2.0 ;
d15a28e7 516
92862013 517 Float_t xP1 = r * TMath::Sin( angle / kRADDEG ) ;
518 Float_t yP1 = -r * TMath::Cos( angle / kRADDEG ) ;
d15a28e7 519
92862013 520 gMC->Gspos("PHOS", i, "ALIC", xP1, yP1, 0.0, idrotm[i-1], "ONLY") ;
d15a28e7 521
522 } // for GetNModules
523
fe4da5cc 524}
d15a28e7 525
526//____________________________________________________________________________
527void AliPHOSv0::CreateGeometryforPHOS()
528{
b2a60966 529 // Create the PHOS-EMC geometry for GEANT
530 //BEGIN_HTML
531 /*
532 <H2>
533 Geant3 geometry tree of PHOS-EMC in ALICE
534 </H2>
535 <P><CENTER>
536 <IMG Align=BOTTOM ALT="EMC geant tree" SRC="../images/EMCinAlice.gif">
537 </CENTER><P>
538 */
539 //END_HTML
540
541 // Get pointer to the array containing media indexes
92862013 542 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
d15a28e7 543
544 // ---
545 // --- Define PHOS box volume, fPUFPill with thermo insulating foam ---
546 // --- Foam Thermo Insulating outer cover dimensions ---
92862013 547 // --- Put it in bigbox = PHOS
d15a28e7 548
92862013 549 Float_t dphos[3] ;
550 dphos[0] = fGeom->GetOuterBoxSize(0) / 2.0 ;
551 dphos[1] = fGeom->GetOuterBoxSize(1) / 2.0 ;
552 dphos[2] = fGeom->GetOuterBoxSize(2) / 2.0 ;
d15a28e7 553
92862013 554 gMC->Gsvolu("EMCA", "BOX ", idtmed[706], dphos, 3) ;
d15a28e7 555
92862013 556 Float_t yO = - fGeom->GetPPSDBoxSize(1) / 2.0 ;
d15a28e7 557
92862013 558 gMC->Gspos("EMCA", 1, "PHOS", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 559
560 // ---
561 // --- Define Textolit Wall box, position inside EMCA ---
562 // --- Textolit Wall box dimentions ---
563
564
92862013 565 Float_t dptxw[3];
566 dptxw[0] = fGeom->GetTextolitBoxSize(0) / 2.0 ;
567 dptxw[1] = fGeom->GetTextolitBoxSize(1) / 2.0 ;
568 dptxw[2] = fGeom->GetTextolitBoxSize(2) / 2.0 ;
d15a28e7 569
92862013 570 gMC->Gsvolu("PTXW", "BOX ", idtmed[707], dptxw, 3);
d15a28e7 571
92862013 572 yO = ( fGeom->GetOuterBoxThickness(1) - fGeom->GetUpperPlateThickness() ) / 2. ;
d15a28e7 573
92862013 574 gMC->Gspos("PTXW", 1, "EMCA", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 575
576 // ---
577 // --- Define Upper Polystyrene Foam Plate, place inside PTXW ---
578 // --- immediately below Foam Thermo Insulation Upper plate ---
579
580 // --- Upper Polystyrene Foam plate thickness ---
581
92862013 582 Float_t dpufp[3] ;
583 dpufp[0] = fGeom->GetTextolitBoxSize(0) / 2.0 ;
584 dpufp[1] = fGeom->GetSecondUpperPlateThickness() / 2. ;
585 dpufp[2] = fGeom->GetTextolitBoxSize(2) /2.0 ;
d15a28e7 586
92862013 587 gMC->Gsvolu("PUFP", "BOX ", idtmed[703], dpufp, 3) ;
d15a28e7 588
92862013 589 yO = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetSecondUpperPlateThickness() ) / 2.0 ;
d15a28e7 590
92862013 591 gMC->Gspos("PUFP", 1, "PTXW", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 592
593 // ---
594 // --- Define air-filled box, place inside PTXW ---
595 // --- Inner AIR volume dimensions ---
fe4da5cc 596
d15a28e7 597
92862013 598 Float_t dpair[3] ;
599 dpair[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ;
600 dpair[1] = fGeom->GetAirFilledBoxSize(1) / 2.0 ;
601 dpair[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ;
d15a28e7 602
92862013 603 gMC->Gsvolu("PAIR", "BOX ", idtmed[798], dpair, 3) ;
d15a28e7 604
92862013 605 yO = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetAirFilledBoxSize(1) ) / 2.0 - fGeom->GetSecondUpperPlateThickness() ;
d15a28e7 606
92862013 607 gMC->Gspos("PAIR", 1, "PTXW", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 608
609// --- Dimensions of PbWO4 crystal ---
610
92862013 611 Float_t xtlX = fGeom->GetCrystalSize(0) ;
612 Float_t xtlY = fGeom->GetCrystalSize(1) ;
613 Float_t xtlZ = fGeom->GetCrystalSize(2) ;
d15a28e7 614
92862013 615 Float_t dptcb[3] ;
616 dptcb[0] = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ;
617 dptcb[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0
d15a28e7 618 + fGeom->GetModuleBoxThickness() / 2.0 ;
92862013 619 dptcb[2] = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ;
d15a28e7 620
92862013 621 gMC->Gsvolu("PTCB", "BOX ", idtmed[706], dptcb, 3) ;
d15a28e7 622
92862013 623 yO = fGeom->GetAirFilledBoxSize(1) / 2.0 - dptcb[1]
d15a28e7 624 - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness()
625 - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() ) ;
626
92862013 627 gMC->Gspos("PTCB", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 628
629 // ---
630 // --- Define Crystal BLock filled with air, position it inside PTCB ---
92862013 631 Float_t dpcbl[3] ;
d15a28e7 632
92862013 633 dpcbl[0] = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 ;
634 dpcbl[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ;
635 dpcbl[2] = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 ;
d15a28e7 636
92862013 637 gMC->Gsvolu("PCBL", "BOX ", idtmed[798], dpcbl, 3) ;
d15a28e7 638
639 // --- Divide PCBL in X (phi) and Z directions --
640 gMC->Gsdvn("PROW", "PCBL", Int_t (fGeom->GetNPhi()), 1) ;
641 gMC->Gsdvn("PCEL", "PROW", Int_t (fGeom->GetNZ()), 3) ;
642
92862013 643 yO = -fGeom->GetModuleBoxThickness() / 2.0 ;
d15a28e7 644
92862013 645 gMC->Gspos("PCBL", 1, "PTCB", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 646
647 // ---
648 // --- Define STeel (actually, it's titanium) Cover volume, place inside PCEL
92862013 649 Float_t dpstc[3] ;
d15a28e7 650
92862013 651 dpstc[0] = ( xtlX + 2 * fGeom->GetCrystalWrapThickness() ) / 2.0 ;
652 dpstc[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ;
653 dpstc[2] = ( xtlZ + 2 * fGeom->GetCrystalWrapThickness() + 2 * fGeom->GetCrystalHolderThickness() ) / 2.0 ;
d15a28e7 654
92862013 655 gMC->Gsvolu("PSTC", "BOX ", idtmed[704], dpstc, 3) ;
d15a28e7 656
657 gMC->Gspos("PSTC", 1, "PCEL", 0.0, 0.0, 0.0, 0, "ONLY") ;
658
659 // ---
660 // --- Define Tyvek volume, place inside PSTC ---
92862013 661 Float_t dppap[3] ;
d15a28e7 662
92862013 663 dppap[0] = xtlX / 2.0 + fGeom->GetCrystalWrapThickness() ;
664 dppap[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 ;
665 dppap[2] = xtlZ / 2.0 + fGeom->GetCrystalWrapThickness() ;
d15a28e7 666
92862013 667 gMC->Gsvolu("PPAP", "BOX ", idtmed[702], dppap, 3) ;
d15a28e7 668
92862013 669 yO = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0
670 - ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ;
d15a28e7 671
92862013 672 gMC->Gspos("PPAP", 1, "PSTC", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 673
674 // ---
675 // --- Define PbWO4 crystal volume, place inside PPAP ---
92862013 676 Float_t dpxtl[3] ;
d15a28e7 677
92862013 678 dpxtl[0] = xtlX / 2.0 ;
679 dpxtl[1] = xtlY / 2.0 ;
680 dpxtl[2] = xtlZ / 2.0 ;
d15a28e7 681
92862013 682 gMC->Gsvolu("PXTL", "BOX ", idtmed[699], dpxtl, 3) ;
d15a28e7 683
92862013 684 yO = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 - xtlY / 2.0 - fGeom->GetCrystalWrapThickness() ;
d15a28e7 685
92862013 686 gMC->Gspos("PXTL", 1, "PPAP", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 687
688 // ---
689 // --- Define crystal support volume, place inside PPAP ---
92862013 690 Float_t dpsup[3] ;
d15a28e7 691
92862013 692 dpsup[0] = xtlX / 2.0 + fGeom->GetCrystalWrapThickness() ;
693 dpsup[1] = fGeom->GetCrystalSupportHeight() / 2.0 ;
694 dpsup[2] = xtlZ / 2.0 + fGeom->GetCrystalWrapThickness() ;
d15a28e7 695
92862013 696 gMC->Gsvolu("PSUP", "BOX ", idtmed[798], dpsup, 3) ;
d15a28e7 697
92862013 698 yO = fGeom->GetCrystalSupportHeight() / 2.0 - ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 ;
d15a28e7 699
92862013 700 gMC->Gspos("PSUP", 1, "PPAP", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 701
702 // ---
703 // --- Define PIN-diode volume and position it inside crystal support ---
704 // --- right behind PbWO4 crystal
705
706 // --- PIN-diode dimensions ---
707
708
92862013 709 Float_t dppin[3] ;
710 dppin[0] = fGeom->GetPinDiodeSize(0) / 2.0 ;
711 dppin[1] = fGeom->GetPinDiodeSize(1) / 2.0 ;
712 dppin[2] = fGeom->GetPinDiodeSize(2) / 2.0 ;
d15a28e7 713
92862013 714 gMC->Gsvolu("PPIN", "BOX ", idtmed[705], dppin, 3) ;
d15a28e7 715
92862013 716 yO = fGeom->GetCrystalSupportHeight() / 2.0 - fGeom->GetPinDiodeSize(1) / 2.0 ;
d15a28e7 717
92862013 718 gMC->Gspos("PPIN", 1, "PSUP", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 719
720 // ---
721 // --- Define Upper Cooling Panel, place it on top of PTCB ---
92862013 722 Float_t dpucp[3] ;
d15a28e7 723 // --- Upper Cooling Plate thickness ---
724
92862013 725 dpucp[0] = dptcb[0] ;
726 dpucp[1] = fGeom->GetUpperCoolingPlateThickness() ;
727 dpucp[2] = dptcb[2] ;
d15a28e7 728
92862013 729 gMC->Gsvolu("PUCP", "BOX ", idtmed[701], dpucp,3) ;
d15a28e7 730
92862013 731 yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetUpperCoolingPlateThickness() ) / 2.
d15a28e7 732 - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness()
733 - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() - fGeom->GetUpperCoolingPlateThickness() ) ;
734
92862013 735 gMC->Gspos("PUCP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 736
737 // ---
738 // --- Define Al Support Plate, position it inside PAIR ---
739 // --- right beneath PTCB ---
740 // --- Al Support Plate thickness ---
741
92862013 742 Float_t dpasp[3] ;
743 dpasp[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ;
744 dpasp[1] = fGeom->GetSupportPlateThickness() / 2.0 ;
745 dpasp[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ;
d15a28e7 746
92862013 747 gMC->Gsvolu("PASP", "BOX ", idtmed[701], dpasp, 3) ;
d15a28e7 748
92862013 749 yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetSupportPlateThickness() ) / 2.
d15a28e7 750 - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance()
92862013 751 - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 ) ;
d15a28e7 752
92862013 753 gMC->Gspos("PASP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 754
755 // ---
756 // --- Define Thermo Insulating Plate, position it inside PAIR ---
757 // --- right beneath PASP ---
758 // --- Lower Thermo Insulating Plate thickness ---
759
92862013 760 Float_t dptip[3] ;
761 dptip[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ;
762 dptip[1] = fGeom->GetLowerThermoPlateThickness() / 2.0 ;
763 dptip[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ;
d15a28e7 764
92862013 765 gMC->Gsvolu("PTIP", "BOX ", idtmed[706], dptip, 3) ;
d15a28e7 766
92862013 767 yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetLowerThermoPlateThickness() ) / 2.
d15a28e7 768 - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetUpperPlateThickness()
92862013 769 - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 + fGeom->GetSupportPlateThickness() ) ;
d15a28e7 770
92862013 771 gMC->Gspos("PTIP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 772
773 // ---
774 // --- Define Textolit Plate, position it inside PAIR ---
775 // --- right beneath PTIP ---
776 // --- Lower Textolit Plate thickness ---
777
92862013 778 Float_t dptxp[3] ;
779 dptxp[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ;
780 dptxp[1] = fGeom->GetLowerTextolitPlateThickness() / 2.0 ;
781 dptxp[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ;
d15a28e7 782
92862013 783 gMC->Gsvolu("PTXP", "BOX ", idtmed[707], dptxp, 3) ;
d15a28e7 784
92862013 785 yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetLowerTextolitPlateThickness() ) / 2.
d15a28e7 786 - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetUpperPlateThickness()
92862013 787 - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 + fGeom->GetSupportPlateThickness()
d15a28e7 788 + fGeom->GetLowerThermoPlateThickness() ) ;
789
92862013 790 gMC->Gspos("PTXP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 791
792}
793
794//____________________________________________________________________________
795void AliPHOSv0::CreateGeometryforPPSD()
fe4da5cc 796{
b2a60966 797 // Create the PHOS-PPSD geometry for GEANT
798
799 //BEGIN_HTML
800 /*
801 <H2>
802 Geant3 geometry tree of PHOS-PPSD in ALICE
803 </H2>
804 <P><CENTER>
805 <IMG Align=BOTTOM ALT="PPSD geant tree" SRC="../images/PPSDinAlice.gif">
806 </CENTER><P>
807 */
808 //END_HTML
809
810 // Get pointer to the array containing media indexes
92862013 811 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
d15a28e7 812
92862013 813 // The box containing all ppsd's for one PHOS module filled with air
814 Float_t ppsd[3] ;
815 ppsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ;
816 ppsd[1] = fGeom->GetPPSDBoxSize(1) / 2.0 ;
817 ppsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ;
fe4da5cc 818
92862013 819 gMC->Gsvolu("PPSD", "BOX ", idtmed[798], ppsd, 3) ;
d15a28e7 820
92862013 821 Float_t yO = fGeom->GetOuterBoxSize(1) / 2.0 ;
d15a28e7 822
92862013 823 gMC->Gspos("PPSD", 1, "PHOS", 0.0, yO, 0.0, 0, "ONLY") ;
d15a28e7 824
825 // Now we build a micromegas module
826 // The box containing the whole module filled with epoxy (FR4)
827
92862013 828 Float_t mppsd[3] ;
829 mppsd[0] = fGeom->GetPPSDModuleSize(0) / 2.0 ;
830 mppsd[1] = fGeom->GetPPSDModuleSize(1) / 2.0 ;
831 mppsd[2] = fGeom->GetPPSDModuleSize(2) / 2.0 ;
d15a28e7 832
92862013 833 gMC->Gsvolu("MPPS", "BOX ", idtmed[708], mppsd, 3) ;
d15a28e7 834
92862013 835 // Inside mppsd :
d15a28e7 836 // 1. The Top Lid made of epoxy (FR4)
837
92862013 838 Float_t tlppsd[3] ;
839 tlppsd[0] = fGeom->GetPPSDModuleSize(0) / 2.0 ;
840 tlppsd[1] = fGeom->GetLidThickness() / 2.0 ;
841 tlppsd[2] = fGeom->GetPPSDModuleSize(2) / 2.0 ;
d15a28e7 842
92862013 843 gMC->Gsvolu("TLPS", "BOX ", idtmed[708], tlppsd, 3) ;
d15a28e7 844
92862013 845 Float_t y0 = ( fGeom->GetMicromegas1Thickness() - fGeom->GetLidThickness() ) / 2. ;
d15a28e7 846
92862013 847 gMC->Gspos("TLPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 848
849 // 2. the upper panel made of composite material
850
92862013 851 Float_t upppsd[3] ;
852 upppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
853 upppsd[1] = fGeom->GetCompositeThickness() / 2.0 ;
854 upppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 855
92862013 856 gMC->Gsvolu("UPPS", "BOX ", idtmed[709], upppsd, 3) ;
d15a28e7 857
92862013 858 y0 = y0 - fGeom->GetLidThickness() / 2. - fGeom->GetCompositeThickness() / 2. ;
d15a28e7 859
92862013 860 gMC->Gspos("UPPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 861
862 // 3. the anode made of Copper
863
92862013 864 Float_t anppsd[3] ;
865 anppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
866 anppsd[1] = fGeom->GetAnodeThickness() / 2.0 ;
867 anppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 868
92862013 869 gMC->Gsvolu("ANPS", "BOX ", idtmed[710], anppsd, 3) ;
d15a28e7 870
92862013 871 y0 = y0 - fGeom->GetCompositeThickness() / 2. - fGeom->GetAnodeThickness() / 2. ;
d15a28e7 872
92862013 873 gMC->Gspos("ANPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 874
875 // 4. the conversion gap + avalanche gap filled with gas
876
92862013 877 Float_t ggppsd[3] ;
878 ggppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
879 ggppsd[1] = ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2.0 ;
880 ggppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 881
92862013 882 gMC->Gsvolu("GGPS", "BOX ", idtmed[715], ggppsd, 3) ;
d15a28e7 883
884 // --- Divide GGPP in X (phi) and Z directions --
885 gMC->Gsdvn("GROW", "GGPS", fGeom->GetNumberOfPadsPhi(), 1) ;
886 gMC->Gsdvn("GCEL", "GROW", fGeom->GetNumberOfPadsZ() , 3) ;
887
92862013 888 y0 = y0 - fGeom->GetAnodeThickness() / 2. - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. ;
d15a28e7 889
92862013 890 gMC->Gspos("GGPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 891
892
893 // 6. the cathode made of Copper
894
92862013 895 Float_t cappsd[3] ;
896 cappsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
897 cappsd[1] = fGeom->GetCathodeThickness() / 2.0 ;
898 cappsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 899
92862013 900 gMC->Gsvolu("CAPS", "BOX ", idtmed[710], cappsd, 3) ;
d15a28e7 901
92862013 902 y0 = y0 - ( fGeom->GetAvalancheGap() + fGeom->GetAvalancheGap() ) / 2. - fGeom->GetCathodeThickness() / 2. ;
d15a28e7 903
92862013 904 gMC->Gspos("CAPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 905
906 // 7. the printed circuit made of G10
907
92862013 908 Float_t pcppsd[3] ;
909 pcppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2,.0 ;
910 pcppsd[1] = fGeom->GetPCThickness() / 2.0 ;
911 pcppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 912
92862013 913 gMC->Gsvolu("PCPS", "BOX ", idtmed[711], cappsd, 3) ;
d15a28e7 914
92862013 915 y0 = y0 - fGeom->GetCathodeThickness() / 2. - fGeom->GetPCThickness() / 2. ;
d15a28e7 916
92862013 917 gMC->Gspos("PCPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 918
919 // 8. the lower panel made of composite material
920
92862013 921 Float_t lpppsd[3] ;
922 lpppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
923 lpppsd[1] = fGeom->GetCompositeThickness() / 2.0 ;
924 lpppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ;
d15a28e7 925
92862013 926 gMC->Gsvolu("LPPS", "BOX ", idtmed[709], lpppsd, 3) ;
d15a28e7 927
92862013 928 y0 = y0 - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ;
d15a28e7 929
92862013 930 gMC->Gspos("LPPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 931
92862013 932 // Position the fNumberOfModulesPhi x fNumberOfModulesZ modules (mppsd) inside PPSD to cover a PHOS module
d15a28e7 933 // the top and bottom one's (which are assumed identical) :
934
92862013 935 Float_t yt = ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas1Thickness() ) / 2. ;
936 Float_t yb = - ( fGeom->GetPPSDBoxSize(1) - fGeom->GetMicromegas2Thickness() ) / 2. ;
d15a28e7 937
92862013 938 Int_t copyNumbertop = 0 ;
939 Int_t copyNumberbot = fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() ;
d15a28e7 940
92862013 941 Float_t x = ( fGeom->GetPPSDBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. ;
d15a28e7 942
943 for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module
92862013 944 Float_t z = ( fGeom->GetPPSDBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. ;
d15a28e7 945
946 for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module
92862013 947 gMC->Gspos("MPPS", ++copyNumbertop, "PPSD", x, yt, z, 0, "ONLY") ;
948 gMC->Gspos("MPPS", ++copyNumberbot, "PPSD", x, yb, z, 0, "ONLY") ;
949 z = z - fGeom->GetPPSDModuleSize(2) ;
d15a28e7 950 } // end of Z module loop
92862013 951 x = x - fGeom->GetPPSDModuleSize(0) ;
d15a28e7 952 } // end of phi module loop
953
954 // The Lead converter between two air gaps
955 // 1. Upper air gap
956
92862013 957 Float_t uappsd[3] ;
958 uappsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ;
959 uappsd[1] = fGeom->GetMicro1ToLeadGap() / 2.0 ;
960 uappsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ;
d15a28e7 961
92862013 962 gMC->Gsvolu("UAPPSD", "BOX ", idtmed[798], uappsd, 3) ;
d15a28e7 963
92862013 964 y0 = ( fGeom->GetPPSDBoxSize(1) - 2 * fGeom->GetMicromegas1Thickness() - fGeom->GetMicro1ToLeadGap() ) / 2. ;
d15a28e7 965
92862013 966 gMC->Gspos("UAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 967
968 // 2. Lead converter
969
92862013 970 Float_t lcppsd[3] ;
971 lcppsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ;
972 lcppsd[1] = fGeom->GetLeadConverterThickness() / 2.0 ;
973 lcppsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ;
d15a28e7 974
92862013 975 gMC->Gsvolu("LCPPSD", "BOX ", idtmed[712], lcppsd, 3) ;
d15a28e7 976
92862013 977 y0 = y0 - fGeom->GetMicro1ToLeadGap() / 2. - fGeom->GetLeadConverterThickness() / 2. ;
d15a28e7 978
92862013 979 gMC->Gspos("LCPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 980
981 // 3. Lower air gap
982
92862013 983 Float_t lappsd[3] ;
984 lappsd[0] = fGeom->GetPPSDBoxSize(0) / 2.0 ;
985 lappsd[1] = fGeom->GetLeadToMicro2Gap() / 2.0 ;
986 lappsd[2] = fGeom->GetPPSDBoxSize(2) / 2.0 ;
d15a28e7 987
92862013 988 gMC->Gsvolu("LAPPSD", "BOX ", idtmed[798], lappsd, 3) ;
fe4da5cc 989
92862013 990 y0 = y0 - fGeom->GetLeadConverterThickness() / 2. - fGeom->GetLeadToMicro2Gap() / 2. ;
d15a28e7 991
92862013 992 gMC->Gspos("LAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ;
d15a28e7 993
fe4da5cc 994}
995
d15a28e7 996
997//____________________________________________________________________________
998void AliPHOSv0::Init(void)
999{
b2a60966 1000 // Just prints an information message
1001
d15a28e7 1002 Int_t i;
1003
1004 printf("\n");
1005 for(i=0;i<35;i++) printf("*");
1006 printf(" PHOS_INIT ");
1007 for(i=0;i<35;i++) printf("*");
1008 printf("\n");
1009
1010 // Here the PHOS initialisation code (if any!)
1011
1012 for(i=0;i<80;i++) printf("*");
1013 printf("\n");
1014
1015}
1016