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
00022 TrajectoryStateOnSurface() {}
00024 TrajectoryStateOnSurface( BasicTrajectoryState* p) : Base(p) {}
00028 TrajectoryStateOnSurface( const FreeTrajectoryState& fts,
00029 const Surface& aSurface,
00030 const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00034 TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00035 const Surface& aSurface,
00036 const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00040 TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00041 const CartesianTrajectoryError& err,
00042 const Surface& aSurface,
00043 const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00048 TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00049 const CurvilinearTrajectoryError& err,
00050 const Surface& aSurface,
00051 const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface,
00052 double weight = 1.);
00057 TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00058 const CurvilinearTrajectoryError& err,
00059 const Surface& aSurface,
00060 double weight);
00064 TrajectoryStateOnSurface( const LocalTrajectoryParameters& p,
00065 const Surface& aSurface,
00066 const MagneticField* field,
00067 const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00072 TrajectoryStateOnSurface( const LocalTrajectoryParameters& p,
00073 const LocalTrajectoryError& err,
00074 const Surface& aSurface,
00075 const MagneticField* field,
00076 const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface,
00077 double weight = 1.);
00082 TrajectoryStateOnSurface( const LocalTrajectoryParameters& p,
00083 const LocalTrajectoryError& err,
00084 const Surface& aSurface,
00085 const MagneticField* field,
00086 double weight);
00087
00088 virtual ~TrajectoryStateOnSurface() {}
00089
00090 #if defined( __GXX_EXPERIMENTAL_CXX0X__)
00091
00092 TrajectoryStateOnSurface(TrajectoryStateOnSurface && rh) :
00093 Base(std::forward<Base>(rh)){}
00094
00095 TrajectoryStateOnSurface & operator=(TrajectoryStateOnSurface && rh) {
00096 Base::swap(rh);
00097 return *this;
00098 }
00099
00100 #endif
00101
00102 void swap(TrajectoryStateOnSurface & rh) {
00103 Base::swap(rh);
00104 }
00105
00106
00107 bool isValid() const {
00108 return Base::isValid() && data().isValid();
00109 }
00110
00111 bool hasError() const {
00112 return data().hasError();
00113 }
00114
00115 FreeTrajectoryState* freeState(bool withErrors = true) const {
00116 return data().freeTrajectoryState();
00117 }
00118
00119 FreeTrajectoryState* freeTrajectoryState(bool withErrors = true) const {
00120 return freeState();
00121 }
00122
00123 const MagneticField *magneticField() const { return data().magneticField(); }
00124
00125 const GlobalTrajectoryParameters& globalParameters() const {
00126 return data().globalParameters();
00127 }
00128 GlobalPoint globalPosition() const {
00129 return data().globalPosition();
00130 }
00131 GlobalVector globalMomentum() const {
00132 return data().globalMomentum();
00133 }
00134 GlobalVector globalDirection() const {
00135 return data().globalDirection();
00136 }
00137 TrackCharge charge() const {
00138 return data().charge();
00139 }
00140 double signedInverseMomentum() const {
00141 return data().signedInverseMomentum();
00142 }
00143 double transverseCurvature() const {
00144 return data().transverseCurvature();
00145 }
00146 const CartesianTrajectoryError& cartesianError() const {
00147 return data().cartesianError();
00148 }
00149 const CurvilinearTrajectoryError& curvilinearError() const {
00150 return data().curvilinearError();
00151 }
00152 const LocalTrajectoryParameters& localParameters() const {
00153 return data().localParameters();
00154 }
00155 LocalPoint localPosition() const {
00156 return data().localPosition();
00157 }
00158 LocalVector localMomentum() const {
00159 return data().localMomentum();
00160 }
00161 LocalVector localDirection() const {
00162 return data().localDirection();
00163 }
00164 const LocalTrajectoryError& localError() const {
00165 return data().localError();
00166 }
00167 const Surface& surface() const {
00168 return data().surface();
00169 }
00170
00171 double weight() const {return data().weight();}
00172
00173 void rescaleError(double factor) {
00174 unsharedData().rescaleError(factor);
00175 }
00176
00177 std::vector<TrajectoryStateOnSurface> components() const {
00178 return data().components();
00179 }
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00192 SurfaceSide surfaceSide() const {
00193 return data().surfaceSide();
00194 }
00195
00201 void update( const LocalTrajectoryParameters& p,
00202 const Surface& aSurface,
00203 const MagneticField* field,
00204 const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface);
00211 void update( const LocalTrajectoryParameters& p,
00212 const LocalTrajectoryError& err,
00213 const Surface& aSurface,
00214 const MagneticField* field,
00215 const SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface,
00216 double weight = 1.);
00217
00218 };
00219
00220 inline void swap( TrajectoryStateOnSurface & rh, TrajectoryStateOnSurface & lh) {
00221
00222 rh.swap(lh);
00223 }
00224
00225 std::ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface& tsos);
00226 #endif