Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-10 06:14:15

0001 #ifndef CkfTrajectoryBuilder_H
0002 #define CkfTrajectoryBuilder_H
0003 
0004 #include <vector>
0005 
0006 class Propagator;
0007 class TrajectoryStateUpdator;
0008 class MeasurementEstimator;
0009 class TrajectorySeed;
0010 class TrajectoryStateOnSurface;
0011 class TrajectoryFilter;
0012 
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0015 #include "FWCore/Framework/interface/EventSetup.h"
0016 #include "FWCore/Framework/interface/Event.h"
0017 
0018 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
0019 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0020 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
0021 
0022 #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h"
0023 
0024 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0025 #include "TrackingTools/PatternTools/interface/TempTrajectory.h"
0026 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0027 
0028 #include <map>
0029 
0030 class TransientTrackingRecHitBuilder;
0031 class TrajectoryFilter;
0032 
0033 class CkfTrajectoryBuilder : public BaseCkfTrajectoryBuilder {
0034 public:
0035   typedef std::vector<Trajectory> TrajectoryContainer;
0036   typedef std::vector<TempTrajectory> TempTrajectoryContainer;
0037 
0038   CkfTrajectoryBuilder(const edm::ParameterSet& conf, edm::ConsumesCollector iC);
0039   CkfTrajectoryBuilder(const edm::ParameterSet& conf,
0040                        edm::ConsumesCollector iC,
0041                        std::unique_ptr<TrajectoryFilter> filter);
0042 
0043   ~CkfTrajectoryBuilder() override {}
0044 
0045   static void fillPSetDescription(edm::ParameterSetDescription& iDesc);
0046 
0047   /// trajectories building starting from a seed
0048   TrajectoryContainer trajectories(const TrajectorySeed& seed) const override;
0049   /// trajectories building starting from a seed
0050   void trajectories(const TrajectorySeed& seed, TrajectoryContainer& ret) const override;
0051 
0052   // new interface returning the start Trajectory...
0053   TempTrajectory buildTrajectories(const TrajectorySeed&,
0054                                    TrajectoryContainer& ret,
0055                                    unsigned int& nCandPerSeed,
0056                                    const TrajectoryFilter*) const override;
0057 
0058   void rebuildTrajectories(TempTrajectory const& startingTraj,
0059                            const TrajectorySeed&,
0060                            TrajectoryContainer& result) const override {}
0061 
0062   /// set Event for the internal MeasurementTracker data member
0063   //  virtual void setEvent(const edm::Event& event) const;
0064 
0065 protected:
0066   int theMaxCand;               /**< Maximum number of trajectory candidates 
0067                              to propagate to the next layer. */
0068   float theLostHitPenalty;      /**< Chi**2 Penalty for each lost hit. */
0069   bool theIntermediateCleaning; /**< Tells whether an intermediary cleaning stage 
0070                                      should take place during TB. */
0071   bool theAlwaysUseInvalidHits;
0072 
0073 protected:
0074   void setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;
0075 
0076   virtual void findCompatibleMeasurements(const TrajectorySeed& seed,
0077                                           const TempTrajectory& traj,
0078                                           std::vector<TrajectoryMeasurement>& result) const;
0079 
0080   unsigned int limitedCandidates(const TrajectorySeed& seed,
0081                                  TempTrajectory& startingTraj,
0082                                  TrajectoryContainer& result) const;
0083   unsigned int limitedCandidates(const std::shared_ptr<const TrajectorySeed>& sharedSeed,
0084                                  TempTrajectoryContainer& candidates,
0085                                  TrajectoryContainer& result) const;
0086 
0087   void updateTrajectory(TempTrajectory& traj, TM&& tm) const;
0088 
0089   /*  
0090       //not mature for integration.  
0091       bool theSharedSeedCheck;
0092       std::string theUniqueName;
0093       void rememberSeedAndTrajectories(const TrajectorySeed& seed,TrajectoryContainer &result) const;
0094       bool seedAlreadyUsed(const TrajectorySeed& seed,TempTrajectoryContainer &candidates) const;
0095       bool sharedSeed(const TrajectorySeed& seed1,const TrajectorySeed& seed2) const;
0096       //  mutable TempTrajectoryContainer theCachedTrajectories;
0097       typedef boost::unordered_multimap<uint32_t,TempTrajectory> SharedTrajectory;
0098       mutable SharedTrajectory theCachedTrajectories;
0099   */
0100 };
0101 
0102 #endif