Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:54

0001 #ifndef RecoMuon_GlobalTrackingTools_MuonTrackingRegionByPtBuilder_h
0002 #define RecoMuon_GlobalTrackingTools_MuonTrackingRegionByPtBuilder_h
0003 
0004 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0005 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0006 #include "DataFormats/VertexReco/interface/Vertex.h"
0007 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0008 
0009 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0010 #include "FWCore/Utilities/interface/InputTag.h"
0011 #include "FWCore/Framework/interface/ConsumesCollector.h"
0012 
0013 #include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducer.h"
0014 #include "RecoTracker/TkTrackingRegions/interface/RectangularEtaPhiTrackingRegion.h"
0015 
0016 #include "FWCore/Framework/interface/Frameworkfwd.h"
0017 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0018 
0019 class MuonServiceProxy;
0020 class MeasurementTrackerEvent;
0021 class MagneticField;
0022 class IdealMagneticFieldRecord;
0023 class MultipleScatteringParametrisationMaker;
0024 class TrackerMultipleScatteringRecord;
0025 
0026 class MuonTrackingRegionByPtBuilder : public TrackingRegionProducer {
0027 public:
0028   /// Constructor

0029   explicit MuonTrackingRegionByPtBuilder(const edm::ParameterSet& par, edm::ConsumesCollector& iC) { build(par, iC); }
0030   explicit MuonTrackingRegionByPtBuilder(const edm::ParameterSet& par, edm::ConsumesCollector&& iC) { build(par, iC); }
0031 
0032   /// Destructor

0033   ~MuonTrackingRegionByPtBuilder() override = default;
0034 
0035   /// Create Region of Interest

0036   std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event&, const edm::EventSetup&) const override;
0037 
0038   /// Define tracking region

0039   std::unique_ptr<RectangularEtaPhiTrackingRegion> region(const reco::TrackRef&) const;
0040   std::unique_ptr<RectangularEtaPhiTrackingRegion> region(const reco::Track& t) const {
0041     return region(t, *theEvent, *theEventSetup);
0042   }
0043   std::unique_ptr<RectangularEtaPhiTrackingRegion> region(const reco::Track&,
0044                                                           const edm::Event&,
0045                                                           const edm::EventSetup&) const;
0046 
0047   /// Pass the Event to the algo at each event

0048   void setEvent(const edm::Event&, const edm::EventSetup&);
0049 
0050   /// Add Fill Descriptions

0051   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0052 
0053 private:
0054   void build(const edm::ParameterSet&, edm::ConsumesCollector&);
0055 
0056   const edm::Event* theEvent;
0057   const edm::EventSetup* theEventSetup;
0058 
0059   bool useVertex;
0060   bool useFixedZ;
0061   bool useFixedPt;
0062   bool thePrecise;
0063 
0064   int theMaxRegions;
0065 
0066   double theNsigmaDz;
0067 
0068   double thePtMin;
0069   double theDeltaR;
0070   double theHalfZ;
0071 
0072   std::vector<double> ptRanges_;
0073   std::vector<double> deltaEtas_;
0074   std::vector<double> deltaPhis_;
0075 
0076   RectangularEtaPhiTrackingRegion::UseMeasurementTracker theOnDemand;
0077   edm::EDGetTokenT<MeasurementTrackerEvent> theMeasurementTrackerToken;
0078   edm::EDGetTokenT<reco::BeamSpot> beamSpotToken;
0079   edm::EDGetTokenT<reco::VertexCollection> vertexCollectionToken;
0080   edm::EDGetTokenT<reco::TrackCollection> inputCollectionToken;
0081   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bfieldToken;
0082   edm::ESGetToken<MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord> msmakerToken;
0083 };
0084 #endif