Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef GsfTrackProducerBase_h
0002 #define GsfTrackProducerBase_h
0003 
0004 /** \class GsfTrackProducerBase
0005  *  Produce Tracks from TrackCandidates
0006  *
0007  *  \author cerati
0008  */
0009 
0010 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
0011 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
0012 #include "DataFormats/GsfTrackReco/interface/GsfTrackExtra.h"
0013 #include "DataFormats/GsfTrackReco/interface/GsfTrackExtraFwd.h"
0014 #include "DataFormats/GsfTrackReco/interface/GsfComponent5D.h"
0015 #include "RecoTracker/TrackProducer/interface/TrackProducerBase.h"
0016 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0017 #include "TrackingTools/GsfTools/interface/MultiTrajectoryStateMode.h"
0018 
0019 // #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0020 
0021 class TrajectoryStateOnSurface;
0022 class Propagator;
0023 class TransverseImpactPointExtrapolator;
0024 class TrajectoryStateClosestToBeamLineBuilder;
0025 
0026 class GsfTrackProducerBase : public TrackProducerBase<reco::GsfTrack> {
0027 public:
0028   /// Constructor
0029   explicit GsfTrackProducerBase(bool trajectoryInEvent, bool split)
0030       : TrackProducerBase<reco::GsfTrack>(trajectoryInEvent), useSplitting(split) {}
0031 
0032   /// Put produced collections in the event
0033   virtual void putInEvt(edm::Event&,
0034                         const Propagator* prop,
0035                         const MeasurementTracker* measTk,
0036                         std::unique_ptr<TrackingRecHitCollection>&,
0037                         std::unique_ptr<reco::GsfTrackCollection>&,
0038                         std::unique_ptr<reco::TrackExtraCollection>&,
0039                         std::unique_ptr<reco::GsfTrackExtraCollection>&,
0040                         std::unique_ptr<std::vector<Trajectory> >&,
0041                         AlgoProductCollection&,
0042                         TransientTrackingRecHitBuilder const*,
0043                         const reco::BeamSpot&,
0044                         const TrackerTopology* ttopo);
0045 
0046 protected:
0047   void fillStates(TrajectoryStateOnSurface tsos, std::vector<reco::GsfComponent5D>& states) const;
0048   void fillMode(reco::GsfTrack& track,
0049                 const TrajectoryStateOnSurface innertsos,
0050                 const Propagator& gsfProp,
0051                 const TransverseImpactPointExtrapolator& tipExtrapolator,
0052                 TrajectoryStateClosestToBeamLineBuilder& tscblBuilder,
0053                 const reco::BeamSpot& bs) const;
0054 
0055 private:
0056   /// local parameters rescaled with q/p from mode
0057   void localParametersFromQpMode(const TrajectoryStateOnSurface tsos,
0058                                  AlgebraicVector5& parameters,
0059                                  AlgebraicSymMatrix55& covariance) const;
0060   /// position, momentum and estimated deltaP at an intermediate measurement (true if successful)
0061   bool computeModeAtTM(const TrajectoryMeasurement& tm,
0062                        reco::GsfTrackExtra::Point& position,
0063                        reco::GsfTrackExtra::Vector& momentum,
0064                        Measurement1D& deltaP) const;
0065 
0066 private:
0067   bool useSplitting;
0068 };
0069 
0070 #endif