Project
Loading...
Searching...
No Matches
Support.h
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
16
17#ifndef ALICEO2_MFT_SUPPORT_H_
18#define ALICEO2_MFT_SUPPORT_H_
19
20#include "TGeoVolume.h"
21#include "TGeoMatrix.h"
22#include "TGeoBBox.h"
23#include "TGeoCompositeShape.h"
24#include "TGeoTube.h"
25#include "TGeoCone.h"
26#include "TGeoArb8.h"
27#include "TGeoBoolNode.h"
28#include "TMath.h"
29#include "TGeoManager.h"
30#include "TGeoVolume.h"
31#include <fairlogger/Logger.h>
32
33namespace o2
34{
35namespace mft
36{
37
39{
40 using shapeParam = std::vector<Double_t>;
41 using diskBoxCuts = std::vector<shapeParam>;
42
43 public:
44 Support();
45 ~Support() = default;
46 TGeoVolumeAssembly* create(Int_t kHalf, Int_t disk);
47
48 private:
49 void initParameters();
50 TGeoVolumeAssembly* mHalfDisk;
51 TGeoMedium* mSupportMedium;
52
53 Double_t mSupThickness; //Support Thickness
54 Double_t mSupRad[5]; // Radius of each support disk
55 Double_t mDiskGap; //gap between half disks
56 Double_t mPhi0;
57 Double_t mPhi1;
58 Double_t mT_delta; //Excess to remove to avoid coplanar surfaces that causes visualization glitches
59 Double_t mRaisedBoxHeight;
60 Double_t mFixBoxHeight;
61 Double_t mOuterCut[5]; //Distance of external disk cuts (oposite to beam pipe)
62 // this is the y origin on Guillamet's PDF blueprints
63
64 std::vector<shapeParam> mDiskBoxCuts[5]; // Box cuts on each disk
65 std::vector<shapeParam> mDiskRaisedBoxes[5]; //Raised boxes for each halfDisk
66 std::vector<shapeParam> mDiskFixBoxes[5]; //Fix boxes for each halfDisk (can be merged with mDiskRaisedBoxes)
67
68 Int_t mNumberOfVoids[5]; //Number of Voids (big holes) in each halfDisk support
69 Double_t (*mVoidVert[5])[4][2]; //Vertexes of Voids
70
71 Int_t mNumberOfM2Holes[5]; // Number of M2 Holes in each halfDisk support
72 Double_t (*mM2Holes[5])[2]; // M2 holes on halfdisk 00 and 01
73 Double_t mRad_M2;
74 Double_t mHeight_M2;
75
76 // ==== D2 H7 - 4 mm deep (on higher surface)
77 Int_t mNumberOfD2_hHoles[5];
78 Double_t (*mD2_hHoles[5])[2]; // D2 holes on raisedBoxes on each disk
79 Double_t mRad_D2_h;
80 Double_t mHeight_D2_h;
81
82 // ==== D 6.5 mm holes
83 Double_t (*mD65Holes[5])[2]; // Positions of D6.5 mm holes on disk
84 Int_t mTwoHoles; // Number of D6.5 mm Holes in each halfDisk support
85 Double_t mD65; //Radius
86
87 // ==== D6 H7 (6 mm diameter holes)
88 Double_t (*mD6Holes[5])[2]; // Positions of D6 mm holes on disk
89 Double_t mD6; // Radius
90
91 // ==== D8 H7 (8 mm diameter holes)
92 Int_t mNumberOfD8_Holes[5];
93 Double_t mD8; // Radius
94 Double_t (*mD8Holes[5])[2]; // Positions of D8 mm holes on disk
95
96 // ==== D3 H7 (3 mm diameter holes)
97 Double_t mD3; // Radius
98 Double_t (*mD3Holes[5])[2]; // Positions of D8 mm holes on disk
99
100 // ==== M3 H7 (?? mm diameter holes)
101 Int_t mNumberOfM3Holes[5]; // Number of M2 Holes in each halfDisk support
102 Double_t mM3; // Radius TODO: Verify this!
103 Double_t (*mM3Holes[5])[2]; // Positions of M3 holes on disk
104
105 // ==== D4.5 H9
106 Double_t mD45; // Radius
107 Double_t (*mD45Holes[5])[2]; // Positions of D4.5 mm holes on disk
108
109 // ==== D2 H7 - 4 mm deep (on lower surface)
110 Double_t mD2; // Radius
111 Double_t mHeight_D2;
112 Double_t (*mD2Holes[5])[2]; // Positions of D2 mm holes on disk
113
114 ClassDefNV(Support, 1);
115};
116
117//Template to reduce boilerplate for TGeo boolean operations
118template <class L, class R, class T, class OP>
119auto compositeOperation(L&& left, R&& right, T&& translation, OP&& op)
120{
121 auto result = new OP(std::forward<L&&>(left), std::forward<R&&>(right), nullptr, std::forward<T&&>(translation));
122 return result;
123}
124
125//Template function to perform serial TGeo boolean operations
126template <class L, class SHAPE, class EL, class OP>
127auto serialBoolOperation(L&& base, SHAPE&& shape, EL&& elements, OP&& op)
128{
129 TGeoCompositeShape* localCS = nullptr;
130 SHAPE* localshape;
131 TGeoTranslation* localTranslation;
132
133 for (auto par : elements) {
134 //Info("SerialBoolOperation", Form("params: %f %f %f %f %f %f,", par[0], par[1], par[2], par[3], par[4], par[5]), 0, 0);
135
136 localshape = new SHAPE(par[0], par[1], par[2], nullptr);
137 localTranslation = new TGeoTranslation(par[3], par[4], par[5]);
138
139 //The first subtraction needs a shape, the base shape
140 if (!localCS) {
141 localCS = new TGeoCompositeShape(nullptr, compositeOperation(base, localshape, localTranslation, std::forward<OP>(op)));
142 } else {
143 localCS = new TGeoCompositeShape(nullptr, compositeOperation(localCS, localshape, localTranslation, std::forward<OP>(op)));
144 }
145 }
146 return localCS;
147}
148
149} // namespace mft
150} // namespace o2
151
152#endif
uint32_t op
TGeoVolumeAssembly * create(Int_t kHalf, Int_t disk)
Definition Support.cxx:59
~Support()=default
GLuint64EXT * result
Definition glcorearb.h:5662
GLdouble GLdouble right
Definition glcorearb.h:4077
auto compositeOperation(L &&left, R &&right, T &&translation, OP &&op)
Definition Support.h:119
auto serialBoolOperation(L &&base, SHAPE &&shape, EL &&elements, OP &&op)
Definition Support.h:127
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...