Project
Loading...
Searching...
No Matches
GeometryBuilder.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 "MFTBase/Geometry.h"
17#include "MFTBase/GeometryTGeo.h"
22#include "MFTBase/HalfCone.h"
23#include "MFTBase/Barrel.h"
24#include "MFTBase/PatchPanel.h"
27
28#include "TGeoVolume.h"
29#include "TGeoManager.h"
30
31#include <fairlogger/Logger.h>
32
33using namespace o2::mft;
34
36
37//_____________________________________________________________________________
40{
41
42 Geometry* mftGeo = Geometry::instance();
43 auto& mftBaseParam = MFTBaseParam::Instance();
44 TGeoVolume* volMFT = new TGeoVolumeAssembly(GeometryTGeo::getMFTVolPattern());
45
46 LOG(info) << "GeometryBuilder::buildGeometry volume name = " << GeometryTGeo::getMFTVolPattern();
47
48 TGeoVolume* vALIC = gGeoManager->GetVolume("barrel");
49 if (!vALIC) {
50 LOG(fatal) << "Could not find the top volume";
51 }
52
53 LOG(debug) << "buildGeometry: "
54 << Form("gGeoManager name is %s title is %s", gGeoManager->GetName(), gGeoManager->GetTitle());
55
56 Segmentation* seg = mftGeo->getSegmentation();
57
58 for (int iHalf = 0; iHalf < 2; iHalf++) {
59 HalfSegmentation* halfSeg = seg->getHalf(iHalf);
60 auto* halfMFT = new HalfDetector(halfSeg);
61 volMFT->AddNode(halfMFT->getVolume(), iHalf, halfSeg->getTransformation());
62 delete halfMFT;
63 }
64
65 // Add the service, Barrel, etc
66 if (!mftBaseParam.minimal && mftBaseParam.buildPSU) {
67 auto* mPSU = new PowerSupplyUnit();
68 TGeoVolumeAssembly* mHalfPSU = mPSU->create();
69 TGeoTranslation* t_PSU = new TGeoTranslation("t_PSU", 0, 0.0, -72.6);
70 t_PSU->RegisterYourself();
71 auto* r_PSU = new TGeoRotation("rotation_PSU", 0.0, 0.0, 180.0);
72 auto* p_PSU = new TGeoCombiTrans(*t_PSU, *r_PSU);
73 volMFT->AddNode(mHalfPSU, 1, t_PSU);
74 volMFT->AddNode(mHalfPSU, 2, p_PSU);
75 }
76
77 if (!mftBaseParam.minimal && mftBaseParam.buildCone) {
78 auto* halfCone = new HalfCone();
79 TGeoVolumeAssembly* halfCone1 = halfCone->createHalfCone(0);
80 TGeoVolumeAssembly* halfCone2 = halfCone->createHalfCone(1);
81 volMFT->AddNode(halfCone1, 1);
82 volMFT->AddNode(halfCone2, 1);
83 }
84
85 if (!mftBaseParam.minimal && mftBaseParam.buildBarrel) {
86 //barrel services
87 auto* t_barrel0 = new TGeoTranslation("translation_barrel", 0.0, 0.0, -80.17);
88 auto* r_barrel0 = new TGeoRotation("rotation_barrel", 0.0, 0.0, 0.0);
89 auto* p_barrel0 = new TGeoCombiTrans(*t_barrel0, *r_barrel0);
90 auto* t_barrel1 = new TGeoTranslation("translation_barrel", 0.0, 0.0, -80.17);
91 auto* r_barrel1 = new TGeoRotation("rotation_barrel", 0.0, 0.0, 180.0);
92 auto* p_barrel1 = new TGeoCombiTrans(*t_barrel1, *r_barrel1);
93
94 auto* halfBarrel = new Barrel();
95 TGeoVolumeAssembly* halfBarrel0 = halfBarrel->createBarrel();
96 volMFT->AddNode(halfBarrel0, 1, p_barrel0);
97 TGeoVolumeAssembly* halfBarrel1 = halfBarrel->createBarrel();
98 volMFT->AddNode(halfBarrel1, 1, p_barrel1);
99 }
100
101 if (!mftBaseParam.minimal && mftBaseParam.buildPatchPanel) {
102 auto* t_patchpanel0 = new TGeoTranslation("translation_patchpanel", 0.0, 0., -81.5);
103 auto* r_patchpanel0 = new TGeoRotation("rotation_patchpanel", 0.0, 0.0, 0.0);
104 auto* p_patchpanel0 = new TGeoCombiTrans(*t_patchpanel0, *r_patchpanel0);
105 auto* t_patchpanel1 = new TGeoTranslation("translation_patchpanel", 0.0, 0., -81.5);
106 auto* r_patchpanel1 = new TGeoRotation("rotation_patchpanel", 0.0, 0.0, 180.0);
107 auto* p_patchpanel1 = new TGeoCombiTrans(*t_patchpanel1, *r_patchpanel1);
108
109 auto* halfpatchpanel = new PatchPanel();
110 TGeoVolumeAssembly* halfpatchpanel0 = halfpatchpanel->createPatchPanel();
111 TGeoVolumeAssembly* halfpatchpanel1 = halfpatchpanel->createPatchPanel();
112 volMFT->AddNode(halfpatchpanel0, 1, p_patchpanel0);
113 volMFT->AddNode(halfpatchpanel1, 1, p_patchpanel1);
114 }
115
116 vALIC->AddNode(volMFT, 0, new TGeoTranslation(0., 30., 0.));
117}
o2::mch::mapping::CathodeSegmentation seg
ClassImp(o2::mft::GeometryBuilder)
Class describing MFT Geometry Builder.
Class building geometry of one half of one MFT half-cone.
Class describing geometry of one half of the ALICE Muon Forward Tracker.
Segmentation class for each half of the ALICE Muon Forward Tracker.
Class handling both virtual segmentation and real volumes.
Class for the virtual segmentation of the ALICE Muon Forward Tracker.
MFT Patch Panel builder.
MFT heat exchanger builder.
std::ostringstream debug
void buildGeometry()
Build the MFT Geometry.
static const Char_t * getMFTVolPattern()
static Geometry * instance()
Singleton access.
Definition Geometry.cxx:98
Segmentation * getSegmentation() const
Returns pointer to the segmentation.
Definition Geometry.h:127
TGeoCombiTrans * getTransformation() const
Returns the Transformation Combining a Rotation followed by a Translation.
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"