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
16
18#include <TGeoManager.h>
19
20namespace o2
21{
22namespace ecal
23{
24std::unique_ptr<o2::ecal::GeometryTGeo> GeometryTGeo::sInstance;
25
26std::string GeometryTGeo::sVolumeName = "ECALV";
27std::string GeometryTGeo::sSectorName = "ECALSector";
28std::string GeometryTGeo::sModuleName = "ECALModule";
29
30GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : DetMatrixCache()
31{
32 if (sInstance) {
33 LOGP(fatal, "Invalid use of public constructor: o2::ecal::GeometryTGeo instance exists");
34 }
35 if (build) {
36 Build(loadTrans);
37 }
38}
39
40void GeometryTGeo::Build(int loadTrans)
41{
42 if (isBuilt()) {
43 LOGP(warning, "Already built");
44 return; // already initialized
45 }
46
47 if (!gGeoManager) {
48 LOGP(fatal, "Geometry is not loaded");
49 }
50
51 fillMatrixCache(loadTrans);
52}
53
57
59{
60 if (!sInstance) {
61 sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
62 }
63 return sInstance.get();
64}
65
67{
68 return Form("%s/%s_%d", composeSymNameECal(), getECalSectorPattern(), s);
69}
70
72{
73 return Form("%s/%s_%d", composeSymNameSector(s), getECalModulePattern(), m);
74}
75
76} // namespace ecal
77} // namespace o2
Class containing ECal volume naming patterns.
static const char * composeSymNameSector(int s)
static std::string sModuleName
static const char * getECalModulePattern()
static GeometryTGeo * Instance()
static const char * getECalSectorPattern()
GeometryTGeo(bool build=false, int loadTrans=0)
static std::string sSectorName
static const char * composeSymNameModule(int s, int m)
void fillMatrixCache(int mask)
static std::string sVolumeName
static const char * composeSymNameECal()
void Build(int loadTrans)
const GLfloat * m
Definition glcorearb.h:4066
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...