17#ifndef ALICEO2_ITS_GEOMETRYTGEO_H_
18#define ALICEO2_ITS_GEOMETRYTGEO_H_
20#include <TGeoMatrix.h>
48 using DetMatrixCache::getMatrixL2G;
49 using DetMatrixCache::getMatrixT2GRot;
50 using DetMatrixCache::getMatrixT2L;
53 using DetMatrixCache::getMatrixT2G;
58#ifdef GPUCA_STANDALONE
62 sInstance = std::make_unique<GeometryTGeo>(
true, 0);
64 return sInstance.get();
70#ifdef GPUCA_STANDALONE
73 return sInstance.get() !=
nullptr;
91#ifndef GPUCA_STANDALONE
107 void Build(
int loadTrans = 0)
override;
112#ifdef ENABLE_UPGRADES
136 int getChipIndex(
int lay,
int hba,
int sta,
int detInSta)
const;
145 int getChipIndex(
int lay,
int hba,
int sta,
int subSta,
int detInSubSta)
const;
155 int getChipIndex(
int lay,
int hba,
int sta,
int subSta,
int md,
int detInMod)
const;
165 bool getChipId(
int index,
int& lay,
int& sta,
int& ssta,
int& mod,
int& chip)
const;
176 bool getChipId(
int index,
int& lay,
int& hba,
int& sta,
int& ssta,
int& mod,
int& chip)
const;
262 void localToGlobal(
int lay,
int sta,
int det,
const double* loc,
double* glob);
266 void globalToLocal(
int lay,
int sta,
int det,
const double* glob,
double* loc);
272 void Print(Option_t* opt =
"")
const;
331 static const char*
composeSymNameModule(
int lr,
int hba,
int sta,
int ssta,
int mod,
bool isITS3 =
false);
334 static const char*
composeSymNameChip(
int lr,
int hba,
int sta,
int ssta,
int mod,
int chip,
bool isITS3 =
false);
439#ifndef GPUCA_STANDALONE
440 static std::unique_ptr<o2::its::GeometryTGeo> sInstance;
Definition of the GeometryManager class.
Definition of the GeometryTGeo class : common part for ITS and MFT.
static const char * getSymbolicName(o2::detectors::DetID detid, int sensid)
static Bool_t getOriginalMatrix(o2::detectors::DetID detid, int sensid, TGeoHMatrix &m)
static TGeoHMatrix * getMatrix(const char *symname)
static TGeoPNEntry * getPNEntry(o2::detectors::DetID detid, Int_t sensid)
virtual void fillMatrixCache(int mask)=0
const o2::detectors::DetID & getDetID() const
const Mat3D & getMatrixL2G(int sensID) const
int extractNumberOfLayers()
Determines the number of layers in the Geometry.
TGeoHMatrix & createT2LMatrix(int isn)
static const char * getITS3ModulePattern()
std::vector< int > mNumberOfChipsPerHalfStave
number of chips per substave
o2::math_utils::Transform3D Mat3D
static const char * getITSLayerPattern()
void getSensorXAlphaRefPlane(int index, float &x, float &alpha) const
const char * getSymbolicName(int index) const
static const std::string sLayerNameITS3
Layer name for ITS3.
static constexpr int MAXLAYERS
max number of active layers
void localToGlobal(int index, const double *loc, double *glob)
static const char * composeSymNameLayer(int lr, bool isITS3=false)
sym name of the layer
static const std::string sStaveNameITS3
Stave name for ITS3.
int getNumberOfModules(int lay) const
void localToGlobal(int lay, int sta, int det, const double *loc, double *glob)
GeometryTGeo & operator=(const GeometryTGeo &geom)=delete
int getChipIdInHalfStave(int index) const
Get chip number within stave, from 0.
void globalToLocalVector(int index, const double *glob, double *loc)
static const std::string sSensorNameITS3
Sensor name for ITS3.
static const char * composeSymNameITS(bool isITS3=false)
sym name of the layer
std::vector< int > mNumberOfHalfStaves
the number of substaves/stave(layer)
static std::string sHalfBarrelName
HalfBarrel name.
static std::string sHalfStaveName
HalfStave name.
const Rot2D & getMatrixT2GRot(int lay, int hba, int sta, int sens)
static const char * getITS3SegmentPattern(int layer)
TGeoHMatrix * getMatrix(int lay, int hba, int sta, int sens) const
int getNumberOfHalfStaves(int lay) const
static const char * getITS3SensorPattern()
static const char * getITS3LayerPattern(int layer)
static const char * getITS3ChipPattern()
static const char * getITS3TilePattern(int layer)
static const char * getITSSensorPattern()
const Mat3D & getMatrixT2L(int lay, int hba, int sta, int det) const
bool getChipId(int index, int &lay, int &sta, int &ssta, int &mod, int &chip) const
int extractNumberOfChipsPerModule(int lay, int &nrow) const
int getNumberOfChipsPerModule(int lay) const
TGeoHMatrix * getMatrix(int index) const
Get the transformation matrix for a given chip (NOT A SENSOR!!!) 'index' by quering the TGeoManager.
static std::string sLayerName
Layer name.
static const char * getITS3CarbonFormPatternRaw()
int getHalfBarrel(int index) const
Get chip half barrel, from 0.
static const char * getITS3ChipPatternRaw()
std::vector< int > mNumberOfStaves
number of staves/layer(layer)
static void setITSSensorPattern(const char *nm)
static const char * getITSHalfBarrelPattern()
std::vector< int > mNumberOfModules
number of modules/substave(layer)
TGeoHMatrix * extractMatrixSensor(int index) const
bool getOriginalMatrix(int lay, int hba, int sta, int det, TGeoHMatrix &m) const
static bool instanceExist()
static const char * getITS3RSUPattern(int layer)
int getLayer(int index) const
Get chip layer, from 0.
static const char * composeSymNameHalfBarrel(int lr, int hba, bool isITS3=false)
Sym name of the half barrel at given layer.
std::array< char, MAXLAYERS > mLayerToWrapper
Layer to wrapper correspondence.
int getNumberOfStaves(int lay) const
std::array< bool, MAXLAYERS > mIsLayerITS3
flag with the information of the ITS version (ITS2 or ITS3)
static const char * getITS3HalfStavePattern()
static const char * getITS3PixelArrayPatternRaw()
static void setITSLayerPattern(const char *nm)
float getSensorRefAlpha(int isn) const
static const char * getITS3TilePatternRaw()
static const std::string sModuleNameITS3
Module name for ITS3.
int getChipIdInStave(int index) const
Get chip number within stave, from 0.
static std::string sModuleName
Module name.
static const std::string sHalfStaveNameITS3
HalfStave name for ITS3.
TString getMatrixPath(int index) const
int extractNumberOfModules(int lay) const
int getNumberOfChipsPerLayer(int lay) const
static const char * composeSymNameHalfStave(int lr, int hba, int sta, int ssta, bool isITS3=false)
Sym name of the stave at given layer/halfbarrel.
static GeometryTGeo * Instance()
void globalToLocal(int index, const double *glob, double *loc)
~GeometryTGeo() override
Default destructor, don't use.
int getNumberOfChipsPerStave(int lay) const
static void setITSVolPattern(const char *nm)
static const char * getITS3CarbonFormPattern(int layer)
static void setITSStavePattern(const char *nm)
int extractVolumeCopy(const char *name, const char *prefix) const
Extract number following the prefix in the name string.
const Mat3D getT2LMatrixITS3(int isn, float alpha)
static const char * composeSymNameChip(int lr, int hba, int sta, int ssta, int mod, int chip, bool isITS3=false)
Sym name of the chip in the given layer/halfbarrel/stave/substave/module.
static const char * getITS3PixelArrayPattern(int layer)
static const char * getITSChipPattern()
static const char * composeSymNameModule(int lr, int hba, int sta, int ssta, int mod, bool isITS3=false)
Sym name of the substave at given layer/halfbarrel/stave.
int extractLayerChipType(int lay) const
GeometryTGeo(const GeometryTGeo &src)=delete
std::vector< float > mCacheRefX
sensors tracking plane reference X
std::vector< int > mNumberOfChipsPerModule
number of chips per module (group of chips on substaves)
static std::string sWrapperVolumeName
Wrapper volume name.
int getNumberOfChipColsPerModule(int lay) const
static const char * getITSVolPattern()
TGeoPNEntry * getPNEntry(int index) const
int getNumberOfChipRowsPerModule(int lay) const
static const char * getITS3HalfBarrelPattern()
std::vector< int > mNumberOfChipsPerStave
number of chips per stave
bool isTrackingFrameCached() const
static const std::string sHalfBarrelNameITS3
HalfBarrel name for ITS3.
void Build(int loadTrans=0) override
Exract ITS parameters from TGeo.
int getNumberOfHalfBarrels() const
static const char * getITS3SegmentPatternRaw()
void extractSensorXAlpha(int isn, float &x, float &alp)
std::vector< int > mNumberOfChipsPerLayer
number of chips per stave
int extractNumberOfStaves(int lay) const
int getHalfStave(int index) const
Get chip substave id in stave, from 0.
const Mat3D & getMatrixSensor(int lay, int hba, int sta, int det) const
int getFirstChipIndex(int lay) const
static const char * getITSModulePattern()
static void setITSHalfBarrelPattern(const char *nm)
int getChipIdInLayer(int index) const
Get chip number within layer, from 0.
static const std::string sChipNameITS3
Chip name for ITS3.
static std::string sStaveName
Stave name.
int extractNumberOfHalfStaves(int lay) const
static void setITSChipPattern(const char *nm)
Int_t mNumberOfHalfBarrels
number of halfbarrels
static const char * getITS3RSUPatternRaw()
void fillMatrixCache(int mask) override
void Print(Option_t *opt="") const
float getSensorRefX(int isn) const
static void adopt(GeometryTGeo *raw, bool canDelete=false)
int getChipIndex(int lay, int detInLay) const
std::vector< float > mCacheRefAlpha
sensors tracking plane reference alpha
static const char * getITS3ChipPattern(int layer)
const char * getSymbolicName(int lay, int hba, int sta, int det) const
Int_t mNumberOfLayers
number of layers
static void setITSModulePattern(const char *nm)
void fillTrackingFramesCache()
static const char * composeSymNameStave(int lr, int hba, int sta, bool isITS3=false)
Sym name of the stave at given layer.
void localToGlobalVector(int index, const double *loc, double *glob)
int getNumberOfLayers() const
int getStave(int index) const
Get chip stave, from 0.
static const char * getITS3LayerPattern()
int getModule(int index) const
Get chip module id in substave, from 0.
static const char * getITS3StavePattern()
static std::string sSensorName
Sensor name.
static std::string sChipName
Chip name.
std::vector< int > mNumberOfChipRowsPerModule
number of chips rows per module (relevant for OB modules)
int getNumberOfChipsPerHalfStave(int lay) const
void globalToLocal(int lay, int sta, int det, const double *glob, double *loc)
bool getOriginalMatrix(int index, TGeoHMatrix &m) const
int getChipIdInModule(int index) const
Get chip number within module, from 0.
std::vector< int > mLastChipIndex
max ID of the detctor in the layer
static void setITSWrapVolPattern(const char *nm)
const Mat3D & getMatrixSensor(int index) const
static const char * getITSHalfStavePattern()
int extractNumberOfHalfBarrels() const
std::vector< int > mNumberOfChipsPerHalfBarrel
number of chips per halfbarrel
static std::string sVolumeName
Mother volume name.
static const char * getITS3LayerPatternRaw()
static const char * getITSStavePattern()
int getNumberOfChipsPerHalfBarrel(int lay) const
static void setITSHalfStavePattern(const char *nm)
int getLastChipIndex(int lay) const
static const char * getITSWrapVolPattern()
GLfloat GLfloat GLfloat alpha
GLuint const GLchar * name
GLenum GLuint GLint GLint layer