CMS 3D CMS Logo

Public Member Functions

DTRecHitSegmentResidual Class Reference

#include <DTRecHitSegmentResidual.h>

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 14 of file DTRecHitSegmentResidual.h.


Constructor & Destructor Documentation

DTRecHitSegmentResidual::DTRecHitSegmentResidual ( ) [inline]

Definition at line 16 of file DTRecHitSegmentResidual.h.

{}
DTRecHitSegmentResidual::~DTRecHitSegmentResidual ( ) [inline]

Definition at line 17 of file DTRecHitSegmentResidual.h.

{}

Member Function Documentation

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

Definition at line 19 of file DTRecHitSegmentResidual.cc.

References 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(), GeomDet::toLocal(), 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().

                                                                                                                          {

  const DTWireId wireId = recHit1D.wireId();
      
  // Get the layer and the wire position
  const DTLayer* layer = dtGeom->layer(wireId);
  float wireX = layer->specificTopology().wirePosition(wireId.wire());
      
  // Extrapolate the segment to the z of the wire
  // Get wire position in chamber RF
  // (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)
  LocalPoint wirePosInLay(wireX,recHit1D.localPosition().y(),recHit1D.localPosition().z());
  GlobalPoint wirePosGlob = layer->toGlobal(wirePosInLay);
  const DTChamber* chamber = dtGeom->chamber(wireId.layerId().chamberId());
  LocalPoint wirePosInChamber = chamber->toLocal(wirePosGlob);
      
  // Segment position at Wire z in chamber local frame
  LocalPoint segPosAtZWire = segment.localPosition() + segment.localDirection()*wirePosInChamber.z()/cos(segment.localDirection().theta());
      
  // Compute the distance of the segment from the wire
  int sl = wireId.superlayer();
  float segmDistance = -1;
  if(sl == 1 || sl == 3) segmDistance = fabs(wirePosInChamber.x() - segPosAtZWire.x());
  else if(sl == 2) segmDistance =  fabs(segPosAtZWire.y() - wirePosInChamber.y());

  // Compute the distance of the recHit from the wire
  float recHitWireDist = fabs( recHit1D.localPosition().x() - wireX );
 
  // Compute the residuals 
  float residualOnDistance = recHitWireDist - segmDistance;

  return residualOnDistance; 
}