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";
57std::string GeometryTGeo::sPassiveName = "FT3Passive";
58
59//__________________________________________________________________________
60GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : o2::itsmft::GeometryTGeo(DetID::FT3)
61{
62 // default c-tor, if build is true, the structures will be filled and the transform matrices
63 // will be cached
64 if (sInstance) {
65 LOG(fatal) << "Invalid use of public constructor: o2::ft3::GeometryTGeo instance exists";
66 // throw std::runtime_error("Invalid use of public constructor: o2::ft3::GeometryTGeo instance exists");
67 }
68
69 if (build) {
70 Build(loadTrans);
71 }
72}
73
74//__________________________________________________________________________
75void GeometryTGeo::Build(int loadTrans)
76{
77 if (isBuilt()) {
78 LOG(warning) << "Already built";
79 return; // already initialized
80 }
81
82 if (!gGeoManager) {
83 // RSTODO: in future there will be a method to load matrices from the CDB
84 LOG(fatal) << "Geometry is not loaded";
85 }
86
87 fillMatrixCache(loadTrans);
88}
89
90//__________________________________________________________________________
91const char* GeometryTGeo::composeSymNameLayer(Int_t d, Int_t lr)
92{
93 return Form("%s/%s%d", composeSymNameFT3(d), getFT3LayerPattern(), lr);
94}
95
96//__________________________________________________________________________
97const char* GeometryTGeo::composeSymNameChip(Int_t d, Int_t lr)
98{
99 return Form("%s/%s%d", composeSymNameLayer(d, lr), getFT3ChipPattern(), lr);
100}
101
102//__________________________________________________________________________
103const char* GeometryTGeo::composeSymNameSensor(Int_t d, Int_t lr)
104{
105 return Form("%s/%s%d", composeSymNameChip(d, lr), getFT3SensorPattern(), lr);
106}
107
108//__________________________________________________________________________
110{
111 // populate matrix cache for requested transformations
112 //
113}
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()
static std::string sPassiveName
Passive material name.
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"