AliRoot Core  da88d91 (da88d91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMFTHalfDisk.cxx
Go to the documentation of this file.
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 
16 // $Id$
17 
18 //-----------------------------------------------------------------------------
23 // author Raphael Tieulent <raphael.tieulent@cern.ch>
24 //-----------------------------------------------------------------------------
25 
26 #include "TGeoMatrix.h"
27 #include "TGeoManager.h"
28 #include "TGeoBBox.h"
29 
30 #include "AliMFTHalfDisk.h"
31 #include "AliMFTGeometry.h"
33 #include "AliMFTLadder.h"
34 #include "AliMFTHeatExchanger.h"
35 #include "AliMFTSupport.h"
36 
40 
41 //=============================================================================================
43 
45 TNamed(), fMFTSupport(NULL),fMFTHeatExchanger(NULL),fSegmentation(NULL){
46 
47 }
48 //=============================================================================================
50 AliMFTHalfDisk::AliMFTHalfDisk(AliMFTHalfDiskSegmentation *segmentation):TNamed(segmentation->GetName(),segmentation->GetName()),
51  fMFTSupport(NULL),
52  fMFTHeatExchanger(NULL),
53  fSegmentation(segmentation)
54 {
56  SetUniqueID(fSegmentation->GetUniqueID());
57 // Int_t halfDiskID = mftGeom->GetHalfDiskID(GetUniqueID());
58 // SetName(Form("D%d",halfDiskID));
59 
60  AliDebug(1,Form("Creating Half-Disk: %s Unique ID = %d ", GetName(), GetUniqueID()));
61 
62  fHalfDiskVolume = new TGeoVolumeAssembly(GetName());
63 
64  // Building MFT Support and PCBs
65  fMFTSupport = new AliMFTSupport();
66  TGeoVolumeAssembly * mftSupport = fMFTSupport->CreateVolume(mftGeom->GetHalfMFTID(GetUniqueID()),mftGeom->GetHalfDiskID(GetUniqueID()));
67  fHalfDiskVolume->AddNode(mftSupport,1);
68 
69  // Building Heat Exchanger Between faces
70  TGeoVolumeAssembly * heatExchangerVol = CreateHeatExchanger();
71  fHalfDiskVolume->AddNode(heatExchangerVol,1);
72 
73  // Building Front Face of the Half Disk
74  CreateLadders();
75 
76 }
77 
78 
79 //=============================================================================================
80 
82  delete fMFTSupport;
83  delete fMFTHeatExchanger;
84 }
85 
86 //=============================================================================================
89 
90 TGeoVolumeAssembly * AliMFTHalfDisk::CreateHeatExchanger(){
91 
93 
95 
96  TGeoVolumeAssembly * vol = fMFTHeatExchanger->Create(mftGeom->GetHalfMFTID(GetUniqueID()), mftGeom->GetHalfDiskID(GetUniqueID()));
97 
98  return vol;
99 
100 }
101 
102 //=============================================================================================
105  AliDebug(1,"Start Building Ladders" );
106  for (Int_t iLadder=0; iLadder<fSegmentation->GetNLadders(); iLadder++) {
107 
108  AliMFTLadderSegmentation * ladderSeg = fSegmentation->GetLadder(iLadder);
109  if(!ladderSeg) AliFatal(Form("No Segmentation found for ladder %d ",iLadder));
110  AliMFTLadder * ladder = new AliMFTLadder(ladderSeg);
111  TGeoVolume * ladVol = ladder->CreateVolume();
112 
113  // Position of the center on the ladder volume in the ladder coordinate system
114  TGeoBBox* shape = (TGeoBBox*)ladVol->GetShape();
115  Double_t center[3];
116  center[0] = shape->GetDX();
117  center[1] = shape->GetDY();
118  center[2] = shape->GetDZ();
119 
120  Double_t master[3];
121  ladderSeg->GetTransformation()->LocalToMaster(center, master);
122  Int_t ladderId = AliMFTGeometry::Instance()->GetLadderID(ladderSeg->GetUniqueID());
123 
124  fHalfDiskVolume->AddNode(ladVol,ladderId,new TGeoCombiTrans(master[0],master[1],master[2],ladderSeg->GetTransformation()->GetRotation()));
125 
126  delete ladder;
127  }
128 
129 }
Class for the description of the structure a Half-Disk.
TGeoVolumeAssembly * Create(Int_t kHalf, Int_t disk)
TGeoCombiTrans * GetTransformation() const
Returns the Transformation Combining a Rotation followed by a Translation.
Int_t GetLadderID(UInt_t uniqueID) const
Returns Ladder ID based on Unique ID provided.
Class building the Ladder geometry.
Definition: AliMFTLadder.h:24
AliMFTLadderSegmentation * GetLadder(Int_t iLadder)
Returns pointer to the ladder segmentation object.
TGeoVolume * CreateVolume()
Build the ladder.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Int_t GetNLadders() const
Get the number of Ladder on the Half-Disk.
AliMFTHeatExchanger * fMFTHeatExchanger
Heat Exchanger.
MFT Heat Exchanger builder.
AliMFTHalfDiskSegmentation * fSegmentation
Virtual Segmentation of the half-disk.
static AliMFTGeometry * Instance()
Retuns MFT Geometry singleton object.
AliMFTSupport * fMFTSupport
Disk Support.
Class Building geometry of one half of a MFT disk.
Description of the virtual segmentation of a ladder.
void CreateLadders()
Build Ladders on the Half-disk.
TGeoVolumeAssembly * CreateVolume(Int_t half, Int_t disk)
Int_t GetHalfMFTID(UInt_t uniqueID) const
Returns Half-MFT ID based on Unique ID provided.
Int_t GetHalfDiskID(UInt_t uniqueID) const
Returns Half-Disk ID based on Unique ID provided.
AliMFTHalfDisk()
Default constructor.
TGeoVolumeAssembly * CreateHeatExchanger()
Build Heat exchanger.
Class Handling both Virutal Segmentation and Real Volumes.
virtual ~AliMFTHalfDisk()
TGeoVolumeAssembly * fHalfDiskVolume
Half-Disk Volume.