CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/Alignment/ReferenceTrajectories/interface/BeamSpotTransientTrackingRecHit.h

Go to the documentation of this file.
00001 #ifndef BeamSpotTransientTrackingRecHit_H
00002 #define BeamSpotTransientTrackingRecHit_H
00003 
00015 #include <cmath>
00016 
00017 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h" 
00018 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00019 #include "DataFormats/GeometryCommonDetAlgo/interface/ErrorFrameTransformer.h"
00020 
00021 #include "Alignment/CommonAlignment/interface/AlignableBeamSpot.h"
00022 
00023 #include "BeamSpotGeomDet.h"
00024 
00025 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00026 
00027 class BeamSpotTransientTrackingRecHit: public TransientTrackingRecHit {
00028  public:
00029 
00030   typedef TrackingRecHit::Type Type;
00031   
00032   BeamSpotTransientTrackingRecHit(const reco::BeamSpot &beamSpot,
00033                                   const BeamSpotGeomDet * geom,
00034                                   double phi)
00035     :TransientTrackingRecHit(geom, AlignableBeamSpot::detId(), valid) {
00036 
00037     localPosition_ = det()->toLocal(GlobalPoint(beamSpot.x0(), beamSpot.y0(), beamSpot.z0()));
00038     localError_ = LocalError(std::pow(beamSpot.BeamWidthX()*cos(phi), 2) +
00039                              std::pow(beamSpot.BeamWidthY()*sin(phi), 2),
00040                              0.0, std::pow(beamSpot.sigmaZ(), 2));
00041   }
00042     
00043   virtual ~BeamSpotTransientTrackingRecHit() {}
00044 
00045   virtual LocalPoint localPosition() const { return localPosition_; }
00046   virtual LocalError localPositionError() const { return localError_; }
00047 
00048   virtual AlgebraicVector parameters() const;
00049   virtual AlgebraicSymMatrix parametersError() const;
00050   virtual int dimension() const { return 1; }
00051 
00052   virtual const TrackingRecHit * hit() const { return 0; }
00053 
00054   virtual std::vector<const TrackingRecHit*> recHits() const {
00055     return std::vector<const TrackingRecHit*>();
00056   }
00057   virtual std::vector<TrackingRecHit*> recHits() {
00058     return std::vector<TrackingRecHit*>();
00059   }
00060 
00061   virtual const Surface * surface() const { return &(det()->surface()); }
00062 
00063   virtual AlgebraicMatrix projectionMatrix() const {
00064     if (!isInitialized) initialize();
00065     return theProjectionMatrix;
00066   }
00067 
00068  protected:
00069 
00070   LocalPoint localPosition_;
00071   LocalError localError_;
00072 
00073  private:
00074   
00075   // should not have assignment operator (?)
00076   BeamSpotTransientTrackingRecHit & operator= (const BeamSpotTransientTrackingRecHit & t) {
00077      return *(this);
00078   }
00079 
00080   // hide the clone method for ReferenceCounted. Warning: this method is still 
00081   // accessible via the bas class TrackingRecHit interface!
00082    virtual BeamSpotTransientTrackingRecHit * clone() const {
00083      return new BeamSpotTransientTrackingRecHit(*this);
00084    }
00085    
00086    static bool isInitialized;
00087    static AlgebraicMatrix theProjectionMatrix;
00088    void initialize() const;
00089 };
00090 
00091 #endif
00092