Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:40

0001 #ifndef SpecialSeedGenerators_SeedFromGenericPairOrTriplet_h
0002 #define SpecialSeedGenerators_SeedFromGenericPairOrTriplet_h
0003 /*
0004 Class that produces a TrajectorySeed from a generic hit pair or triplet withou the vertex constraint.
0005 If used without B (e.g. cosmics) it checks the three hits are aligned.
0006 If used with B it checks the initial state has a momentum greated than the threshold set in the cfg
0007 */
0008 //FWK
0009 #include "FWCore/Framework/interface/EventSetup.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 //DataFormats
0012 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
0013 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0014 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0015 //RecoLocal
0016 #include "RecoTracker/TkSeedingLayers/interface/SeedingHitSet.h"
0017 //TrackingTools
0018 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0019 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0020 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
0021 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
0022 #include "TrackingTools/DetLayers/interface/NavigationDirection.h"
0023 //Geometry
0024 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0025 //MagneticField
0026 #include "MagneticField/Engine/interface/MagneticField.h"
0027 
0028 #include <vector>
0029 
0030 class SeedFromGenericPairOrTriplet {
0031 public:
0032   SeedFromGenericPairOrTriplet(const MagneticField* mf,
0033                                const TrackerGeometry* geom,
0034                                const TransientTrackingRecHitBuilder* builder,
0035                                const Propagator* propagatorAlong,
0036                                const Propagator* propagatorOpposite,
0037                                const std::vector<int>& charges,
0038                                bool momFromPSet,
0039                                double errorRescaling);
0040   ~SeedFromGenericPairOrTriplet(){};
0041   void setMomentumTo(double mom) { theP = mom; };
0042   bool momentumFromPSet() { return theSetMomentum; };
0043   //builds a seed from a pair or triplet. it returns a null pointer if the seed does not pass the quality filter
0044   std::vector<TrajectorySeed*> seed(const SeedingHitSet& hits,
0045                                     const PropagationDirection& dir,
0046                                     const NavigationDirection& seedDir,
0047                                     const edm::EventSetup& iSetup);
0048   TrajectorySeed* seedFromTriplet(const SeedingHitSet& hits,
0049                                   const PropagationDirection& dir,
0050                                   const NavigationDirection& seedDir,
0051                                   const edm::EventSetup& iSetup,
0052                                   int charge = -1) const;
0053   TrajectorySeed* seedFromPair(const SeedingHitSet& hits,
0054                                const PropagationDirection& dir,
0055                                const NavigationDirection& seedDir,
0056                                int charge = -1) const;
0057 
0058 private:
0059   TrajectorySeed* buildSeed(const GlobalVector& momentum,
0060                             int charge,
0061                             //const TrackingRecHit* firsthit,
0062                             std::vector<const BaseTrackerRecHit*>& trHits,
0063                             const PropagationDirection& dir) const;
0064   //initial error estimate
0065   //CurvilinearTrajectoryError initialError(const TrackingRecHit* rechit);
0066   //in the case of noB it returns false if 3 hist are not aligned
0067   //if the B is on it returns false if the initial momentum is less than p
0068   bool qualityFilter(const SeedingHitSet& hits) const;
0069   bool qualityFilter(const GlobalVector& momentum) const;
0070   const MagneticField* theMagfield;
0071   const TrackerGeometry* theTracker;
0072   const TransientTrackingRecHitBuilder* theBuilder;
0073   const Propagator* thePropagatorAlong;
0074   const Propagator* thePropagatorOpposite;
0075 
0076   float theP;
0077   bool theSetMomentum;
0078   std::vector<int> theCharges;
0079   double theErrorRescaling;
0080 };
0081 
0082 #endif