Project
Loading...
Searching...
No Matches
GeometryTGeo.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
13#include <TGeoManager.h>
14
15namespace o2
16{
17namespace iotof
18{
19std::unique_ptr<o2::iotof::GeometryTGeo> GeometryTGeo::sInstance;
20
21// Common i/oTOF
22std::string GeometryTGeo::sIOTOFVolumeName = "IOTOFV";
23
24// Inner TOF
25std::string GeometryTGeo::sITOFLayerName = "ITOFLayer";
26std::string GeometryTGeo::sITOFStaveName = "ITOFStave";
27std::string GeometryTGeo::sITOFModuleName = "ITOFModule";
28std::string GeometryTGeo::sITOFChipName = "ITOFChip";
29std::string GeometryTGeo::sITOFSensorName = "ITOFSensor";
30
31// Outer TOF
32std::string GeometryTGeo::sOTOFLayerName = "OTOFLayer";
33std::string GeometryTGeo::sOTOFStaveName = "OTOFStave";
34std::string GeometryTGeo::sOTOFModuleName = "OTOFModule";
35std::string GeometryTGeo::sOTOFChipName = "OTOFChip";
36std::string GeometryTGeo::sOTOFSensorName = "OTOFSensor";
37
38// Forward TOF
39std::string GeometryTGeo::sFTOFLayerName = "FTOFLayer";
40std::string GeometryTGeo::sFTOFChipName = "FTOFChip";
41std::string GeometryTGeo::sFTOFSensorName = "FTOFSensor";
42
43// Backward TOF
44std::string GeometryTGeo::sBTOFLayerName = "BTOFLayer";
45std::string GeometryTGeo::sBTOFChipName = "BTOFChip";
46std::string GeometryTGeo::sBTOFSensorName = "BTOFSensor";
47
48GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache()
49{
50 if (sInstance) {
51 LOGP(fatal, "Invalid use of public constructor: o2::iotof::GeometryTGeo instance exists");
52 }
53 if (build) {
54 Build(loadTrans);
55 }
56}
57
58void GeometryTGeo::Build(int loadTrans)
59{
60 if (isBuilt()) {
61 LOGP(warning, "Already built");
62 return; // already initialized
63 }
64
65 if (!gGeoManager) {
66 LOGP(fatal, "Geometry is not loaded");
67 }
68
69 fillMatrixCache(loadTrans);
70}
71
75
77{
78 if (!sInstance) {
79 sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
80 }
81 return sInstance.get();
82}
83
84} // namespace iotof
85} // namespace o2
static std::string sFTOFSensorName
static std::string sOTOFLayerName
static std::string sOTOFSensorName
static std::string sIOTOFVolumeName
void fillMatrixCache(int mask)
static std::string sITOFStaveName
static std::string sFTOFChipName
static std::string sOTOFChipName
static std::string sITOFModuleName
static std::string sFTOFLayerName
GeometryTGeo(bool build=false, int loadTrans=0)
static std::string sBTOFSensorName
static std::string sBTOFChipName
static std::string sITOFChipName
void Build(int loadTrans)
static std::string sOTOFModuleName
static std::string sOTOFStaveName
static std::string sITOFSensorName
static GeometryTGeo * Instance()
static std::string sITOFLayerName
static std::string sBTOFLayerName
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...