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>
17
18namespace o2
19{
20namespace iotof
21{
23{
24 public:
25 using DetMatrixCache::getMatrixL2G;
26
27 GeometryTGeo(bool build = false, int loadTrans = 0);
28 void Build(int loadTrans);
29 void fillMatrixCache(int mask);
30 static GeometryTGeo* Instance();
31
32 // Common i/o/f/bTOF
33 static const char* getIOTOFVolPattern() { return sIOTOFVolumeName.c_str(); }
34
35 // Inner TOF
36 static const char* getITOFLayerPattern() { return sITOFLayerName.c_str(); }
37 static const char* getITOFStavePattern() { return sITOFStaveName.c_str(); }
38 static const char* getITOFModulePattern() { return sITOFModuleName.c_str(); }
39 static const char* getITOFChipPattern() { return sITOFChipName.c_str(); }
40 static const char* getITOFSensorPattern() { return sITOFSensorName.c_str(); }
41
42 // Outer TOF
43 static const char* getOTOFLayerPattern() { return sOTOFLayerName.c_str(); }
44 static const char* getOTOFStavePattern() { return sOTOFStaveName.c_str(); }
45 static const char* getOTOFModulePattern() { return sOTOFModuleName.c_str(); }
46 static const char* getOTOFChipPattern() { return sOTOFChipName.c_str(); }
47 static const char* getOTOFSensorPattern() { return sOTOFSensorName.c_str(); }
48
49 // Forward TOF
50 static const char* getFTOFLayerPattern() { return sFTOFLayerName.c_str(); }
51 static const char* getFTOFChipPattern() { return sFTOFChipName.c_str(); }
52 static const char* getFTOFSensorPattern() { return sFTOFSensorName.c_str(); }
53
54 // Backward TOF
55 static const char* getBTOFLayerPattern() { return sBTOFLayerName.c_str(); }
56 static const char* getBTOFChipPattern() { return sBTOFChipName.c_str(); }
57 static const char* getBTOFSensorPattern() { return sBTOFSensorName.c_str(); }
58
59 static const char* composeSymNameIOTOF(int d)
60 {
61 return Form("%s_%d", o2::detectors::DetID(o2::detectors::DetID::TF3).getName(), d);
62 }
63
64 // Inner TOF
65 static const char* composeITOFSymNameLayer(int d, int layer);
66 static const char* composeITOFSymNameChip(int d, int lr);
67 static const char* composeITOFSymNameSensor(int d, int layer);
68
69 // Outer TOF
70 static const char* composeOTOFSymNameLayer(int d, int layer);
71 static const char* composeOTOFSymNameChip(int d, int lr);
72 static const char* composeOTOFSymNameSensor(int d, int layer);
73
74 // Forward TOF
75 static const char* composeFTOFSymNameLayer(int d, int layer);
76 static const char* composeFTOFSymNameChip(int d, int lr);
77 static const char* composeFTOFSymNameSensor(int d, int layer);
78
79 // Backward TOF
80 static const char* composeBTOFSymNameLayer(int d, int layer);
81 static const char* composeBTOFSymNameChip(int d, int lr);
82 static const char* composeBTOFSymNameSensor(int d, int layer);
83
84 int getIOTOFFirstChipIndex(int lay) const;
85 int getIOTOFLayer(int index) const;
86 int getIOTOFChipIndex(int lay, int sta, int mod, int chip) const;
87 bool getIOTOFChipId(int index, int& lay, int& sta, int& mod, int& chip) const;
88
91 TGeoHMatrix* extractMatrixSensor(int index) const;
92
93 TString getMatrixPath(int index) const;
94
95 protected:
96 // Determine the number of active parts in the geometry
97 int extractNumberOfStavesIOTOF(int lay) const;
98 int extractNumberOfModulesIOTOF(int lay) const;
99 int extractNumberOfChipsPerModuleIOTOF(int lay) const;
100 int extractNumberOfChipsFTOF() const;
101 int extractNumberOfChipsBTOF() const;
102
103 // i/oTOF mother volume
104 static std::string sIOTOFVolumeName;
105
106 // Inner TOF
107 static std::string sITOFLayerName;
108 static std::string sITOFStaveName;
109 static std::string sITOFModuleName;
110 static std::string sITOFChipName;
111 static std::string sITOFSensorName;
112
113 // Outer TOF
114 static std::string sOTOFLayerName;
115 static std::string sOTOFStaveName;
116 static std::string sOTOFModuleName;
117 static std::string sOTOFChipName;
118 static std::string sOTOFSensorName;
119
120 // Forward TOF
121 static std::string sFTOFLayerName;
122 static std::string sFTOFChipName;
123 static std::string sFTOFSensorName;
124
125 // Backward TOF
126 static std::string sBTOFLayerName;
127 static std::string sBTOFChipName;
128 static std::string sBTOFSensorName;
129
130 // Inner/outer TOF
137
138 // Forward TOF
140
141 // Backward TOF
143
144 private:
145 static std::unique_ptr<o2::iotof::GeometryTGeo> sInstance;
146};
147
148} // namespace iotof
149} // namespace o2
150#endif
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
const char * getName() const
static const char * getITOFChipPattern()
static std::string sFTOFSensorName
TString getMatrixPath(int index) const
static const char * composeOTOFSymNameSensor(int d, int layer)
static const char * getFTOFLayerPattern()
static std::string sOTOFLayerName
static const char * getIOTOFVolPattern()
static const char * getOTOFLayerPattern()
static const char * getFTOFSensorPattern()
static const char * getFTOFChipPattern()
static const char * getBTOFChipPattern()
bool getIOTOFChipId(int index, int &lay, int &sta, int &mod, int &chip) const
static const char * getOTOFModulePattern()
static std::string sOTOFSensorName
static std::string sIOTOFVolumeName
static const char * getITOFModulePattern()
static const char * composeBTOFSymNameLayer(int d, int layer)
void fillMatrixCache(int mask)
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
static std::string sBTOFSensorName
static const char * composeOTOFSymNameChip(int d, int lr)
static std::string sBTOFChipName
static const char * getOTOFChipPattern()
static const char * composeITOFSymNameSensor(int d, int layer)
static const char * getBTOFLayerPattern()
static std::string sITOFChipName
int extractNumberOfChipsPerModuleIOTOF(int lay) const
void Build(int loadTrans)
static std::string sOTOFModuleName
int extractNumberOfStavesIOTOF(int lay) const
static const char * composeOTOFSymNameLayer(int d, int layer)
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 getIOTOFChipIndex(int lay, int sta, int mod, int chip) const
int extractNumberOfChipsBTOF() const
static std::string sBTOFLayerName
static const char * composeITOFSymNameChip(int d, int lr)
static const char * composeSymNameIOTOF(int d)
static const char * getBTOFSensorPattern()
static const char * composeBTOFSymNameChip(int d, int lr)
GLuint index
Definition glcorearb.h:781
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 ...