CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h

Go to the documentation of this file.
00001 #ifndef TrajectoryStateOnSurface_H
00002 #define TrajectoryStateOnSurface_H
00003 
00004 #include "TrackingTools/TrajectoryState/interface/BasicTrajectoryState.h"
00005 #include "TrackingTools/TrajectoryState/interface/SurfaceSideDefinition.h"
00006 
00007 #include <iosfwd>
00008 
00015 class TrajectoryStateOnSurface : private  BasicTrajectoryState::Proxy 
00016 {
00017   typedef BasicTrajectoryState::SurfaceSide SurfaceSide;
00018   typedef BasicTrajectoryState::Proxy             Base;
00019 
00020 public:
00021   // construct
00022   TrajectoryStateOnSurface() {}
00024 
00025   // invalid state
00026   explicit TrajectoryStateOnSurface(const Surface& aSurface);
00027 
00028 
00029   TrajectoryStateOnSurface( BasicTrajectoryState* p) : Base(p) {}
00033   TrajectoryStateOnSurface( const FreeTrajectoryState& fts,
00034                             const Surface& aSurface,
00035                             const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00039   TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00040                             const Surface& aSurface,
00041                             const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00045   TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00046                             const CartesianTrajectoryError& err,
00047                             const Surface& aSurface,
00048                             const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00053   TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00054                             const CurvilinearTrajectoryError& err,
00055                             const Surface& aSurface,
00056                             const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface, 
00057                             double weight = 1.);
00062   TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00063                             const CurvilinearTrajectoryError& err,
00064                             const Surface& aSurface,
00065                             double weight);
00069   TrajectoryStateOnSurface( const LocalTrajectoryParameters& p,
00070                             const Surface& aSurface,
00071                             const MagneticField* field,
00072                             const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00077   TrajectoryStateOnSurface( const LocalTrajectoryParameters& p,
00078                             const LocalTrajectoryError& err,
00079                             const Surface& aSurface,
00080                             const MagneticField* field,
00081                             const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface, 
00082                             double weight = 1.);
00087   TrajectoryStateOnSurface( const LocalTrajectoryParameters& p,
00088                             const LocalTrajectoryError& err,
00089                             const Surface& aSurface,
00090                             const MagneticField* field,
00091                             double weight);
00092 
00093   ~TrajectoryStateOnSurface() {}
00094 
00095 #if defined( __GXX_EXPERIMENTAL_CXX0X__)
00096 
00097  TrajectoryStateOnSurface(TrajectoryStateOnSurface const & rh)  noexcept :
00098     Base(rh){}
00099 
00100 
00101   TrajectoryStateOnSurface(TrajectoryStateOnSurface && rh)  noexcept :
00102     Base(std::forward<Base>(rh)){}
00103     
00104   TrajectoryStateOnSurface & operator=(TrajectoryStateOnSurface && rh)  noexcept {
00105     Base::swap(rh);
00106     return *this;
00107   }
00108 
00109  TrajectoryStateOnSurface & operator=(TrajectoryStateOnSurface const & rh)  noexcept {
00110     Base::operator=(rh);
00111     return *this;
00112   }
00113 
00114 
00115 #endif
00116 
00117   void swap(TrajectoryStateOnSurface & rh)  noexcept {
00118     Base::swap(rh);
00119   }
00120 
00121 
00122   bool isValid() const {
00123     return Base::isValid() && data().isValid();
00124   }
00125 
00126   bool hasError() const {
00127     return data().hasError();
00128   }
00129 
00130   FreeTrajectoryState* freeState(bool withErrors = true) const {
00131     return data().freeTrajectoryState();
00132   }
00133 
00134   FreeTrajectoryState* freeTrajectoryState(bool withErrors = true) const {
00135     return freeState();
00136   }
00137 
00138   const MagneticField *magneticField() const { return data().magneticField(); }
00139 
00140   const GlobalTrajectoryParameters& globalParameters() const {
00141     return data().globalParameters();
00142   }
00143   GlobalPoint globalPosition() const {
00144     return data().globalPosition();
00145   }
00146   GlobalVector globalMomentum() const {
00147     return data().globalMomentum();
00148   }
00149   GlobalVector globalDirection() const {
00150     return data().globalDirection();
00151   }
00152   TrackCharge charge() const {
00153     return data().charge();
00154   }
00155   double signedInverseMomentum() const {
00156     return data().signedInverseMomentum();
00157   }
00158   double transverseCurvature() const {
00159     return data().transverseCurvature();
00160   }
00161   const CartesianTrajectoryError cartesianError() const {
00162     return data().cartesianError();
00163   }
00164   const CurvilinearTrajectoryError& curvilinearError() const {
00165     return data().curvilinearError();
00166   }
00167   const LocalTrajectoryParameters& localParameters() const {
00168     return data().localParameters();
00169   }
00170   LocalPoint localPosition() const {
00171     return data().localPosition();
00172   }
00173   LocalVector localMomentum() const {
00174     return data().localMomentum();
00175   }
00176   LocalVector localDirection() const {
00177     return data().localDirection();
00178   }
00179   const LocalTrajectoryError& localError() const {
00180     return data().localError();
00181   }
00182   const Surface& surface() const {
00183     return data().surface();
00184   }
00185 
00186   double weight() const {return data().weight();} 
00187 
00188   void rescaleError(double factor) {
00189     unsharedData().rescaleError(factor);
00190   }
00191 
00192   std::vector<TrajectoryStateOnSurface> components() const {
00193     return data().components();
00194   }
00195   /*
00196   std::vector<TrajectoryStateOnSurface> components() const {
00197     std::vector<BasicTrajectoryState::RCPtr> c( data().components());
00198     std::vector<TrajectoryStateOnSurface> result; 
00199     result.reserve(c.size());
00200     for (std::vector<BasicTrajectoryState::RCPtr>::iterator i=c.begin();
00201          i != c.end(); i++) result.push_back(&(**i));
00202     return result;
00203   }
00204   */
00205 
00207   SurfaceSide surfaceSide() const {
00208     return data().surfaceSide();
00209   }
00210 
00216   void update( const LocalTrajectoryParameters& p,
00217                const Surface& aSurface,
00218                const MagneticField* field,
00219                const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00226   void update( const LocalTrajectoryParameters& p,
00227                const LocalTrajectoryError& err,
00228                const Surface& aSurface,
00229                const MagneticField* field,
00230                const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface, 
00231                double weight = 1.);
00232 
00233 };
00234 
00235 inline void swap( TrajectoryStateOnSurface & rh,  TrajectoryStateOnSurface & lh) {
00236   // use base swap
00237   rh.swap(lh);
00238 }
00239 
00240 std::ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface& tsos);
00241 #endif