Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:24

0001 #ifndef Alignment_MuonAlignmentAlgorithms_MuonChamberResidual_H
0002 #define Alignment_MuonAlignmentAlgorithms_MuonChamberResidual_H
0003 
0004 /** \class MuonChamberResidual
0005  * 
0006  * Abstract base class for muon chamber residulas
0007  * 
0008  *  $Id: $
0009  *  \author J. Pivarski - Texas A&M University <pivarski@physics.tamu.edu>
0010  */
0011 
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 #include "Alignment/CommonAlignment/interface/AlignableNavigator.h"
0014 #include "Alignment/CommonAlignment/interface/Alignable.h"
0015 #include "Alignment/CommonAlignment/interface/AlignmentParameters.h"
0016 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
0017 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0018 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0019 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0020 #include "DataFormats/DetId/interface/DetId.h"
0021 #include "DataFormats/MuonReco/interface/Muon.h"
0022 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0023 
0024 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0025 
0026 class MuonChamberResidual {
0027 public:
0028   enum { kDT13, kDT2, kCSC };
0029 
0030   MuonChamberResidual(edm::ESHandle<GlobalTrackingGeometry> globalGeometry,
0031                       AlignableNavigator *navigator,
0032                       DetId chamberId,
0033                       AlignableDetOrUnitPtr chamberAlignable);
0034 
0035   virtual ~MuonChamberResidual() {}
0036 
0037   // has to be implemented for rechit based residuals
0038   virtual void addResidual(
0039       edm::ESHandle<Propagator> prop, const TrajectoryStateOnSurface *, const TrackingRecHit *, double, double) = 0;
0040 
0041   // has to be implemented for track muon segment residuals
0042   virtual void setSegmentResidual(const reco::MuonChamberMatch *, const reco::MuonSegmentMatch *) = 0;
0043 
0044   int type() const { return m_type; }
0045 
0046   virtual double signConvention() const { return m_sign; }
0047 
0048   DetId chamberId() const { return m_chamberId; }
0049 
0050   AlignableDetOrUnitPtr chamberAlignable() const { return m_chamberAlignable; }
0051 
0052   int numHits() const { return m_numHits; }
0053 
0054   double residual() const { return m_residual; }
0055   double residual_error() const { return m_residual_error; }
0056   double resslope() const { return m_resslope; }
0057   double resslope_error() const { return m_resslope_error; }
0058 
0059   double chi2() const { return m_chi2; }
0060   int ndof() const { return m_ndof; }
0061 
0062   double trackdxdz() const { return m_trackdxdz; }
0063   double trackdydz() const { return m_trackdydz; }
0064   double trackx() const { return m_trackx; }
0065   double tracky() const { return m_tracky; }
0066 
0067   double ChambW() const { return m_ChambW; }
0068   double Chambl() const { return m_Chambl; }
0069 
0070   double segdxdz() const { return m_segdxdz; }
0071   double segdydz() const { return m_segdydz; }
0072   double segx() const { return m_segx; }
0073   double segy() const { return m_segy; }
0074 
0075   align::GlobalPoint global_trackpos();
0076   align::GlobalPoint global_stubpos();
0077   double global_residual() const;
0078   double global_resslope() const;
0079   double global_hitresid(int i) const;
0080 
0081   // individual hit methods
0082   double hitresid(int i) const;
0083   int hitlayer(int i) const;
0084   double hitposition(int i) const;
0085   DetId localid(int i) const { return m_localIDs[i]; }
0086 
0087 protected:
0088   edm::ESHandle<GlobalTrackingGeometry> m_globalGeometry;
0089   AlignableNavigator *m_navigator;
0090   DetId m_chamberId;
0091   AlignableDetOrUnitPtr m_chamberAlignable;
0092 
0093   int m_numHits;
0094   std::vector<DetId> m_localIDs;
0095   std::vector<double> m_localResids;
0096   std::vector<double> m_individual_x;
0097   std::vector<double> m_individual_y;
0098   std::vector<double> m_individual_weight;
0099 
0100   int m_type;
0101   double m_sign;
0102   double m_chi2;
0103   int m_ndof;
0104   double m_residual;
0105   double m_residual_error;
0106   double m_resslope;
0107   double m_resslope_error;
0108   double m_trackdxdz;
0109   double m_trackdydz;
0110   double m_trackx;
0111   double m_tracky;
0112   double m_segdxdz;
0113   double m_segdydz;
0114   double m_segx;
0115   double m_segy;
0116   double m_ChambW;
0117   double m_Chambl;
0118 };
0119 
0120 #endif  // Alignment_MuonAlignmentAlgorithms_MuonChamberResidual_H