AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMFTLadder.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 #include "TGeoTube.h"
30 
31 #include "AliLog.h"
32 
34 #include "AliMFTChipSegmentation.h"
35 #include "AliMFTFlex.h"
36 #include "AliMFTChip.h"
37 #include "AliMFTLadder.h"
38 #include "AliMFTConstants.h"
39 #include "AliMFTGeometry.h"
40 #include "TGeoCompositeShape.h"
41 #include "TGeoBoolNode.h"
42 
46 
47 // Units are cm
49 const Double_t AliMFTLadder::kLadderDeltaZ = AliMFTGeometry::kFlexThickness + AliMFTGeometry::kSensorThickness; // TODO: Adjust that value when adding glue layer
50 
51 //=============================================================================================
53 
55 TNamed(), fMFTFlex(NULL){
56 
57 
58 }
59 //=============================================================================================
61 AliMFTLadder::AliMFTLadder(AliMFTLadderSegmentation *segmentation):TNamed(segmentation->GetName(),segmentation->GetName()),fSegmentation(segmentation), fMFTFlex(NULL)
62 {
63  AliDebug(1, Form("Creating : %s", GetName()));
64  fLadderVolume = new TGeoVolumeAssembly(GetName());
65 
66 
67 }
68 
69 
70 //=============================================================================================
71 
73  delete fMFTFlex;
74 
75 }
76 
77 //=============================================================================================
80 
81  Int_t nChips = fSegmentation->GetNSensors();
82 
83  // Create the flex
87  TGeoVolumeAssembly * flexVol = fMFTFlex->MakeFlex(fSegmentation->GetNSensors(), kFlexLength);
88  fLadderVolume->AddNode(flexVol, 1, new TGeoTranslation(kFlexLength/2+AliMFTGeometry::kSensorSideOffset/2, kShiftY, AliMFTGeometry::kFlexThickness/2));
89 
90  // Create the CMOS Sensors
91  CreateSensors();
92 
93  return fLadderVolume;
94 
95 }
96 
97 
98 
99 //=============================================================================================
102  // Create Shapes
103 
104  // The sensor part
106 
107  // The readout part
109 
110  // Get Mediums
111  TGeoMedium *medSensorSi = gGeoManager->GetMedium("MFT_Si$");
112  TGeoMedium *medReadoutSi = gGeoManager->GetMedium("MFT_Readout$");
113  TGeoMedium *medAir = gGeoManager->GetMedium("MFT_Air$");
114  TGeoMedium *kMedGlue = gGeoManager->GetMedium("MFT_Epoxy$"); // we assume epoxy glue, the silicone glue has to be defined
115 
116 
118 
119  TString namePrefix = Form("MFT_S_%d_%d_%d",
120  mftGeom->GetHalfMFTID(fSegmentation->GetUniqueID()),
121  mftGeom->GetHalfDiskID(fSegmentation->GetUniqueID()),
122  mftGeom->GetLadderID(fSegmentation->GetUniqueID()) );
123 
124  TGeoVolume * chipVol = gGeoManager->MakeBox(namePrefix.Data(), medAir,AliMFTGeometry::kSensorLength/2.,AliMFTGeometry::kSensorHeight/2., AliMFTGeometry::kSensorThickness/2. );
125  TGeoVolume * glue = gGeoManager->MakeBox(namePrefix.Data(), kMedGlue, (AliMFTGeometry::kSensorLength-AliMFTGeometry::kGlueEdge)/2.,
127  glue->SetVisibility(kTRUE);
128  glue->SetLineColor(kRed-10);
129  glue->SetLineWidth(1);
130  glue->SetFillColor(glue->GetLineColor());
131  glue->SetFillStyle(4000); // 0% transparent
132 
133  // Create Volumes
134  // Chip Volume
135  chipVol->SetVisibility(kTRUE);
136 
137  // The sensor Volume
138  TGeoVolume *sensorVol = new TGeoVolume("MFTSensor", sensor, medSensorSi);
139  sensorVol->SetVisibility(kTRUE);
140  sensorVol->SetLineColor(kGreen+1);
141  sensorVol->SetLineWidth(1);
142  sensorVol->SetFillColor(sensorVol->GetLineColor());
143  sensorVol->SetFillStyle(4000); // 0% transparent
144  if(!mftGeom->GetSensorVolumeID()){
145  mftGeom->SetSensorVolumeID(sensorVol->GetNumber());
146  } else if (mftGeom->GetSensorVolumeID() != sensorVol->GetNumber()){
147  AliFatal(Form("Different Sensor VOLUME ID in TGeo !!!!"));
148  }
149 
150  // The Readout Volume
151  TGeoVolume *readoutVol = new TGeoVolume("Readout", readout, medReadoutSi);
152  readoutVol->SetVisibility(kTRUE);
153  readoutVol->SetLineColor(kRed-6);
154  readoutVol->SetLineWidth(1);
155  readoutVol->SetFillColor(readoutVol->GetLineColor());
156  readoutVol->SetFillStyle(4000); // 0% transparent
157 
158  // Building up the chip
159  chipVol->AddNode(readoutVol, 1, new TGeoTranslation(0.,-AliMFTGeometry::kSensorHeight/2.+readout->GetDY(), 0.));
160  chipVol->AddNode(sensorVol, 1, new TGeoTranslation( 0., AliMFTGeometry::kSensorHeight/2.-sensor->GetDY(),0.));
161 
162  for (int ichip =0; ichip<fSegmentation->GetNSensors(); ichip++) {
163  AliMFTChipSegmentation * chipSeg = fSegmentation->GetSensor(ichip);
164  TGeoCombiTrans * chipPos = chipSeg->GetTransformation();
165  TGeoCombiTrans * chipPosGlue = chipSeg->GetTransformation();
166  // Position of the center on the chip in the chip coordinate system
169  Double_t master[3];
170  Double_t masterglue[3];
171  chipPos->LocalToMaster(pos, master);
172  chipPosGlue->LocalToMaster(posglue, masterglue);
173 
174  TGeoBBox* shape = (TGeoBBox*)fLadderVolume->GetShape();
175  master[0] -= shape->GetDX();
176  master[1] -= shape->GetDY();
177  master[2] -= shape->GetDZ();
178 
179  masterglue[0] -= shape->GetDX();
180  masterglue[1] -= shape->GetDY();
181  masterglue[2] -= shape->GetDZ();
182 
183  AliDebug(1,Form("Adding Chip %s_%d ",namePrefix.Data(),ichip));
184  fLadderVolume->AddNode(chipVol, ichip, new TGeoTranslation(master[0],master[1],master[2]));
185  fLadderVolume->AddNode(glue, ichip, new TGeoTranslation(masterglue[0],masterglue[1],masterglue[2]));
186 
187  }
188 
189 }
virtual ~AliMFTLadder()
static const Double_t kGlueEdge
TGeoCombiTrans * GetTransformation() const
Returns the Transformation Combining a Rotation followed by a Translation.
Chip Segmentation description.
Int_t GetLadderID(UInt_t uniqueID) const
Returns Ladder ID based on Unique ID provided.
static const Double_t kLadderOffsetToEnd
Offset of sensor compare to ladder connector edge.
Class building the Ladder geometry.
Definition: AliMFTLadder.h:24
static const Double_t kSensorLength
CMOS Sensor Length.
static const Double_t kLadderDeltaZ
Ladder size along Z direction (thickness)
Definition: AliMFTLadder.h:39
static const Double_t kSensorInterspace
Interspace between 2 sensors on a ladder.
static const Double_t kLadderDeltaY
Ladder size along Y direction (height)
Definition: AliMFTLadder.h:38
TGeoVolume * CreateVolume()
Build the ladder.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
TGeoVolumeAssembly * MakeFlex(Int_t nbsensors, Double_t length)
Definition: AliMFTFlex.cxx:62
static const Double_t kSensorSideOffset
Offset of sensor compare to ladder edge (close to the beam pipe)
static const Double_t kSensorActiveHeight
CMOS Sensor Active height.
static const Double_t kSensorTopOffset
Offset of sensor compare to ladder top edge.
Int_t GetNSensors() const
Returns number of Sensor on the ladder.
AliMFTChipSegmentation * GetSensor(Int_t sensor) const
static AliMFTGeometry * Instance()
Retuns MFT Geometry singleton object.
AliMFTLadder()
Default constructor.
void CreateSensors()
Build the sensors.
AliMFTLadderSegmentation * fSegmentation
Virtual Segmentation object of the ladder.
Definition: AliMFTLadder.h:40
Description of the virtual segmentation of a ladder.
static const Double_t kFlexThickness
Flex Thickness.
static const Double_t kSensorHeight
CMOS Sensor Height.
static const Double_t kSensorThickness
CMOS Sensor Thickness.
TGeoVolumeAssembly * fLadderVolume
Pointer to the Volume holding the ladder geometry.
Definition: AliMFTLadder.h:42
static const Double_t kGlueThickness
void SetSensorVolumeID(Int_t val)
Set the TGeo ID of the volume describing the sensors.
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.
static const Double_t kFlexHeight
Flex Height.
AliMFTFlex * fMFTFlex
Flex object (.
Definition: AliMFTLadder.h:41
Class Handling both Virutal Segmentation and Real Volumes.
Int_t GetSensorVolumeID() const
Returns TGeo ID of the volume describing the sensors.