Go to the documentation of this file.00001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResidualsFromTrack_H
00002 #define Alignment_MuonAlignmentAlgorithms_MuonResidualsFromTrack_H
00003
00009 #include "FWCore/Framework/interface/ESHandle.h"
00010 #include "FWCore/Utilities/interface/Exception.h"
00011 #include "Alignment/CommonAlignment/interface/AlignableNavigator.h"
00012 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
00013 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00014 #include "TrackingTools/TrackFitters/interface/TrajectoryStateCombiner.h"
00015 #include "DataFormats/DetId/interface/DetId.h"
00016 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
00017 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
00018 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00019 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00020 #include "DataFormats/MuonReco/interface/Muon.h"
00021 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00022 #include "DataFormats/TrackReco/interface/Track.h"
00023
00024 #include "TMatrixDSym.h"
00025 #include "TMatrixD.h"
00026
00027 #include <vector>
00028 #include <map>
00029
00030 #include "Alignment/MuonAlignmentAlgorithms/interface/MuonChamberResidual.h"
00031
00032 class MuonResidualsFromTrack
00033 {
00034 public:
00035
00036 MuonResidualsFromTrack(edm::ESHandle<GlobalTrackingGeometry> globalGeometry,
00037 const Trajectory *traj,
00038 const reco::Track* trk,
00039 AlignableNavigator *navigator, double maxResidual);
00040
00041
00042 MuonResidualsFromTrack(edm::ESHandle<GlobalTrackingGeometry> globalGeometry,
00043 const reco::Muon *mu,
00044 AlignableNavigator *navigator,
00045 double maxResidual);
00046
00047 ~MuonResidualsFromTrack();
00048
00049 void clear();
00050
00051 const reco::Track *getTrack() { return track; }
00052
00053 int trackerNumHits() const { return m_tracker_numHits; }
00054
00055 double trackerChi2() const { return m_tracker_chi2; }
00056 double trackerRedChi2() const;
00057 double normalizedChi2() const;
00058
00059 bool contains_TIDTEC() const { return m_contains_TIDTEC; }
00060
00061 const std::vector<DetId> chamberIds() const { return m_chamberIds; }
00062
00063 MuonChamberResidual *chamberResidual(DetId chamberId, int type);
00064
00065 TMatrixDSym covMatrix(DetId chamberId);
00066 TMatrixDSym corrMatrix(DetId chamberId);
00067 TMatrixD choleskyCorrMatrix(DetId chamberId);
00068
00069 private:
00070 TrajectoryStateCombiner m_tsoscomb;
00071
00072 int m_tracker_numHits;
00073 double m_tracker_chi2;
00074 bool m_contains_TIDTEC;
00075
00076 std::vector<DetId> m_chamberIds;
00077 std::map<DetId,MuonChamberResidual*> m_dt13, m_dt2, m_csc;
00078 std::map<DetId,TMatrixDSym> m_trkCovMatrix;
00079
00080 void addTrkCovMatrix(DetId, TrajectoryStateOnSurface &);
00081
00082
00083 const reco::Track *track;
00084
00085
00086 const reco::Muon *muon;
00087 };
00088
00089 #endif // Alignment_MuonAlignmentAlgorithms_MuonResidualsFromTrack_H