Project
Loading...
Searching...
No Matches
Ladder.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#include "TGeoMatrix.h"
17#include "TGeoManager.h"
18#include "TGeoBBox.h"
19#include "TGeoTube.h"
20#include "TGeoCompositeShape.h"
21#include "TGeoBoolNode.h"
22
23#include <fairlogger/Logger.h>
24
27
30#include "MFTBase/Flex.h"
31#include "MFTBase/Ladder.h"
32#include "MFTBase/Geometry.h"
34
35using namespace o2::itsmft;
36using namespace o2::mft;
38
40
41// Units are cm
42const Double_t Ladder::sLadderDeltaY = SegmentationAlpide::SensorSizeRows + 2. * Geometry::sSensorTopOffset;
43const Double_t Ladder::sLadderDeltaZ =
44 Geometry::sFlexThickness + Geometry::sChipThickness; // TODO: Adjust that value when adding glue layer
45
47
48//_____________________________________________________________________________
49Ladder::Ladder() : TNamed(), mSegmentation(nullptr), mFlex(nullptr), mLadderVolume(nullptr) {}
50
52
53//_____________________________________________________________________________
55 : TNamed(segmentation->GetName(), segmentation->GetName()), mSegmentation(segmentation), mFlex(nullptr)
56{
57
58 LOG(debug1) << "Ladder " << Form("creating : %s", GetName());
59 mLadderVolume = new TGeoVolumeAssembly(GetName());
60}
61
62//_____________________________________________________________________________
63Ladder::~Ladder() { delete mFlex; }
64
66
67//_____________________________________________________________________________
69{
70 Int_t nChips = mSegmentation->getNSensors();
71
72 // Create the flex
73 mFlex = new Flex(mSegmentation);
74 Double_t flexLength = nChips * (SegmentationAlpide::SensorSizeCols + Geometry::sSensorInterspace) +
76 Double_t shiftY =
78
79 auto& mftBaseParam = MFTBaseParam::Instance();
80 if (mftBaseParam.buildFlex) {
81
82 // to perform the alignment
83 Double_t shiftFlex = 0.0;
84 if (mftBaseParam.buildAlignment) {
85 shiftFlex = 0.2;
86 }
87 TGeoVolumeAssembly* flexVol = mFlex->makeFlex(mSegmentation->getNSensors(), flexLength);
88 mLadderVolume->AddNode(flexVol, 1, new TGeoTranslation(flexLength / 2 + Geometry::sSensorSideOffset / 2, shiftY, Geometry::sFlexThickness / 2 - 2 * (Geometry::sKaptonOnCarbonThickness + Geometry::sKaptonGlueThickness) - shiftFlex));
89 }
90 // Create the CMOS Sensors
92
93 return mLadderVolume;
94}
95
97
98//_____________________________________________________________________________
100{
101 auto& mftBaseParam = MFTBaseParam::Instance();
102
103 Geometry* mftGeom = Geometry::instance();
104
105 // Create Shapes
106
107 // sensor = sensitive volume
108 TString namePrefixS = "MFTSensor";
109
110 // chip = sensor + readout
111 TString namePrefixC =
112 Form("MFT_C_%d_%d_%d", mftGeom->getHalfID(mSegmentation->GetUniqueID()),
113 mftGeom->getDiskID(mSegmentation->GetUniqueID()), mftGeom->getLadderID(mSegmentation->GetUniqueID()));
114
115 // the MFT glue
116 TString namePrefixG =
117 Form("MFT_G_%d_%d_%d", mftGeom->getHalfID(mSegmentation->GetUniqueID()),
118 mftGeom->getDiskID(mSegmentation->GetUniqueID()), mftGeom->getLadderID(mSegmentation->GetUniqueID()));
119
120 TGeoMedium* kMedGlue = gGeoManager->GetMedium("MFT_SE4445$");
121
122 TGeoVolume* glue = gGeoManager->MakeBox(
123 namePrefixG.Data(), kMedGlue, (SegmentationAlpide::SensorSizeCols - Geometry::sGlueEdge) / 2.,
125 glue->SetVisibility(kTRUE);
126 glue->SetLineColor(kRed - 10);
127 glue->SetLineWidth(1);
128 glue->SetFillColor(glue->GetLineColor());
129 glue->SetFillStyle(4000); // 0% transparent
130
131 // common with ITS
133 namePrefixC, namePrefixS, kFALSE);
134
135 // chipVol->Print();
136
137 for (int ichip = 0; ichip < mSegmentation->getNSensors(); ichip++) {
138
139 ChipSegmentation* chipSeg = mSegmentation->getSensor(ichip);
140 TGeoCombiTrans* chipPos = chipSeg->getTransformation();
141 TGeoCombiTrans* chipPosGlue = chipSeg->getTransformation();
142
143 // Position of the center on the chip in the chip coordinate system
146
147 // To perform chips alignment --> shift of the chip glue layer
148 Double_t shiftGlue = 0.0;
149 if (mftBaseParam.buildAlignment) {
150 shiftGlue = 0.19;
151 }
154
155 Double_t master[3];
156 Double_t masterglue[3];
157 chipPos->LocalToMaster(pos, master);
158 chipPosGlue->LocalToMaster(posglue, masterglue);
159
160 TGeoBBox* shape = (TGeoBBox*)mLadderVolume->GetShape();
161 master[0] -= shape->GetDX();
162 master[1] -= shape->GetDY();
163 master[2] -= shape->GetDZ();
164
165 masterglue[0] -= shape->GetDX();
166 masterglue[1] -= shape->GetDY();
167 masterglue[2] -= shape->GetDZ();
168
169 LOG(debug1) << "CreateSensors " << Form("adding chip %s_%d ", namePrefixS.Data(), ichip);
170 // chipPos->Print();
171
172 TGeoTranslation* trans = new TGeoTranslation(master[0], master[1], master[2]);
173 TGeoHMatrix* final = new TGeoHMatrix((*trans) * (Geometry::sTransMFT2ITS).Inverse());
174 mLadderVolume->AddNode(chipVol, ichip, final);
175 mLadderVolume->AddNode(glue, ichip, new TGeoTranslation(masterglue[0], masterglue[1], masterglue[2]));
176 }
177}
Creates an ALPIDE chip in simulation.
Chip (sensor) segmentation description.
Flex (Printed Cabled Board) class for ALICE MFT upgrade.
Class handling both virtual segmentation and real volumes.
Description of the virtual segmentation of a ladder.
ClassImp(o2::mft::Ladder)
Class building the Ladder geometry.
uint16_t pos
Definition RawData.h:3
Definition of the SegmentationAlpide class.
static TGeoVolume * createChip(Double_t yc, Double_t ys, char const *chipName="AlpideChip", char const *sensName="AlpideSensor", Bool_t dummy=kFALSE, const TGeoManager *mgr=gGeoManager)
static constexpr float SensorSizeCols
static constexpr float SensorSizeRows
TGeoVolumeAssembly * makeFlex(Int_t nbsensors, Double_t length)
Definition Flex.cxx:56
static const Double_t sChipThickness
CMOS chip thickness.
Definition Geometry.h:49
static const Double_t sSensorTopOffset
Offset of sensor compare to ladder top edge.
Definition Geometry.h:53
static const Double_t sSensorSideOffset
Offset of sensor compare to ladder edge (close to the beam pipe)
Definition Geometry.h:52
Int_t getDiskID(UInt_t uniqueID) const
Returns Half-Disk ID based on Unique ID provided.
Definition Geometry.h:106
static const Double_t sFlexThickness
Flex Thickness.
Definition Geometry.h:61
static const Double_t sKaptonGlueThickness
Definition Geometry.h:82
Int_t getLadderID(UInt_t uniqueID) const
Returns Ladder ID based on Unique ID provided.
Definition Geometry.h:112
Int_t getHalfID(UInt_t uniqueID) const
Returns Half-MFT ID based on Unique ID provided.
Definition Geometry.h:103
static const Double_t sGlueThickness
Definition Geometry.h:76
static Geometry * instance()
Singleton access.
Definition Geometry.cxx:98
static const Double_t sSensorInterspace
Interspace between 2 sensors on a ladder.
Definition Geometry.h:51
static const Double_t sGlueEdge
Definition Geometry.h:77
static TGeoHMatrix sTransMFT2ITS
transformation due to the different conventions
Definition Geometry.h:85
static const Double_t sSensorThickness
CMOS sensor part thickness.
Definition Geometry.h:48
static const Double_t sFlexHeight
Flex Height.
Definition Geometry.h:56
static const Double_t sKaptonOnCarbonThickness
Definition Geometry.h:81
static const Double_t sLadderOffsetToEnd
Offset of sensor compare to ladder connector edge.
Definition Geometry.h:54
Int_t getNSensors() const
Returns number of Sensor on the ladder.
ChipSegmentation * getSensor(Int_t sensor) const
Ladder()
Default constructor.
Definition Ladder.cxx:49
void createSensors()
Build the sensors.
Definition Ladder.cxx:99
~Ladder() override
Definition Ladder.cxx:63
TGeoVolume * createVolume()
Build the ladder.
Definition Ladder.cxx:68
TGeoCombiTrans * getTransformation() const
Returns the Transformation Combining a Rotation followed by a Translation.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"