Skip to content

Commit 6779bbb

Browse files
committed
Method to translate TOF cluster to nominal sector frame
1 parent f9fd594 commit 6779bbb

File tree

3 files changed

+19
-0
lines changed
  • DataFormats/Detectors/TOF/include/DataFormatsTOF
  • Detectors/TOF/base

3 files changed

+19
-0
lines changed

DataFormats/Detectors/TOF/include/DataFormatsTOF/Cluster.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@ class Cluster : public o2::BaseCluster<float>
5050
kDown = 5, // 2^5, 6th bit
5151
kDownLeft = 6, // 2^6, 7th bit
5252
kLeft = 7 }; // 2^7, 8th bit
53+
constexpr int FrameBit = 6; // this bit set means that the cluster is in the nominal (alpha=20*sector+10 deg.) sector frame rather than aligned
5354

5455
Cluster() = default;
5556

5657
Cluster(std::int16_t sensid, float x, float y, float z, float sy2, float sz2, float syz, double timeRaw, double time, float tot, int L0L1latency, int deltaBC, float geanttime = 0.0, double t0 = 0.0);
5758

5859
~Cluster() = default;
5960

61+
bool isInNominalSector() const { return isBitSet(FrameBit); }
62+
void setInNominalSector() { setBit(FrameBit); }
63+
6064
std::int8_t getSector() const { return getCount(); }
6165
void setSector(std::int8_t value) { setCount(value); }
6266

Detectors/TOF/base/include/TOFBase/Geo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class Geo
6666
static void antiRotateToSector(Float_t* xyz, Int_t isector);
6767
static void antiRotateToStrip(Float_t* xyz, Int_t iplate, Int_t istrip, Int_t isector);
6868

69+
static void alignedToNominalSector(Float_t xyz, Int_t isector);
70+
6971
static void antiRotate(Float_t* xyz, Double_t rotationAngles[6]);
7072
static void getDetID(Float_t* pos, Int_t* det);
7173
static Int_t getIndex(const Int_t* detId); // Get channel index from det Id (for calibration mainly)

Detectors/TOF/base/src/Geo.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,7 @@ void Geo::translate(Float_t* xyz, Float_t translationVector[3])
988988

989989
return;
990990
}
991+
991992
void Geo::translate(Float_t& x, Float_t& y, Float_t& z, Float_t translationVector[3])
992993
{
993994
//
@@ -1045,6 +1046,18 @@ void Geo::rotateToSector(Float_t* xyz, Int_t isector)
10451046
return;
10461047
}
10471048

1049+
void Geo::alignedToNominalSector(Float_t* xyz, Int_t isector)
1050+
{
1051+
// rotate from the aligned sector frame coordinates to nominal ones (i.e. alpha=20*sector+10 deg.)
1052+
constexpr float CS[18] = {.848077e-01, 8.660254e-01, 6.427876e-01, 3.420202e-01, -4.371139e-08, -3.420201e-01, -6.427876e-01, -8.660254e-01, -9.848077e-01, -9.848077e-01, -8.660254e-01, -6.427875e-01, -3.420201e-01, 1.192488e-08, 3.420201e-01, 6.427875e-01, 8.660253e-01, 9.848078e-01};
1053+
constexpr float SN[18] = {1.736482e-01, 5.000000e-01, 7.660444e-01, 9.396926e-01, 1.000000e+00, 9.396926e-01, 7.660444e-01, 5.000001e-01, 1.736483e-01, -1.736482e-01, -5.000000e-01, -7.660446e-01, -9.396927e-01, -1.000000e+00, -9.396926e-01, -7.660445e-01, -5.000002e-01, -1.736480e-01};
1054+
Float_t xyzDummy[3] = {xyz[1], xyz[2], xyz[0]); // go to twisted coordinates...
1055+
o2::tof::Geo::antiRotateToSector(xyzDummy, isector); // lab coordinates
1056+
xyz[0] = xyzDummy[0] * CS[isector] + xyzDummy[1] * SN[isector];
1057+
xyz[1] = -xyzDummy[0] * SN[isector] + xyzDummy[1] * CS[isector];
1058+
xyz[2] = xyzDummy[2];
1059+
}
1060+
10481061
void Geo::antiRotateToStrip(Float_t* xyz, Int_t iplate, Int_t istrip, Int_t isector)
10491062
{
10501063
Float_t xyzDummy[3] = {0., 0., 0.};

0 commit comments

Comments
 (0)