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::sITOFChipName = "ITOFChip";
27std::string GeometryTGeo::sITOFSensorName = "ITOFSensor";
28
29// Outer TOF
30std::string GeometryTGeo::sOTOFLayerName = "OTOFLayer";
31std::string GeometryTGeo::sOTOFChipName = "OTOFChip";
32std::string GeometryTGeo::sOTOFSensorName = "OTOFSensor";
33
34// Forward TOF
35std::string GeometryTGeo::sFTOFLayerName = "FTOFLayer";
36std::string GeometryTGeo::sFTOFChipName = "FTOFChip";
37std::string GeometryTGeo::sFTOFSensorName = "FTOFSensor";
38
39// Backward TOF
40std::string GeometryTGeo::sBTOFLayerName = "BTOFLayer";
41std::string GeometryTGeo::sBTOFChipName = "BTOFChip";
42std::string GeometryTGeo::sBTOFSensorName = "BTOFSensor";
43
44GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache()
45{
46 if (sInstance) {
47 LOGP(fatal, "Invalid use of public constructor: o2::iotof::GeometryTGeo instance exists");
48 }
49 if (build) {
50 Build(loadTrans);
51 }
52}
53
54void GeometryTGeo::Build(int loadTrans)
55{
56 if (isBuilt()) {
57 LOGP(warning, "Already built");
58 return; // already initialized
59 }
60
61 if (!gGeoManager) {
62 LOGP(fatal, "Geometry is not loaded");
63 }
64
65 fillMatrixCache(loadTrans);
66}
67
71
73{
74 if (!sInstance) {
75 sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
76 }
77 return sInstance.get();
78}
79
80} // namespace iotof
81} // 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 sFTOFChipName
static std::string sOTOFChipName
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 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 ...