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
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 = atCenterOfSurface);
00034 TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00035 const Surface& aSurface,
00036 const SurfaceSide side = atCenterOfSurface);
00040 TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00041 const CartesianTrajectoryError& err,
00042 const Surface& aSurface,
00043 const SurfaceSide side = atCenterOfSurface);
00048 TrajectoryStateOnSurface( const GlobalTrajectoryParameters& gp,
00049 const CurvilinearTrajectoryError& err,
00050 const Surface& aSurface,
00051 const SurfaceSide side = 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 = atCenterOfSurface);
00072 TrajectoryStateOnSurface( const LocalTrajectoryParameters& p,
00073 const LocalTrajectoryError& err,
00074 const Surface& aSurface,
00075 const MagneticField* field,
00076 const SurfaceSide side = 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 bool isValid() const {
00091 return Base::isValid() && data().isValid();
00092 }
00093 bool hasError() const {
00094 return data().hasError();
00095 }
00096
00097 FreeTrajectoryState* freeState(bool withErrors = true) const {
00098 return data().freeTrajectoryState();
00099 }
00100
00101 FreeTrajectoryState* freeTrajectoryState(bool withErrors = true) const {
00102 return freeState();
00103 }
00104
00105 const MagneticField *magneticField() const { return data().magneticField(); }
00106
00107 const GlobalTrajectoryParameters& globalParameters() const {
00108 return data().globalParameters();
00109 }
00110 GlobalPoint globalPosition() const {
00111 return data().globalPosition();
00112 }
00113 GlobalVector globalMomentum() const {
00114 return data().globalMomentum();
00115 }
00116 GlobalVector globalDirection() const {
00117 return data().globalDirection();
00118 }
00119 TrackCharge charge() const {
00120 return data().charge();
00121 }
00122 double signedInverseMomentum() const {
00123 return data().signedInverseMomentum();
00124 }
00125 double transverseCurvature() const {
00126 return data().transverseCurvature();
00127 }
00128 const CartesianTrajectoryError& cartesianError() const {
00129 return data().cartesianError();
00130 }
00131 const CurvilinearTrajectoryError& curvilinearError() const {
00132 return data().curvilinearError();
00133 }
00134 const LocalTrajectoryParameters& localParameters() const {
00135 return data().localParameters();
00136 }
00137 LocalPoint localPosition() const {
00138 return data().localPosition();
00139 }
00140 LocalVector localMomentum() const {
00141 return data().localMomentum();
00142 }
00143 LocalVector localDirection() const {
00144 return data().localDirection();
00145 }
00146 const LocalTrajectoryError& localError() const {
00147 return data().localError();
00148 }
00149 const Surface& surface() const {
00150 return data().surface();
00151 }
00152
00153 double weight() const {return data().weight();}
00154
00155 void rescaleError(double factor) {
00156 unsharedData().rescaleError(factor);
00157 }
00158
00159 std::vector<TrajectoryStateOnSurface> components() const {
00160 return data().components();
00161 }
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00174 SurfaceSide surfaceSide() const {
00175 return data().surfaceSide();
00176 }
00177 };
00178
00179 std::ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface& tsos);
00180 #endif