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.1 2009/01/08 09:57:27 alebihan 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 using namespace std; 00033 using namespace edm; 00034 using namespace reco; 00035 00036 namespace reco{class TransientTrack;} 00037 00038 class DQMStore; 00039 00040 class TrackEfficiencyMonitor : public edm::EDAnalyzer { 00041 public: 00042 explicit TrackEfficiencyMonitor(const edm::ParameterSet&); 00043 ~TrackEfficiencyMonitor(); 00044 virtual void beginJob(edm::EventSetup const& iSetup); 00045 virtual void endJob(void); 00046 virtual void analyze(const edm::Event&, const edm::EventSetup&); 00047 00048 enum SemiCylinder{Up,Down}; 00049 std::pair<TrajectoryStateOnSurface, const DetLayer*> findNextLayer( TrajectoryStateOnSurface startTSOS, std::vector< const DetLayer*> trackCompatibleLayers , bool isUpMuon ); 00050 SemiCylinder checkSemiCylinder(const Track&); 00051 void testTrackerTracks(edm::Handle<TrackCollection> tkTracks, edm::Handle<TrackCollection> staTracks); 00052 void testSTATracks(edm::Handle<TrackCollection> tkTracks, edm::Handle<TrackCollection> staTracks); 00053 bool trackerAcceptance( TrajectoryStateOnSurface theTSOS, double theRadius, double theMaxZ ); 00054 int compatibleLayers( TrajectoryStateOnSurface theTSOS ); 00055 00056 00057 00058 private: 00059 00060 // ----------member data --------------------------- 00061 00062 00063 std::string histname; //for naming the histograms 00064 00065 DQMStore * dqmStore_; 00066 edm::ParameterSet conf_; 00067 00068 double theRadius_; 00069 double theMaxZ_; 00070 bool isBFieldOff_; 00071 bool trackEfficiency_;//1 if one wants to measure the tracking efficiency 00072 //0 if one wants to measure the muon reco efficiency 00073 00074 edm::InputTag theTKTracksLabel_; 00075 edm::InputTag theSTATracksLabel_; 00076 00077 int failedToPropagate; 00078 int nCompatibleLayers; 00079 bool findDetLayer; 00080 00081 MonitorElement * muonX ; 00082 MonitorElement * muonY ; 00083 MonitorElement * muonZ ; 00084 MonitorElement * muonEta; 00085 MonitorElement * muonPhi; 00086 MonitorElement * muonD0; 00087 MonitorElement * muonCompatibleLayers; 00088 00089 MonitorElement * trackX ; 00090 MonitorElement * trackY ; 00091 MonitorElement * trackZ ; 00092 MonitorElement * trackEta; 00093 MonitorElement * trackPhi; 00094 MonitorElement * trackD0; 00095 MonitorElement * trackCompatibleLayers; 00096 00097 MonitorElement * deltaX ; 00098 MonitorElement * deltaY ; 00099 MonitorElement * signDeltaX; 00100 MonitorElement * signDeltaY; 00101 00102 const DirectTrackerNavigation* theNavigation; 00103 MuonServiceProxy *theMuonServiceProxy; 00104 00105 edm::ESHandle<GeometricSearchTracker> theGeometricSearchTracker; 00106 edm::ESHandle<Propagator> thePropagator; 00107 edm::ESHandle<Propagator> thePropagatorCyl; 00108 edm::ESHandle<TransientTrackBuilder> theTTrackBuilder; 00109 edm::ESHandle<GeometricSearchTracker> theTracker; 00110 edm::ESHandle<MagneticField> bField; 00111 00112 ESHandle<MeasurementTracker> measurementTrackerHandle; 00113 00114 }; 00115 #endif