Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:29

0001 #ifndef RecoJets_JetAssociationProducers_interface_TrackExtrapolator_h
0002 #define RecoJets_JetAssociationProducers_interface_TrackExtrapolator_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:    TrackExtrapolator
0007 // Class:      TrackExtrapolator
0008 //
0009 /**\class TrackExtrapolator TrackExtrapolator.cc RecoTracker/TrackExtrapolator/src/TrackExtrapolator.cc
0010 
0011  Description: Extrapolates tracks to Calo Face. Migrating this functionality from 
0012               RecoJets/JetAssociationAlgorithms/JetTracksAssociatorDRCalo.h,
0013           which will now essentially be defunct. 
0014 
0015  Implementation:
0016 
0017 */
0018 //
0019 // Original Author:  Salvatore Rappoccio (salvatore.rappoccio@cern.ch)
0020 //         Created:  Mon Feb 22 11:54:41 CET 2010
0021 //
0022 // Revision by: John Paul Chou (chou@hep.brown.edu)
0023 //              Modified algorithm to extrapolate correctly to the endcap front face.
0024 //
0025 //
0026 
0027 // system include files
0028 #include <memory>
0029 
0030 // user include files
0031 #include "FWCore/Framework/interface/Frameworkfwd.h"
0032 #include "FWCore/Framework/interface/stream/EDProducer.h"
0033 
0034 #include "FWCore/Framework/interface/Event.h"
0035 #include "FWCore/Framework/interface/MakerMacros.h"
0036 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0037 
0038 #include "DataFormats/JetReco/interface/TrackExtrapolation.h"
0039 #include "DataFormats/GeometrySurface/interface/Cylinder.h"
0040 #include "DataFormats/GeometrySurface/interface/Plane.h"
0041 #include "DataFormats/Math/interface/deltaR.h"
0042 #include "DataFormats/Math/interface/Vector3D.h"
0043 #include "MagneticField/Engine/interface/MagneticField.h"
0044 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0045 #include "TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h"
0046 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0047 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0048 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0049 #include "TrackingTools/Records/interface/DetIdAssociatorRecord.h"
0050 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0051 #include "TrackingTools/TrackAssociator/interface/DetIdAssociator.h"
0052 #include "TrackingTools/TrackAssociator/interface/FiducialVolume.h"
0053 
0054 //
0055 // class declaration
0056 //
0057 
0058 class TrackExtrapolator : public edm::stream::EDProducer<> {
0059 public:
0060   explicit TrackExtrapolator(const edm::ParameterSet&);
0061   ~TrackExtrapolator() override;
0062 
0063 private:
0064   void produce(edm::Event&, const edm::EventSetup&) override;
0065 
0066   // ----------member data ---------------------------
0067 
0068   const edm::EDGetTokenT<reco::TrackCollection> tracksSrc_;  /// Input tracks
0069   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> fieldToken_;
0070   const edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_;
0071   const edm::ESGetToken<DetIdAssociator, DetIdAssociatorRecord> ecalDetIdAssociatorToken_;
0072   const reco::TrackBase::TrackQuality trackQuality_;  /// track quality of the tracks we care about
0073 
0074   // ----------internal functions ---------------------------
0075 
0076   /// Propagate a track to a given radius, given the magnetic
0077   /// field and the propagator. Store the resulting
0078   /// position, momentum, and direction.
0079   bool propagateTrackToVolume(const reco::Track& fTrack,
0080                               const MagneticField& fField,
0081                               const Propagator& fPropagator,
0082                               const FiducialVolume& volume,
0083                               reco::TrackBase::Point& resultPos,
0084                               reco::TrackBase::Vector& resultMom);
0085 };
0086 
0087 #endif