Skip to content

Commit

Permalink
Merged refs/pull/19178/head from repository cms-sw
Browse files Browse the repository at this point in the history
  • Loading branch information
UBParker committed Jul 4, 2017
2 parents 0c63302 + 933b1cf commit dd7fdb2
Show file tree
Hide file tree
Showing 9 changed files with 1,584 additions and 3 deletions.
620 changes: 620 additions & 0 deletions DQMOffline/Trigger/plugins/JetMonitor.cc

Large diffs are not rendered by default.

152 changes: 152 additions & 0 deletions DQMOffline/Trigger/plugins/JetMonitor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
#ifndef JETMETMONITOR_H
#define JETMETMONITOR_H

#include <string>
#include <vector>
#include <map>

#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include <DQMServices/Core/interface/DQMEDAnalyzer.h>

#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/Registry.h"

#include "CommonTools/Utils/interface/StringCutObjectSelector.h"

//DataFormats
#include "DataFormats/METReco/interface/PFMET.h"
#include "DataFormats/METReco/interface/PFMETCollection.h"

#include "DataFormats/JetReco/interface/PFJet.h"
#include "DataFormats/JetReco/interface/PFJetCollection.h"
#include "DataFormats/JetReco/interface/CaloJet.h"
#include "DataFormats/JetReco/interface/CaloJetCollection.h"
#include "DataFormats/JetReco/interface/GenJetCollection.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
#include "DataFormats/EgammaCandidates/interface/Photon.h"
#include "DataFormats/EgammaCandidates/interface/PhotonFwd.h"

class GenericTriggerEventFlag;

struct MEbinning {
int nbins;
double xmin;
double xmax;
};

struct JetME {
MonitorElement* numerator;
MonitorElement* denominator;
};

//
// class declaration
//

class JetMonitor : public DQMEDAnalyzer
{
public:
JetMonitor( const edm::ParameterSet& );
~JetMonitor();
static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
static void fillHistoPSetDescription(edm::ParameterSetDescription & pset);
static void fillHistoLSPSetDescription(edm::ParameterSetDescription & pset);

protected:

void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, int& nbins, double& xmin, double& xmax);
void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, std::vector<double> binningX);
void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, int& nbinsX, double& xmin, double& xmax, double& ymin, double& ymax);
void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, int& nbinsX, double& xmin, double& xmax, int& nbinsY, double& ymin, double& ymax);
void bookME(DQMStore::IBooker &, JetME& me, std::string& histname, std::string& histtitle, std::vector<double> binningX, std::vector<double> binningY);
void setMETitle(JetME& me, std::string titleX, std::string titleY);
void bookME(DQMStore::IBooker &, MonitorElement* me, std::string& histname, std::string& histtitle, int& nbins, double& xmin, double& xmax);
void bookME(DQMStore::IBooker &, MonitorElement* me, std::string& histname, std::string& histtitle, int& nbinsX, double& xmin, double& xmax,int& nbinsY, double& ymin, double& ymax );

void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) override;
bool isBarrel(double eta);
bool isEndCapP(double eta);
bool isEndCapM(double eta);
bool isForward(double eta);
bool isHEP17(double eta, double phi);
bool isHEM17(double eta, double phi);
bool isHEP18(double eta, double phi); // -0.87< Phi < -1.22
//void FillME(std::vector<MonitorElement*> v_me,std::vector<double>v_pt, std::vector<double> v_phi); //Fill Histograms
void AutoNullPtr(JetME* a_me,const int len_); //Fill Histograms
void bookMESub(DQMStore::IBooker &,JetME* a_me,const int len_,std::string h_Name ,std::string h_Title, std::string h_subOptName, std::string h_subOptTitle ); //Fill Histograms
void FillME(std::vector<JetME> v_me,double pt, double phi, double eta, int ls_, std::string denu); //Fill Histograms
void FillME(JetME* a_me,double pt_, double phi_, double eta_, int ls_, std::string denu); //Fill Histograms

private:
static MEbinning getHistoPSet (edm::ParameterSet pset);
static MEbinning getHistoLSPSet (edm::ParameterSet pset);

