00001 #ifndef _ThirdHitPrediction_h_
00002 #define _ThirdHitPrediction_h_
00003
00009 #include "RecoTracker/TkMSParametrization/interface/PixelRecoRange.h"
00010 #include "RecoTracker/TkMSParametrization/interface/PixelRecoLineRZ.h"
00011 #include "RecoTracker/TkTrackingRegions/interface/TkTrackingRegionsMargin.h"
00012
00013 #include "DataFormats/GeometryVector/interface/GlobalTag.h"
00014 #include "DataFormats/GeometryVector/interface/Vector2DBase.h"
00015 typedef Vector2DBase<float,GlobalTag> Global2DVector;
00016
00017 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00018 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00019
00020 class DetLayer;
00021 class OrderedHitPair;
00022 class TrackingRecHit;
00023
00024 class TransientTrackingRecHitBuilder;
00025
00026 #include "FWCore/Framework/interface/EventSetup.h"
00027 #include "FWCore/Framework/interface/ESHandle.h"
00028
00029 #include <vector>
00030 #include <utility>
00031
00032 class ThirdHitPrediction {
00033 public:
00034 typedef PixelRecoRange<float> Range;
00035 typedef TkTrackingRegionsMargin<float> Margin;
00036
00037 ThirdHitPrediction
00038 (float originRBound, float ptMin, GlobalPoint inner, GlobalPoint outer, const edm::EventSetup& es, double nSigMultipleScattering, double maxAngleRatio);
00039 ~ThirdHitPrediction();
00040
00041 void getRanges(const DetLayer *layer, float phi[],float rz[]);
00042 void getRanges(float rORz , float phi[],float rz[]);
00043
00044 bool isCompatibleWithMultipleScattering
00045 (GlobalPoint g3, std::vector<const TrackingRecHit*> h,
00046 std::vector<GlobalVector>& localDirs, const edm::EventSetup& es);
00047
00048 private:
00049 void initLayer(const DetLayer *layer);
00050
00051 void printOut(char *text);
00052
00053 void invertCircle(Global2DVector& c,float& r);
00054 void invertPoint (Global2DVector& p);
00055
00056 std::pair<float,float> findMinimalCircles (float r);
00057 std::pair<float,float> findTouchingCircles(float r);
00058
00059 std::pair<float,float> findArcIntersection
00060 (std::pair<float,float> a, std::pair<float,float> b, bool& keep);
00061
00062 void fitParabola
00063 (const float x[3], const float y[3], float par[3]);
00064 void findRectangle
00065 (const float x[3], const float y[3], const float par[3],
00066 float phi[2],float z[2]);
00067
00068 float areaParallelogram(const Global2DVector& a , const Global2DVector& b);
00069 float angleRatio (const Global2DVector& p3, const Global2DVector& c);
00070
00071 void spinCloser(float phi[3]);
00072
00073 void calculateRangesBarrel (float r3, float phi[2],float z[2], bool keep);
00074 void calculateRangesForward(float z3, float phi[2],float r[2], bool keep);
00075 void calculateRanges (float rz3, float phi[2],float rz[2]);
00076
00077 bool theBarrel, theForward;
00078 Range theDetRange;
00079 Margin theTolerance;
00080 PixelRecoLineRZ theLine;
00081
00082 const DetLayer * theLayer;
00083
00084 const TransientTrackingRecHitBuilder * theTTRecHitBuilder;
00085
00086
00087 float Bz, r0,rm;
00088 GlobalPoint g1,g2;
00089 Global2DVector p1,p2,dif;
00090 std::pair<float,float> arc_0m;
00091
00092 bool keep;
00093
00094 double nSigma;
00095 double maxRatio;
00096 };
00097 #endif