4 #include "Math/GenVector/VectorUtil.h"
14 triggerTag_(ps.getUntrackedParameter<std::
string>(
"DQMFolder",
"SingleJet")),
15 patternJetTrg_(ps.getUntrackedParameter<std::
string>(
"PatternJetTrg",
"")),
16 patternMetTrg_(ps.getUntrackedParameter<std::
string>(
"PatternMetTrg",
"")),
17 patternMuTrg_(ps.getUntrackedParameter<std::
string>(
"PatternMuTrg",
"")),
35 bool foundMuTrg =
false;
37 bool changedConfig =
true;
45 edm::LogError(
"HLTJetMETValidation") <<
"Initialization of HLTConfigProvider failed!!";
50 for (
size_t j = 0;
j < validTriggerNames.size();
j++) {
52 if (TString(validTriggerNames[
j]).Contains(patternMu)) {
54 if (!foundMuTrg) trgMuNm = validTriggerNames[
j].c_str();
58 if (TString(validTriggerNames[j]).Contains(patternJet)) {
59 hltTrgJet.push_back(validTriggerNames[j]);
62 if (TString(validTriggerNames[j]).Contains(patternMet)) {
63 hltTrgMet.push_back(validTriggerNames[j]);
68 for (
size_t it=0;it<
hltTrgJet.size();it++) {
69 if (it==0 && foundMuTrg)
hltTrgJetLow.push_back(trgMuNm);
74 int itm(0), itpm(0), itmh(0), itpmh(0);
75 for (
size_t it=0;it<
hltTrgMet.size();it++) {
76 if (TString(
hltTrgMet[it]).Contains(
"PF")) {
77 if (TString(
hltTrgMet[it]).Contains(
"MHT")) {
85 if (TString(
hltTrgMet[it]).Contains(
"MET")) {
95 if (TString(
hltTrgMet[it]).Contains(
"MHT")) {
103 if (TString(
hltTrgMet[it]).Contains(
"MET")) {
123 for (
size_t it=0;it<
hltTrgJet.size();it++) {
129 _meHLTJetPt.push_back(iBooker.
book1D(
"_meHLTJetPt",
"Single HLT Jet Pt",100,0,500));
130 _meHLTJetPtTrgMC.push_back(iBooker.
book1D(
"_meHLTJetPtTrgMC",
"Single HLT Jet Pt - HLT Triggered",100,0,500));
131 _meHLTJetPtTrg.push_back(iBooker.
book1D(
"_meHLTJetPtTrg",
"Single HLT Jet Pt - HLT Triggered",100,0,500));
132 _meHLTJetPtTrgLow.push_back(iBooker.
book1D(
"_meHLTJetPtTrgLow",
"Single HLT Jet Pt - HLT Triggered Low",100,0,500));
134 _meHLTJetEta.push_back(iBooker.
book1D(
"_meHLTJetEta",
"Single HLT Jet Eta",100,-10,10));
135 _meHLTJetEtaTrgMC.push_back(iBooker.
book1D(
"_meHLTJetEtaTrgMC",
"Single HLT Jet Eta - HLT Triggered",100,-10,10));
136 _meHLTJetEtaTrg.push_back(iBooker.
book1D(
"_meHLTJetEtaTrg",
"Single HLT Jet Eta - HLT Triggered",100,-10,10));
137 _meHLTJetEtaTrgLow.push_back(iBooker.
book1D(
"_meHLTJetEtaTrgLow",
"Single HLT Jet Eta - HLT Triggered Low",100,-10,10));
139 _meHLTJetPhi.push_back(iBooker.
book1D(
"_meHLTJetPhi",
"Single HLT Jet Phi",100,-4.,4.));
140 _meHLTJetPhiTrgMC.push_back(iBooker.
book1D(
"_meHLTJetPhiTrgMC",
"Single HLT Jet Phi - HLT Triggered",100,-4.,4.));
141 _meHLTJetPhiTrg.push_back(iBooker.
book1D(
"_meHLTJetPhiTrg",
"Single HLT Jet Phi - HLT Triggered",100,-4.,4.));
142 _meHLTJetPhiTrgLow.push_back(iBooker.
book1D(
"_meHLTJetPhiTrgLow",
"Single HLT Jet Phi - HLT Triggered Low",100,-4.,4.));
144 _meGenJetPt.push_back(iBooker.
book1D(
"_meGenJetPt",
"Single Generated Jet Pt",100,0,500));
145 _meGenJetPtTrgMC.push_back(iBooker.
book1D(
"_meGenJetPtTrgMC",
"Single Generated Jet Pt - HLT Triggered",100,0,500));
146 _meGenJetPtTrg.push_back(iBooker.
book1D(
"_meGenJetPtTrg",
"Single Generated Jet Pt - HLT Triggered",100,0,500));
147 _meGenJetPtTrgLow.push_back(iBooker.
book1D(
"_meGenJetPtTrgLow",
"Single Generated Jet Pt - HLT Triggered Low",100,0,500));
149 _meGenJetEta.push_back(iBooker.
book1D(
"_meGenJetEta",
"Single Generated Jet Eta",100,-10,10));
150 _meGenJetEtaTrgMC.push_back(iBooker.
book1D(
"_meGenJetEtaTrgMC",
"Single Generated Jet Eta - HLT Triggered",100,-10,10));
151 _meGenJetEtaTrg.push_back(iBooker.
book1D(
"_meGenJetEtaTrg",
"Single Generated Jet Eta - HLT Triggered",100,-10,10));
152 _meGenJetEtaTrgLow.push_back(iBooker.
book1D(
"_meGenJetEtaTrgLow",
"Single Generated Jet Eta - HLT Triggered Low",100,-10,10));
154 _meGenJetPhi.push_back(iBooker.
book1D(
"_meGenJetPhi",
"Single Generated Jet Phi",100,-4.,4.));
155 _meGenJetPhiTrgMC.push_back(iBooker.
book1D(
"_meGenJetPhiTrgMC",
"Single Generated Jet Phi - HLT Triggered",100,-4.,4.));
156 _meGenJetPhiTrg.push_back(iBooker.
book1D(
"_meGenJetPhiTrg",
"Single Generated Jet Phi - HLT Triggered",100,-4.,4.));
157 _meGenJetPhiTrgLow.push_back(iBooker.
book1D(
"_meGenJetPhiTrgLow",
"Single Generated Jet Phi - HLT Triggered Low",100,-4.,4.));
160 for (
size_t it=0;it<
hltTrgMet.size();it++) {
164 _meHLTMET.push_back(iBooker.
book1D(
"_meHLTMET",
"HLT Missing ET",100,0,500));
165 _meHLTMETTrgMC.push_back(iBooker.
book1D(
"_meHLTMETTrgMC",
"HLT Missing ET - HLT Triggered",100,0,500));
166 _meHLTMETTrg.push_back(iBooker.
book1D(
"_meHLTMETTrg",
"HLT Missing ET - HLT Triggered",100,0,500));
167 _meHLTMETTrgLow.push_back(iBooker.
book1D(
"_meHLTMETTrgLow",
"HLT Missing ET - HLT Triggered Low",100,0,500));
169 _meGenMET.push_back(iBooker.
book1D(
"_meGenMET",
"Generated Missing ET",100,0,500));
170 _meGenMETTrgMC.push_back(iBooker.
book1D(
"_meGenMETTrgMC",
"Generated Missing ET - HLT Triggered",100,0,500));
171 _meGenMETTrg.push_back(iBooker.
book1D(
"_meGenMETTrg",
"Generated Missing ET - HLT Triggered",100,0,500));
172 _meGenMETTrgLow.push_back(iBooker.
book1D(
"_meGenMETTrgLow",
"Generated Missing ET - HLT Triggered Low",100,0,500));
183 using namespace reco;
184 using namespace l1extra;
185 using namespace trigger;
195 std::vector<bool> myTrigJ;
196 for (
size_t it=0;it<
hltTrgJet.size();it++) myTrigJ.push_back(
false);
197 std::vector<bool> myTrigJLow;
198 for (
size_t it=0;it<
hltTrgJetLow.size();it++) myTrigJLow.push_back(
false);
199 std::vector<bool> myTrigM;
200 for (
size_t it=0;it<
hltTrgMet.size();it++) myTrigM.push_back(
false);
201 std::vector<bool> myTrigMLow;
202 for (
size_t it=0;it<
hltTrgMetLow.size();it++) myTrigMLow.push_back(
false);
207 if (! hltresults.isValid() ) {
217 for (
size_t it=0;it<
hltTrgJet.size();it++) {
238 for (
size_t it=0;it<
hltTrgMet.size();it++) {
265 double pfJetEta=-999.;
266 double pfJetPhi=-999.;
271 for( PFJetCollection::const_iterator pf =
pfJets->begin(); pf !=
pfJets->end(); ++ pf ) {
277 for (
size_t it=0;it<
hltTrgJet.size();it++) {
284 if (myTrigJ[it] && myTrigJLow[it])
_meHLTJetPtTrg[it]->Fill( pfJetPt );
285 if (myTrigJ[it] && myTrigJLow[it])
_meHLTJetEtaTrg[it]->Fill( pfJetEta );
286 if (myTrigJ[it] && myTrigJLow[it])
_meHLTJetPhiTrg[it]->Fill( pfJetPhi );
304 double genJetEta=-999.;
305 double genJetPhi=-999.;
307 if (genJets.isValid()) {
310 for( GenJetCollection::const_iterator
gen = genJets->begin();
gen != genJets->end(); ++
gen ) {
313 genJetEta=
gen->eta();
314 genJetPhi=
gen->phi();
315 for (
size_t it=0;it<
hltTrgJet.size();it++) {
322 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetPtTrg[it]->Fill( genJetPt );
323 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetEtaTrg[it]->Fill( genJetEta );
324 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetPhiTrg[it]->Fill( genJetPhi );
344 if (recmet.isValid()) {
345 typedef CaloMETCollection::const_iterator cmiter;
347 for ( cmiter
i=recmet->begin();
i!=recmet->end();
i++) {
349 for (
size_t it=0;it<
hltTrgMet.size();it++) {
366 if (genmet.isValid()) {
367 typedef GenMETCollection::const_iterator cmiter;
368 for ( cmiter
i=genmet->begin();
i!=genmet->end();
i++) {
370 for (
size_t it=0;it<
hltTrgMet.size();it++) {
388 int ntrigs=hltresults.
size();
392 for (
int itrig = 0; itrig != ntrigs; ++itrig){
398 for (
int itrig = 0; itrig != ntrigs; ++itrig){
std::vector< MonitorElement * > _meHLTMETTrgMC
std::vector< std::string > hltTrgMet
std::vector< MonitorElement * > _meGenJetEtaTrgMC
std::vector< MonitorElement * > _meGenJetPt
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
std::vector< MonitorElement * > _meGenJetPhiTrg
std::vector< std::string > hltTrgJet
std::vector< MonitorElement * > _meHLTJetPtTrg
std::map< std::string, bool > hltTriggerMap
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &iRun, edm::EventSetup const &iSetup) override
edm::EDGetTokenT< TriggerEventWithRefs > triggerEventObject_
InputTag of TriggerEventWithRefs to analyze.
edm::EDGetTokenT< GenMETCollection > GenMETColl
std::vector< MonitorElement * > _meHLTJetPhiTrgLow
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::string patternMetTrg_
edm::EDGetTokenT< GenJetCollection > GenJetAlgorithm
std::string patternJetTrg_
std::vector< MonitorElement * > _meGenMET
virtual void dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) override
std::vector< MonitorElement * > _meHLTMETTrgLow
std::vector< MonitorElement * > _meGenJetPtTrgMC
std::vector< MonitorElement * > _meGenMETTrgMC
edm::EDGetTokenT< CaloMETCollection > CaloMETColl
std::vector< std::string > hltTrgMetLow
std::vector< MonitorElement * > _meGenJetPhiTrgMC
std::vector< MonitorElement * > _meGenMETTrgLow
std::vector< MonitorElement * > _meHLTJetPtTrgLow
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
HLTJetMETValidation(const edm::ParameterSet &)
std::vector< MonitorElement * > _meHLTJetEta
static const std::string removeVersion(const std::string &trigger)
std::vector< MonitorElement * > _meHLTJetPhiTrgMC
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 * > _meHLTJetEtaTrg
std::vector< MonitorElement * > _meHLTJetEtaTrgLow
MonitorElement * book1D(Args &&...args)
edm::EDGetTokenT< PFJetCollection > PFJetAlgorithm
std::vector< MonitorElement * > _meGenJetEtaTrg
std::vector< MonitorElement * > _meGenJetPtTrg
Container::value_type value_type
std::vector< MonitorElement * > _meGenMETTrg
std::vector< MonitorElement * > _meGenJetEtaTrgLow
std::string patternMuTrg_
std::vector< MonitorElement * > _meHLTJetPt
void getHLTResults(const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
std::vector< MonitorElement * > _meHLTJetPhi
std::vector< MonitorElement * > _meGenJetEta
void setCurrentFolder(const std::string &fullpath)
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
std::vector< MonitorElement * > _meGenJetPhi
std::vector< MonitorElement * > _meGenJetPtTrgLow
TLorentzVector genMet(const HepMC::GenEvent *all, double etamin=-9999., double etamax=9999.)
HLTConfigProvider hltConfig_
std::vector< MonitorElement * > _meHLTJetPtTrgMC
std::vector< MonitorElement * > _meHLTMETTrg
std::vector< MonitorElement * > _meHLTJetPhiTrg
std::vector< PFJet > PFJetCollection
collection of PFJet objects
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< std::string > hltTrgJetLow
volatile std::atomic< bool > shutdown_flag false
std::vector< MonitorElement * > _meGenJetPhiTrgLow
std::map< std::string, bool >::iterator trig_iter
std::vector< MonitorElement * > _meHLTJetEtaTrgMC
std::vector< MonitorElement * > _meHLTMET