00001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonDT2ChamberResidual_H 00002 #define Alignment_MuonAlignmentAlgorithms_MuonDT2ChamberResidual_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 MuonDT2ChamberResidual: public MuonChamberResidual { 00016 public: 00017 MuonDT2ChamberResidual(edm::ESHandle<GlobalTrackingGeometry> globalGeometry, AlignableNavigator *navigator, DetId chamberId, AlignableDetOrUnitPtr chamberAlignable) 00018 : MuonChamberResidual(globalGeometry, navigator, chamberId, chamberAlignable) 00019 {}; 00020 00021 int type() const { return MuonChamberResidual::kDT2; }; 00022 00023 // for DT2, the residual is chamber local y 00024 // for DT2, the resslope is dresy/dz, or tan(phi_x) 00025 void addResidual(const TrajectoryStateOnSurface *tsos, const TransientTrackingRecHit *hit); 00026 00027 // for DT2, the global direction is CMS z (e.g. local y 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 GlobalVector zDirection(0., 0., 1.); 00032 return (m_globalGeometry->idToDet(id)->toLocal(zDirection).y() > 0. ? 1. : -1.); 00033 }; 00034 }; 00035 00036 #endif // Alignment_MuonAlignmentAlgorithms_MuonDT2ChamberResidual_H