CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/RecoTracker/SpecialSeedGenerators/interface/SeedFromGenericPairOrTriplet.h

Go to the documentation of this file.
00001 #ifndef SpecialSeedGenerators_SeedFromGenericPairOrTriplet_h
00002 #define SpecialSeedGenerators_SeedFromGenericPairOrTriplet_h
00003 /*
00004 Class that produces a TrajectorySeed from a generic hit pair or triplet withou the vertex constraint.
00005 If used without B (e.g. cosmics) it checks the three hits are aligned.
00006 If used with B it checks the initial state has a momentum greated than the threshold set in the cfg
00007 */
00008 //FWK
00009 #include "FWCore/Framework/interface/EventSetup.h"
00010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00011 //DataFormats
00012 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
00013 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00014 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00015 //RecoLocal
00016 #include "RecoTracker/TkSeedingLayers/interface/SeedingHitSet.h"
00017 //TrackingTools
00018 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00019 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00020 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00021 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
00022 #include "TrackingTools/DetLayers/interface/NavigationDirection.h"
00023 //Geometry
00024 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00025 //MagneticField
00026 #include "MagneticField/Engine/interface/MagneticField.h"
00027 
00028 #include <vector>
00029 
00030 class SeedFromGenericPairOrTriplet{
00031         public:
00032         SeedFromGenericPairOrTriplet(const MagneticField* mf,
00033                                      const TrackerGeometry* geom,
00034                                      const TransientTrackingRecHitBuilder* builder,
00035                                      const Propagator* propagatorAlong,
00036                                      const Propagator* propagatorOpposite,
00037                                      const std::vector<int>& charges,           
00038                                      bool momFromPSet,
00039                                      double errorRescaling );
00040         ~SeedFromGenericPairOrTriplet(){};
00041         void setMomentumTo(double mom){theP = mom;};
00042         bool momentumFromPSet(){return theSetMomentum;}; 
00043         //builds a seed from a pair or triplet. it returns a null pointer if the seed does not pass the quality filter
00044         std::vector<TrajectorySeed*> seed(const SeedingHitSet& hits,
00045                                          const PropagationDirection& dir,
00046                                          const NavigationDirection&  seedDir,
00047                                          const edm::EventSetup& iSetup);
00048         TrajectorySeed* seedFromTriplet(const SeedingHitSet& hits,
00049                                         const PropagationDirection& dir,
00050                                         const NavigationDirection&  seedDir,
00051                                         const edm::EventSetup& iSetup, int charge = -1) const ;
00052         TrajectorySeed*    seedFromPair(const SeedingHitSet& hits,
00053                                         const PropagationDirection& dir,
00054                                         const NavigationDirection&  seedDir, int charge = -1) const ;
00055 
00056         
00057         private:
00058         TrajectorySeed*       buildSeed(const GlobalVector& momentum,
00059                                         int charge,
00060                                         //const TrackingRecHit* firsthit,
00061                                         std::vector<const TrackingRecHit*>& trHits,
00062                                         const PropagationDirection& dir) const;
00063         //initial error estimate        
00064         //CurvilinearTrajectoryError initialError(const TrackingRecHit* rechit);        
00065         //in the case of noB it returns false if 3 hist are not aligned
00066         //if the B is on it returns false if the initial momentum is less than p
00067         bool qualityFilter(const SeedingHitSet& hits) const ;
00068         bool qualityFilter(const GlobalVector& momentum) const;
00069         const MagneticField*   theMagfield;
00070         const TrackerGeometry* theTracker;
00071         const TransientTrackingRecHitBuilder* theBuilder;
00072         const Propagator* thePropagatorAlong;
00073         const Propagator* thePropagatorOpposite;
00074         
00075         float theP;
00076         bool theSetMomentum;
00077         std::vector<int> theCharges;
00078         double theErrorRescaling;       
00079 };
00080 
00081 #endif