CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/Alignment/MuonAlignmentAlgorithms/interface/MuonChamberResidual.h

Go to the documentation of this file.
00001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonChamberResidual_H
00002 #define Alignment_MuonAlignmentAlgorithms_MuonChamberResidual_H
00003 
00012 #include "FWCore/Framework/interface/ESHandle.h"
00013 #include "Alignment/CommonAlignment/interface/AlignableNavigator.h"
00014 #include "Alignment/CommonAlignment/interface/Alignable.h"
00015 #include "Alignment/CommonAlignment/interface/AlignmentParameters.h"
00016 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
00017 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00018 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00019 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00020 #include "DataFormats/DetId/interface/DetId.h"
00021 #include "DataFormats/MuonReco/interface/Muon.h"
00022 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00023 
00024 class MuonChamberResidual
00025 {
00026 public:
00027 
00028   enum {
00029     kDT13,
00030     kDT2,
00031     kCSC
00032   };
00033 
00034   MuonChamberResidual(edm::ESHandle<GlobalTrackingGeometry> globalGeometry, AlignableNavigator *navigator, 
00035                       DetId chamberId, AlignableDetOrUnitPtr chamberAlignable);
00036 
00037   virtual ~MuonChamberResidual() {}
00038 
00039   // has to be implemented for rechit based residuals 
00040   virtual void addResidual(const TrajectoryStateOnSurface *, const TransientTrackingRecHit *) = 0;
00041   
00042   // has to be implemented for track muon segment residuals
00043   virtual void setSegmentResidual(const reco::MuonChamberMatch *, const reco::MuonSegmentMatch *) = 0;
00044   
00045   int type() const { return m_type; }
00046 
00047   virtual double signConvention() const {return m_sign; }
00048 
00049   DetId chamberId() const { return m_chamberId; }
00050   
00051   AlignableDetOrUnitPtr chamberAlignable() const { return m_chamberAlignable; }
00052 
00053   int numHits() const { return m_numHits; }
00054 
00055   double residual() const { return m_residual; }
00056   double residual_error() const { return m_residual_error; }
00057   double resslope() const { return m_resslope; }
00058   double resslope_error() const { return m_resslope_error; }
00059 
00060   double chi2() const { return m_chi2; }
00061   int ndof() const { return m_ndof; }
00062 
00063   double trackdxdz() const { return m_trackdxdz; }
00064   double trackdydz() const { return m_trackdydz; }
00065   double trackx() const { return m_trackx; }
00066   double tracky() const { return m_tracky; }
00067 
00068   double segdxdz() const { return m_segdxdz; }
00069   double segdydz() const { return m_segdydz; }
00070   double segx() const { return m_segx; }
00071   double segy() const { return m_segy; }
00072 
00073   align::GlobalPoint global_trackpos();
00074   align::GlobalPoint global_stubpos();
00075   double global_residual() const;
00076   double global_resslope() const;
00077   double global_hitresid(int i) const;
00078   
00079   // individual hit methods
00080   double hitresid(int i) const;
00081   int hitlayer(int i) const;
00082   double hitposition(int i) const;
00083   DetId localid(int i) const { return m_localIDs[i];  }
00084 
00085 protected:
00086   edm::ESHandle<GlobalTrackingGeometry> m_globalGeometry;
00087   AlignableNavigator *m_navigator;
00088   DetId m_chamberId;
00089   AlignableDetOrUnitPtr m_chamberAlignable;
00090 
00091   int m_numHits;
00092   std::vector<DetId> m_localIDs;
00093   std::vector<double> m_localResids;
00094   std::vector<double> m_individual_x;
00095   std::vector<double> m_individual_y;
00096   std::vector<double> m_individual_weight;
00097 
00098   int m_type;
00099   double m_sign;
00100   double m_chi2;
00101   int m_ndof;
00102   double m_residual;
00103   double m_residual_error;
00104   double m_resslope;
00105   double m_resslope_error;
00106   double m_trackdxdz;
00107   double m_trackdydz;
00108   double m_trackx;
00109   double m_tracky;
00110   double m_segdxdz;
00111   double m_segdydz;
00112   double m_segx;
00113   double m_segy;
00114   
00115 };
00116 
00117 #endif // Alignment_MuonAlignmentAlgorithms_MuonChamberResidual_H