Project
Loading...
Searching...
No Matches
GeometryTGeo.h
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#ifndef ALICEO2_FCT_GEOMETRYTGEO_H_
19#define ALICEO2_FCT_GEOMETRYTGEO_H_
20
21#include <TGeoMatrix.h> // for TGeoHMatrix
22#include <TObject.h> // for TObject
23#include <array>
24#include <string>
25#include <vector>
29#include "MathUtils/Utils.h"
30#include "Rtypes.h" // for Int_t, Double_t, Bool_t, UInt_t, etc
31
32class TGeoPNEntry;
33
34namespace o2
35{
36namespace fct
37{
43
45{
46 public:
48 using DetMatrixCache::getMatrixL2G;
49 using DetMatrixCache::getMatrixT2GRot;
50 using DetMatrixCache::getMatrixT2L;
51 // this method is not advised for ITS: for barrel detectors whose tracking frame is just a rotation
52 // it is cheaper to use T2GRot
53 using DetMatrixCache::getMatrixT2G;
54
56 {
57 // get (create if needed) a unique instance of the object
58 if (!sInstance) {
59 sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
60 }
61 return sInstance.get();
62 }
63
64 // adopt the unique instance from external raw pointer (to be used only to read saved instance from file)
65 static void adopt(GeometryTGeo* raw);
66
67 // constructor
68 // ATTENTION: this class is supposed to behave as a singleton, but to make it root-persistent
69 // we must define public default constructor.
70 // NEVER use it, it will throw exception if the class instance was already created
71 // Use GeometryTGeo::Instance() instead
72 GeometryTGeo(bool build = kFALSE, int loadTrans = 0
73 /*o2::base::utils::bit2Mask(o2::TransformType::T2L, // default transformations to load
74 o2::TransformType::T2G,
75 o2::TransformType::L2G)*/
76 );
77
79 ~GeometryTGeo() override = default;
80
81 GeometryTGeo(const GeometryTGeo& src) = delete;
82 GeometryTGeo& operator=(const GeometryTGeo& geom) = delete;
83
84 // implement filling of the matrix cache
86 void fillMatrixCache(int mask) override;
87
89 void Build(int loadTrans = 0) override;
90
91 void Print(Option_t* opt = "") const;
92 static const char* getFCTVolPattern() { return sVolumeName.c_str(); }
93 static const char* getFCTInnerVolPattern() { return sInnerVolumeName.c_str(); }
94 static const char* getFCTLayerPattern() { return sLayerName.c_str(); }
95 static const char* getFCTChipPattern() { return sChipName.c_str(); }
96 static const char* getFCTSensorPattern() { return sSensorName.c_str(); }
97
98 static const char* composeSymNameFCT(Int_t d) { return Form("%s_%d", o2::detectors::DetID(o2::detectors::DetID::FCT).getName(), d); }
99 static const char* composeSymNameLayer(Int_t d, Int_t lr);
100 static const char* composeSymNameChip(Int_t d, Int_t lr);
101 static const char* composeSymNameSensor(Int_t d, Int_t lr);
102
103 protected:
104 static constexpr int MAXLAYERS = 15;
105
107 static std::string sInnerVolumeName;
108 static std::string sVolumeName;
109 static std::string sLayerName;
110 static std::string sChipName;
111
112 static std::string sSensorName;
113
114 private:
115 static std::unique_ptr<o2::fct::GeometryTGeo> sInstance;
116
117 ClassDefOverride(GeometryTGeo, 1); // FCT geometry based on TGeo
118};
119} // namespace fct
120} // namespace o2
121
122#endif
General auxilliary methods.
Definition of the GeometryManager class.
Definition of the GeometryTGeo class : common part for ITS and MFT.
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:58
virtual void fillMatrixCache(int mask)=0
const char * getName() const
GeometryTGeo(const GeometryTGeo &src)=delete
static const char * getFCTChipPattern()
static const char * composeSymNameLayer(Int_t d, Int_t lr)
static std::string sInnerVolumeName
Mother inner volume name.
static const char * getFCTVolPattern()
static constexpr int MAXLAYERS
max number of active layers
GeometryTGeo & operator=(const GeometryTGeo &geom)=delete
o2::math_utils::Transform3D Mat3D
static std::string sLayerName
Layer name.
static const char * composeSymNameSensor(Int_t d, Int_t lr)
Int_t mNumberOfLayers
number of layers
static void adopt(GeometryTGeo *raw)
static const char * getFCTInnerVolPattern()
static GeometryTGeo * Instance()
void Print(Option_t *opt="") const
static const char * getFCTLayerPattern()
void Build(int loadTrans=0) override
Exract FCT parameters from TGeo.
static const char * composeSymNameChip(Int_t d, Int_t lr)
void fillMatrixCache(int mask) override
static const char * composeSymNameFCT(Int_t d)
static std::string sSensorName
Sensor name.
static std::string sChipName
Chip name.
~GeometryTGeo() override=default
Default destructor.
static const char * getFCTSensorPattern()
static std::string sVolumeName
Mother volume name.
GLenum src
Definition glcorearb.h:1767
GLint GLuint mask
Definition glcorearb.h:291
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...