CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Alignment/MuonAlignmentAlgorithms/interface/MuonDT13ChamberResidual.h

Go to the documentation of this file.
00001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonDT13ChamberResidual_H
00002 #define Alignment_MuonAlignmentAlgorithms_MuonDT13ChamberResidual_H
00003 
00010 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonChamberResidual.h"
00011 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
00012 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00013 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00014 
00015 class MuonDT13ChamberResidual: public MuonChamberResidual {
00016 public:
00017   MuonDT13ChamberResidual(edm::ESHandle<GlobalTrackingGeometry> globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable)
00018     : MuonChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable)
00019   {};
00020 
00021   int type() const { return MuonChamberResidual::kDT13; };
00022 
00023   // for DT13, the residual is chamber local x
00024   // for DT13, the resslope is dresx/dz, or tan(phi_y)
00025   void addResidual(const TrajectoryStateOnSurface *tsos, const TransientTrackingRecHit *hit);
00026 
00027   // for DT13, the global direction is a polygonal rphi (e.g. local x without the sign convention issues)
00028   double signConvention(const unsigned int rawId=0) const {
00029     DetId id = m_chamberId;
00030     if (rawId != 0) id = DetId(rawId);
00031     double rphiAngle = atan2(m_globalGeometry->idToDet(id)->position().y(), m_globalGeometry->idToDet(id)->position().x()) + M_PI/2.;
00032     GlobalVector rphiDirection(cos(rphiAngle), sin(rphiAngle), 0.);
00033     return (m_globalGeometry->idToDet(id)->toLocal(rphiDirection).x() > 0. ? 1. : -1.);
00034   };
00035 };
00036 
00037 #endif // Alignment_MuonAlignmentAlgorithms_MuonDT13ChamberResidual_H