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::fct;
46using namespace o2::detectors;
47
49
50std::unique_ptr<o2::fct::GeometryTGeo> GeometryTGeo::sInstance;
51
52std::string GeometryTGeo::sVolumeName = "FCTV";
53std::string GeometryTGeo::sInnerVolumeName = "FCTInner";
54std::string GeometryTGeo::sLayerName = "FCTLayer";
55std::string GeometryTGeo::sChipName = "FCTChip";
56std::string GeometryTGeo::sSensorName = "FCTSensor";
57
58//__________________________________________________________________________
59GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : o2::itsmft::GeometryTGeo(DetID::FCT)
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::fct::GeometryTGeo instance exists";
65 // throw std::runtime_error("Invalid use of public constructor: o2::fct::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", composeSymNameFCT(d), getFCTLayerPattern(), lr);
93}
94
95//__________________________________________________________________________
96const char* GeometryTGeo::composeSymNameChip(Int_t d, Int_t lr)
97{
98 return Form("%s/%s%d", composeSymNameLayer(d, lr), getFCTChipPattern(), lr);
99}
100
101//__________________________________________________________________________
102const char* GeometryTGeo::composeSymNameSensor(Int_t d, Int_t lr)
103{
104 return Form("%s/%s%d", composeSymNameChip(d, lr), getFCTSensorPattern(), lr);
105}
106
107//__________________________________________________________________________
109{
110 // populate matrix cache for requested transformations
111 //
112}
Definition of the GeometryManager class.
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events d
Definition of the GeometryTGeo class.
ClassImp(o2::fct::GeometryTGeo)
Static class with identifiers, bitmasks and names for ALICE detectors.
Definition DetID.h:60
static const char * getFCTChipPattern()
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 * 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.
static const char * getFCTSensorPattern()
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"