Project
Loading...
Searching...
No Matches
GeometryTGeo.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
12#ifndef ALICEO2_IOTOF_GEOMETRYTGEO_H
13#define ALICEO2_IOTOF_GEOMETRYTGEO_H
14
15#include <memory>
16#include <string>
17#include <vector>
21#include <MathUtils/Cartesian.h>
22
23namespace o2
24{
25namespace iotof
26{
28{
29 public:
30 using DetMatrixCache::getMatrixL2G;
31 using DetMatrixCache::getMatrixT2L;
32
33 GeometryTGeo(bool build = false, int loadTrans = 0);
34 void Build(int loadTrans);
35 void fillMatrixCache(int mask);
36 static GeometryTGeo* Instance();
37
38 // Common i/o/f/bTOF
39 static const char* getIOTOFVolPattern() { return sIOTOFVolumeName.c_str(); }
40
41 // Inner TOF
42 const int getITOFNumberOfChips() const { return mNumberOfChipsIOTOF[0]; }
43 static const char* getITOFLayerPattern() { return sITOFLayerName.c_str(); }
44 static const char* getITOFStavePattern() { return sITOFStaveName.c_str(); }
45 static const char* getITOFModulePattern() { return sITOFModuleName.c_str(); }
46 static const char* getITOFChipPattern() { return sITOFChipName.c_str(); }
47 static const char* getITOFSensorPattern() { return sITOFSensorName.c_str(); }
48
49 // Outer TOF
50 const int getOTOFNumberOfChips() const { return mNumberOfChipsIOTOF[1]; }
51 static const char* getOTOFLayerPattern() { return sOTOFLayerName.c_str(); }
52 static const char* getOTOFStavePattern() { return sOTOFStaveName.c_str(); }
53 static const char* getOTOFSubStavePattern() { return sOTOFSubStaveName.c_str(); }
54 static const char* getOTOFModulePattern() { return sOTOFModuleName.c_str(); }
55 static const char* getOTOFChipPattern() { return sOTOFChipName.c_str(); }
56 static const char* getOTOFSensorPattern() { return sOTOFSensorName.c_str(); }
57
58 // Forward TOF
59 const int getFTOFNumberOfChips() const { return mNumberOfChipsFTOF; }
60 static const char* getFTOFLayerPattern() { return sFTOFLayerName.c_str(); }
61 static const char* getFTOFChipPattern() { return sFTOFChipName.c_str(); }
62 static const char* getFTOFSensorPattern() { return sFTOFSensorName.c_str(); }
63
64 // Backward TOF
65 const int getBTOFNumberOfChips() const { return mNumberOfChipsBTOF; }
66 static const char* getBTOFLayerPattern() { return sBTOFLayerName.c_str(); }
67 static const char* getBTOFChipPattern() { return sBTOFChipName.c_str(); }
68 static const char* getBTOFSensorPattern() { return sBTOFSensorName.c_str(); }
69
70#ifdef ENABLE_UPGRADES
71 static const char* composeSymNameIOTOF(int d)
72 {
73 return Form("%s_%d", o2::detectors::DetID(o2::detectors::DetID::TF3).getName(), d);
74 }
75#endif
76
77 // Inner TOF
78 static const char* composeITOFSymNameLayer(int d, int layer);
79 static const char* composeITOFSymNameChip(int d, int lr);
80 static const char* composeITOFSymNameSensor(int d, int layer);
81
82 // Outer TOF
83 static const char* composeOTOFSymNameLayer(int d, int layer);
84 static const char* composeOTOFSymNameChip(int d, int lr);
85 static const char* composeOTOFSymNameSensor(int d, int layer);
86
87 // Forward TOF
88 static const char* composeFTOFSymNameLayer(int d, int layer);
89 static const char* composeFTOFSymNameChip(int d, int lr);
90 static const char* composeFTOFSymNameSensor(int d, int layer);
91
92 // Backward TOF
93 static const char* composeBTOFSymNameLayer(int d, int layer);
94 static const char* composeBTOFSymNameChip(int d, int lr);
95 static const char* composeBTOFSymNameSensor(int d, int layer);
96
97 int getIOTOFFirstChipIndex(int lay) const;
98 int getIOTOFLayer(int index) const;
99 bool isValidIOTOFChipIndex(int index) const { return index >= 0 && index <= mLastChipIndex[1]; }
100 int getIOTOFChipIndex(int lay, int sta, int substa, int mod, int chip) const;
101 bool getIOTOFChipId(int index, int& lay, int& sta, int& substa, int& mod, int& chip) const;
102 o2::math_utils::Point3D<float> detectorToLocal(int row, int col, int chipId) const;
103 static const ChipSpecifics& getChipSpecifics(int iotofLayer);
104
107 TGeoHMatrix* extractMatrixSensor(int index) const;
108
109 // sensor ref X and alpha
110 void extractSensorXAlpha(int, float&, float&);
111
112 // create matrix for tracking to local frame for IOTOF
113 TGeoHMatrix& createT2LMatrix(int);
114
115 TString getMatrixPath(int index) const;
116
117 // cache for tracking frames
118 void defineSensors();
119 bool isTrackingFrameCached() const { return !mCacheRefX.empty(); }
121
122 float getSensorRefAlpha(int chipId) const
123 {
124 const int local = chipId;
125 return mCacheRefAlpha[local];
126 }
127
128 float getSensorX(int chipId) const
129 {
130 const int local = chipId;
131 return mCacheRefX[local];
132 }
133
134 protected:
135 // Determine the number of active parts in the geometry
136 int extractNumberOfStavesIOTOF(int lay) const;
137 int extractNumberOfSubStavesIOTOF(int lay) const;
138 int extractNumberOfModulesIOTOF(int lay) const;
139 int extractNumberOfChipsPerModuleIOTOF(int lay) const;
140 int extractNumberOfChipsFTOF() const;
141 int extractNumberOfChipsBTOF() const;
142
143 // i/oTOF mother volume
144 static std::string sIOTOFVolumeName;
145
146 // Inner TOF
147 static std::string sITOFLayerName;
148 static std::string sITOFStaveName;
149 static std::string sITOFModuleName;
150 static std::string sITOFChipName;
151 static std::string sITOFSensorName;
152
153 // Outer TOF
154 static std::string sOTOFLayerName;
155 static std::string sOTOFStaveName;
156 static std::string sOTOFSubStaveName;
157 static std::string sOTOFModuleName;
158 static std::string sOTOFChipName;
159 static std::string sOTOFSensorName;
160
161 // Forward TOF
162 static std::string sFTOFLayerName;
163 static std::string sFTOFChipName;
164 static std::string sFTOFSensorName;
165
166 // Backward TOF
167 static std::string sBTOFLayerName;
168 static std::string sBTOFChipName;
169 static std::string sBTOFSensorName;
170
171 // Inner/outer TOF
179 int mLastChipIndex[2]{-1, -1};
180
181 // Forward TOF
183
184 // Backward TOF
186
187 std::vector<int> sensors;
188 std::vector<float> mCacheRefX;
189 std::vector<float> mCacheRefAlpha;
190
191 private:
192 static std::unique_ptr<o2::iotof::GeometryTGeo> sInstance;
193};
194
195} // namespace iotof
196} // namespace o2
197#endif
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events d
uint32_t col
Definition RawData.h:4
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:60
const char * getName() const
int getIOTOFChipIndex(int lay, int sta, int substa, int mod, int chip) const
int extractNumberOfSubStavesIOTOF(int lay) const
static const char * getITOFChipPattern()
static std::string sFTOFSensorName
TString getMatrixPath(int index) const
static const char * composeOTOFSymNameSensor(int d, int layer)
const int getFTOFNumberOfChips() const
static const char * getFTOFLayerPattern()
static std::string sOTOFLayerName
static const char * getIOTOFVolPattern()
static const char * getOTOFLayerPattern()
static const char * getFTOFSensorPattern()
const int getITOFNumberOfChips() const
static const char * getFTOFChipPattern()
static const char * getBTOFChipPattern()
static const char * getOTOFSubStavePattern()
static const char * getOTOFModulePattern()
static std::string sOTOFSensorName
static std::string sIOTOFVolumeName
o2::math_utils::Point3D< float > detectorToLocal(int row, int col, int chipId) const
static const char * getITOFModulePattern()
static const char * composeBTOFSymNameLayer(int d, int layer)
void fillMatrixCache(int mask)
void extractSensorXAlpha(int, float &, float &)
static std::string sOTOFSubStaveName
bool isTrackingFrameCached() const
static const char * getOTOFSensorPattern()
static std::string sITOFStaveName
static const char * composeFTOFSymNameSensor(int d, int layer)
static std::string sFTOFChipName
int extractNumberOfModulesIOTOF(int lay) const
static const char * composeBTOFSymNameSensor(int d, int layer)
static const char * composeFTOFSymNameChip(int d, int lr)
static std::string sOTOFChipName
static const char * composeITOFSymNameLayer(int d, int layer)
static std::string sITOFModuleName
static const char * composeFTOFSymNameLayer(int d, int layer)
static const char * getITOFStavePattern()
static std::string sFTOFLayerName
int extractNumberOfChipsFTOF() const
static const char * getITOFSensorPattern()
static const char * getOTOFStavePattern()
int getIOTOFLayer(int index) const
int getIOTOFFirstChipIndex(int lay) const
bool isValidIOTOFChipIndex(int index) const
static std::string sBTOFSensorName
static const char * composeOTOFSymNameChip(int d, int lr)
static std::string sBTOFChipName
std::vector< float > mCacheRefAlpha
cache for X of IOTOF
float getSensorX(int chipId) const
static const char * getOTOFChipPattern()
static const char * composeITOFSymNameSensor(int d, int layer)
static const char * getBTOFLayerPattern()
static std::string sITOFChipName
const int getOTOFNumberOfChips() const
int extractNumberOfChipsPerModuleIOTOF(int lay) const
void Build(int loadTrans)
static std::string sOTOFModuleName
std::vector< float > mCacheRefX
int extractNumberOfStavesIOTOF(int lay) const
std::vector< int > sensors
static const char * composeOTOFSymNameLayer(int d, int layer)
const int getBTOFNumberOfChips() const
TGeoHMatrix & createT2LMatrix(int)
static std::string sOTOFStaveName
static std::string sITOFSensorName
static GeometryTGeo * Instance()
static const char * getITOFLayerPattern()
TGeoHMatrix * extractMatrixSensor(int index) const
static std::string sITOFLayerName
int extractNumberOfChipsBTOF() const
static std::string sBTOFLayerName
bool getIOTOFChipId(int index, int &lay, int &sta, int &substa, int &mod, int &chip) const
static const ChipSpecifics & getChipSpecifics(int iotofLayer)
static const char * composeITOFSymNameChip(int d, int lr)
static const char * getBTOFSensorPattern()
float getSensorRefAlpha(int chipId) const
static const char * composeBTOFSymNameChip(int d, int lr)
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< int > row