00001 #ifndef SeedForPhotonConversionFromQuadruplets_H
00002 #define SeedForPhotonConversionFromQuadruplets_H
00003
00004 #include "RecoTracker/TkTrackingRegions/interface/GlobalTrackingRegion.h"
00005 #include "RecoTracker/TkSeedGenerator/interface/SeedCreator.h"
00006 #include "RecoTracker/TkSeedingLayers/interface/SeedingHitSet.h"
00007 #include "RecoTracker/ConversionSeedGenerators/interface/PrintRecoObjects.h"
00008 #include "RecoTracker/ConversionSeedGenerators/interface/Quad.h"
00009 class FreeTrajectoryState;
00010
00011 class SeedForPhotonConversionFromQuadruplets : public SeedCreator {
00012 public:
00013 static const int cotTheta_Max=99999;
00014
00015 SeedForPhotonConversionFromQuadruplets( const edm::ParameterSet & cfg):
00016 thePropagatorLabel(cfg.getParameter<std::string>("propagator")),
00017 theBOFFMomentum(cfg.existsAs<double>("SeedMomentumForBOFF") ? cfg.getParameter<double>("SeedMomentumForBOFF") : 5.0)
00018 {}
00019
00020 SeedForPhotonConversionFromQuadruplets(
00021 const std::string & propagator = "PropagatorWithMaterial", double seedMomentumForBOFF = -5.0)
00022 : thePropagatorLabel(propagator), theBOFFMomentum(seedMomentumForBOFF) { }
00023
00024
00025 virtual ~SeedForPhotonConversionFromQuadruplets(){}
00026
00027 virtual const TrajectorySeed * trajectorySeed( TrajectorySeedCollection & seedCollection,
00028 const SeedingHitSet & phits,
00029 const SeedingHitSet & mhits,
00030 const TrackingRegion & region,
00031 const edm::EventSetup& es,
00032 std::stringstream& ss, std::vector<Quad> & quadV);
00033
00034 virtual const TrajectorySeed *trajectorySeed(
00035 TrajectorySeedCollection & seedCollection,
00036 const SeedingHitSet & hits,
00037 const TrackingRegion & region,
00038 const edm::EventSetup& es,
00039 const SeedComparitor *filter){ return 0;}
00040
00041 double simpleGetSlope(const TransientTrackingRecHit::ConstRecHitPointer &ohit, const TransientTrackingRecHit::ConstRecHitPointer &nohit, const TransientTrackingRecHit::ConstRecHitPointer &ihit, const TransientTrackingRecHit::ConstRecHitPointer &nihit, const TrackingRegion & region, double & cotTheta, double & z0);
00042 double verySimpleFit(int size, double* ax, double* ay, double* e2y, double& p0, double& e2p0, double& p1);
00043 double getSqrEffectiveErrorOnZ(const TransientTrackingRecHit::ConstRecHitPointer &hit, const TrackingRegion & region);
00044
00045
00046
00047 void stupidPrint(std::string s,float* d);
00048 void stupidPrint(std::string s,double* d);
00049 void stupidPrint(const char* s,GlobalPoint* d);
00050 void stupidPrint(const char* s,GlobalPoint* d, int n);
00051 void bubbleSortVsPhi(GlobalPoint arr[], int n, GlobalPoint vtx);
00052 void bubbleReverseSortVsPhi(GlobalPoint arr[], int n, GlobalPoint vtx);
00053
00054
00055
00056
00057
00058
00059 protected:
00060
00061 virtual bool checkHit(
00062 const TrajectoryStateOnSurface &,
00063 const TransientTrackingRecHit::ConstRecHitPointer &hit,
00064 const edm::EventSetup& es) const { return true; }
00065
00066 virtual GlobalTrajectoryParameters initialKinematic(
00067 const SeedingHitSet & hits,
00068 const GlobalPoint & vertexPos,
00069 const edm::EventSetup& es,
00070 const float cotTheta) const;
00071
00072 virtual CurvilinearTrajectoryError initialError(
00073 const GlobalVector& vertexBounds,
00074 float ptMin,
00075 float sinTheta) const;
00076
00077 virtual const TrajectorySeed * buildSeed(
00078 TrajectorySeedCollection & seedCollection,
00079 const SeedingHitSet & hits,
00080 const FreeTrajectoryState & fts,
00081 const edm::EventSetup& es) const;
00082
00083 virtual TransientTrackingRecHit::RecHitPointer refitHit(
00084 const TransientTrackingRecHit::ConstRecHitPointer &hit,
00085 const TrajectoryStateOnSurface &state) const;
00086
00087 bool similarQuadExist(Quad & thisQuad, std::vector<Quad>& quadV);
00088
00089
00090 protected:
00091 std::string thePropagatorLabel;
00092 double theBOFFMomentum;
00093
00094 std::stringstream * pss;
00095 PrintRecoObjects po;
00096 };
00097 #endif