CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQMOffline/Trigger/interface/HLTMuonMatchAndPlot.h

Go to the documentation of this file.
00001 #ifndef DQMOffline_Trigger_HLTMuonMatchAndPlot_H
00002 #define DQMOffline_Trigger_HLTMuonMatchAndPlot_H
00003 
00020 // Base Class Headers
00021 
00022 //#include "FWCore/Framework/interface/Frameworkfwd.h"
00023 #include "FWCore/Framework/interface/Event.h"
00024 #include "FWCore/Framework/interface/MakerMacros.h"
00025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00026 #include "FWCore/Utilities/interface/InputTag.h"
00027 //#include "DataFormats/Common/interface/RefToBase.h"
00028 //#include "DataFormats/TrackReco/interface/Track.h"
00029 //#include "DataFormats/Candidate/interface/Candidate.h"
00030 
00031 #include "DQMServices/Core/interface/DQMStore.h"
00032 #include "DQMServices/Core/interface/MonitorElement.h"
00033 
00034 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00035 #include "DataFormats/Common/interface/TriggerResults.h"
00036 #include "DataFormats/MuonReco/interface/Muon.h"
00037 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00038 #include "DataFormats/Math/interface/LorentzVector.h"
00039 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00040 #include "DataFormats/MuonReco/interface/Muon.h"
00041 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
00042 #include "DataFormats/Math/interface/deltaR.h"
00043 
00044 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
00045 
00046 #include <vector>
00047 #include "TFile.h"
00048 #include "TNtuple.h"
00049 #include "TString.h"
00050 #include "TPRegexp.h"
00051 
00052 
00053 
00056 
00057 typedef math::XYZTLorentzVector LorentzVector;
00058 
00059 const double NOMATCH = 999.;
00060 const std::string EFFICIENCY_SUFFIXES[2] = {"denom", "numer"};
00061 
00062 
00065 
00066 class HLTMuonMatchAndPlot {
00067 
00068  public:
00069 
00071   HLTMuonMatchAndPlot(const edm::ParameterSet &, std::string,
00072                       std::vector<std::string>);
00073 
00074   // Analyzer Methods
00075   void beginRun(const edm::Run &, const edm::EventSetup &);
00076   void analyze(const edm::Event &, const edm::EventSetup &);
00077   void endRun(const edm::Run &, const edm::EventSetup &);
00078 
00079   // Helper Methods
00080   void fillEdges(size_t & nBins, float * & edges, std::vector<double> binning);
00081   template <class T> void 
00082     fillMapFromPSet(std::map<std::string, T> &, edm::ParameterSet, std::string);
00083   template <class T1, class T2> std::vector<size_t> 
00084     matchByDeltaR(const std::vector<T1> &, const std::vector<T2> &, 
00085                   const double maxDeltaR = NOMATCH);
00086 
00087  private:
00088 
00089   // Internal Methods
00090   void book1D(std::string, std::string, std::string);
00091   void book2D(std::string, std::string, std::string, std::string);
00092   reco::MuonCollection selectedMuons(
00093     const reco::MuonCollection &,
00094     const reco::BeamSpot &,
00095     bool,    
00096     const StringCutObjectSelector<reco::Muon> &,
00097     double, double);
00098   trigger::TriggerObjectCollection selectedTriggerObjects(
00099     const trigger::TriggerObjectCollection &,
00100     const trigger::TriggerEvent &,
00101     const edm::ParameterSet &);
00102  
00103   // Input from Configuration File
00104   std::string hltProcessName_;
00105   std::string destination_;
00106   std::vector<std::string> requiredTriggers_;
00107   std::map<std::string, edm::InputTag> inputTags_;
00108   std::map<std::string, std::vector<double> > binParams_;
00109   std::map<std::string, double> plotCuts_;
00110   edm::ParameterSet targetParams_;
00111   edm::ParameterSet probeParams_;
00112 
00113   // Member Variables
00114   std::string triggerLevel_;
00115   unsigned int cutMinPt_;
00116   std::string hltPath_;
00117   std::vector<std::string> moduleLabels_;
00118   DQMStore * dbe_;
00119   std::map<std::string, MonitorElement *> hists_;
00120   
00121   // Selectors
00122   bool hasTargetRecoCuts;                                                                                                                                                                                                                                                    
00123   bool hasProbeRecoCuts;
00124     
00125   StringCutObjectSelector<reco::Muon> targetMuonSelector_;
00126   double targetZ0Cut_; 
00127   double targetD0Cut_;
00128   StringCutObjectSelector<reco::Muon> probeMuonSelector_;
00129   double probeZ0Cut_; 
00130   double probeD0Cut_;
00131 };
00132 
00133 #endif