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 ecal
18{
19std::unique_ptr<o2::ecal::GeometryTGeo> GeometryTGeo::sInstance;
20
21std::string GeometryTGeo::sVolumeName = "ECALV";
22std::string GeometryTGeo::sSensorName = "ECALSensor";
23
24GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache()
25{
26 if (sInstance) {
27 LOGP(fatal, "Invalid use of public constructor: o2::ecal::GeometryTGeo instance exists");
28 }
29 if (build) {
30 Build(loadTrans);
31 }
32}
33
34void GeometryTGeo::Build(int loadTrans)
35{
36 if (isBuilt()) {
37 LOGP(warning, "Already built");
38 return; // already initialized
39 }
40
41 if (!gGeoManager) {
42 LOGP(fatal, "Geometry is not loaded");
43 }
44
45 fillMatrixCache(loadTrans);
46}
47
51
53{
54 if (!sInstance) {
55 sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
56 }
57 return sInstance.get();
58}
59
61{
62 return Form("%s/%d", composeSymNameECal(), 0);
63}
64
65} // namespace ecal
66} // namespace o2
static GeometryTGeo * Instance()
static const char * composeSymNameSensor()
GeometryTGeo(bool build=false, int loadTrans=0)
void fillMatrixCache(int mask)
static std::string sVolumeName
static const char * composeSymNameECal()
void Build(int loadTrans)
static std::string sSensorName
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...