CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TrackingTools/TrajectoryState/interface/TrajectoryStateClosestToBeamLine.h

Go to the documentation of this file.
00001 #ifndef TrajectoryStateClosestToBeamLine_H
00002 #define TrajectoryStateClosestToBeamLine_H
00003 
00004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00005 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00006 #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h"
00007 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00008 
00015 class TrajectoryStateClosestToBeamLine
00016 {
00017 public:
00018 
00019   typedef FreeTrajectoryState           FTS;
00020 
00021   TrajectoryStateClosestToBeamLine() : valid(false) {}
00022 
00023   TrajectoryStateClosestToBeamLine
00024     (const FTS& stateAtPCA, const GlobalPoint & pointOnBeamLine,
00025      const reco::BeamSpot & beamSpot);
00026 
00027   ~TrajectoryStateClosestToBeamLine(){}
00028 
00033   FTS const & trackStateAtPCA() const {
00034     if (!isValid()) throw TrajectoryStateException(
00035       "TrajectoryStateClosestToBeamLine is invalid.");
00036     return theFTS;
00037   }
00038 
00042   GlobalPoint const & beamLinePCA() const {
00043     if (!isValid()) throw TrajectoryStateException(
00044       "TrajectoryStateClosestToBeamLine is invalid.");
00045     return thePointOnBeamLine;
00046   }
00047 
00052   Measurement1D transverseImpactParameter() const;
00053 
00057   reco::BeamSpot const & beamSpot() {
00058     if (!isValid()) throw TrajectoryStateException(
00059       "TrajectoryStateClosestToBeamLine is invalid.");
00060     return theBeamSpot;
00061   }
00062 
00063   inline bool isValid() const {return valid;}
00064 
00065 private:
00066 
00067   bool valid;
00068   FTS theFTS;
00069   GlobalPoint thePointOnBeamLine;
00070   reco::BeamSpot theBeamSpot;
00071 
00072 };
00073 #endif