Project
Loading...
Searching...
No Matches
HalfDisk.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
20#include <fairlogger/Logger.h>
21
23#include "MFTBase/Ladder.h"
24#include "MFTBase/HalfDisk.h"
25#include "MFTBase/Geometry.h"
27#include "MFTBase/Support.h"
28#include "MFTBase/PCBSupport.h"
30
31using namespace o2::mft;
32
34
36
37//_____________________________________________________________________________
39 : TNamed(), mPCBSupport(nullptr), mSupport(nullptr), mHeatExchanger(nullptr), mHalfDiskVolume(nullptr), mSegmentation(nullptr)
40{
41}
42
44
45//_____________________________________________________________________________
47 : TNamed(segmentation->GetName(), segmentation->GetName()),
48 mPCBSupport(nullptr),
49 mSupport(nullptr),
50 mHeatExchanger(nullptr),
51 mSegmentation(segmentation)
52{
53 Geometry* mftGeom = Geometry::instance();
54 SetUniqueID(mSegmentation->GetUniqueID());
55 auto& mftBaseParam = MFTBaseParam::Instance();
56
57 LOG(debug1) << "HalfDisk " << Form("creating half-disk: %s Unique ID = %d ", GetName(), mSegmentation->GetUniqueID());
58
59 mHalfDiskVolume = new TGeoVolumeAssembly(GetName());
60
61 // Building Heat Exchanger Between faces
62 if (mftBaseParam.buildHeatExchanger) {
63 TGeoVolumeAssembly* heatExchangerVol = createHeatExchanger();
64 mHalfDiskVolume->AddNode(heatExchangerVol, 1);
65 }
66
67 if (!mftBaseParam.minimal && mftBaseParam.buildPCBSupports) {
68 // Building Support
69 TGeoVolumeAssembly* supportVol = createSupport();
70 mHalfDiskVolume->AddNode(supportVol, 1);
71 }
72
73 if (!mftBaseParam.minimal && mftBaseParam.buildPCBs) {
74 // Building PCB
75 TGeoVolumeAssembly* PCBVol = createPCBSupport();
76 mHalfDiskVolume->AddNode(PCBVol, 1);
77 }
78 // Building Front Face of the Half Disk
80}
81
82//_____________________________________________________________________________
84{
85
86 delete mSupport;
87 delete mHeatExchanger;
88}
89
92
93//_____________________________________________________________________________
94TGeoVolumeAssembly* HalfDisk::createHeatExchanger()
95{
96
97 Geometry* mftGeom = Geometry::instance();
98
99 mHeatExchanger = new HeatExchanger();
100
101 TGeoVolumeAssembly* vol =
102 mHeatExchanger->create(mftGeom->getHalfID(GetUniqueID()), mftGeom->getDiskID(GetUniqueID()));
103
104 return vol;
105}
106
107//_____________________________________________________________________________
108TGeoVolumeAssembly* HalfDisk::createSupport()
109{
110
111 Geometry* mftGeom = Geometry::instance();
112
113 mSupport = new Support();
114
115 TGeoVolumeAssembly* vol =
116 mSupport->create(mftGeom->getHalfID(GetUniqueID()), mftGeom->getDiskID(GetUniqueID()));
117
118 return vol;
119}
120
121//_____________________________________________________________________________
122TGeoVolumeAssembly* HalfDisk::createPCBSupport()
123{
124
125 Geometry* mftGeom = Geometry::instance();
126
127 mPCBSupport = new PCBSupport();
128
129 TGeoVolumeAssembly* vol =
130 mPCBSupport->create(mftGeom->getHalfID(GetUniqueID()), mftGeom->getDiskID(GetUniqueID()));
131
132 return vol;
133}
134
136
137//_____________________________________________________________________________
139{
140
141 LOG(debug1) << "CreateLadders: start building ladders";
142 for (Int_t iLadder = 0; iLadder < mSegmentation->getNLadders(); iLadder++) {
143
144 LadderSegmentation* ladderSeg = mSegmentation->getLadder(iLadder);
145 if (!ladderSeg) {
146 Fatal("CreateLadders", Form("No Segmentation found for ladder %d ", iLadder), 0, 0);
147 }
148 auto* ladder = new Ladder(ladderSeg);
149 TGeoVolume* ladVol = ladder->createVolume();
150
151 // Position of the center on the ladder volume in the ladder coordinate system
152 TGeoBBox* shape = (TGeoBBox*)ladVol->GetShape();
153 Double_t center[3];
154 center[0] = shape->GetDX();
155 center[1] = shape->GetDY();
156 center[2] = shape->GetDZ();
157
158 Double_t master[3];
159 ladderSeg->getTransformation()->LocalToMaster(center, master);
160 Int_t ladderId = Geometry::instance()->getLadderID(ladderSeg->GetUniqueID());
161
162 mHalfDiskVolume->AddNode(ladVol, ladderId, new TGeoCombiTrans(master[0], master[1], master[2], ladderSeg->getTransformation()->GetRotation()));
163
164 delete ladder;
165 }
166}
Class for the description of the structure of a half-disk.
ClassImp(o2::mft::HalfDisk)
Class building geometry of one half of an MFT disk.
MFT heat exchanger builder.
Class handling both virtual segmentation and real volumes.
Class building the Ladder geometry.
Class describing geometry of one MFT half-disk PCBsupport.
Class describing geometry of one MFT half-disk support.
Int_t getDiskID(UInt_t uniqueID) const
Returns Half-Disk ID based on Unique ID provided.
Definition Geometry.h:106
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 Geometry * instance()
Singleton access.
Definition Geometry.cxx:98
Int_t getNLadders() const
Get the number of Ladder on the Half-Disk.
LadderSegmentation * getLadder(Int_t iLadder)
Returns pointer to the ladder segmentation object.
HalfDisk()
Default constructor.
Definition HalfDisk.cxx:38
TGeoVolumeAssembly * createSupport()
Definition HalfDisk.cxx:108
void createLadders()
Build Ladders on the Half-disk.
Definition HalfDisk.cxx:138
~HalfDisk() override
Definition HalfDisk.cxx:83
TGeoVolumeAssembly * createHeatExchanger()
Build Heat exchanger.
Definition HalfDisk.cxx:94
TGeoVolumeAssembly * createPCBSupport()
Definition HalfDisk.cxx:122
TGeoVolumeAssembly * create(Int_t kHalf, Int_t disk)
TGeoVolumeAssembly * create(Int_t kHalf, Int_t disk)
TGeoVolumeAssembly * create(Int_t kHalf, Int_t disk)
Definition Support.cxx:59
TGeoCombiTrans * getTransformation() const
Returns the Transformation Combining a Rotation followed by a Translation.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"