00001 #ifndef RecoLocalTracker_SiPixelRecHits_CPEFromDetPosition_H
00002 #define RecoLocalTracker_SiPixelRecHits_CPEFromDetPosition_H 1
00003
00004 #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h"
00005 #include "RecoLocalTracker/SiPixelRecHits/interface/EtaCorrection.h"
00006
00007 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
00008 #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
00009 #include "Geometry/TrackerTopology/interface/RectangularPixelTopology.h"
00010
00011
00012 #ifdef TP_OLD
00013 #include "Geometry/CommonDetAlgo/interface/MeasurementPoint.h"
00014 #include "Geometry/CommonDetAlgo/interface/MeasurementError.h"
00015 #include "Geometry/Surface/interface/GloballyPositioned.h"
00016 #else // new location
00017 #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementPoint.h"
00018 #include "DataFormats/GeometryCommonDetAlgo/interface/MeasurementError.h"
00019 #include "DataFormats/GeometrySurface/interface/GloballyPositioned.h"
00020 #endif
00021
00022
00023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00024
00025
00026
00027
00028 #include <utility>
00029 #include <vector>
00030
00031
00032
00033
00034 #if 0
00035
00039 #endif
00040 class MagneticField;
00041 class CPEFromDetPosition : public PixelClusterParameterEstimator
00042 {
00043 public:
00044
00045 CPEFromDetPosition(edm::ParameterSet const& conf, const MagneticField*);
00046
00047
00048 LocalValues localParameters( const SiPixelCluster & cl,
00049 const GeomDetUnit & det ) const {
00050 return std::make_pair( localPosition(cl,det), localError(cl,det) );
00051 }
00052
00053 LocalPoint localPosition(const SiPixelCluster& cl, const GeomDetUnit & det) const ;
00054 LocalError localError (const SiPixelCluster& cl, const GeomDetUnit & det) const ;
00055
00056 protected:
00057
00058 mutable const PixelGeomDetUnit* theDet;
00059 mutable const RectangularPixelTopology * theTopol;
00060 mutable GeomDetType::SubDetector thePart;
00061 mutable EtaCorrection theEtaFunc;
00062 mutable float theThickness;
00063 mutable float thePitchX;
00064 mutable float thePitchY;
00065 mutable float theOffsetX;
00066 mutable float theOffsetY;
00067 mutable float theNumOfRow;
00068 mutable float theNumOfCol;
00069 mutable float theDetZ;
00070 mutable float theDetR;
00071 mutable float theLShiftX;
00072 mutable float theLShiftY;
00073
00074 mutable float theSign;
00075
00076 mutable float theTanLorentzAnglePerTesla;
00077 int theVerboseLevel;
00078
00079
00080 const MagneticField* magfield_;
00081
00082
00083 bool alpha2Order;
00084
00085
00086 void setTheDet( const GeomDetUnit & det ) const ;
00087
00088 MeasurementPoint measurementPosition( const SiPixelCluster&,
00089 const GeomDetUnit & det) const ;
00090 MeasurementError measurementError ( const SiPixelCluster&,
00091 const GeomDetUnit & det) const ;
00092
00093
00094
00095 float err2X(bool&, int&) const;
00096 float err2Y(bool&, int&) const;
00097 bool isFlipped() const;
00098
00099 float chargeWidthX()const;
00100 float chargeWidthY()const;
00101 float geomCorrectionX(float xpos)const;
00102 float geomCorrectionY(float ypos)const;
00103
00104 float estimatedAlphaForBarrel(const float&) const;
00105
00106
00107 float lorentzShiftX()const;
00108 float lorentzShiftY()const;
00109
00110
00111 float xpos( const SiPixelCluster& ) const;
00112
00113 float ypos( const SiPixelCluster& ) const;
00114
00115
00116 std::vector<float>
00117 xCharge(const std::vector<SiPixelCluster::Pixel>&, const float&, const float&)const;
00118 std::vector<float>
00119 yCharge(const std::vector<SiPixelCluster::Pixel>&, const float&, const float&)const;
00120
00121 LocalVector driftDirection( GlobalVector bfield )const ;
00122 typedef GloballyPositioned<double> Frame;
00123 };
00124
00125 #endif
00126
00127
00128
00129