9#include <alignment/reconstruction/AlignableEKLMRecoHit.h>
11#include <alignment/GlobalDerivatives.h>
12#include <alignment/GlobalLabel.h>
13#include <alignment/reconstruction/AlignableEKLMRecoHit.h>
14#include <klm/dataobjects/eklm/EKLMElementNumbers.h>
15#include <klm/dataobjects/KLMDigit.h>
16#include <klm/dataobjects/KLMElementNumbers.h>
17#include <klm/dataobjects/KLMHit2d.h>
18#include <klm/dbobjects/eklm/EKLMAlignment.h>
19#include <klm/eklm/geometry/GeometryData.h>
20#include <klm/eklm/geometry/TransformDataGlobalAligned.h>
23using namespace alignment;
31 genfit::PlanarMeasurement(1)
34 int digit, plane, segment, strip;
35 const HepGeom::Transform3D* t;
37 CLHEP::Hep3Vector origin;
38 CLHEP::Hep3Vector u(1, 0, 0);
39 CLHEP::Hep3Vector v(0, 1, 0);
48 if (hit2ds.
size() != 1)
49 B2FATAL(
"Incorrect number of related KLMHit2ds.");
51 if (eklmDigits.
size() != 2)
52 B2FATAL(
"Incorrect number of related KLMDigits.");
53 digit = hit->getDigitIdentifier();
54 m_Section = eklmDigits[digit]->getSection();
55 m_Layer = eklmDigits[digit]->getLayer();
56 m_Sector = eklmDigits[digit]->getSector();
57 plane = eklmDigits[digit]->getPlane();
58 segment = (eklmDigits[digit]->getStrip() - 1) /
66 origin = t->getTranslation();
80 r = t->getRotation().inverse();
84 genfit::SharedPlanePtr detPlane(
new genfit::DetPlane(origin2, u2, v2, 0));
87 ((eklmDigits[digit]->getStrip() - 1) %
100 std::vector<int> labGlobal;
106 const double dalpha = 0;
107 const double dxs = 0;
108 const double dys = 0;
109 const double sinda = sin(dalpha);
110 const double cosda = cos(dalpha);
113 HepGeom::Transform3D t;
117 globalPos.setX(sop->getPos().X() /
Unit::cm * CLHEP::cm);
118 globalPos.setY(sop->getPos().Y() /
Unit::cm * CLHEP::cm);
119 globalPos.setZ(sop->getPos().Z() /
Unit::cm * CLHEP::cm);
120 globalPos = t * globalPos;
121 double x = globalPos.x() / CLHEP::cm *
Unit::cm;
122 double y = globalPos.y() / CLHEP::cm *
Unit::cm;
129 TMatrixD derGlobal(2, 3);
uint16_t m_Segment
Segment number.
int m_Section
Section number.
AlignableEKLMRecoHit()
Constructor.
int m_Sector
Sector number.
virtual std::pair< std::vector< int >, TMatrixD > globalDerivatives(const genfit::StateOnPlane *sop) override
Labels and derivatives of residuals (local measurement coordinates) w.r.t.
~AlignableEKLMRecoHit()
Destructor.
genfit::AbsMeasurement * clone() const override
Clone.
B2Vector3D m_StripV
V direction.
uint16_t m_KLMModule
KLM module number.
void SetX(DataType x)
set X/1st-coordinate
DataType X() const
access variable X (= .at(0) without boundary check)
DataType Y() const
access variable Y (= .at(1) without boundary check)
void SetZ(DataType z)
set Z/3rd-coordinate
void SetY(DataType y)
set Y/2nd-coordinate
This dataobject is used only for EKLM alignment.
static const EKLMElementNumbers & Instance()
Instantiation.
static constexpr int getNStripsSegment()
Get number of strips in a segment.
int segmentNumber(int section, int layer, int sector, int plane, int segment) const
Get segment number.
double getWidth() const
Get width.
const StripGeometry * getStripGeometry() const
Get strip geometry data.
static const GeometryData & Instance(enum DataSource dataSource=c_Database, const GearDir *gearDir=nullptr)
Instantiation.
@ c_DeltaU
Shift in U (EKLM: local X).
@ c_DeltaGamma
Rotation in gamma (EKLM: rotation in local plane).
@ c_DeltaV
Shift in V (EKLM: local Y).
KLM digit (class representing a digitized hit in RPCs or scintillators).
static const KLMElementNumbers & Instance()
Instantiation.
KLMModuleNumber moduleNumberEKLM(int section, int sector, int layer) const
Get module number for EKLM.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
static const double cm
Standard units with the value = 1.
Class for easier manipulation with global derivatives (and their labels)
Abstract base class for different kinds of events.