-
- // create the getter not needed
- //AliPHOSGetter::GetInstance(gDirectory->GetName(), 0);
-
-}
-
-//____________________________________________________________________________
-void AliPHOSv0::BuildGeometry()
-{
- // Build the PHOS geometry for the ROOT display
- //BEGIN_HTML
- /*
- <H2>
- PHOS in ALICE displayed by root
- </H2>
- <UL>
- <LI> All Views
- <P>
- <CENTER>
- <IMG Align=BOTTOM ALT="All Views" SRC="../images/AliPHOSv0AllViews.gif">
- </CENTER></P></LI>
- <LI> Front View
- <P>
- <CENTER>
- <IMG Align=BOTTOM ALT="Front View" SRC="../images/AliPHOSv0FrontView.gif">
- </CENTER></P></LI>
- <LI> 3D View 1
- <P>
- <CENTER>
- <IMG Align=BOTTOM ALT="3D View 1" SRC="../images/AliPHOSv03DView1.gif">
- </CENTER></P></LI>
- <LI> 3D View 2
- <P>
- <CENTER>
- <IMG Align=BOTTOM ALT="3D View 2" SRC="../images/AliPHOSv03DView2.gif">
- </CENTER></P></LI>
- </UL>
- */
- //END_HTML
-
- this->BuildGeometryforEMC() ;
- this->BuildGeometryforCPV() ;
-
-}
-
-//____________________________________________________________________________
-void AliPHOSv0:: BuildGeometryforEMC(void)
-{
- // Build the PHOS-EMC geometry for the ROOT display
-
- const Int_t kColorPHOS = kRed ;
- const Int_t kColorXTAL = kBlue ;
-
- Double_t const kRADDEG = 180.0 / kPI ;
-
- AliPHOSGeometry * geom = GetGeometry() ;
- AliPHOSEMCAGeometry * emcg = geom->GetEMCAGeometry() ;
- Float_t * boxparams = emcg->GetEMCParams() ;
-
- new TTRD1("OuterBox", "PHOS box", "void",boxparams[0],boxparams[1],boxparams[2], boxparams[3] );
-
-
- // Crystals Box
-
- Float_t * cribox = emcg->GetInnerThermoHalfSize() ;
- new TBRIK( "CrystalsBox", "PHOS crystals box", "void", cribox[0], cribox[2], cribox[1] ) ;
-
- // position PHOS into ALICE
-
- Float_t r = geom->GetIPtoOuterCoverDistance() + boxparams[3] ;
- Int_t number = 988 ;
- TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
-
- char * nodename = new char[20] ;
- char * rotname = new char[20] ;
-
- new TRotMatrix("cribox", "cribox", 90, 0, 90, 90, 0, 0);
-
- for( Int_t i = 1; i <= geom->GetNModules(); i++ ) {
-
- Float_t angle = geom->GetPHOSAngle(i) ;
- sprintf(rotname, "%s%d", "rot", number++) ;
- new TRotMatrix(rotname, rotname, 90, angle, 0, 0, 90, 270 + angle);
-
- top->cd();
- sprintf(nodename,"%s%d", "Module", i) ;
- Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
- Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
- TNode * outerboxnode = new TNode(nodename, nodename, "OuterBox", x, y, 0, rotname ) ;
- outerboxnode->SetLineColor(kColorPHOS) ;
- fNodes->Add(outerboxnode) ;
- outerboxnode->cd() ;
-
- Float_t z = -boxparams[3] - geom->GetIPtoOuterCoverDistance() +
- cribox[1] + geom->GetIPtoCrystalSurface() ;
- TNode * crystalsboxnode = new TNode(nodename, nodename, "CrystalsBox", 0, 0, z) ;
- crystalsboxnode->SetLineColor(kColorXTAL) ;
- fNodes->Add(crystalsboxnode) ;
- }
-
- delete[] rotname ;
- delete[] nodename ;
-}
-
-
-//____________________________________________________________________________
-void AliPHOSv0:: BuildGeometryforCPV(void)
-{
- // Build the PHOS-CPV geometry for the ROOT display
- // Author: Yuri Kharlov 11 September 2000
- //
- //BEGIN_HTML
- /*
- <H2>
- CPV displayed by root
- </H2>
- <table width=700>
-
- <tr>
- <td>CPV perspective view</td>
- <td>CPV front view </td>
- </tr>
-
- <tr>
- <td> <img height=300 width=290 src="../images/CPVRootPersp.gif"> </td>
- <td> <img height=300 width=290 src="../images/CPVRootFront.gif"> </td>
- </tr>
-
- </table>
-
- */
- //END_HTML
-
- const Double_t kRADDEG = 180.0 / kPI ;
- const Int_t kColorCPV = kGreen ;
- const Int_t kColorFrame = kYellow ;
- const Int_t kColorGassiplex = kRed;
- const Int_t kColorPCB = kCyan;
-
- AliPHOSGeometry * geom = GetGeometry() ;
-
- // Box for a full PHOS module
-
- new TBRIK ("CPVBox", "CPV box", "void", geom->GetCPVBoxSize(0)/2,
- geom->GetCPVBoxSize(1)/2,
- geom->GetCPVBoxSize(2)/2 );
- new TBRIK ("CPVFrameLR", "CPV frame Left-Right", "void", geom->GetCPVFrameSize(0)/2,
- geom->GetCPVFrameSize(1)/2,
- geom->GetCPVBoxSize(2)/2 );
- new TBRIK ("CPVFrameUD", "CPV frame Up-Down", "void", geom->GetCPVBoxSize(0)/2 - geom->GetCPVFrameSize(0),
- geom->GetCPVFrameSize(1)/2,
- geom->GetCPVFrameSize(2)/2);
- new TBRIK ("CPVPCB", "CPV PCB", "void", geom->GetCPVActiveSize(0)/2,
- geom->GetCPVTextoliteThickness()/2,
- geom->GetCPVActiveSize(1)/2);
- new TBRIK ("CPVGassiplex", "CPV Gassiplex PCB", "void", geom->GetGassiplexChipSize(0)/2,
- geom->GetGassiplexChipSize(1)/2,
- geom->GetGassiplexChipSize(2)/2);
-
- // position CPV into ALICE
-
- char * nodename = new char[25] ;
- char * rotname = new char[25] ;
-
- Float_t r = geom->GetIPtoCPVDistance() + geom->GetCPVBoxSize(1) / 2.0 ;
- Int_t number = 988 ;
- TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
-
- Int_t lastModule = 0 ;
- lastModule = geom->GetNModules();
-
- for( Int_t i = 1; i <= lastModule; i++ ) { // the number of PHOS modules
-
- // One CPV module
-
- Float_t angle = geom->GetPHOSAngle(i) ;
- sprintf(rotname, "%s%d", "rotg", number+i) ;
- new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0);
- top->cd();
- sprintf(nodename, "%s%d", "CPVModule", i) ;
- Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
- Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
- Float_t z;
- TNode * cpvBoxNode = new TNode(nodename , nodename ,"CPVBox", x, y, 0, rotname ) ;
- cpvBoxNode->SetLineColor(kColorCPV) ;
- fNodes->Add(cpvBoxNode) ;
- cpvBoxNode->cd() ;
-
- // inside each CPV box:
-
- // Frame around CPV
- Int_t j;
- for (j=0; j<=1; j++) {
- sprintf(nodename, "CPVModule%d Frame%d", i, j+1) ;
- x = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(0) - geom->GetCPVFrameSize(0)) / 2;
- TNode * cpvFrameNode = new TNode(nodename , nodename ,"CPVFrameLR", x, 0, 0) ;
- cpvFrameNode->SetLineColor(kColorFrame) ;
- fNodes->Add(cpvFrameNode) ;
-
- sprintf(nodename, "CPVModule%d Frame%d", i, j+3) ;
- z = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(2) - geom->GetCPVFrameSize(2)) / 2;
- cpvFrameNode = new TNode(nodename , nodename ,"CPVFrameUD", 0, 0, z) ;
- cpvFrameNode->SetLineColor(kColorFrame) ;
- fNodes->Add(cpvFrameNode) ;
- }
-
- // 4 printed circuit boards
- for (j=0; j<4; j++) {
- sprintf(nodename, "CPVModule%d PCB%d", i, j+1) ;
- y = geom->GetCPVFrameSize(1) / 2 - geom->GetFTPosition(j) + geom->GetCPVTextoliteThickness()/2;
- TNode * cpvPCBNode = new TNode(nodename , nodename ,"CPVPCB", 0, y, 0) ;
- cpvPCBNode->SetLineColor(kColorPCB) ;
- fNodes->Add(cpvPCBNode) ;
- }
-
- // Gassiplex chips
- Float_t xStep = geom->GetCPVActiveSize(0) / (geom->GetNumberOfCPVChipsPhi() + 1);
- Float_t zStep = geom->GetCPVActiveSize(1) / (geom->GetNumberOfCPVChipsZ() + 1);
- y = geom->GetCPVFrameSize(1)/2 - geom->GetFTPosition(0) +
- geom->GetCPVTextoliteThickness() / 2 + geom->GetGassiplexChipSize(1) / 2 + 0.1;
- for (Int_t ix=0; ix<geom->GetNumberOfCPVChipsPhi(); ix++) {
- x = xStep * (ix+1) - geom->GetCPVActiveSize(0)/2;
- for (Int_t iz=0; iz<geom->GetNumberOfCPVChipsZ(); iz++) {
- z = zStep * (iz+1) - geom->GetCPVActiveSize(1)/2;
- sprintf(nodename, "CPVModule%d Chip(%dx%d)", i, ix+1,iz+1) ;
- TNode * cpvGassiplexNode = new TNode(nodename , nodename ,"CPVGassiplex", x, y, z) ;
- cpvGassiplexNode->SetLineColor(kColorGassiplex) ;
- fNodes->Add(cpvGassiplexNode) ;
- }
- }
-
- } // PHOS modules
-
- delete[] rotname ;
- delete[] nodename ;