Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-22 02:30:55

0001 #ifndef Alignment_ReferenceTrajectories_TrajectoryFactoryBase_h
0002 #define Alignment_ReferenceTrajectories_TrajectoryFactoryBase_h
0003 
0004 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h"
0005 #include "Alignment/ReferenceTrajectories/interface/ReferenceTrajectoryBase.h"
0006 
0007 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0008 
0009 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0010 
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 
0013 #include "FWCore/Framework/interface/ConsumesCollector.h"
0014 /// Base class for factories producing reference trajectories, i.e. instances of classes deriving from
0015 /// ReferenceTrajectoryBase, from a TrajTrackPairCollection.
0016 
0017 namespace reco {
0018   class BeamSpot;
0019 }
0020 
0021 class TrajectoryFactoryBase {
0022 public:
0023   typedef ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr;
0024   typedef ReferenceTrajectoryBase::MaterialEffects MaterialEffects;
0025   typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair;
0026   typedef AlignmentAlgorithmBase::ConstTrajTrackPairCollection ConstTrajTrackPairCollection;
0027   typedef std::vector<ReferenceTrajectoryPtr> ReferenceTrajectoryCollection;
0028   typedef std::pair<TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer> TrajectoryInput;
0029   typedef std::vector<TrajectoryStateOnSurface> ExternalPredictionCollection;
0030 
0031   TrajectoryFactoryBase(const edm::ParameterSet& config, const edm::ConsumesCollector& iC);
0032   TrajectoryFactoryBase(const edm::ParameterSet& config,
0033                         unsigned int tracksPerTrajectory,
0034                         const edm::ConsumesCollector& iC);
0035   virtual ~TrajectoryFactoryBase(void);
0036 
0037   virtual const ReferenceTrajectoryCollection trajectories(const edm::EventSetup& setup,
0038                                                            const ConstTrajTrackPairCollection& tracks,
0039                                                            const reco::BeamSpot& beamSpot) const = 0;
0040 
0041   virtual const ReferenceTrajectoryCollection trajectories(const edm::EventSetup& setup,
0042                                                            const ConstTrajTrackPairCollection& tracks,
0043                                                            const ExternalPredictionCollection& external,
0044                                                            const reco::BeamSpot& beamSpot) const = 0;
0045 
0046   virtual TrajectoryFactoryBase* clone(void) const = 0;
0047 
0048   inline MaterialEffects materialEffects(void) const { return materialEffects_; }
0049   inline PropagationDirection propagationDirection(void) const { return propDir_; }
0050   inline const edm::ParameterSet& configuration() const { return cfg_; }
0051   inline unsigned int tracksPerTrajectory() const { return tracksPerTrajectory_; }
0052 
0053 protected:
0054   virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair& track) const;
0055   virtual const Trajectory::DataContainer orderedTrajectoryMeasurements(const Trajectory& trajectory) const;
0056   bool sameSurface(const Surface& s1, const Surface& s2) const;
0057   bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer& hitPtr) const;
0058 
0059 private:
0060   MaterialEffects materialEffects(const std::string& strME) const;
0061   PropagationDirection propagationDirection(const std::string& strPD) const;
0062 
0063   const edm::ParameterSet cfg_;  // need to keep for possible re-use after constructor... :-(
0064   const unsigned int tracksPerTrajectory_;
0065   const MaterialEffects materialEffects_;
0066   const PropagationDirection propDir_;
0067 
0068   const bool useWithoutDet_;
0069   const bool useInvalidHits_;
0070   const bool useProjectedHits_;
0071 
0072 protected:
0073   const bool useBeamSpot_;
0074   const bool includeAPEs_;
0075   const bool allowZeroMaterial_;
0076 };
0077 
0078 #endif