Go to the documentation of this file.00001
00002
00003
00004
00005 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonTrackDT13ChamberResidual.h"
00006
00007
00008 MuonTrackDT13ChamberResidual::MuonTrackDT13ChamberResidual(edm::ESHandle<GlobalTrackingGeometry> globalGeometry, AlignableNavigator *navigator,
00009 DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
00010 : MuonChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable)
00011 {
00012 m_type = MuonChamberResidual::kDT13;
00013 double rphiAngle = atan2(m_globalGeometry->idToDet(m_chamberId)->position().y(), m_globalGeometry->idToDet(m_chamberId)->position().x()) + M_PI/2.;
00014 align::GlobalVector rphiDirection(cos(rphiAngle), sin(rphiAngle), 0.);
00015 m_sign = m_globalGeometry->idToDet(m_chamberId)->toLocal(rphiDirection).x() > 0. ? 1. : -1.;
00016 }
00017
00018
00019 void MuonTrackDT13ChamberResidual::setSegmentResidual(const reco::MuonChamberMatch *trk, const reco::MuonSegmentMatch *seg)
00020 {
00021 DTRecSegment4DRef segmentDT = seg->dtSegmentRef;
00022 if (segmentDT.get() != 0)
00023 {
00024 const DTRecSegment4D* segment = segmentDT.get();
00025 assert(segment->hasPhi());
00026 const DTChamberRecSegment2D* phiSeg = segment->phiSegment();
00027 m_numHits = phiSeg->recHits().size();
00028 m_ndof = phiSeg->degreesOfFreedom();
00029 m_chi2 = phiSeg->chi2();
00030
00031 }
00032
00033 m_residual = trk->x - seg->x;
00034 m_residual_error = sqrt( pow(trk->xErr, 2) + pow(seg->xErr, 2) );
00035 m_resslope = trk->dXdZ - seg->dXdZ;
00036 m_resslope_error = sqrt( pow(trk->dXdZErr, 2) + pow(seg->dXdZErr, 2) );
00037
00038 m_trackx = trk->x;
00039 m_tracky = trk->y;
00040 m_trackdxdz = trk->dXdZ;
00041 m_trackdydz = trk->dYdZ;
00042
00043 m_segx = seg->x;
00044 m_segy = seg->y;
00045 m_segdxdz = seg->dXdZ;
00046 m_segdydz = seg->dYdZ;
00047
00048
00049
00050
00051 }