14#include <TGeoManager.h>
20std::unique_ptr<o2::iotof::GeometryTGeo> GeometryTGeo::sInstance;
52 LOGP(fatal,
"Invalid use of public constructor: o2::iotof::GeometryTGeo instance exists");
61 int numberOfStaves{0};
64 TGeoVolume* layV = gGeoManager->GetVolume(layName.c_str());
65 if (layV ==
nullptr) {
66 LOG(fatal) <<
"Can't find volume " << layName;
70 TObjArray*
nodes = layV->GetNodes();
71 int nNodes =
nodes->GetEntriesFast();
73 for (
int j{0};
j < nNodes; ++
j) {
79 return numberOfStaves;
84 int numberOfModules{0};
87 TGeoVolume* staveV = gGeoManager->GetVolume(staveName.c_str());
88 if (staveV ==
nullptr) {
89 LOG(fatal) <<
"Can't find volume " << staveName;
93 TObjArray*
nodes = staveV->GetNodes();
94 int nNodes =
nodes->GetEntriesFast();
96 for (
int j{0};
j < nNodes; ++
j) {
102 return numberOfModules;
107 int numberOfChips{0};
110 TGeoVolume* moduleV = gGeoManager->GetVolume(moduleName.c_str());
111 if (moduleV ==
nullptr) {
112 LOG(fatal) <<
"Can't find volume " << moduleName;
116 TObjArray*
nodes = moduleV->GetNodes();
117 int nNodes =
nodes->GetEntriesFast();
119 for (
int j{0};
j < nNodes; ++
j) {
125 return numberOfChips;
146 LOG(fatal) <<
"Invalid chip index " <<
index;
170 int lay, sta, mod, chip;
203 static TGeoHMatrix matTmp;
204 gGeoManager->PushPath();
206 if (!gGeoManager->cd(
path.Data())) {
207 gGeoManager->PopPath();
208 LOG(error) <<
"Error in cd-ing to " <<
path.Data();
212 matTmp = *gGeoManager->GetCurrentMatrix();
216 gGeoManager->PopPath();
227 LOGP(warning,
"Already built");
232 LOGP(fatal,
"Geometry is not loaded");
236 if (!iotofPars.segmentedInnerTOF && !iotofPars.segmentedOuterTOF) {
241 for (
int j{0};
j < 2; ++
j) {
253 int numberOfChips{0};
254 for (
int j{0};
j < 2; ++
j) {
271 LOG(warning) <<
"The method Build was not called yet";
278 LOG(info) <<
"Loading " <<
getName() <<
" L2G matrices from TGeo; there are " <<
mSize <<
" matrices";
280 cacheL2G.setSize(
mSize);
292 sInstance = std::unique_ptr<GeometryTGeo>(
new GeometryTGeo(
true, 0));
294 return sInstance.get();
static const IOTOFBaseParam & Instance()
const char * getName() const
int mSize
prebooked number of sensors
const MatrixCache< Mat3D > & getCacheL2G() const
static const char * getITOFChipPattern()
static std::string sFTOFSensorName
TString getMatrixPath(int index) const
static std::string sOTOFLayerName
static const char * getIOTOFVolPattern()
static const char * getOTOFLayerPattern()
bool getIOTOFChipId(int index, int &lay, int &sta, int &mod, int &chip) const
int mNumberOfModulesIOTOF[2]
int mNumberOfChipsPerModuleIOTOF[2]
static const char * getOTOFModulePattern()
static std::string sOTOFSensorName
static std::string sIOTOFVolumeName
static const char * getITOFModulePattern()
void fillMatrixCache(int mask)
static const char * getOTOFSensorPattern()
static std::string sITOFStaveName
static std::string sFTOFChipName
int extractNumberOfModulesIOTOF(int lay) const
static std::string sOTOFChipName
static std::string sITOFModuleName
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
GeometryTGeo(bool build=false, int loadTrans=0)
static std::string sBTOFSensorName
static std::string sBTOFChipName
static const char * getOTOFChipPattern()
static std::string sITOFChipName
int mNumberOfChipsPerStaveIOTOF[2]
int mNumberOfStavesIOTOF[2]
int extractNumberOfChipsPerModuleIOTOF(int lay) const
void Build(int loadTrans)
static std::string sOTOFModuleName
int extractNumberOfStavesIOTOF(int lay) const
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
int mNumberOfChipsIOTOF[2]
GLsizei const GLchar *const * path
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"