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