Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:20

0001 #ifndef BeamSpotTransientTrackingRecHit_H
0002 #define BeamSpotTransientTrackingRecHit_H
0003 
0004 /** \class BeamSpotTransientTrackingRecHit
0005  *
0006  * Transient tracking rec hit for the beam spot used in ReferenceTrajectory
0007  * to extend the track to the beam spot.
0008  *
0009  * Author     : Andreas Mussgiller
0010  * date       : 2010/08/30
0011  * last update: $Date: 2012/02/04 15:02:59 $
0012  * by         : $Author: innocent $
0013  */
0014 
0015 #include <cmath>
0016 
0017 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0018 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0019 #include "DataFormats/GeometryCommonDetAlgo/interface/ErrorFrameTransformer.h"
0020 
0021 #include "Alignment/CommonAlignment/interface/AlignableBeamSpot.h"
0022 
0023 #include "BeamSpotGeomDet.h"
0024 
0025 #include "TrackingTools/TransientTrackingRecHit/interface/TValidTrackingRecHit.h"
0026 
0027 class BeamSpotTransientTrackingRecHit final : public TValidTrackingRecHit {
0028 public:
0029   typedef TrackingRecHit::Type Type;
0030 
0031   BeamSpotTransientTrackingRecHit(const reco::BeamSpot &beamSpot, const BeamSpotGeomDet *geom, double phi)
0032       : TValidTrackingRecHit(*geom) {
0033     localPosition_ = det()->toLocal(GlobalPoint(beamSpot.x0(), beamSpot.y0(), beamSpot.z0()));
0034     localError_ =
0035         LocalError(std::pow(beamSpot.BeamWidthX() * cos(phi), 2) + std::pow(beamSpot.BeamWidthY() * sin(phi), 2),
0036                    0.0,
0037                    std::pow(beamSpot.sigmaZ(), 2));
0038   }
0039 
0040   ~BeamSpotTransientTrackingRecHit() override {}
0041 
0042   LocalPoint localPosition() const override { return localPosition_; }
0043   LocalError localPositionError() const override { return localError_; }
0044 
0045   AlgebraicVector parameters() const override;
0046   AlgebraicSymMatrix parametersError() const override;
0047   int dimension() const override { return 1; }
0048 
0049   const TrackingRecHit *hit() const override { return nullptr; }
0050   TrackingRecHit *cloneHit() const override { return nullptr; }
0051 
0052   std::vector<const TrackingRecHit *> recHits() const override { return std::vector<const TrackingRecHit *>(); }
0053   std::vector<TrackingRecHit *> recHits() override { return std::vector<TrackingRecHit *>(); }
0054 
0055   AlgebraicMatrix projectionMatrix() const override { return theProjectionMatrix; }
0056 
0057 protected:
0058   LocalPoint localPosition_;
0059   LocalError localError_;
0060 
0061 private:
0062   // hide the clone method for ReferenceCounted. Warning: this method is still
0063   // accessible via the bas class TrackingRecHit interface!
0064   BeamSpotTransientTrackingRecHit *clone() const override { return new BeamSpotTransientTrackingRecHit(*this); }
0065 
0066   static const AlgebraicMatrix theProjectionMatrix;
0067 };
0068 
0069 #endif