CMS 3D CMS Logo

Public Member Functions

MuonDT2ChamberResidual Class Reference

#include <MuonDT2ChamberResidual.h>

Inheritance diagram for MuonDT2ChamberResidual:
MuonChamberResidual

List of all members.

Public Member Functions

void addResidual (const TrajectoryStateOnSurface *tsos, const TransientTrackingRecHit *hit)
 MuonDT2ChamberResidual (edm::ESHandle< GlobalTrackingGeometry > globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
double signConvention (const unsigned int rawId=0) const
int type () const

Detailed Description

Date:
2009/04/23 05:06:01
Revision:
1.2
Author:
J. Pivarski - Texas A&M University <pivarski@physics.tamu.edu>

Definition at line 15 of file MuonDT2ChamberResidual.h.


Constructor & Destructor Documentation

MuonDT2ChamberResidual::MuonDT2ChamberResidual ( edm::ESHandle< GlobalTrackingGeometry globalGeometry,
AlignableNavigator navigator,
DetId  chamberId,
AlignableDetOrUnitPtr  chamberAlignable 
) [inline]

Definition at line 17 of file MuonDT2ChamberResidual.h.

    : MuonChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable)
  {};

Member Function Documentation

void MuonDT2ChamberResidual::addResidual ( const TrajectoryStateOnSurface tsos,
const TransientTrackingRecHit hit 
) [virtual]

Implements MuonChamberResidual.

Definition at line 3 of file MuonDT2ChamberResidual.cc.

References TrackingRecHit::geographicalId(), TrackingRecHit::localPosition(), TrajectoryStateOnSurface::localPosition(), TrackingRecHit::localPositionError(), MuonChamberResidual::m_chamberAlignable, MuonChamberResidual::m_globalGeometry, MuonChamberResidual::m_individual_weight, MuonChamberResidual::m_individual_x, MuonChamberResidual::m_individual_y, MuonChamberResidual::m_localIDs, MuonChamberResidual::m_localResids, MuonChamberResidual::m_numHits, MuonChamberResidual::m_residual_1, MuonChamberResidual::m_residual_x, MuonChamberResidual::m_residual_xx, MuonChamberResidual::m_residual_xy, MuonChamberResidual::m_residual_y, MuonChamberResidual::m_trackx_1, MuonChamberResidual::m_trackx_x, MuonChamberResidual::m_trackx_xx, MuonChamberResidual::m_trackx_xy, MuonChamberResidual::m_trackx_y, MuonChamberResidual::m_tracky_1, MuonChamberResidual::m_tracky_x, MuonChamberResidual::m_tracky_xx, MuonChamberResidual::m_tracky_xy, MuonChamberResidual::m_tracky_y, MuonChamberResidual::residual(), CommonMethods::weight(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

                                                                                                                 {
  DetId id = hit->geographicalId();

  LocalPoint hitChamberPos = m_chamberAlignable->surface().toLocal(m_globalGeometry->idToDet(id)->toGlobal(hit->localPosition()));
  LocalPoint tsosChamberPos = m_chamberAlignable->surface().toLocal(m_globalGeometry->idToDet(id)->toGlobal(tsos->localPosition()));

  double residual = tsosChamberPos.y() - hitChamberPos.y();  // residual is track minus hit
  double weight = 1. / hit->localPositionError().xx();  // weight linear fit by hit-only local error (yes, xx: layer x is chamber y)
  double layerPosition = tsosChamberPos.z();  // the layer's position in the chamber's coordinate system

  m_numHits++;

  // "x" is the layerPosition, "y" is the residual (this is a linear fit to residual versus layerPosition)
  m_residual_1 += weight;
  m_residual_x += weight * layerPosition;
  m_residual_y += weight * residual;
  m_residual_xx += weight * layerPosition * layerPosition;
  m_residual_xy += weight * layerPosition * residual;

  // "x" is the layerPosition, "y" is chamberx (this is a linear fit to chamberx versus layerPosition)
  m_trackx_1 += weight;
  m_trackx_x += weight * layerPosition;
  m_trackx_y += weight * tsosChamberPos.x();
  m_trackx_xx += weight * layerPosition * layerPosition;
  m_trackx_xy += weight * layerPosition * tsosChamberPos.x();

  // "x" is the layerPosition, "y" is chambery (this is a linear fit to chambery versus layerPosition)
  m_tracky_1 += weight;
  m_tracky_x += weight * layerPosition;
  m_tracky_y += weight * tsosChamberPos.y();
  m_tracky_xx += weight * layerPosition * layerPosition;
  m_tracky_xy += weight * layerPosition * tsosChamberPos.y();

  m_localIDs.push_back(id);
  m_localResids.push_back(tsos->localPosition().x() - hit->localPosition().x());
  m_individual_x.push_back(layerPosition);
  m_individual_y.push_back(residual);
  m_individual_weight.push_back(weight);
}
double MuonDT2ChamberResidual::signConvention ( const unsigned int  rawId = 0) const [inline, virtual]

Implements MuonChamberResidual.

Definition at line 28 of file MuonDT2ChamberResidual.h.

References MuonChamberResidual::m_chamberId, and MuonChamberResidual::m_globalGeometry.

                                                          {
    DetId id = m_chamberId;
    if (rawId != 0) id = DetId(rawId);
    GlobalVector zDirection(0., 0., 1.);
    return (m_globalGeometry->idToDet(id)->toLocal(zDirection).y() > 0. ? 1. : -1.);
  };
int MuonDT2ChamberResidual::type ( ) const [inline, virtual]

Implements MuonChamberResidual.

Definition at line 21 of file MuonDT2ChamberResidual.h.

References MuonChamberResidual::kDT2.