forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeometryTGeo.h
More file actions
120 lines (101 loc) · 4.63 KB
/
GeometryTGeo.h
File metadata and controls
120 lines (101 loc) · 4.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file GeometryTGeo.h
/// \brief Definition of the GeometryTGeo class
/// \author cvetan.cheshkov@cern.ch - 15/02/2007
/// \author ruben.shahoyan@cern.ch - adapted to ITSupg 18/07/2012
/// \author rafael.pezzi@cern.ch - adapted to PostLS4EndCaps 25/06/2020
#ifndef ALICEO2_FT3_GEOMETRYTGEO_H_
#define ALICEO2_FT3_GEOMETRYTGEO_H_
#include <TGeoMatrix.h> // for TGeoHMatrix
#include <TObject.h> // for TObject
#include <array>
#include <string>
#include <vector>
#include "DetectorsBase/GeometryManager.h"
#include "DetectorsCommonDataFormats/DetID.h"
#include "ITSMFTBase/GeometryTGeo.h"
#include "MathUtils/Utils.h"
#include "Rtypes.h" // for Int_t, Double_t, Bool_t, UInt_t, etc
class TGeoPNEntry;
namespace o2
{
namespace ft3
{
/// GeometryTGeo is a simple interface class to TGeoManager. It is used in the simulation
/// in order to query the TGeo FT3 geometry.
/// RS: In order to preserve the static character of the class but make it dynamically access
/// geometry, we need to check in every method if the structures are initialized. To be converted
/// to singleton at later stage.
class GeometryTGeo : public o2::itsmft::GeometryTGeo
{
public:
typedef o2::math_utils::Transform3D Mat3D;
using DetMatrixCache::getMatrixL2G;
using DetMatrixCache::getMatrixT2GRot;
using DetMatrixCache::getMatrixT2L;
// this method is not advised for ITS: for barrel detectors whose tracking frame is just a rotation
// it is cheaper to use T2GRot
using DetMatrixCache::getMatrixT2G;
static GeometryTGeo* Instance()
{
// get (create if needed) a unique instance of the object
if (!sInstance) {
sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0));
}
return sInstance.get();
}
// adopt the unique instance from external raw pointer (to be used only to read saved instance from file)
static void adopt(GeometryTGeo* raw);
// constructor
// ATTENTION: this class is supposed to behave as a singleton, but to make it root-persistent
// we must define public default constructor.
// NEVER use it, it will throw exception if the class instance was already created
// Use GeometryTGeo::Instance() instead
GeometryTGeo(bool build = kFALSE, int loadTrans = 0
/*o2::base::utils::bit2Mask(o2::TransformType::T2L, // default transformations to load
o2::TransformType::T2G,
o2::TransformType::L2G)*/
);
/// Default destructor
~GeometryTGeo() override = default;
GeometryTGeo(const GeometryTGeo& src) = delete;
GeometryTGeo& operator=(const GeometryTGeo& geom) = delete;
// implement filling of the matrix cache
using o2::itsmft::GeometryTGeo::fillMatrixCache;
void fillMatrixCache(int mask) override;
/// Exract FT3 parameters from TGeo
void Build(int loadTrans = 0) override;
void Print(Option_t* opt = "") const;
static const char* getFT3VolPattern() { return sVolumeName.c_str(); }
static const char* getFT3InnerVolPattern() { return sInnerVolumeName.c_str(); }
static const char* getFT3LayerPattern() { return sLayerName.c_str(); }
static const char* getFT3ChipPattern() { return sChipName.c_str(); }
static const char* getFT3SensorPattern() { return sSensorName.c_str(); }
static const char* getFT3PassivePattern() { return sPassiveName.c_str(); }
static const char* composeSymNameFT3(Int_t d) { return Form("%s_%d", o2::detectors::DetID(o2::detectors::DetID::FT3).getName(), d); }
static const char* composeSymNameLayer(Int_t d, Int_t lr);
static const char* composeSymNameChip(Int_t d, Int_t lr);
static const char* composeSymNameSensor(Int_t d, Int_t lr);
protected:
static std::string sInnerVolumeName; ///< Mother inner volume name
static std::string sVolumeName; ///< Mother volume name
static std::string sLayerName; ///< Layer name
static std::string sChipName; ///< Chip name
static std::string sSensorName; ///< Sensor name
static std::string sPassiveName; ///< Passive material name
private:
static std::unique_ptr<o2::ft3::GeometryTGeo> sInstance; ///< singletone instance
ClassDefOverride(GeometryTGeo, 1); // FT3 geometry based on TGeo
};
} // namespace ft3
} // namespace o2
#endif