5 #include "Math/GenVector/VectorUtil.h"
10 using namespace l1extra;
11 using namespace trigger;
14 : triggerEventObject_(
21 triggerTag_(ps.getUntrackedParameter<std::
string>(
"DQMFolder",
"SingleJet")),
22 patternJetTrg_(ps.getUntrackedParameter<std::
string>(
"PatternJetTrg",
"")),
23 patternMetTrg_(ps.getUntrackedParameter<std::
string>(
"PatternMetTrg",
"")),
24 patternMuTrg_(ps.getUntrackedParameter<std::
string>(
"PatternMuTrg",
"")),
37 bool foundMuTrg =
false;
39 bool changedConfig =
true;
47 edm::LogError(
"HLTJetMETValidation") <<
"Initialization of HLTConfigProvider failed!!";
52 for (
size_t j = 0;
j < validTriggerNames.size();
j++) {
54 if (TString(validTriggerNames[
j]).Contains(patternMu)) {
57 trgMuNm = validTriggerNames[
j];
61 if (TString(validTriggerNames[j]).Contains(patternJet)) {
62 hltTrgJet.push_back(validTriggerNames[j]);
65 if (TString(validTriggerNames[j]).Contains(patternMet)) {
66 hltTrgMet.push_back(validTriggerNames[j]);
71 for (
size_t it = 0; it <
hltTrgJet.size(); it++) {
72 if (it == 0 && foundMuTrg)
74 if (it == 0 && !foundMuTrg)
81 int itm(0), itpm(0), itmh(0), itpmh(0);
82 for (
size_t it = 0; it <
hltTrgMet.size(); it++) {
83 if (TString(
hltTrgMet[it]).Contains(
"PF")) {
84 if (TString(
hltTrgMet[it]).Contains(
"MHT")) {
94 if (TString(
hltTrgMet[it]).Contains(
"MET")) {
105 if (TString(
hltTrgMet[it]).Contains(
"MHT")) {
115 if (TString(
hltTrgMet[it]).Contains(
"MET")) {
137 for (
size_t it = 0; it <
hltTrgJet.size(); it++) {
144 _meHLTJetPt.push_back(iBooker.
book1D(
"_meHLTJetPt",
"Single HLT Jet Pt", 100, 0, 500));
145 _meHLTJetPtTrgMC.push_back(iBooker.
book1D(
"_meHLTJetPtTrgMC",
"Single HLT Jet Pt - HLT Triggered", 100, 0, 500));
146 _meHLTJetPtTrg.push_back(iBooker.
book1D(
"_meHLTJetPtTrg",
"Single HLT Jet Pt - HLT Triggered", 100, 0, 500));
148 iBooker.
book1D(
"_meHLTJetPtTrgLow",
"Single HLT Jet Pt - HLT Triggered Low", 100, 0, 500));
150 _meHLTJetEta.push_back(iBooker.
book1D(
"_meHLTJetEta",
"Single HLT Jet Eta", 100, -10, 10));
152 iBooker.
book1D(
"_meHLTJetEtaTrgMC",
"Single HLT Jet Eta - HLT Triggered", 100, -10, 10));
153 _meHLTJetEtaTrg.push_back(iBooker.
book1D(
"_meHLTJetEtaTrg",
"Single HLT Jet Eta - HLT Triggered", 100, -10, 10));
155 iBooker.
book1D(
"_meHLTJetEtaTrgLow",
"Single HLT Jet Eta - HLT Triggered Low", 100, -10, 10));
157 _meHLTJetPhi.push_back(iBooker.
book1D(
"_meHLTJetPhi",
"Single HLT Jet Phi", 100, -4., 4.));
159 iBooker.
book1D(
"_meHLTJetPhiTrgMC",
"Single HLT Jet Phi - HLT Triggered", 100, -4., 4.));
160 _meHLTJetPhiTrg.push_back(iBooker.
book1D(
"_meHLTJetPhiTrg",
"Single HLT Jet Phi - HLT Triggered", 100, -4., 4.));
162 iBooker.
book1D(
"_meHLTJetPhiTrgLow",
"Single HLT Jet Phi - HLT Triggered Low", 100, -4., 4.));
164 _meGenJetPt.push_back(iBooker.
book1D(
"_meGenJetPt",
"Single Generated Jet Pt", 100, 0, 500));
166 iBooker.
book1D(
"_meGenJetPtTrgMC",
"Single Generated Jet Pt - HLT Triggered", 100, 0, 500));
167 _meGenJetPtTrg.push_back(iBooker.
book1D(
"_meGenJetPtTrg",
"Single Generated Jet Pt - HLT Triggered", 100, 0, 500));
169 iBooker.
book1D(
"_meGenJetPtTrgLow",
"Single Generated Jet Pt - HLT Triggered Low", 100, 0, 500));
171 _meGenJetEta.push_back(iBooker.
book1D(
"_meGenJetEta",
"Single Generated Jet Eta", 100, -10, 10));
173 iBooker.
book1D(
"_meGenJetEtaTrgMC",
"Single Generated Jet Eta - HLT Triggered", 100, -10, 10));
175 iBooker.
book1D(
"_meGenJetEtaTrg",
"Single Generated Jet Eta - HLT Triggered", 100, -10, 10));
177 iBooker.
book1D(
"_meGenJetEtaTrgLow",
"Single Generated Jet Eta - HLT Triggered Low", 100, -10, 10));
179 _meGenJetPhi.push_back(iBooker.
book1D(
"_meGenJetPhi",
"Single Generated Jet Phi", 100, -4., 4.));
181 iBooker.
book1D(
"_meGenJetPhiTrgMC",
"Single Generated Jet Phi - HLT Triggered", 100, -4., 4.));
183 iBooker.
book1D(
"_meGenJetPhiTrg",
"Single Generated Jet Phi - HLT Triggered", 100, -4., 4.));
185 iBooker.
book1D(
"_meGenJetPhiTrgLow",
"Single Generated Jet Phi - HLT Triggered Low", 100, -4., 4.));
187 for (
size_t it = 0; it <
hltTrgMet.size(); it++) {
192 _meHLTMET.push_back(iBooker.
book1D(
"_meHLTMET",
"HLT Missing ET", 100, 0, 500));
193 _meHLTMETTrgMC.push_back(iBooker.
book1D(
"_meHLTMETTrgMC",
"HLT Missing ET - HLT Triggered", 100, 0, 500));
194 _meHLTMETTrg.push_back(iBooker.
book1D(
"_meHLTMETTrg",
"HLT Missing ET - HLT Triggered", 100, 0, 500));
195 _meHLTMETTrgLow.push_back(iBooker.
book1D(
"_meHLTMETTrgLow",
"HLT Missing ET - HLT Triggered Low", 100, 0, 500));
197 _meGenMET.push_back(iBooker.
book1D(
"_meGenMET",
"Generated Missing ET", 100, 0, 500));
198 _meGenMETTrgMC.push_back(iBooker.
book1D(
"_meGenMETTrgMC",
"Generated Missing ET - HLT Triggered", 100, 0, 500));
199 _meGenMETTrg.push_back(iBooker.
book1D(
"_meGenMETTrg",
"Generated Missing ET - HLT Triggered", 100, 0, 500));
201 iBooker.
book1D(
"_meGenMETTrgLow",
"Generated Missing ET - HLT Triggered Low", 100, 0, 500));
209 using namespace reco;
210 using namespace l1extra;
211 using namespace trigger;
221 std::vector<bool> myTrigJ;
222 for (
size_t it = 0; it <
hltTrgJet.size(); it++)
223 myTrigJ.push_back(
false);
224 std::vector<bool> myTrigJLow;
226 myTrigJLow.push_back(
false);
227 std::vector<bool> myTrigM;
228 for (
size_t it = 0; it <
hltTrgMet.size(); it++)
229 myTrigM.push_back(
false);
230 std::vector<bool> myTrigMLow;
232 myTrigMLow.push_back(
false);
236 if (!hltresults.isValid()) {
247 for (
size_t it = 0; it <
hltTrgJet.size(); it++) {
272 for (
size_t it = 0; it <
hltTrgMet.size(); it++) {
302 double pfJetPt = -1.;
303 double pfJetEta = -999.;
304 double pfJetPhi = -999.;
309 for (PFJetCollection::const_iterator pf =
pfJets->begin(); pf !=
pfJets->end(); ++pf) {
314 pfJetEta = pf->eta();
315 pfJetPhi = pf->phi();
316 for (
size_t it = 0; it <
hltTrgJet.size(); it++) {
326 if (myTrigJ[it] && myTrigJLow[it])
328 if (myTrigJ[it] && myTrigJLow[it])
330 if (myTrigJ[it] && myTrigJLow[it])
351 double genJetPt = -1.;
352 double genJetEta = -999.;
353 double genJetPhi = -999.;
355 if (genJets.isValid()) {
358 for (GenJetCollection::const_iterator
gen = genJets->begin();
gen != genJets->end(); ++
gen) {
360 genJetPt =
gen->pt();
361 genJetEta =
gen->eta();
362 genJetPhi =
gen->phi();
363 for (
size_t it = 0; it <
hltTrgJet.size(); it++) {
373 if (myTrigJ[it] && myTrigJLow[it])
375 if (myTrigJ[it] && myTrigJLow[it])
377 if (myTrigJ[it] && myTrigJLow[it])
401 if (recmet.isValid()) {
402 typedef CaloMETCollection::const_iterator cmiter;
404 for (cmiter
i = recmet->begin();
i != recmet->end();
i++) {
406 for (
size_t it = 0; it <
hltTrgMet.size(); it++) {
408 if (myTrigM.size() > it && myTrigM[it])
410 if (myTrigM.size() > it && myTrigMLow.size() > it && myTrigM[it] && myTrigMLow[it])
412 if (myTrigMLow.size() > it && myTrigMLow[it])
426 if (genmet.isValid()) {
427 typedef GenMETCollection::const_iterator cmiter;
428 for (cmiter
i = genmet->begin();
i != genmet->end();
i++) {
430 for (
size_t it = 0; it <
hltTrgMet.size(); it++) {
432 if (myTrigM.size() > it && myTrigM[it])
434 if (myTrigM.size() > it && myTrigMLow.size() > it && myTrigM[it] && myTrigMLow[it])
436 if (myTrigMLow.size() > it && myTrigMLow[it])
448 int ntrigs = hltresults.
size();
452 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
457 for (
int itrig = 0; itrig != ntrigs; ++itrig) {
std::vector< std::string > hltTrgMet
std::vector< MonitorElement * > _meHLTMETTrgMC
std::vector< MonitorElement * > _meGenJetPhiTrgLow
std::vector< MonitorElement * > _meHLTJetPtTrgLow
std::vector< MonitorElement * > _meHLTJetPhiTrg
std::vector< std::string > hltTrgJet
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &iRun, edm::EventSetup const &iSetup) override
bool accept() const
Has at least one path accepted the event?
std::vector< GenJet > GenJetCollection
collection of GenJet objects
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< MonitorElement * > _meHLTMETTrg
std::vector< MonitorElement * > _meHLTJetEta
std::vector< MonitorElement * > _meHLTJetEtaTrg
std::vector< MonitorElement * > _meGenJetEta
std::string patternMetTrg_
std::string patternJetTrg_
void dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) override
std::vector< MonitorElement * > _meGenMETTrg
std::vector< std::string > hltTrgMetLow
std::vector< MonitorElement * > _meGenJetEtaTrg
edm::EDGetTokenT< reco::GenMETCollection > GenMETColl
Log< level::Error, false > LogError
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
HLTJetMETValidation(const edm::ParameterSet &)
static const std::string removeVersion(const std::string &trigger)
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
std::vector< MonitorElement * > _meHLTJetPt
std::vector< MonitorElement * > _meGenJetPtTrg
std::vector< MonitorElement * > _meGenJetPt
std::vector< MonitorElement * > _meHLTJetPhi
std::vector< MonitorElement * > _meHLTJetPtTrg
std::vector< MonitorElement * > _meGenJetPhiTrg
Container::value_type value_type
edm::EDGetTokenT< edm::TriggerResults > HLTriggerResults
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
unsigned int size() const
Get number of paths stored.
std::vector< MonitorElement * > _meGenMETTrgMC
std::vector< MonitorElement * > _meHLTJetPtTrgMC
std::vector< MonitorElement * > _meGenJetPtTrgMC
std::vector< MonitorElement * > _meGenMET
std::vector< MonitorElement * > _meHLTMETTrgLow
std::vector< MonitorElement * > _meHLTJetEtaTrgLow
edm::EDGetTokenT< reco::PFJetCollection > PFJetAlgorithm
std::string patternMuTrg_
void getHLTResults(const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
std::vector< MonitorElement * > _meHLTJetPhiTrgMC
edm::EDGetTokenT< reco::GenJetCollection > GenJetAlgorithm
std::vector< MonitorElement * > _meHLTJetPhiTrgLow
std::vector< MonitorElement * > _meGenJetEtaTrgLow
std::string const & triggerName(unsigned int index) const
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
HLTConfigProvider hltConfig_
std::vector< MonitorElement * > _meGenJetPtTrgLow
std::map< std::string, bool > hltTriggerMap
std::map< std::string, bool >::iterator trig_iter
std::vector< PFJet > PFJetCollection
collection of PFJet objects
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< MonitorElement * > _meGenMETTrgLow
std::vector< MonitorElement * > _meHLTMET
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerEventObject_
InputTag of TriggerEventWithRefs to analyze.
std::vector< std::string > hltTrgJetLow
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
~HLTJetMETValidation() override
std::vector< MonitorElement * > _meHLTJetEtaTrgMC
std::vector< MonitorElement * > _meGenJetEtaTrgMC
std::vector< MonitorElement * > _meGenJetPhi
edm::EDGetTokenT< reco::CaloMETCollection > CaloMETColl
std::vector< MonitorElement * > _meGenJetPhiTrgMC