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
17
18// ATTENTION: In opposite to old AliITSgeomTGeo, all indices start from 0, not from 1!!!
19
22#include "MathUtils/Cartesian.h"
23
24#include <fairlogger/Logger.h> // for LOG
25
26#include <TGeoBBox.h> // for TGeoBBox
27#include <TGeoManager.h> // for gGeoManager, TGeoManager
28#include <TGeoPhysicalNode.h> // for TGeoPNEntry, TGeoPhysicalNode
29#include <TGeoShape.h> // for TGeoShape
30#include <TMath.h> // for Nint, ATan2, RadToDeg
31#include <TString.h> // for TString, Form
32#include "TClass.h" // for TClass
33#include "TGeoMatrix.h" // for TGeoHMatrix
34#include "TGeoNode.h" // for TGeoNode, TGeoNodeMatrix
35#include "TGeoVolume.h" // for TGeoVolume
36#include "TMathBase.h" // for Max
37#include "TObjArray.h" // for TObjArray
38#include "TObject.h" // for TObject
39
40#include <cctype> // for isdigit
41#include <cstdio> // for snprintf, NULL, printf
42#include <cstring> // for strstr, strlen
43
44using namespace TMath;
45using namespace o2::ft3;
46using namespace o2::detectors;
47
49
50std::unique_ptr<o2::ft3::GeometryTGeo> GeometryTGeo::sInstance;
51
52std::string GeometryTGeo::sVolumeName = "FT3V";
53std::string GeometryTGeo::sInnerVolumeName = "FT3Inner";
54std::string GeometryTGeo::sLayerName = "FT3Layer";
55std::string GeometryTGeo::sChipName = "FT3Chip";
56std::string GeometryTGeo::sSensorName = "FT3Sensor";
57
58//__________________________________________________________________________
59GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : o2::itsmft::GeometryTGeo(DetID::FT3)
60{
61 // default c-tor, if build is true, the structures will be filled and the transform matrices
62 // will be cached
63 if (sInstance) {
64 LOG(fatal) << "Invalid use of public constructor: o2::ft3::GeometryTGeo instance exists";
65 // throw std::runtime_error("Invalid use of public constructor: o2::ft3::GeometryTGeo instance exists");
66 }
67
68 if (build) {
69 Build(loadTrans);
70 }
71}
72
73//__________________________________________________________________________
74void GeometryTGeo::Build(int loadTrans)
75{
76 if (isBuilt()) {
77 LOG(warning) << "Already built";
78 return; // already initialized
79 }
80
81 if (!gGeoManager) {
82 // RSTODO: in future there will be a method to load matrices from the CDB
83 LOG(fatal) << "Geometry is not loaded";
84 }
85
86 fillMatrixCache(loadTrans);
87}
88
89//__________________________________________________________________________
90const char* GeometryTGeo::composeSymNameLayer(Int_t d, Int_t lr)
91{
92 return Form("%s/%s%d", composeSymNameFT3(d), getFT3LayerPattern(), lr);
93}
94
95//__________________________________________________________________________
96const char* GeometryTGeo::composeSymNameChip(Int_t d, Int_t lr)
97{
98 return Form("%s/%s%d", composeSymNameLayer(d, lr), getFT3ChipPattern(), lr);
99}
100
101//__________________________________________________________________________
102const char* GeometryTGeo::composeSymNameSensor(Int_t d, Int_t lr)
103{
104 return Form("%s/%s%d", composeSymNameChip(d, lr), getFT3SensorPattern(), lr);
105}
106
107//__________________________________________________________________________
109{
110 // populate matrix cache for requested transformations
111 //
112}
Definition of the GeometryManager class.
Definition of the GeometryTGeo class.
ClassImp(o2::ft3::GeometryTGeo)
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
static const char * composeSymNameLayer(Int_t d, Int_t lr)
static std::string sInnerVolumeName
Mother inner volume name.
static std::string sLayerName
Layer name.
static const char * composeSymNameSensor(Int_t d, Int_t lr)
GeometryTGeo(bool build=kFALSE, int loadTrans=0)
static const char * getFT3SensorPattern()
static const char * getFT3ChipPattern()
void Build(int loadTrans=0) override
Exract FT3 parameters from TGeo.
static const char * composeSymNameFT3(Int_t d)
static const char * composeSymNameChip(Int_t d, Int_t lr)
static const char * getFT3LayerPattern()
void fillMatrixCache(int mask) override
static std::string sSensorName
Sensor name.
static std::string sChipName
Chip name.
static std::string sVolumeName
Mother volume name.
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"