std::string folderName_;
std::string histoSuffix_;

edm::EDGetTokenT<reco::PFMETCollection> metToken_;
edm::EDGetTokenT<reco::PFJetCollection> pfjetToken_;// pfjet
edm::EDGetTokenT<reco::CaloJetCollection> calojetToken_;// calojet
edm::EDGetTokenT<reco::GsfElectronCollection> eleToken_;
edm::EDGetTokenT<reco::MuonCollection> muoToken_;
//edm::InputTag jetSrc_; // test for Jet
edm::EDGetTokenT<edm::View<reco::Jet> > jetSrc_; // test for Jet

std::vector<double> jetpT_variable_binning_;
MEbinning jetpT_binning;
MEbinning jetptThr_binning_;
MEbinning ls_binning_;


JetME a_ME[7];
JetME a_ME_HB[7];
JetME a_ME_HE[7];
JetME a_ME_HF[7];
JetME a_ME_HE_p[7];
JetME a_ME_HE_m[7];
JetME a_ME_HEM17[7];
JetME a_ME_HEP17[7];
JetME a_ME_HEP18[7];

JetME jetHEP17_AbsEtaVsPhi_;
JetME jetHEM17_AbsEtaVsPhi_;
// For Ratio plot
JetME jetHEP17_AbsEta_;
JetME jetHEM17_AbsEta_;

GenericTriggerEventFlag* num_genTriggerEventFlag_;
GenericTriggerEventFlag* den_genTriggerEventFlag_;

StringCutObjectSelector<reco::MET,true> metSelection_;
StringCutObjectSelector<reco::PFJet,true> jetSelection_;
StringCutObjectSelector<reco::CaloJet,true> calojetSelection_;
StringCutObjectSelector<reco::GsfElectron,true> eleSelection_;
StringCutObjectSelector<reco::Muon,true> muoSelection_;

int njets_;
int nelectrons_;
int nmuons_;
double ptcut_;
bool isPFJetTrig;
bool isCaloJetTrig;
bool isMetTrig;
bool isJetFrac;
std::vector<double> v_jetpt;
std::vector<double> v_jeteta;
std::vector<double> v_jetphi;
};

#endif // JETMETMONITOR_H
4 changes: 3 additions & 1 deletion DQMOffline/Trigger/python/DQMOffline_HLT_Client_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

from DQMOffline.Trigger.BTaggingMonitoring_Client_cff import *
from DQMOffline.Trigger.BPHMonitoring_Client_cff import *
from DQMOffline.Trigger.JetMETPromptMonitoring_Client_cff import *
hltOfflineDQMClient = cms.Sequence(
# hltGeneralSeqClient *
sipixelHarvesterHLTsequence *
Expand All @@ -48,6 +49,7 @@
smpClient *
topClient *
btaggingClient *
bphClient
bphClient*
JetMetPromClient
)

5 changes: 4 additions & 1 deletion DQMOffline/Trigger/python/DQMOffline_Trigger_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
from DQMOffline.Trigger.BPHMonitor_cff import *
# remove quadJetAna
from DQMOffline.Trigger.topHLTOfflineDQM_cff import *
from DQMOffline.Trigger.JetMETPromptMonitor_cff import *

offlineHLTSource = cms.Sequence(
hltResults *
lumiMonitorHLTsequence *
Expand Down Expand Up @@ -108,7 +110,8 @@
topMonitorHLT *
btagMonitorHLT *
bphMonitorHLT *
hltObjectsMonitor
hltObjectsMonitor *
jetmetMonitorHLT
)

# offline DQM for the HLTMonitoring stream
Expand Down
7 changes: 7 additions & 0 deletions DQMOffline/Trigger/python/JetMETPromptMonitor_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import FWCore.ParameterSet.Config as cms

from DQMOffline.Trigger.JetMonitor_cff import *

jetmetMonitorHLT = cms.Sequence(
HLTJetmonitoring
)
Loading

0 comments on commit dd7fdb2

Please sign in to comment.