Project
Loading...
Searching...
No Matches
ITS3Layer.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
15
16#ifndef ALICEO2_ITS3_ITS3LAYER_H
17#define ALICEO2_ITS3_ITS3LAYER_H
18
19#include <TGeoCompositeShape.h>
20#include <TGeoTube.h>
21#include <TGeoVolume.h>
22
23#include "ITS3Base/SpecsV2.h"
24
25namespace o2::its3
26{
27
30{
31 // The hierarchy will be the following:
32 // ITS2 -> ITS3
33 // ---------------------------------
34 // Sensor PixelArray
35 // Chip Tile
36 // Module RSU
37 // HalfStave Segment
38 // Stave Chip
39 // HalfBarrel CarbonForm
40 // Layer Layer
41 public:
42 enum class BuildLevel : uint8_t {
43 kPixelArray = 0,
44 kTile,
45 kRSU,
47 kChip,
49 kLayer,
50 kAll,
51 };
52 static constexpr std::array<std::string_view, static_cast<size_t>(BuildLevel::kAll)> mNames{"PixelArray", "Tile", "RSU", "Segment", "CarbonForm", "Chip", "Layer"};
53 static std::string_view getName(BuildLevel b)
54 {
55 return mNames[static_cast<size_t>((b == BuildLevel::kAll) ? BuildLevel::kLayer : b)];
56 }
57
58 explicit ITS3Layer(int layer = 0) : mNLayer(layer),
59 mR(o2::its3::constants::radii[mNLayer]),
60 mRmin(o2::its3::constants::radiiInner[mNLayer]),
61 mRmax(o2::its3::constants::radiiOuter[mNLayer]) {}
62
63 explicit ITS3Layer(TGeoVolume* motherVolume, int layer = 0) : ITS3Layer(layer)
64 {
65 createLayer(motherVolume);
66 }
67
68 explicit ITS3Layer(int layer, TGeoVolume* motherVolume, TGeoMatrix* mat = nullptr, BuildLevel level = BuildLevel::kAll, bool createMaterials = false) : ITS3Layer(layer)
69 {
70 buildPartial(motherVolume, mat, level, createMaterials);
71 }
72
73 // Create one layer of ITS3 and attach it to the motherVolume.
74 void createLayer(TGeoVolume* motherVolume);
75 // Build a partial Version of the detector.
76 void buildPartial(TGeoVolume* motherVolume, TGeoMatrix* mat = nullptr, BuildLevel level = BuildLevel::kAll, bool createMaterials = false);
77
78 private:
79 bool mBuilt{false};
80 TGeoMedium* mSilicon{nullptr};
81 TGeoMedium* mAir{nullptr};
82 TGeoMedium* mCarbon{nullptr};
83 TGeoMedium* mCopper{nullptr};
84 void getMaterials(bool create = false);
85 TGeoMedium* getMaterial(const char* matName, bool create = false);
86
87 void init();
88 void createPixelArray();
89 void createTile();
90 void createRSU();
91 void createSegment();
92 void createChip();
93 void createCarbonForm();
94 TGeoCompositeShape* getHringShape(TGeoTubeSeg* Hring);
95 void createLayerImpl();
96
97 uint8_t mNLayer{0}; // Layer number
98 double mR{0}; // Middle Radius
99 double mRmin{0}; // Minimum Radius
100 double mRmax{0}; // Maximum Radius
101
102 // Individual pieces
103 // since TGeo manages the resources itself one should not use these pointers
104 // after initializition anymore!
105 TGeoVolume* mPixelArray{nullptr};
106 TGeoVolumeAssembly* mTile{nullptr};
107 TGeoVolumeAssembly* mRSU{nullptr};
108 TGeoVolumeAssembly* mSegment{nullptr};
109 TGeoVolumeAssembly* mChip{nullptr};
110 TGeoVolumeAssembly* mCarbonForm{nullptr};
111 TGeoVolumeAssembly* mLayer{nullptr};
112
113 ClassDef(ITS3Layer, 3);
114};
115} // namespace o2::its3
116
117#endif
This class defines the geometry for the ITS3 IB layers.
Definition ITS3Layer.h:30
ITS3Layer(int layer, TGeoVolume *motherVolume, TGeoMatrix *mat=nullptr, BuildLevel level=BuildLevel::kAll, bool createMaterials=false)
Definition ITS3Layer.h:68
ITS3Layer(int layer=0)
Definition ITS3Layer.h:58
static std::string_view getName(BuildLevel b)
Definition ITS3Layer.h:53
ITS3Layer(TGeoVolume *motherVolume, int layer=0)
Definition ITS3Layer.h:63
static constexpr std::array< std::string_view, static_cast< size_t >(BuildLevel::kAll)> mNames
Definition ITS3Layer.h:52
void createLayer(TGeoVolume *motherVolume)
Definition ITS3Layer.cxx:65
void buildPartial(TGeoVolume *motherVolume, TGeoMatrix *mat=nullptr, BuildLevel level=BuildLevel::kAll, bool createMaterials=false)
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
uint8_t itsSharedClusterMap uint8_t
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...