CMS 3D CMS Logo

HLTMuonGenericRate.h

Go to the documentation of this file.
00001 #ifndef HLTriggerOffline_Muon_HLTMuonGenericRate_H
00002 #define HLTriggerOffline_Muon_HLTMuonGenericRate_H
00003 
00014 // Base Class Headers
00015 
00016 #include "FWCore/Framework/interface/EDAnalyzer.h"
00017 #include "FWCore/Framework/interface/Frameworkfwd.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "FWCore/Framework/interface/MakerMacros.h"
00020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00021 #include "FWCore/ParameterSet/interface/InputTag.h"
00022 #include "DataFormats/Common/interface/RefToBase.h"
00023 #include "DataFormats/TrackReco/interface/Track.h"
00024 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
00025 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateFwd.h"
00026 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
00027 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
00028 #include "DataFormats/Candidate/interface/Candidate.h"
00029 #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
00030 #include "DQMServices/Core/interface/DQMStore.h"
00031 #include "DQMServices/Core/interface/MonitorElement.h"
00032 
00033 #include "DataFormats/Math/interface/LorentzVector.h"
00034 
00035 #include <vector>
00036 #include "TFile.h"
00037 #include "TNtuple.h"
00038 
00039 
00040 
00041 typedef math::XYZTLorentzVector LorentzVector;
00042 
00043 
00044 
00045 class HLTMuonGenericRate {
00046 
00047 public:
00048 
00050   HLTMuonGenericRate( const edm::ParameterSet& pset, std::string triggerName,
00051                       std::vector<std::string> moduleNames );
00052 
00053   // Operations
00054   void            begin  ( );
00055   void            analyze( const edm::Event & iEvent );
00056   void            finish ( );
00057   MonitorElement* bookIt ( TString name, TString title, std::vector<double> );
00058 
00059 private:
00060 
00061   // Struct and methods for matching
00062 
00063   struct MatchStruct {
00064     const reco::GenParticle*   genCand;
00065     const reco::Track*         recCand;
00066     LorentzVector              l1Cand;
00067     std::vector<LorentzVector> hltCands;
00068     std::vector<const reco::RecoChargedCandidate*> hltTracks;
00069   };
00070 
00071   const reco::Candidate* findMother( const reco::Candidate* );
00072   int findGenMatch( double eta, double phi, double maxDeltaR,
00073                     std::vector<MatchStruct> matches );
00074   int findRecMatch( double eta, double phi, double maxdeltaR,
00075                     std::vector<MatchStruct> matches );
00076   
00077   // Data members
00078 
00079   bool    makeNtuple;
00080   float   theNtuplePars[100]; 
00081   TNtuple *theNtuple;
00082   TFile   *theFile;
00083 
00084   // Input from cfg file
00085 
00086   std::string              theHltProcessName;
00087   std::string              theTriggerName;
00088   std::string              theL1CollectionLabel;
00089   std::vector<std::string> theHltCollectionLabels;
00090   unsigned int             theNumberOfObjects;
00091 
00092   bool         useMuonFromGenerator;
00093   bool         useMuonFromReco;
00094   std::string  theGenLabel;
00095   std::string  theRecoLabel;
00096 
00097   bool         useAod;
00098   std::string  theAodL1Label;
00099   std::string  theAodL2Label;
00100 
00101   std::vector<double> theMaxPtParameters;
00102   std::vector<double> thePtParameters;
00103   std::vector<double> theEtaParameters;
00104   std::vector<double> thePhiParameters;
00105 
00106   double       theMinPtCut;
00107   double       theMaxEtaCut;
00108   double       theL1DrCut;
00109   double       theL2DrCut;
00110   double       theL3DrCut;
00111   int          theMotherParticleId;
00112   std::vector<double> theNSigmas;
00113 
00114   std::string  theNtupleFileName;
00115   std::string  theNtuplePath;
00116 
00117   // Book-keeping information
00118 
00119   int          eventNumber;
00120   unsigned int numHltLabels;
00121   bool         isIsolatedPath;
00122 
00123   // Monitor Elements (Histograms and ints)
00124 
00125   DQMStore* dbe_;
00126 
00127   std::vector <MonitorElement*> hPassMaxPtGen;
00128   std::vector <MonitorElement*> hPassEtaGen;
00129   std::vector <MonitorElement*> hPassPhiGen;
00130   std::vector <MonitorElement*> hPassMaxPtRec;
00131   std::vector <MonitorElement*> hPassEtaRec;
00132   std::vector <MonitorElement*> hPassPhiRec;
00133 
00134   MonitorElement *hNumObjects;
00135   MonitorElement *hNumOrphansGen;
00136   MonitorElement *hNumOrphansRec;
00137   MonitorElement *meNumberOfEvents;
00138 
00139 };
00140 #endif

Generated on Tue Jun 9 17:38:02 2009 for CMSSW by  doxygen 1.5.4