Project
Loading...
Searching...
No Matches
AlignSensorHelper.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
15
16#ifndef ALICEO2_MFT_ALIGN_SENSOR_HELPER_H
17#define ALICEO2_MFT_ALIGN_SENSOR_HELPER_H
18
19#include <sstream>
20#include <array>
21
22#include <TGeoMatrix.h>
23#include <TString.h>
24#include <Rtypes.h>
25
27#include "MathUtils/Cartesian.h"
28#include "MFTBase/Geometry.h"
29#include "MFTBase/GeometryTGeo.h"
30
31namespace o2
32{
33namespace mft
34{
35
38{
39 public:
42
44 virtual ~AlignSensorHelper() = default;
45
47 void setGeometry();
48
50 bool setSensor(const int chipIndex);
51
53 void setSensorOnlyInfo(const int chipIndex);
54
56 UShort_t chipIndexOnLadder() const { return mChipIndexOnLadder; }
57
59 UShort_t chipIndexInMft() const { return mChipIndexInMft; }
60
62 UShort_t half() const { return mHalf; }
63
65 UShort_t disk() const { return mDisk; }
66
68 UShort_t layer() const { return mLayer; }
69
71 UShort_t zone() const { return mZone; }
72
74 UShort_t connector() const { return mConnector; }
75
77 UShort_t transceiver() const { return mTransceiver; }
78
80 Int_t sensorUid() const { return mChipUniqueId; }
81
83 TString geoSymbolicName() { return mGeoSymbolicName; }
84
86 double translateX() const { return mTranslation.X(); }
87
89 double translateY() const { return mTranslation.Y(); }
90
92 double translateZ() const { return mTranslation.Z(); }
93
95 double angleRx() const { return mRx; }
96
98 double angleRy() const { return mRy; }
99
101 double angleRz() const { return mRz; }
102
104 double sinRx() const { return mSinRx; }
105 double cosRx() const { return mCosRx; }
106
108 double sinRy() const { return mSinRy; }
109 double cosRy() const { return mCosRy; }
110
112 double sinRz() const { return mSinRz; }
113 double cosRz() const { return mCosRz; }
114
117
119 std::stringstream getSensorFullName(bool wSymName = true);
120
121 protected:
124 UShort_t mChipIndexOnLadder = 0;
125 UShort_t mChipIndexInMft = 0;
126 UShort_t mConnector = 0;
127 UShort_t mTransceiver = 0;
128 UShort_t mLayer = 0;
129 UShort_t mZone = 0;
130 UShort_t mDisk = 0;
131 UShort_t mHalf = 0;
132 Int_t mChipUniqueId = 0;
133 TGeoHMatrix mTransform;
135 std::array<TString, mNumberOfSensors> mSymNames;
136
137 // Euler angles extracted from the sensor transform
138 double mRx = 0;
139 double mRy = 0;
140 double mRz = 0;
141
142 // Cosinus and sinus of the Euler angles
143 double mSinRx = 0;
144 double mCosRx = 0;
145 double mSinRy = 0;
146 double mCosRy = 0;
147 double mSinRz = 0;
148 double mCosRz = 0;
149
151
153
154 protected:
156 void setSensorUid(const int chipIndex);
157
159 void builSymNames();
160
162 int getChipIdGeoFromRO(const int chipIdRO);
163
165 void setSymName();
166
169
172
174};
175
176} // namespace mft
177} // namespace o2
178#endif
Class handling both virtual segmentation and real volumes.
static constexpr int NChips
o2::math_utils::Point3D< double > mTranslation
coordinates of the translation between the local system origin (the center of the sensor) and the glo...
UShort_t mTransceiver
transceiver id to which the sensor is connected in the zone [0, 24]
double translateY() const
return the y component of the translation in the sensor transform
TString geoSymbolicName()
return the geo symbolic name for this sensor
AlignSensorHelper()
constructor with a pointer to the geometry
UShort_t mConnector
connector index to which the ladder is plugged in the zone [0, 4]
std::array< TString, mNumberOfSensors > mSymNames
void setGeometry()
set pointer to geometry that should already have done fillMatrixCache()
double angleRz() const
return the rotation angle w.r.t. global z-axis in the sensor transform
UShort_t disk() const
return the disk number to which belongs the sensor
UShort_t transceiver() const
return the transceiver on the RU for this sensor
UShort_t layer() const
return the layer number to which belongs the sensor
UShort_t mLayer
layer id [0, 9]
double translateX() const
return the x component of the translation in the sensor transform
double mRx
‍array of symbolic names of all sensors
void resetSensorTransformInfo()
reset all sensor transform related variables
bool isTransformExtracted() const
return the status of the sensor transform extraction
static constexpr int mNumberOfSensors
Total number of sensors (detection elements) in the MFT.
void setSymName()
set the symbolic name of this sensor in the geometry
void setSensorOnlyInfo(const int chipIndex)
set the studied sensor
double mRz
rotation angle aroung global z-axis (radian)
UShort_t mChipIndexOnLadder
sensor index within the ladder [0, 4]
TString mGeoSymbolicName
symbolic name of this sensor in the geometry
double sinRx() const
return the sin, cos of the rotation angle w.r.t. x-axis
UShort_t connector() const
return the connector to which the ladder is plugged
UShort_t mHalf
half id [0, 1]
bool setSensor(const int chipIndex)
set the studied sensor
TGeoHMatrix mTransform
sensor transformation matrix L2G
bool mIsTransformExtracted
boolean used to check if the sensor transform was successfully extracted from geometry
UShort_t chipIndexOnLadder() const
return sensor index within the ladder [0, 4]
Int_t sensorUid() const
return the ALICE global unique id of the sensor
void extractSensorTransform()
init the matrix that stores the sensor transform L2G and extract its components
int getChipIdGeoFromRO(const int chipIdRO)
return chip id Geo from a given chip id RO
UShort_t half() const
return the half number to which belongs the sensor
Int_t mChipUniqueId
ALICE global unique id of the sensor.
double mRy
rotation angle aroung global y-axis (radian)
void builSymNames()
build array of symbolic names of all sensors
double sinRy() const
return the sin, cos of the rotation angle w.r.t. y-axis
UShort_t mDisk
disk id [0, 4]
void setSensorUid(const int chipIndex)
set the ALICE global unique id of the sensor
double angleRy() const
return the rotation angle w.r.t. global y-axis in the sensor transform
UShort_t mChipIndexInMft
sensor sw index within the MFT [0, 935]
double translateZ() const
return the z component of the translation in the sensor transform
std::stringstream getSensorFullName(bool wSymName=true)
return a stringstream filled with the sensor info
UShort_t mZone
zone id [0,3]
double angleRx() const
return the rotation angle w.r.t. global x-axis in the sensor transform
UShort_t zone() const
return the zone to which belongs the sensor
double sinRz() const
return the sin, cos of the rotation angle w.r.t. z-axis
UShort_t chipIndexInMft() const
return sensor sw index within the MFT [0, 935]
virtual ~AlignSensorHelper()=default
default destructor
o2::mft::GeometryTGeo * mGeometry
MFT geometry.
ClassDef(AlignSensorHelper, 0)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...