Project
Loading...
Searching...
No Matches
Detector.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
14
15#ifndef ALICEO2_FT0_DETECTOR_H_
16#define ALICEO2_FT0_DETECTOR_H_
17
18#include <TGeoShape.h>
20#include "DetectorsBase/Detector.h" // for Detector
21#include "FT0Base/Geometry.h"
23#include <TGeoManager.h> // for gGeoManager, TGeoManager (ptr only)
24
25class FairModule;
26
27class FairVolume;
28class TGeoVolume;
29class TGraph;
30
31namespace o2
32{
33namespace ft0
34{
35class Geometry;
36}
37} // namespace o2
38
39namespace o2
40{
41namespace ft0
42{
43// using HitType = o2::BasicXYZEHit<float>;
44class Geometry;
45class Detector : public o2::base::DetImpl<Detector>
46{
47 public:
48 enum constants {
49 kAir = 1,
50 kVac = 3,
52 kGlass = 6,
53 kAl = 15,
55 kOptAl = 17,
57 kCable = 23,
58 kMCPwalls = 25
59 }; // materials
60
64 Detector(Bool_t Active);
65
67 Detector() = default;
68
70 ~Detector() override;
71
73 void InitializeO2Detector() override;
74 bool isMTSafe() const override { return true; }
75
77 Bool_t ProcessHits(FairVolume* v) override;
78 o2::ft0::HitType* AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId);
79
80 void Register() override;
81
82 std::vector<o2::ft0::HitType>* getHits(Int_t iColl)
83 {
84 if (iColl == 0) {
85 return mHits;
86 }
87 return nullptr;
88 }
89
90 void Reset() override;
91 void EndOfEvent() override { Reset(); }
92
94 void CreateMaterials();
95 void ConstructGeometry() override;
96 void ConstructOpGeometry() override;
97 void SetOneMCP(TGeoVolume* stl);
98
99 void SetCablesA(TGeoVolume* stl);
100 TGeoVolume* SetCablesSize(int mod);
101
102 // Optical properties reader: e-Energy, abs-AbsorptionLength[cm], n-refractive index
104 Int_t ReadOptProperties(const std::string inputFilePath);
106 Bool_t RegisterPhotoE(float energy);
107 void Print(std::ostream* os) const;
108
111 void Read(std::istream* is);
112
113 void DefineSim2LUTindex();
115 void addAlignableVolumes() const override;
116 // Return Chip Volume UID
118 Int_t chipVolUID(Int_t id) const
119 {
120 return o2::base::GeometryManager::getSensID(o2::detectors::DetID::FT0, id);
121 }
122
123 private:
125 Detector(const Detector& rhs);
126
127 Int_t mIdSens1; // Sensetive volume in T0
128 TGraph* mPMTeff = nullptr; // pmt registration effeicincy
129
130 // Optical properties to be extracted from file
131 std::vector<Double_t> mPhotonEnergyD;
132 std::vector<Double_t> mAbsorptionLength;
133 std::vector<Double_t> mRefractionIndex;
134 std::vector<Double_t> mQuantumEfficiency;
135
136 // Optical properties to be set to constants
137 std::vector<Double_t> mEfficAll;
138 std::vector<Double_t> mRindexAir;
139 std::vector<Double_t> mAbsorAir;
140 std::vector<Double_t> mRindexCathodeNext;
141 std::vector<Double_t> mAbsorbCathodeNext;
142 std::vector<Double_t> mEfficMet;
143 std::vector<Double_t> mReflMet;
144 std::vector<Double_t> mRindexMet;
145 std::vector<Double_t> mReflBlackPaper;
146 std::vector<Double_t> mAbsBlackPaper;
147 std::vector<Double_t> mEffBlackPaper;
148 std::vector<Double_t> mReflFrontWindow;
149 std::vector<Double_t> mEffFrontWindow;
150 std::vector<Double_t> mRindexFrontWindow;
151
152 // Define the aluminium frame for the detector
153 TGeoVolume* constructFrameAGeometry(); //A-side
154 TGeoVolume* constructFrameCGeometry(); //C-side
155 std::string cPlateShapeString();
156
157 // BEGIN: Support structure constants
158 // define some error to avoid overlaps
159 static constexpr Float_t sEps = 0.05;
160 static constexpr Float_t sFrameZ = 5.700;
161
162 // PMT socket dimensions
163 static constexpr Float_t sPmtSide = 5.950;
164 static constexpr Float_t sPmtZ = 3.750;
165
166 // quartz radiator socket dimensions
167 static constexpr Float_t sQuartzRadiatorSide = 5.350;
168 static constexpr Float_t sQuartzRadiatorZ = 1.950;
169 // for the rounded socket corners
170 static constexpr Float_t sCornerRadius = 0.300;
171
172 // quartz & PMT socket transformations
173 static constexpr Float_t sQuartzHeight = -sFrameZ / 2 + sQuartzRadiatorZ / 2;
174 static constexpr Float_t sPmtHeight = sFrameZ / 2 - sPmtZ / 2;
175 static constexpr Float_t sPmtCornerTubePos = -0.15;
176 static constexpr Float_t sPmtCornerPos = 2.825;
177 static constexpr Float_t sEdgeCornerPos[2] = {-6.515, -0.515};
178 static constexpr Float_t sQuartzFrameOffsetX = -1.525;
179 // END: Support structure constants
180
182 std::vector<o2::ft0::HitType>* mHits = nullptr;
183 int mTrackRefLastTrackID = -1;
184
185 // Define volume IDs
186 int mREGVolID = -1;
187 int mTOPVolID = -1;
188 int mMTOVolID = -1;
189
191 void defineSensitiveVolumes();
192
193 Detector& operator=(const Detector&);
194
195 Geometry* mGeometry = nullptr;
196
197 template <typename Det>
198 friend class o2::base::DetImpl;
199
200 int mTrackIdTop;
201 int mTrackIdMCPtop; // TEMPORARY
202
203 int mSim2LUT[Geometry::Nchannels];
204
205 Double_t mPosModuleAx[Geometry::NCellsA];
206 Double_t mPosModuleAy[Geometry::NCellsA];
207 Double_t mPosModuleCx[Geometry::NCellsC];
208 Double_t mPosModuleCy[Geometry::NCellsC];
209 Double_t mPosModuleCz[Geometry::NCellsC];
210 Float_t mStartC[3] = {20., 20, 5.5};
211 Float_t mStartA[3] = {20., 20., 5};
212 Float_t mInStart[3] = {2.9491, 2.9491, 2.6};
213
214 ClassDefOverride(Detector, 6);
215};
216
217// Input and output function for standard C++ input/output.
218std::ostream& operator<<(std::ostream& os, Detector& source);
219
220std::istream& operator>>(std::istream& os, Detector& source);
221} // namespace ft0
222} // namespace o2
223
224#ifdef USESHM
225namespace o2
226{
227namespace base
228{
229template <>
230struct UseShm<o2::ft0::Detector> {
231 static constexpr bool value = true;
232};
233} // namespace base
234} // namespace o2
235#endif
236
237#endif
Definition of the Detector class.
int16_t time
Definition RawEventData.h:4
Definition of the FIT hits class.
static int getSensID(o2::detectors::DetID detid, int sensid)
void SetOneMCP(TGeoVolume *stl)
Definition Detector.cxx:205
void Read(std::istream *is)
bool isMTSafe() const override
whether this detector may run in multithreaded Geant4, with one clone per worker thread
Definition Detector.h:74
TGeoVolume * SetCablesSize(int mod)
Definition Detector.cxx:358
Int_t ReadOptProperties(const std::string inputFilePath)
void DefineSim2LUTindex()
~Detector() override
Destructor.
Definition Detector.cxx:63
void DefineOpticalProperties()
void InitializeO2Detector() override
Initialization of the detector is done here.
Definition Detector.cxx:68
void EndOfEvent() override
Definition Detector.h:91
std::vector< o2::ft0::HitType > * getHits(Int_t iColl)
Definition Detector.h:82
Bool_t ProcessHits(FairVolume *v) override
This method is called for each step during simulation (see FairMCApplication::Stepping())
void Register() override
void FillOtherOptProperties()
void ConstructGeometry() override
Definition Detector.cxx:95
void addAlignableVolumes() const override
Add alignable volumes.
Definition Detector.cxx:396
void Print(std::ostream *os) const
void CreateMaterials()
Base class to create the detector geometry.
void SetCablesA(TGeoVolume *stl)
Definition Detector.cxx:314
void ConstructOpGeometry() override
Definition Detector.cxx:196
o2::ft0::HitType * AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId)
Detector()=default
Default constructor.
Bool_t RegisterPhotoE(float energy)
Int_t chipVolUID(Int_t id) const
Definition Detector.h:118
void Reset() override
static constexpr int NCellsA
Definition Geometry.h:52
static constexpr int Nchannels
Definition Geometry.h:50
static constexpr int NCellsC
Definition Geometry.h:53
GLint GLenum GLint x
Definition glcorearb.h:403
const GLdouble * v
Definition glcorearb.h:832
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLint y
Definition glcorearb.h:270
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
std::ostream & operator<<(std::ostream &os, Detector &source)
std::istream & operator>>(std::istream &os, Detector &source)
struct o2::upgrades_utils::@481 ft0
structure to keep V0C information
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...