17 folderName_ ( iConfig.getParameter<
std::
string>(
"FolderName") )
22 , theTrigSummary_ ( consumes<
trigger::TriggerEvent> (iConfig.getParameter<
edm::InputTag>(
"trigSummary") ) )
23 , hltMetTag_ ( iConfig.getParameter<
edm::InputTag>(
"hltMetFilter") )
24 , hltMetCleanTag_ ( iConfig.getParameter<
edm::InputTag>(
"hltMetCleanFilter") )
25 , trackLegFilterTag_ ( iConfig.getParameter<
edm::InputTag>(
"trackLegFilter") )
26 , met_variable_binning_ ( iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> >(
"metBinning") )
27 , muonPt_variable_binning_ ( iConfig.getParameter<
edm::
ParameterSet>(
"histoPSet").getParameter<
std::vector<double> >(
"ptBinning") )
35 , metSelection_ ( iConfig.getParameter<
std::
string>(
"metSelection") )
36 , muonSelection_ ( iConfig.getParameter<
std::
string>(
"muonSelection") )
37 , jetSelection_ ( iConfig.getParameter<
std::
string>(
"jetSelection") )
38 , vtxSelection_ ( iConfig.getParameter<
std::
string>(
"vtxSelection") )
39 , nmuons_ ( iConfig.getParameter<unsigned>(
"nmuons") )
40 , njets_ ( iConfig.getParameter<unsigned>(
"njets") )
41 , leadJetEtaCut_ ( iConfig.getParameter<double>(
"leadJetEtaCut") )
42 , requireLeadMatched_ ( iConfig.getParameter<bool>(
"requireLeadMatched") )
43 , maxMatchDeltaR_ ( iConfig.getParameter<double>(
"maxMatchDeltaR") )
79 histname =
"met_variable"; histtitle =
"CaloMET";
83 histname =
"metVsLS"; histtitle =
"CaloMET vs LS";
87 histname =
"metPhi"; histtitle =
"CaloMET phi";
91 histname =
"deltaphi_metjet1"; histtitle =
"dPhi(CaloMET, jet1)";
95 histname =
"metVsHltMet"; histtitle =
"CaloMET vs hltMet";
99 histname =
"metVsHltMetClean"; histtitle =
"CaloMET vs hltMetClean";
105 histname =
"muonPt_variable"; histtitle =
"Muon PT";
109 histname =
"muonEta"; histtitle =
"Muon eta";
113 histname =
"deltaphi_muonmet"; histtitle =
"dPhi(Muon, CaloMET)";
117 histname =
"muonEtaVsPhi"; histtitle =
"Muon eta vs phi";
121 histname =
"muonPtVsLS"; histtitle =
"Muon PT vs LS";
142 float met = caloMet.
pt();
143 float metPhi = caloMet.
phi();
147 if(jetsHandle->size() <
njets_)
return;
148 std::vector<reco::PFJet>
jets;
149 for(
auto const & j : *jetsHandle) {
152 if(jets.size() <
njets_)
return;
154 float deltaphi_metjet1 = !(jets.empty()) ? fabs(
deltaPhi(caloMet.
phi(), jets[0].phi())) : 10.0;
158 if(!primaryVertices->size())
return;
160 for(
auto const&
v: *primaryVertices) {
165 if(pv ==
nullptr)
return;
169 if(muonHandle->size() <
nmuons_)
return;
170 std::vector<reco::Muon>
muons;
171 for(
auto const &
m : *muonHandle) {
177 if(muons.size() <
nmuons_)
return;
190 if(!triggerSummary.
isValid()) {
191 edm::LogError(
"METplusTrackMonitor") <<
"Invalid collection: TriggerSummary" <<
"\n";
199 if(!passesHltMetFilter || !passesHltMetCleanFilter)
return;
210 double leadMuonPt = !(muons.empty()) ? muons[0].
pt() : -1.0;
211 double leadMuonEta = !(muons.empty()) ? muons[0].
eta() : 10.0;
212 double leadMuonPhi = !(muons.empty()) ? muons[0].
phi() : 10.0;
213 float deltaphi_metmuon = !(muons.empty()) ? fabs(
deltaPhi(caloMet.
phi(), muons[0].phi())) : 10.0;
226 if(!passesTrackLegFilter)
return;
262 desc.
add<
unsigned>(
"njets", 0);
263 desc.
add<
unsigned>(
"nmuons", 0);
264 desc.
add<
double>(
"leadJetEtaCut", 2.4);
265 desc.
add<
bool>(
"requireLeadMatched",
true);
266 desc.
add<
double>(
"maxMatchDeltaR", 0.1);
269 genericTriggerEventPSet.
add<
bool>(
"andOr");
271 genericTriggerEventPSet.
add<std::vector<int> >(
"dcsPartitions", {});
272 genericTriggerEventPSet.
add<
bool>(
"andOrDcs",
false);
273 genericTriggerEventPSet.
add<
bool>(
"errorReplyDcs",
true);
275 genericTriggerEventPSet.
add<
bool>(
"andOrHlt",
true);
277 genericTriggerEventPSet.
add<std::vector<std::string> >(
"hltPaths", {});
279 genericTriggerEventPSet.
add<
bool>(
"errorReplyHlt",
false);
280 genericTriggerEventPSet.
add<
unsigned int>(
"verbosityLevel", 1);
301 std::vector<double>
bins = {0.,20.,40.,60.,80.,90.,100.,110.,120.,130.,140.,150.,160.,170.,180.,190.,200.,220.,240.,260.,280.,300.,350.,400.,450.,1000.};
303 histoPSet.add<std::vector<double> >(
"metBinning",
bins);
304 histoPSet.add<std::vector<double> >(
"ptBinning",
bins);
312 descriptions.
add(
"metPlusTrackMonitoring", desc);
318 double leadingPt = -1.0;
320 size_t filterIndex = trigSummary->
filterIndex( filterTag );
323 if( !(filterIndex >= trigSummary->
sizeFilters()) ) {
325 for(
unsigned short key : keys) {
327 if(foundObject.
pt() > leadingPt) {
329 leadingPt = obj.
pt();
334 return (leadingPt > 0.0);
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
virtual double pt() const final
transverse momentum
MonitorElement * numerator
edm::InputTag hltMetCleanTag_
METplusTrackMonitor(const edm::ParameterSet &)
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
trigger::size_type sizeFilters() const
bool getHLTObj(const edm::Handle< trigger::TriggerEvent > &trigSummary, const edm::InputTag &filterTag, trigger::TriggerObject &obj) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const Keys & filterKeys(trigger::size_type index) const
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
std::vector< Vertex > VertexCollection
collection of Vertex objects
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
LuminosityBlockNumber_t luminosityBlock() const
edm::InputTag trackLegFilterTag_
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
std::vector< Muon > MuonCollection
collection of Muon objects
std::vector< double > muonPt_variable_binning_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
Single trigger physics object (e.g., an isolated muon)
virtual double phi() const final
momentum azimuthal angle
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * denominator
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
ObjME muonPtME_variableBinning_
const TriggerObjectCollection & getObjects() const
std::vector< double > met_variable_binning_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
caloMet
____________________________________________________________________________||
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
StringCutObjectSelector< reco::CaloMET, true > metSelection_
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
StringCutObjectSelector< reco::PFJet, true > jetSelection_
StringCutObjectSelector< reco::Muon, true > muonSelection_
void setCurrentFolder(const std::string &fullpath)
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
std::vector< size_type > Keys
StringCutObjectSelector< reco::Vertex, true > vtxSelection_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< reco::CaloMETCollection > metToken_
std::vector< PFJet > PFJetCollection
collection of PFJet objects
ObjME metME_variableBinning_
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, unsigned nbins, double xmin, double xmax)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_