Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef MuonIdentification_DTTimingExtractor_H
0002 #define MuonIdentification_DTTimingExtractor_H
0003 
0004 /**\class DTTimingExtractor
0005  *
0006  * Extracts timing information associated to a muon track
0007  *
0008 */
0009 //
0010 // Original Author:  Traczyk Piotr
0011 //         Created:  Thu Oct 11 15:01:28 CEST 2007
0012 //
0013 //
0014 
0015 // system include files
0016 #include <memory>
0017 
0018 // user include files
0019 #include "FWCore/Framework/interface/Frameworkfwd.h"
0020 
0021 #include "FWCore/Framework/interface/Event.h"
0022 
0023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0024 
0025 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
0026 
0027 #include "DataFormats/Common/interface/Ref.h"
0028 
0029 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0030 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
0031 
0032 #include "DataFormats/MuonReco/interface/Muon.h"
0033 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0034 #include "RecoMuon/TrackingTools/interface/MuonSegmentMatcher.h"
0035 #include "RecoMuon/MuonIdentification/interface/TimeMeasurementSequence.h"
0036 
0037 #include "DataFormats/TrackReco/interface/Track.h"
0038 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0039 #include "DataFormats/TrackReco/interface/TrackExtra.h"
0040 #include "DataFormats/TrackReco/interface/TrackExtraFwd.h"
0041 
0042 #include <vector>
0043 
0044 namespace edm {
0045   class ParameterSet;
0046   class EventSetup;
0047   class InputTag;
0048 }  // namespace edm
0049 
0050 class MuonServiceProxy;
0051 class DTGeometry;
0052 class MuonGeometryRecord;
0053 class Propagator;
0054 class TrackingComponentsRecord;
0055 
0056 class DTTimingExtractor {
0057 public:
0058   /// Constructor
0059   DTTimingExtractor(const edm::ParameterSet&, MuonSegmentMatcher* segMatcher, edm::ConsumesCollector&);
0060 
0061   /// Destructor
0062   ~DTTimingExtractor();
0063 
0064   class TimeMeasurement {
0065   public:
0066     bool isLeft;
0067     bool isPhi;
0068     float posInLayer;
0069     float distIP;
0070     float timeCorr;
0071     int station;
0072     DetId driftCell;
0073   };
0074 
0075   void fillTiming(TimeMeasurementSequence& tmSequence,
0076                   const std::vector<const DTRecSegment4D*>& segments,
0077                   reco::TrackRef muonTrack,
0078                   const edm::Event& iEvent,
0079                   const edm::EventSetup& iSetup);
0080 
0081   void fillTiming(TimeMeasurementSequence& tmSequence,
0082                   reco::TrackRef muonTrack,
0083                   const edm::Event& iEvent,
0084                   const edm::EventSetup& iSetup);
0085 
0086 private:
0087   double fitT0(double& a,
0088                double& b,
0089                const std::vector<double>& xl,
0090                const std::vector<double>& yl,
0091                const std::vector<double>& xr,
0092                const std::vector<double>& yr);
0093 
0094   edm::InputTag DTSegmentTags_;
0095   unsigned int theHitsMin_;
0096   double thePruneCut_;
0097   double theTimeOffset_;
0098   double theError_;
0099   bool useSegmentT0_;
0100   bool doWireCorr_;
0101   bool dropTheta_;
0102   bool requireBothProjections_;
0103   bool debug;
0104 
0105   std::unique_ptr<MuonServiceProxy> theService;
0106   MuonSegmentMatcher* theMatcher;
0107   edm::ESGetToken<DTGeometry, MuonGeometryRecord> theDTGeomToken;
0108   edm::ESGetToken<Propagator, TrackingComponentsRecord> thePropagatorToken;
0109 };
0110 
0111 #endif