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
00023 CSCSegmentRef segmentCSC = seg->cscSegmentRef;
00024 if (segmentCSC.get() != 0)
00025 {
00026 const CSCSegment* segment = segmentCSC.get();
00027 m_numHits = segment->nRecHits();
00028 m_ndof = segment->degreesOfFreedom();
00029 m_chi2 = segment->chi2();
00030
00031 }
00032
00033 align::LocalPoint l_seg(seg->x, seg->y, 0.);
00034 align::LocalPoint l_trk(trk->x, trk->y, 0.);
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 m_residual = trk->x-seg->x;
00046 m_residual_error = sqrt( pow(trk->xErr, 2) + pow(seg->xErr, 2) );
00047 m_resslope = trk->dXdZ - seg->dXdZ;
00048 m_resslope_error = sqrt( pow(trk->dXdZErr, 2) + pow(seg->dXdZErr, 2) );
00049
00050 m_trackx = trk->x;
00051 m_tracky = trk->y;
00052 m_trackdxdz = trk->dXdZ;
00053 m_trackdydz = trk->dYdZ;
00054
00055 m_segx = seg->x;
00056 m_segy = seg->y;
00057 m_segdxdz = seg->dXdZ;
00058 m_segdydz = seg->dYdZ;
00059
00060
00061
00062
00063
00064
00065 }