CMS 3D CMS Logo

List of all members | Public Member Functions
DTRecHitSegmentResidual Class Reference

#include <DTRecHitSegmentResidual.h>

Public Member Functions

float compute (const DTGeometry *, const DTRecHit1D &, const DTRecSegment4D &)
 
 DTRecHitSegmentResidual ()
 
 ~DTRecHitSegmentResidual ()
 

Detailed Description

Definition at line 12 of file DTRecHitSegmentResidual.h.

Constructor & Destructor Documentation

◆ DTRecHitSegmentResidual()

DTRecHitSegmentResidual::DTRecHitSegmentResidual ( )
inline

Definition at line 14 of file DTRecHitSegmentResidual.h.

14 {}

◆ ~DTRecHitSegmentResidual()

DTRecHitSegmentResidual::~DTRecHitSegmentResidual ( )
inline

Definition at line 15 of file DTRecHitSegmentResidual.h.

15 {}

Member Function Documentation

◆ compute()

float DTRecHitSegmentResidual::compute ( const DTGeometry dtGeom,
const DTRecHit1D recHit1D,
const DTRecSegment4D segment 
)

Definition at line 17 of file DTRecHitSegmentResidual.cc.

19  {
20  const DTWireId wireId = recHit1D.wireId();
21 
22  // Get the layer and the wire position
23  const DTLayer* layer = dtGeom->layer(wireId);
24  float wireX = layer->specificTopology().wirePosition(wireId.wire());
25 
26  // Extrapolate the segment to the z of the wire
27  // Get wire position in chamber RF
28  // (y and z must be those of the hit to be coherent in the transf. of RF in case of rotations of the layer alignment)
29  LocalPoint wirePosInLay(wireX, recHit1D.localPosition().y(), recHit1D.localPosition().z());
30  GlobalPoint wirePosGlob = layer->toGlobal(wirePosInLay);
31  const DTChamber* chamber = dtGeom->chamber(wireId.layerId().chamberId());
32  LocalPoint wirePosInChamber = chamber->toLocal(wirePosGlob);
33 
34  // Segment position at Wire z in chamber local frame
35  LocalPoint segPosAtZWire =
36  segment.localPosition() + segment.localDirection() * wirePosInChamber.z() / cos(segment.localDirection().theta());
37 
38  // Compute the distance of the segment from the wire
39  int sl = wireId.superlayer();
40  float segmDistance = -1;
41  if (sl == 1 || sl == 3)
42  segmDistance = fabs(wirePosInChamber.x() - segPosAtZWire.x());
43  else if (sl == 2)
44  segmDistance = fabs(segPosAtZWire.y() - wirePosInChamber.y());
45 
46  // Compute the distance of the recHit from the wire
47  float recHitWireDist = fabs(recHit1D.localPosition().x() - wireX);
48 
49  // Compute the residuals
50  float residualOnDistance = recHitWireDist - segmDistance;
51 
52  return residualOnDistance;
53 }

References relativeConstraints::chamber, DTGeometry::chamber(), DTSuperLayerId::chamberId(), funct::cos(), DTGeometry::layer(), DTWireId::layerId(), DTRecSegment4D::localDirection(), DTRecHit1D::localPosition(), DTRecSegment4D::localPosition(), DTLayer::specificTopology(), DTSuperLayerId::superlayer(), PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toGlobal(), DTWireId::wire(), DTRecHit1D::wireId(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by DTResidualCalibration::analyze().

DTWireId::wire
int wire() const
Return the wire number.
Definition: DTWireId.h:42
DTRecSegment4D::localDirection
LocalVector localDirection() const override
Local direction in Chamber frame.
Definition: DTRecSegment4D.h:67
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
DTChamber
Definition: DTChamber.h:24
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
DTRecSegment4D::localPosition
LocalPoint localPosition() const override
Local position in Chamber frame.
Definition: DTRecSegment4D.h:61
DTGeometry::chamber
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DTTopology::wirePosition
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:59
DTRecHit1D::wireId
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:76
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DTWireId
Definition: DTWireId.h:12
Point3DBase< float, LocalTag >
DTRecHit1D::localPosition
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
DTSuperLayerId::chamberId
DTChamberId chamberId() const
Return the corresponding ChamberId.
Definition: DTSuperLayerId.h:45
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
DTLayer
Definition: DTLayer.h:25
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
DTWireId::layerId
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:45