CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/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 //
00030 //#include "DataFormats/METReco/interface/PFMETCollection.h"
00031 //#include "DataFormats/METReco/interface/PFMET.h"
00032 #include <DataFormats/ParticleFlowCandidate/interface/PFCandidate.h>
00033 
00034 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00035 #include "DataFormats/Common/interface/TriggerResults.h"
00036 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00037 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00038 
00039 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00040 
00041 #include "RecoMET/METAlgorithms/interface/HcalNoiseRBXArray.h"
00042 #include "DataFormats/METReco/interface/HcalNoiseSummary.h"
00043 #include "DataFormats/METReco/interface/BeamHaloSummary.h"
00044 #include "RecoJets/JetProducers/interface/JetIDHelper.h"
00045 
00046 #include "DataFormats/VertexReco/interface/Vertex.h"
00047 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00048 
00049 #include "DQMOffline/JetMET/interface/JetMETDQMDCSFilter.h"
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   // Switch for verbosity
00103   int _verbose;
00104 
00105   std::string metname;
00106   std::string _source;
00107 
00108   edm::InputTag thePfMETCollectionLabel;
00109   edm::InputTag HcalNoiseRBXCollectionTag;
00110   edm::InputTag HcalNoiseSummaryTag;
00111   edm::InputTag theJetCollectionLabel;
00112   edm::InputTag thePfJetCollectionLabel;
00113   edm::InputTag PFCandidatesTag;
00114   edm::InputTag BeamHaloSummaryTag;
00115   edm::InputTag vertexTag;
00116   edm::InputTag gtTag;
00117 
00118   // list of Jet or MB HLT triggers
00119   std::vector<std::string > HLTPathsJetMBByName_;
00120 
00121   GenericTriggerEventFlag * _HighPtJetEventFlag;
00122   GenericTriggerEventFlag * _LowPtJetEventFlag;
00123   GenericTriggerEventFlag * _MinBiasEventFlag;
00124   GenericTriggerEventFlag * _HighMETEventFlag;
00125   GenericTriggerEventFlag * _LowMETEventFlag;
00126   GenericTriggerEventFlag * _EleEventFlag;
00127   GenericTriggerEventFlag * _MuonEventFlag;
00128 
00129   std::string _hlt_HighPtJet;
00130   std::string _hlt_LowPtJet;
00131   std::string _hlt_MinBias;
00132   std::string _hlt_HighMET;
00133   std::string _hlt_LowMET;
00134   std::string _hlt_Ele;
00135   std::string _hlt_Muon;
00136 
00137   edm::ParameterSet theCleaningParameters;
00138   std::string _hlt_PhysDec;
00139 
00140   std::vector<unsigned > _techTrigsAND;
00141   std::vector<unsigned > _techTrigsOR;
00142   std::vector<unsigned > _techTrigsNOT;
00143 
00144   bool _doPVCheck;
00145   bool _doHLTPhysicsOn;
00146 
00147   bool     _tightBHFiltering;
00148   int      _tightJetIDFiltering;
00149   bool     _tightHcalFiltering;
00150 
00151   int _nvtx_min;
00152   int _nvtxtrks_min;
00153   int _vtxndof_min;
00154   double _vtxchi2_max;
00155   double _vtxz_max;
00156   
00157   int _trig_JetMB;
00158   int _trig_HighPtJet;
00159   int _trig_LowPtJet;
00160   int _trig_MinBias;
00161   int _trig_HighMET;
00162   int _trig_LowMET;
00163   int _trig_Ele;
00164   int _trig_Muon;
00165   int _trig_PhysDec;
00166 
00167 
00168   double _highPtPFJetThreshold;
00169   double _lowPtPFJetThreshold;
00170   double _highPFMETThreshold;
00171   double _lowPFMETThreshold;
00172 
00173   // Et threshold for MET plots
00174   double _etThreshold;
00175 
00176   // HF calibration factor (in 31X applied by PFProducer)
00177   double hfCalibFactor_;  //
00178 
00179   // JetID helper
00180   reco::helper::JetIDHelper *jetID;
00181 
00182   // DCS filter
00183   JetMETDQMDCSFilter *DCSFilter;
00184 
00185   //
00186   bool _allhist;
00187   bool _allSelection;
00188   bool _cleanupSelection;
00189 
00190   //
00191   std::vector<std::string> _FolderNames;
00192 
00193   //
00194   DQMStore *_dbe;
00195 
00196   //the histos
00197   MonitorElement* metME;
00198 
00199   MonitorElement* meTriggerName_HighPtJet;
00200   MonitorElement* meTriggerName_LowPtJet;
00201   MonitorElement* meTriggerName_MinBias;
00202   MonitorElement* meTriggerName_HighMET;
00203   MonitorElement* meTriggerName_LowMET;
00204   MonitorElement* meTriggerName_Ele;
00205   MonitorElement* meTriggerName_Muon;
00206   MonitorElement* meTriggerName_PhysDec;
00207 
00208   MonitorElement* mePfNeutralEMFraction;
00209   MonitorElement* mePfNeutralHadFraction;
00210   MonitorElement* mePfChargedEMFraction;
00211   MonitorElement* mePfChargedHadFraction;
00212   MonitorElement* mePfMuonFraction;
00213 
00214   MonitorElement* meNevents;
00215   MonitorElement* mePfMEx;
00216   MonitorElement* mePfMEy;
00217   MonitorElement* mePfEz;
00218   MonitorElement* mePfMETSig;
00219   MonitorElement* mePfMET;
00220   MonitorElement* mePfMETPhi;
00221   MonitorElement* mePfSumET;
00222   MonitorElement* mePfMExLS;
00223   MonitorElement* mePfMEyLS;
00224 
00225   MonitorElement* mePfMET_logx;
00226   MonitorElement* mePfSumET_logx;
00227 
00228   MonitorElement* mePfMETIonFeedbck;
00229   MonitorElement* mePfMETHPDNoise;
00230   MonitorElement* mePfMETRBXNoise;
00231 
00232   MonitorElement* mePfMETRate;
00233 
00234 
00235 };
00236 #endif