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 "Framework/Logger.h"
24#include <fmt/core.h>
25
26namespace o2::its3
27{
28
31{
32 // The hierarchy will be the following:
33 // ITS2 -> ITS3
34 // ---------------------------------
35 // Sensor PixelArray
36 // Chip Tile
37 // Module RSU
38 // HalfStave Segment
39 // Stave Chip
40 // HalfBarrel CarbonForm
41 // Layer Layer
42 public:
43 enum class BuildLevel : uint8_t {
44 kPixelArray = 0,
45 kTile,
46 kRSU,
49 kChip,
50 kLayer,
51 kAll,
52 };
53 static constexpr std::array<std::string_view, static_cast<size_t>(BuildLevel::kAll)> mNames{"PixelArray", "Tile", "RSU", "Segment", "CarbonForm", "Chip", "Layer"};
54 static std::string_view getName(BuildLevel b)
55 {
56 return mNames[static_cast<size_t>((b == BuildLevel::kAll) ? BuildLevel::kLayer : b)];
57 }
58
59 explicit ITS3Layer(int layer = 0) : mNLayer(layer)
60 {
61 LOGP(debug, "Called on {} layer {}", layer, mNLayer);
62 init();
63 }
64
65 explicit ITS3Layer(TGeoVolume* motherVolume, int layer = 0) : ITS3Layer(layer)
66 {
67 createLayer(motherVolume);
68 }
69
70 explicit ITS3Layer(int layer, TGeoVolume* motherVolume, TGeoMatrix* mat = nullptr, BuildLevel level = BuildLevel::kAll, bool createMaterials = false) : ITS3Layer(layer)
71 {
72 buildPartial(motherVolume, mat, level, createMaterials);
73 }
74
75 // Create one layer of ITS3 and attach it to the motherVolume.
76 void createLayer(TGeoVolume* motherVolume);
77 // Build a partial Version of the detector.
78 void buildPartial(TGeoVolume* motherVolume, TGeoMatrix* mat = nullptr, BuildLevel level = BuildLevel::kAll, bool createMaterials = false);
79
80 private:
81 bool mBuilt{false};
82 TGeoMedium* mSilicon{nullptr};
83 TGeoMedium* mAir{nullptr};
84 TGeoMedium* mCarbon{nullptr};
85 void getMaterials(bool create = false);
86 TGeoMedium* getMaterial(const char* matName, bool create = false);
87
88 void init();
89 void createPixelArray();
90 void createTile();
91 void createRSU();
92 void createSegment();
93 void createChip();
94 void createCarbonForm();
95 TGeoCompositeShape* getHringShape(TGeoTubeSeg* Hring);
96 void createLayerImpl();
97
98 uint8_t mNLayer{0}; // Layer number
99 double mR{0}; // Middle Radius
100 double mRmin{}; // Minimum Radius
101 double mRmax{0}; // Maximum Radius
102
103 // Individual Pieces
104 TGeoVolume* mPixelArray{nullptr};
105 TGeoVolumeAssembly* mTile{nullptr};
106 TGeoVolumeAssembly* mRSU{nullptr};
107 TGeoVolumeAssembly* mSegment{nullptr};
108 TGeoVolumeAssembly* mChip{nullptr};
109 TGeoVolumeAssembly* mCarbonForm{nullptr};
110 TGeoVolumeAssembly* mLayer{nullptr};
111
112 ClassDef(ITS3Layer, 2);
113};
114} // namespace o2::its3
115
116#endif
std::ostringstream debug
This class defines the Geometry for the ITS3 using TGeo.
Definition ITS3Layer.h:31
ITS3Layer(int layer, TGeoVolume *motherVolume, TGeoMatrix *mat=nullptr, BuildLevel level=BuildLevel::kAll, bool createMaterials=false)
Definition ITS3Layer.h:70
ITS3Layer(int layer=0)
Definition ITS3Layer.h:59
static std::string_view getName(BuildLevel b)
Definition ITS3Layer.h:54
ITS3Layer(TGeoVolume *motherVolume, int layer=0)
Definition ITS3Layer.h:65
static constexpr std::array< std::string_view, static_cast< size_t >(BuildLevel::kAll)> mNames
Definition ITS3Layer.h:53
void createLayer(TGeoVolume *motherVolume)
Definition ITS3Layer.cxx:71
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