Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef RecoMuon_TrackingTools_MuonTrackingRegionBuilder_H
0002 #define RecoMuon_TrackingTools_MuonTrackingRegionBuilder_H
0003 
0004 /** \class MuonTrackingRegionBuilder

0005  *

0006  *  Build a TrackingRegion around a standalone muon

0007  *

0008  * Options:

0009  *  Beamspot : Origin is defined by primary vertex

0010  *  Vertex   : Origin is defined by primary vertex (first valid vertex in the VertexCollection)

0011  *             if no vertex is found the beamspot is used instead

0012  *  DynamicZError           

0013  *  DynamicEtaError

0014  *  DynamicphiError

0015  *

0016  *  \author N. Neumeister   Purdue University

0017  *  \author A. Everett      Purdue University

0018  */
0019 
0020 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0021 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0022 #include "DataFormats/VertexReco/interface/Vertex.h"
0023 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0024 
0025 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0026 #include "FWCore/Utilities/interface/InputTag.h"
0027 #include "FWCore/Framework/interface/ConsumesCollector.h"
0028 
0029 #include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducer.h"
0030 #include "RecoTracker/TkTrackingRegions/interface/RectangularEtaPhiTrackingRegion.h"
0031 
0032 #include "FWCore/Framework/interface/Frameworkfwd.h"
0033 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0034 
0035 class MuonServiceProxy;
0036 class MeasurementTrackerEvent;
0037 class MagneticField;
0038 class IdealMagneticFieldRecord;
0039 class MultipleScatteringParametrisationMaker;
0040 class TrackerMultipleScatteringRecord;
0041 
0042 class MuonTrackingRegionBuilder : public TrackingRegionProducer {
0043 public:
0044   /// Constructor

0045   explicit MuonTrackingRegionBuilder(const edm::ParameterSet& par, edm::ConsumesCollector& iC) { build(par, iC); }
0046   explicit MuonTrackingRegionBuilder(const edm::ParameterSet& par, edm::ConsumesCollector&& iC) { build(par, iC); }
0047 
0048   /// Destructor

0049   ~MuonTrackingRegionBuilder() override {}
0050 
0051   /// Create Region of Interest

0052   std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event&, const edm::EventSetup&) const override;
0053 
0054   /// Define tracking region

0055   std::unique_ptr<RectangularEtaPhiTrackingRegion> region(const reco::TrackRef&) const;
0056   std::unique_ptr<RectangularEtaPhiTrackingRegion> region(const reco::Track& t) const {
0057     return region(t, *theEvent, *theEventSetup);
0058   }
0059   std::unique_ptr<RectangularEtaPhiTrackingRegion> region(const reco::Track&,
0060                                                           const edm::Event&,
0061                                                           const edm::EventSetup&) const;
0062 
0063   /// Pass the Event to the algo at each event

0064   void setEvent(const edm::Event&, const edm::EventSetup&);
0065 
0066   /// Add Fill Descriptions

0067   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0068   static void fillDescriptionsHLT(edm::ParameterSetDescription& descriptions);
0069   static void fillDescriptionsOffline(edm::ParameterSetDescription& descriptions);
0070 
0071 private:
0072   void build(const edm::ParameterSet&, edm::ConsumesCollector&);
0073 
0074   const edm::Event* theEvent;
0075   const edm::EventSetup* theEventSetup;
0076 
0077   bool useVertex;
0078   bool useFixedZ;
0079   bool useFixedPt;
0080   bool useFixedPhi;
0081   bool useFixedEta;
0082   bool thePrecise;
0083 
0084   int theMaxRegions;
0085 
0086   double theNsigmaEta;
0087   double theNsigmaPhi;
0088   double theNsigmaDz;
0089 
0090   double theEtaRegionPar1;
0091   double theEtaRegionPar2;
0092   double thePhiRegionPar1;
0093   double thePhiRegionPar2;
0094 
0095   double thePtMin;
0096   double thePhiMin;
0097   double theEtaMin;
0098   double theDeltaR;
0099   double theHalfZ;
0100   double theDeltaPhi;
0101   double theDeltaEta;
0102 
0103   RectangularEtaPhiTrackingRegion::UseMeasurementTracker theOnDemand;
0104   edm::EDGetTokenT<MeasurementTrackerEvent> theMeasurementTrackerToken;
0105   edm::EDGetTokenT<reco::BeamSpot> beamSpotToken;
0106   edm::EDGetTokenT<reco::VertexCollection> vertexCollectionToken;
0107   edm::EDGetTokenT<reco::TrackCollection> inputCollectionToken;
0108   edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bfieldToken;
0109   edm::ESGetToken<MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord> msmakerToken;
0110 };
0111 #endif