Project
Loading...
Searching...
No Matches
FT3Layer.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
16
20
21#include <fairlogger/Logger.h> // for LOG
22
23#include <TGeoManager.h> // for TGeoManager, gGeoManager
24#include <TGeoMatrix.h> // for TGeoCombiTrans, TGeoRotation, etc
25#include <TGeoTube.h> // for TGeoTube, TGeoTubeSeg
26#include <TGeoVolume.h> // for TGeoVolume, TGeoVolumeAssembly
27#include <TGeoCompositeShape.h> // for TGeoCompositeShape
28#include "TMathBase.h" // for Abs
29#include <TMath.h> // for Sin, RadToDeg, DegToRad, Cos, Tan, etc
30
31#include <cstdio> // for snprintf
32
33class TGeoMedium;
34
35using namespace TMath;
36using namespace o2::ft3;
37using namespace o2::itsmft;
38
40
41FT3Layer::~FT3Layer() = default;
42
43FT3Layer::FT3Layer(Int_t layerDirection, Int_t layerNumber, std::string layerName, Float_t z, Float_t rIn, Float_t rOut, Float_t Layerx2X0)
44{
45 // Creates a simple parametrized EndCap layer covering the given
46 // pseudorapidity range at the z layer position
47 mDirection = layerDirection;
48 mLayerNumber = layerNumber;
49 mLayerName = layerName;
50 mZ = layerDirection ? std::abs(z) : -std::abs(z);
51 mx2X0 = Layerx2X0;
52 mInnerRadius = rIn;
53 mOuterRadius = rOut;
54 auto Si_X0 = 9.5;
55 mChipThickness = Layerx2X0 * Si_X0;
56
57 LOG(info) << "Creating FT3 Layer " << mLayerNumber << " ; direction " << mDirection;
58 LOG(info) << " Using silicon X0 = " << Si_X0 << " to emulate layer radiation length.";
59 LOG(info) << " Layer z = " << mZ << " ; R_in = " << mInnerRadius << " ; R_out = " << mOuterRadius << " ; x2X0 = " << mx2X0 << " ; ChipThickness = " << mChipThickness;
60}
61
62void FT3Layer::createLayer(TGeoVolume* motherVolume)
63{
64 if (mLayerNumber >= 0) {
65 // Create tube, set sensitive volume, add to mother volume
66
67 std::string chipName = o2::ft3::GeometryTGeo::getFT3ChipPattern() + std::to_string(mLayerNumber),
68 sensName = Form("%s_%d_%d", GeometryTGeo::getFT3SensorPattern(), mDirection, mLayerNumber);
69 TGeoTube* sensor = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
70 TGeoTube* chip = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
71 TGeoTube* layer = new TGeoTube(mInnerRadius, mOuterRadius, mChipThickness / 2);
72
73 TGeoMedium* medSi = gGeoManager->GetMedium("FT3_SILICON$");
74 TGeoMedium* medAir = gGeoManager->GetMedium("FT3_AIR$");
75
76 TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi);
77 sensVol->SetLineColor(kYellow);
78 TGeoVolume* chipVol = new TGeoVolume(chipName.c_str(), chip, medSi);
79 chipVol->SetLineColor(kYellow);
80 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
81 layerVol->SetLineColor(kYellow);
82
83 LOG(info) << "Inserting " << sensVol->GetName() << " inside " << chipVol->GetName();
84 chipVol->AddNode(sensVol, 1, nullptr);
85
86 LOG(info) << "Inserting " << chipVol->GetName() << " inside " << layerVol->GetName();
87 layerVol->AddNode(chipVol, 1, nullptr);
88
89 // Finally put everything in the mother volume
90 auto* FwdDiskRotation = new TGeoRotation("FwdDiskRotation", 0, 0, 180);
91 auto* FwdDiskCombiTrans = new TGeoCombiTrans(0, 0, mZ, FwdDiskRotation);
92
93 LOG(info) << "Inserting " << layerVol->GetName() << " inside " << motherVolume->GetName();
94 motherVolume->AddNode(layerVol, 1, FwdDiskCombiTrans);
95
96 return;
97 }
98}
ClassImp(FT3Layer)
Definition of the FT3Layer class.
Definition of the GeometryTGeo class.
Definition of the Detector class.
virtual void createLayer(TGeoVolume *motherVolume)
Definition FT3Layer.cxx:62
~FT3Layer() override
Default destructor.
FT3Layer()=default
static const char * getFT3SensorPattern()
static const char * getFT3ChipPattern()
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"