00001 #ifndef TrackEfficiencyMonitor_H 00002 #define TrackEfficiencyMonitor_H 00003 // -*- C++ -*- 00004 // 00005 // Package: TrackEfficiencyMonitor 00006 // Class: TrackEfficiencyMonitor 00007 // 00011 // Original Author: Jeremy Andrea 00012 // Insertion in DQM: Anne-Catherine Le Bihan 00013 // Created: Thu 28 22:45:30 CEST 2008 00014 // $Id: TrackEfficiencyMonitor.h,v 1.3 2010/08/06 20:24:23 wmtan Exp $ 00015 00016 #include <memory> 00017 #include <fstream> 00018 #include "FWCore/Framework/interface/Frameworkfwd.h" 00019 #include "FWCore/Framework/interface/EDAnalyzer.h" 00020 #include "FWCore/Framework/interface/Event.h" 00021 #include "FWCore/Framework/interface/MakerMacros.h" 00022 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00023 #include "FWCore/ServiceRegistry/interface/Service.h" 00024 #include "DQMServices/Core/interface/MonitorElement.h" 00025 00026 #include "RecoMuon/GlobalTrackingTools/interface/DirectTrackerNavigation.h" 00027 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" 00028 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" 00029 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h" 00030 00031 00032 00033 00034 00035 00036 namespace reco{class TransientTrack;} 00037 00038 class DQMStore; 00039 00040 class TrackEfficiencyMonitor : public edm::EDAnalyzer { 00041 public: 00042 typedef reco::Track Track; 00043 typedef reco::TrackCollection TrackCollection; 00044 explicit TrackEfficiencyMonitor(const edm::ParameterSet&); 00045 ~TrackEfficiencyMonitor(); 00046 virtual void beginJob(void); 00047 virtual void endJob(void); 00048 virtual void analyze(const edm::Event&, const edm::EventSetup&); 00049 00050 enum SemiCylinder{Up,Down}; 00051 std::pair<TrajectoryStateOnSurface, const DetLayer*> findNextLayer( TrajectoryStateOnSurface startTSOS, std::vector< const DetLayer*> trackCompatibleLayers , bool isUpMuon ); 00052 SemiCylinder checkSemiCylinder(const Track&); 00053 void testTrackerTracks(edm::Handle<TrackCollection> tkTracks, edm::Handle<TrackCollection> staTracks); 00054 void testSTATracks(edm::Handle<TrackCollection> tkTracks, edm::Handle<TrackCollection> staTracks); 00055 bool trackerAcceptance( TrajectoryStateOnSurface theTSOS, double theRadius, double theMaxZ ); 00056 int compatibleLayers( TrajectoryStateOnSurface theTSOS ); 00057 00058 00059 00060 private: 00061 00062 // ----------member data --------------------------- 00063 00064 00065 std::string histname; //for naming the histograms 00066 00067 DQMStore * dqmStore_; 00068 edm::ParameterSet conf_; 00069 00070 double theRadius_; 00071 double theMaxZ_; 00072 bool isBFieldOff_; 00073 bool trackEfficiency_;//1 if one wants to measure the tracking efficiency 00074 //0 if one wants to measure the muon reco efficiency 00075 00076 edm::InputTag theTKTracksLabel_; 00077 edm::InputTag theSTATracksLabel_; 00078 00079 int failedToPropagate; 00080 int nCompatibleLayers; 00081 bool findDetLayer; 00082 00083 MonitorElement * muonX ; 00084 MonitorElement * muonY ; 00085 MonitorElement * muonZ ; 00086 MonitorElement * muonEta; 00087 MonitorElement * muonPhi; 00088 MonitorElement * muonD0; 00089 MonitorElement * muonCompatibleLayers; 00090 00091 MonitorElement * trackX ; 00092 MonitorElement * trackY ; 00093 MonitorElement * trackZ ; 00094 MonitorElement * trackEta; 00095 MonitorElement * trackPhi; 00096 MonitorElement * trackD0; 00097 MonitorElement * trackCompatibleLayers; 00098 00099 MonitorElement * deltaX ; 00100 MonitorElement * deltaY ; 00101 MonitorElement * signDeltaX; 00102 MonitorElement * signDeltaY; 00103 00104 const DirectTrackerNavigation* theNavigation; 00105 MuonServiceProxy *theMuonServiceProxy; 00106 00107 edm::ESHandle<GeometricSearchTracker> theGeometricSearchTracker; 00108 edm::ESHandle<Propagator> thePropagator; 00109 edm::ESHandle<Propagator> thePropagatorCyl; 00110 edm::ESHandle<TransientTrackBuilder> theTTrackBuilder; 00111 edm::ESHandle<GeometricSearchTracker> theTracker; 00112 edm::ESHandle<MagneticField> bField; 00113 00114 edm::ESHandle<MeasurementTracker> measurementTrackerHandle; 00115 00116 }; 00117 #endif