CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/Validation/RecoMuon/src/MuonTrackAnalyzer.h

Go to the documentation of this file.
00001 #ifndef Validation_RecoMuon_MuonTrackAnalyzer_H
00002 #define Validation_RecoMuon_MuonTrackAnalyzer_H
00003 
00012 // Base Class Headers
00013 #include "FWCore/Framework/interface/EDAnalyzer.h"
00014 #include "FWCore/Utilities/interface/InputTag.h"
00015 
00016 #include "DQMServices/Core/interface/DQMStore.h"
00017 #include "DQMServices/Core/interface/MonitorElement.h"
00018 #include "FWCore/ServiceRegistry/interface/Service.h"
00019 
00020 #include "FWCore/Framework/interface/ESHandle.h"
00021 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00022 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00023 
00024 namespace edm {class ParameterSet; class Event; class EventSetup;}
00025 namespace reco {class TransientTrack;}
00026 
00027 class TFile;
00028 class TH1F; 
00029 class TH2F;
00030 class HTrackVariables;
00031 class HTrack;
00032 
00033 class TrajectoryStateOnSurface;
00034 class FreeTrajectoryState;
00035 class MuonServiceProxy;
00036 class MuonPatternRecoDumper;
00037 class TrajectorySeed;
00038 class MuonUpdatorAtVertex;
00039 
00040 class MuonTrackAnalyzer: public edm::EDAnalyzer {
00041 
00042  public:
00043   enum EtaRange{all,barrel,endcap};
00044 
00045  public:
00047   MuonTrackAnalyzer(const edm::ParameterSet& pset);
00048 
00050   virtual ~MuonTrackAnalyzer();
00051 
00052   // Operations
00053 
00054   void analyze(const edm::Event & event, const edm::EventSetup& eventSetup);
00055   void tracksAnalysis(const edm::Event & event, const edm::EventSetup& eventSetup,
00056                       edm::Handle<edm::SimTrackContainer> simTracks);
00057   void seedsAnalysis(const edm::Event & event, const edm::EventSetup& eventSetup,
00058                      edm::Handle<edm::SimTrackContainer> simTracks);
00059     
00060 
00061   virtual void beginJob() ;
00062   virtual void endJob() ;
00063  protected:
00064 
00065  private:
00066   bool isInTheAcceptance(double eta);
00067   bool checkMuonSimHitPresence(const edm::Event & event,
00068                                edm::Handle<edm::SimTrackContainer> simTracks);
00069 
00070   std::pair<SimTrack,double> getSimTrack(TrajectoryStateOnSurface &tsos,
00071                                        edm::Handle<edm::SimTrackContainer> simTracks);  
00072 
00073   void fillPlots(const edm::Event &event, edm::Handle<edm::SimTrackContainer> &simTracks);
00074   void fillPlots(reco::TransientTrack &track, SimTrack &simTrack);
00075   void fillPlots(TrajectoryStateOnSurface &recoTSOS,SimTrack &simState,
00076                  HTrack*, MuonPatternRecoDumper&);
00077   void fillPlots(FreeTrajectoryState &recoFTS,SimTrack &simTrack,
00078                  HTrack *histo, MuonPatternRecoDumper &debug);
00079 
00080 
00081   TrajectoryStateOnSurface getSeedTSOS(const TrajectorySeed& seed);
00082 
00083   DQMStore* dbe_;
00084   std::string dirName_;
00085 
00086   std::string out;
00087   //TFile* theFile;
00088 
00089   EtaRange theEtaRange;
00090   
00091   edm::InputTag theTracksLabel;
00092   edm::InputTag theSeedsLabel;
00093   edm::InputTag theCSCSimHitLabel;
00094   edm::InputTag theDTSimHitLabel; 
00095   edm::InputTag theRPCSimHitLabel;
00096 
00097   bool doTracksAnalysis;
00098   bool doSeedsAnalysis;
00099   std::string theSeedPropagatorName;
00100 
00101   MuonServiceProxy *theService;
00102   MuonUpdatorAtVertex *theUpdator;
00103 
00104   // Histograms
00105   MonitorElement *hChi2;
00106   MonitorElement *hChi2Norm;
00107   MonitorElement *hHitsPerTrack;
00108   MonitorElement *hDof;
00109   MonitorElement *hChi2Prob;
00110 
00111   MonitorElement *hNumberOfTracks;
00112   MonitorElement *hNumberOfTracksVsEta;
00113   MonitorElement *hChargeVsEta;
00114   MonitorElement *hChargeVsPt;
00115   MonitorElement *hPtRecVsPtGen;
00116 
00117   MonitorElement *hChi2VsEta;
00118   MonitorElement *hChi2NormVsEta;
00119   MonitorElement *hHitsPerTrackVsEta;
00120   MonitorElement *hDofVsEta; 
00121   MonitorElement *hChi2ProbVsEta;
00122   MonitorElement *hDeltaPtVsEta;
00123   MonitorElement *hDeltaPt_In_Out_VsEta;
00124 
00125   HTrackVariables *hSimTracks;
00126 
00127   HTrack *hRecoSeedInner;
00128   HTrack *hRecoSeedPCA;
00129   HTrack *hRecoTracksPCA; 
00130   HTrack *hRecoTracksInner;
00131   HTrack *hRecoTracksOuter;
00132 
00133   // Counters
00134   int numberOfSimTracks;
00135   int numberOfRecTracks;
00136 };
00137 #endif
00138 
00139