21#include <fairlogger/Logger.h>
23#include <TGeoManager.h>
24#include <TGeoMatrix.h>
25#include <TGeoMedium.h>
27#include <TGeoVolume.h>
28#include <TGeoCompositeShape.h>
42FCTLayer::FCTLayer(Int_t layerNumber, std::string layerName,
Float_t z,
Float_t rIn,
Float_t rOut_SideL,
Float_t Layerx2X0, Int_t
type) : mLayerNumber(layerNumber), mLayerName(layerName), mx2X0(Layerx2X0), mType(
type), mInnerRadius(rIn)
46 mOuterRadius = rOut_SideL;
47 }
else if (
type == 1) {
48 mSideLength = rOut_SideL;
54 mChipThickness = Layerx2X0 * Si_X0;
55 LOG(info) <<
"Creating FCT Disk Layer " << mLayerNumber;
56 LOG(info) <<
" Using silicon X0 = " << Si_X0 <<
" to emulate layer radiation length.";
57 LOG(info) <<
" Layer z = " << mZ <<
" ; R_in = " << mInnerRadius <<
" ; R_out = " << mOuterRadius <<
" ; x2X0 = " << mx2X0 <<
" ; ChipThickness = " << mChipThickness;
58 }
else if (mType == 1) {
59 mChipThickness = Layerx2X0 * Si_X0;
60 LOG(info) <<
"Creating FCT Square Layer " << mLayerNumber;
61 LOG(info) <<
" Using silicon X0 = " << Si_X0 <<
" to emulate layer radiation length.";
62 LOG(info) <<
" Layer z = " << mZ <<
" ; R_in = " << mInnerRadius <<
" ; L_side = " << mSideLength <<
" ; x2X0 = " << mx2X0 <<
" ; ChipThickness = " << mChipThickness;
63 }
else if (mType == 2) {
64 mChipThickness = Layerx2X0 * Pb_X0;
65 LOG(info) <<
"Creating FCT Converter Layer " << mLayerNumber;
66 LOG(info) <<
" Using lead X0 = " << Pb_X0 <<
" to emulate layer radiation length.";
67 LOG(info) <<
" Layer z = " << mZ <<
" ; R_in = " << mInnerRadius <<
" ; R_out = " << mOuterRadius <<
" ; x2X0 = " << mx2X0 <<
" ; ChipThickness = " << mChipThickness;
74 createDiskLayer(motherVolume);
75 }
else if (mType == 1) {
76 createSquareLayer(motherVolume);
77 }
else if (mType == 2) {
78 createConverterLayer(motherVolume);
83void FCTLayer::createDiskLayer(TGeoVolume* motherVolume)
85 if (mLayerNumber < 0) {
92 TGeoTube* sensor =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
93 TGeoTube* chip =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
94 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
96 TGeoMedium* medSi = gGeoManager->GetMedium(
"FCT_SILICON$");
97 TGeoMedium* medAir = gGeoManager->GetMedium(
"FCT_AIR$");
99 TGeoVolume* sensVol =
new TGeoVolume(sensName.c_str(), sensor, medSi);
100 sensVol->SetLineColor(kSpring + 5);
101 TGeoVolume* chipVol =
new TGeoVolume(chipName.c_str(), chip, medSi);
102 chipVol->SetLineColor(kSpring + 5);
103 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medAir);
104 layerVol->SetLineColor(kSpring + 5);
106 LOG(info) <<
"Inserting " << sensVol->GetName() <<
" inside " << chipVol->GetName();
107 chipVol->AddNode(sensVol, 1,
nullptr);
109 LOG(info) <<
"Inserting " << chipVol->GetName() <<
" inside " << layerVol->GetName();
110 layerVol->AddNode(chipVol, 1,
nullptr);
113 auto FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
114 auto FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, FwdDiskRotation);
116 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" inside " << motherVolume->GetName();
117 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
120void FCTLayer::createSquareLayer(TGeoVolume* motherVolume)
122 if (mLayerNumber < 0) {
126 LOG(info) <<
"Constructing a layer and adding it to the motherVolume";
130 TGeoBBox* sensorBox =
new TGeoBBox(
"SensorBox", mSideLength, mSideLength, mChipThickness / 2);
131 TGeoBBox* chipBox =
new TGeoBBox(
"ChipBox", mSideLength, mSideLength, mChipThickness / 2);
132 TGeoBBox* layerBox =
new TGeoBBox(
"LayerBox", mSideLength, mSideLength, mChipThickness / 2);
134 TGeoTube* sensorCutout =
new TGeoTube(
"SensorTube", 0., mInnerRadius, mChipThickness / 2);
135 TGeoTube* chipCutout =
new TGeoTube(
"ChipTube", 0., mInnerRadius, mChipThickness / 2);
136 TGeoTube* layerCutout =
new TGeoTube(
"LayerTube", 0., mInnerRadius, mChipThickness / 2);
138 TGeoCompositeShape* SensorComp =
new TGeoCompositeShape(
"SensorComp",
"SensorBox - SensorTube");
139 TGeoCompositeShape* ChipComp =
new TGeoCompositeShape(
"SensorComp",
"ChipBox - ChipTube");
140 TGeoCompositeShape* LayerComp =
new TGeoCompositeShape(
"SensorComp",
"LayerBox - LayerTube");
142 TGeoMedium* medSi = gGeoManager->GetMedium(
"FCT_SI$");
143 TGeoMedium* medAir = gGeoManager->GetMedium(
"FCT_AIR$");
145 TGeoVolume* sensVol =
new TGeoVolume(sensName.c_str(), SensorComp, medSi);
146 TGeoVolume* chipVol =
new TGeoVolume(chipName.c_str(), ChipComp, medSi);
147 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(), LayerComp, medAir);
149 LOG(info) <<
"Inserting " << sensVol->GetName() <<
" inside " << chipVol->GetName();
150 chipVol->AddNode(sensVol, 1,
nullptr);
152 LOG(info) <<
"Inserting " << chipVol->GetName() <<
" inside " << layerVol->GetName();
153 layerVol->AddNode(chipVol, 1,
nullptr);
156 auto FwdLayerRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
157 auto FwdLayerCombiTrans =
new TGeoCombiTrans(0, 0, mZ, FwdLayerRotation);
159 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" inside " << motherVolume->GetName();
160 motherVolume->AddNode(layerVol, 1, FwdLayerCombiTrans);
163void FCTLayer::createConverterLayer(TGeoVolume* motherVolume)
165 if (mLayerNumber < 0) {
169 LOG(info) <<
"Constructing a passive converter layer and adding it to the motherVolume";
172 TGeoTube* sensor =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
173 TGeoTube* chip =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
174 TGeoTube*
layer =
new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
176 TGeoMedium* medPb = gGeoManager->GetMedium(
"FCT_LEAD$");
177 TGeoMedium* medAir = gGeoManager->GetMedium(
"FCT_AIR$");
179 TGeoVolume* sensVol =
new TGeoVolume(sensName.c_str(), sensor, medPb);
180 TGeoVolume* chipVol =
new TGeoVolume(chipName.c_str(), chip, medPb);
181 TGeoVolume* layerVol =
new TGeoVolume(mLayerName.c_str(),
layer, medPb);
183 LOG(info) <<
"Inserting " << sensVol->GetName() <<
" inside " << chipVol->GetName();
184 chipVol->AddNode(sensVol, 1,
nullptr);
186 LOG(info) <<
"Inserting " << chipVol->GetName() <<
" inside " << layerVol->GetName();
187 layerVol->AddNode(chipVol, 1,
nullptr);
190 auto FwdDiskRotation =
new TGeoRotation(
"FwdDiskRotation", 0, 0, 180);
191 auto FwdDiskCombiTrans =
new TGeoCombiTrans(0, 0, mZ, FwdDiskRotation);
193 LOG(info) <<
"Inserting " << layerVol->GetName() <<
" inside " << motherVolume->GetName();
194 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
Definition of the FCTLayer class.
Definition of the GeometryTGeo class.
Definition of the Detector class.
virtual void createLayer(TGeoVolume *motherVolume)
~FCTLayer() override
Default destructor.
static const char * getFCTChipPattern()
static const char * getFCTSensorPattern()
GLint GLint GLsizei GLint GLenum GLenum type
GLenum GLuint GLint GLint layer
GLdouble GLdouble GLdouble z
std::string to_string(gsl::span< T, Size > span)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"