CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DQMOffline/JetMET/interface/PFMETAnalyzer.h

Go to the documentation of this file.
00001 #ifndef PFMETAnalyzer_H
00002 #define PFMETAnalyzer_H
00003 
00004 
00016 #include <memory>
00017 #include <fstream>
00018 #include "TMath.h"
00019 #include "FWCore/Framework/interface/Frameworkfwd.h"
00020 #include "DQMOffline/JetMET/interface/PFMETAnalyzerBase.h"
00021 #include "FWCore/Framework/interface/Event.h"
00022 #include "FWCore/Framework/interface/MakerMacros.h"
00023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00024 #include "FWCore/ServiceRegistry/interface/Service.h"
00025 #include "DQMServices/Core/interface/DQMStore.h"
00026 #include "DQMServices/Core/interface/MonitorElement.h"
00027 
00028 #include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h"
00029 #include <DataFormats/ParticleFlowCandidate/interface/PFCandidate.h>
00030 
00031 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00032 #include "DataFormats/Common/interface/TriggerResults.h"
00033 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00034 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00035 
00036 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00037 
00038 #include "RecoMET/METAlgorithms/interface/HcalNoiseRBXArray.h"
00039 #include "DataFormats/METReco/interface/BeamHaloSummary.h"
00040 #include "RecoJets/JetProducers/interface/JetIDHelper.h"
00041 
00042 #include "DataFormats/VertexReco/interface/Vertex.h"
00043 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00044 
00045 #include "DQMOffline/JetMET/interface/JetMETDQMDCSFilter.h"
00046 
00047 
00048 #include "GlobalVariables.h"
00049 
00050 
00051 class PFMETAnalyzer : public PFMETAnalyzerBase {
00052  public:
00053 
00055   PFMETAnalyzer(const edm::ParameterSet&);
00056   
00058   virtual ~PFMETAnalyzer();
00059 
00061   void beginJob(DQMStore * dbe);
00062 
00064   void endJob();
00065 
00066   // Book MonitorElements
00067   void bookMESet(std::string);
00068   void bookMonitorElement(std::string, bool);
00069 
00071   void analyze(const edm::Event&, const edm::EventSetup&, 
00072                const edm::TriggerResults&);
00073 
00075   void beginRun(const edm::Run&,  const edm::EventSetup&);
00076 
00078   void endRun(const edm::Run& iRun, const edm::EventSetup& iSetup, DQMStore *dbe);
00079 
00080   // Fill MonitorElements
00081   void fillMESet(const edm::Event&, std::string, const reco::PFMET&);
00082   void fillMonitorElement(const edm::Event&, std::string, std::string, const reco::PFMET&, bool);
00083   void makeRatePlot(std::string, double);
00084 
00085   void validateMET(const reco::PFMET&, edm::Handle<edm::View<reco::PFCandidate> >);
00086 
00087   bool selectHighPtJetEvent(const edm::Event&);
00088   bool selectLowPtJetEvent(const edm::Event&);
00089   bool selectWElectronEvent(const edm::Event&);
00090   bool selectWMuonEvent(const edm::Event&);
00091 
00092   void setSource(std::string source) {
00093     _source = source;
00094   }
00095 
00096   int evtCounter;
00097 
00098  private:
00099   // ----------member data ---------------------------
00100   
00101   edm::ParameterSet parameters;
00102   int _verbose;
00103 
00104   std::string metname;
00105   std::string _source;
00106 
00107   edm::InputTag thePfMETCollectionLabel;
00108   edm::InputTag HcalNoiseRBXCollectionTag;
00109   edm::InputTag theJetCollectionLabel;
00110   edm::InputTag thePfJetCollectionLabel;
00111   edm::InputTag PFCandidatesTag;
00112   edm::InputTag BeamHaloSummaryTag;
00113   edm::InputTag HBHENoiseFilterResultTag;
00114   edm::InputTag vertexTag;
00115   edm::InputTag gtTag;
00116 
00117   // list of Jet or MB HLT triggers
00118   std::vector<std::string > HLTPathsJetMBByName_;
00119 
00120   GenericTriggerEventFlag * _HighPtJetEventFlag;
00121   GenericTriggerEventFlag * _LowPtJetEventFlag;
00122   GenericTriggerEventFlag * _MinBiasEventFlag;
00123   GenericTriggerEventFlag * _HighMETEventFlag;
00124   //  GenericTriggerEventFlag * _LowMETEventFlag;
00125   GenericTriggerEventFlag * _EleEventFlag;
00126   GenericTriggerEventFlag * _MuonEventFlag;
00127 
00128   std::vector<std::string> highPtJetExpr_;
00129   std::vector<std::string> lowPtJetExpr_;
00130   std::vector<std::string> highMETExpr_;
00131   //  std::vector<std::string> lowMETExpr_;
00132   std::vector<std::string> muonExpr_;
00133   std::vector<std::string> elecExpr_;
00134   std::vector<std::string> minbiasExpr_;
00135 
00136   edm::ParameterSet theCleaningParameters;
00137   std::string _hlt_PhysDec;
00138 
00139   std::vector<unsigned > _techTrigsAND;
00140   std::vector<unsigned > _techTrigsOR;
00141   std::vector<unsigned > _techTrigsNOT;
00142 
00143   bool _doPVCheck;
00144   bool _doHLTPhysicsOn;
00145 
00146   bool     _tightBHFiltering;
00147   int      _tightJetIDFiltering;
00148 
00149   int _nvtx_min;
00150   int _nvtxtrks_min;
00151   int _vtxndof_min;
00152   double _vtxchi2_max;
00153   double _vtxz_max;
00154   
00155   int _trig_JetMB;
00156   int _trig_HighPtJet;
00157   int _trig_LowPtJet;
00158   int _trig_MinBias;
00159   int _trig_HighMET;
00160   //  int _trig_LowMET;
00161   int _trig_Ele;
00162   int _trig_Muon;
00163   int _trig_PhysDec;
00164 
00165 
00166   double _highPtPFJetThreshold;
00167   double _lowPtPFJetThreshold;
00168   double _highPFMETThreshold;
00169   double _lowPFMETThreshold;
00170 
00171   int _numPV;
00172   // Et threshold for MET plots
00173   double _etThreshold;
00174 
00175   // HF calibration factor (in 31X applied by PFProducer)
00176   double hfCalibFactor_;  //
00177 
00178   // JetID helper
00179   reco::helper::JetIDHelper *jetID;
00180 
00181   // DCS filter
00182   JetMETDQMDCSFilter *DCSFilter;
00183 
00184   //
00185   bool _allhist;
00186   bool _allSelection;
00187   bool _cleanupSelection;
00188 
00189   std::vector<std::string> _FolderNames;
00190 
00191   DQMStore *_dbe;
00192 
00193 
00194   // MonitorElements
00195   //----------------------------------------------------------------------------
00196   MonitorElement* metME;
00197   MonitorElement* mePfMETRate;
00198 
00199   MonitorElement* meTriggerName_HighPtJet;
00200   MonitorElement* meTriggerName_LowPtJet;
00201   MonitorElement* meTriggerName_MinBias;
00202   MonitorElement* meTriggerName_HighMET;
00203   MonitorElement* meTriggerName_Ele;
00204   MonitorElement* meTriggerName_Muon;
00205   MonitorElement* meTriggerName_PhysDec;
00206 
00207   MonitorElement* mePfMEx;
00208   MonitorElement* mePfMEy;
00209   MonitorElement* mePfMETSig;
00210   MonitorElement* mePfMET;
00211   MonitorElement* mePfMETPhi;
00212   MonitorElement* mePfSumET;
00213   MonitorElement* mePfMExLS;
00214   MonitorElement* mePfMEyLS;
00215   MonitorElement* mePfMET_logx;
00216   MonitorElement* mePfSumET_logx;
00217 
00218   MonitorElement* mePhotonEtFraction;
00219   MonitorElement* mePhotonEt;
00220   MonitorElement* meNeutralHadronEtFraction;
00221   MonitorElement* meNeutralHadronEt;
00222   MonitorElement* meElectronEtFraction;
00223   MonitorElement* meElectronEt;
00224   MonitorElement* meChargedHadronEtFraction;
00225   MonitorElement* meChargedHadronEt;
00226   MonitorElement* meMuonEtFraction;
00227   MonitorElement* meMuonEt;
00228   MonitorElement* meHFHadronEtFraction;
00229   MonitorElement* meHFHadronEt;
00230   MonitorElement* meHFEMEtFraction;
00231   MonitorElement* meHFEMEt;
00232 
00233 
00234   // NPV profiles
00235   //----------------------------------------------------------------------------
00236   MonitorElement* mePfMEx_profile;
00237   MonitorElement* mePfMEy_profile;
00238   MonitorElement* mePfMET_profile;
00239   MonitorElement* mePfSumET_profile;
00240 
00241   MonitorElement* mePhotonEtFraction_profile;
00242   MonitorElement* mePhotonEt_profile;
00243   MonitorElement* meNeutralHadronEtFraction_profile;
00244   MonitorElement* meNeutralHadronEt_profile;
00245   MonitorElement* meElectronEtFraction_profile;
00246   MonitorElement* meElectronEt_profile;
00247   MonitorElement* meChargedHadronEtFraction_profile;
00248   MonitorElement* meChargedHadronEt_profile;
00249   MonitorElement* meMuonEtFraction_profile;
00250   MonitorElement* meMuonEt_profile;
00251   MonitorElement* meHFHadronEtFraction_profile;
00252   MonitorElement* meHFHadronEt_profile;
00253   MonitorElement* meHFEMEtFraction_profile;
00254   MonitorElement* meHFEMEt_profile;
00255 };
00256 
00257 
00258 #endif