Go to the documentation of this file.00001
00002
00003
00004
00005 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonTrackCSCChamberResidual.h"
00006
00007
00008
00009 MuonTrackCSCChamberResidual::MuonTrackCSCChamberResidual(edm::ESHandle<GlobalTrackingGeometry> globalGeometry, AlignableNavigator *navigator,
00010 DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
00011 : MuonChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable)
00012 {
00013 m_type = MuonChamberResidual::kCSC;
00014 align::GlobalVector zDirection(0., 0., 1.);
00015 m_sign = m_globalGeometry->idToDet(m_chamberId)->toLocal(zDirection).z() > 0. ? 1. : -1.;
00016 }
00017
00018
00019 void MuonTrackCSCChamberResidual::setSegmentResidual(const reco::MuonChamberMatch *trk, const reco::MuonSegmentMatch *seg)
00020 {
00021 CSCDetId id(trk->id.rawId());
00022 CSCDetId chamber(id.chamberId());
00023
00024 CSCSegmentRef segmentCSC = seg->cscSegmentRef;
00025 if (segmentCSC.get() != 0)
00026 {
00027 const CSCSegment* segment = segmentCSC.get();
00028 m_numHits = segment->nRecHits();
00029 m_ndof = segment->degreesOfFreedom();
00030 m_chi2 = segment->chi2();
00031
00032 }
00033
00034 align::LocalPoint l_seg(seg->x, seg->y, 0.);
00035 align::LocalPoint l_trk(trk->x, trk->y, 0.);
00036
00037
00038
00039
00040
00041
00042
00043
00044 m_residual = trk->x-seg->x;
00045 m_residual_error = sqrt( pow(trk->xErr, 2) + pow(seg->xErr, 2) );
00046 m_resslope = trk->dXdZ - seg->dXdZ;
00047 m_resslope_error = sqrt( pow(trk->dXdZErr, 2) + pow(seg->dXdZErr, 2) );
00048
00049 m_trackx = trk->x;
00050 m_tracky = trk->y;
00051 m_trackdxdz = trk->dXdZ;
00052 m_trackdydz = trk->dYdZ;
00053
00054 m_segx = seg->x;
00055 m_segy = seg->y;
00056 m_segdxdz = seg->dXdZ;
00057 m_segdydz = seg->dYdZ;
00058
00059
00060
00061
00062
00063
00064 }