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
14
15#include <cmath>
16
17#include <fairlogger/Logger.h>
18
19using namespace o2::fd3;
20namespace o2
21{
22namespace fd3
23{
24
25std::unique_ptr<o2::fd3::GeometryTGeo> GeometryTGeo::sInstance;
26
27GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache()
28{
29 if (sInstance) {
30 LOGP(fatal, "Invalid use of public constructor: o2::fd3::GeometryTGeo instance exists");
31 }
32 if (build) {
33 Build(loadTrans);
34 }
35}
36
38
40{
41 if (!sInstance) {
42 sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
43 }
44 return sInstance.get();
45}
46
47void GeometryTGeo::Build(int loadTrans)
48{
49 if (isBuilt()) {
50 LOGP(warning, "Already built");
51 return; // already initialized
52 }
53
54 if (!gGeoManager) {
55 LOGP(fatal, "Geometry is not loaded");
56 }
57
58 fillMatrixCache(loadTrans);
59}
60
64
65} // namespace fd3
66} // namespace o2
FD3 Geometry type.
GeometryTGeo(bool build=false, int loadTrans=0)
static GeometryTGeo * Instance()
void Build(int loadTrans)
void fillMatrixCache(int mask)
GLint GLuint mask
Definition glcorearb.h:291
Definition Hit.h:27
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...