4 #include "Math/GenVector/VectorUtil.h" 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",
"")),
42 bool foundMuTrg =
false;
44 bool changedConfig =
true;
52 edm::LogError(
"HLTJetMETValidation") <<
"Initialization of HLTConfigProvider failed!!";
57 for (
size_t j = 0; j < validTriggerNames.size(); j++) {
59 if (TString(validTriggerNames[j]).Contains(patternMu)) {
61 if (!foundMuTrg) trgMuNm = validTriggerNames[j];
65 if (TString(validTriggerNames[j]).Contains(patternJet)) {
66 hltTrgJet.push_back(validTriggerNames[j]);
69 if (TString(validTriggerNames[j]).Contains(patternMet)) {
70 hltTrgMet.push_back(validTriggerNames[j]);
75 for (
size_t it=0;it<
hltTrgJet.size();it++) {
76 if (it==0 && foundMuTrg)
hltTrgJetLow.push_back(trgMuNm);
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")) {
92 if (TString(
hltTrgMet[it]).Contains(
"MET")) {
102 if (TString(
hltTrgMet[it]).Contains(
"MHT")) {
110 if (TString(
hltTrgMet[it]).Contains(
"MET")) {
130 for (
size_t it=0;it<
hltTrgJet.size();it++) {
136 _meHLTJetPt.push_back(iBooker.
book1D(
"_meHLTJetPt",
"Single HLT Jet Pt",100,0,500));
137 _meHLTJetPtTrgMC.push_back(iBooker.
book1D(
"_meHLTJetPtTrgMC",
"Single HLT Jet Pt - HLT Triggered",100,0,500));
138 _meHLTJetPtTrg.push_back(iBooker.
book1D(
"_meHLTJetPtTrg",
"Single HLT Jet Pt - HLT Triggered",100,0,500));
139 _meHLTJetPtTrgLow.push_back(iBooker.
book1D(
"_meHLTJetPtTrgLow",
"Single HLT Jet Pt - HLT Triggered Low",100,0,500));
141 _meHLTJetEta.push_back(iBooker.
book1D(
"_meHLTJetEta",
"Single HLT Jet Eta",100,-10,10));
142 _meHLTJetEtaTrgMC.push_back(iBooker.
book1D(
"_meHLTJetEtaTrgMC",
"Single HLT Jet Eta - HLT Triggered",100,-10,10));
143 _meHLTJetEtaTrg.push_back(iBooker.
book1D(
"_meHLTJetEtaTrg",
"Single HLT Jet Eta - HLT Triggered",100,-10,10));
144 _meHLTJetEtaTrgLow.push_back(iBooker.
book1D(
"_meHLTJetEtaTrgLow",
"Single HLT Jet Eta - HLT Triggered Low",100,-10,10));
146 _meHLTJetPhi.push_back(iBooker.
book1D(
"_meHLTJetPhi",
"Single HLT Jet Phi",100,-4.,4.));
147 _meHLTJetPhiTrgMC.push_back(iBooker.
book1D(
"_meHLTJetPhiTrgMC",
"Single HLT Jet Phi - HLT Triggered",100,-4.,4.));
148 _meHLTJetPhiTrg.push_back(iBooker.
book1D(
"_meHLTJetPhiTrg",
"Single HLT Jet Phi - HLT Triggered",100,-4.,4.));
149 _meHLTJetPhiTrgLow.push_back(iBooker.
book1D(
"_meHLTJetPhiTrgLow",
"Single HLT Jet Phi - HLT Triggered Low",100,-4.,4.));
151 _meGenJetPt.push_back(iBooker.
book1D(
"_meGenJetPt",
"Single Generated Jet Pt",100,0,500));
152 _meGenJetPtTrgMC.push_back(iBooker.
book1D(
"_meGenJetPtTrgMC",
"Single Generated Jet Pt - HLT Triggered",100,0,500));
153 _meGenJetPtTrg.push_back(iBooker.
book1D(
"_meGenJetPtTrg",
"Single Generated Jet Pt - HLT Triggered",100,0,500));
154 _meGenJetPtTrgLow.push_back(iBooker.
book1D(
"_meGenJetPtTrgLow",
"Single Generated Jet Pt - HLT Triggered Low",100,0,500));
156 _meGenJetEta.push_back(iBooker.
book1D(
"_meGenJetEta",
"Single Generated Jet Eta",100,-10,10));
157 _meGenJetEtaTrgMC.push_back(iBooker.
book1D(
"_meGenJetEtaTrgMC",
"Single Generated Jet Eta - HLT Triggered",100,-10,10));
158 _meGenJetEtaTrg.push_back(iBooker.
book1D(
"_meGenJetEtaTrg",
"Single Generated Jet Eta - HLT Triggered",100,-10,10));
159 _meGenJetEtaTrgLow.push_back(iBooker.
book1D(
"_meGenJetEtaTrgLow",
"Single Generated Jet Eta - HLT Triggered Low",100,-10,10));
161 _meGenJetPhi.push_back(iBooker.
book1D(
"_meGenJetPhi",
"Single Generated Jet Phi",100,-4.,4.));
162 _meGenJetPhiTrgMC.push_back(iBooker.
book1D(
"_meGenJetPhiTrgMC",
"Single Generated Jet Phi - HLT Triggered",100,-4.,4.));
163 _meGenJetPhiTrg.push_back(iBooker.
book1D(
"_meGenJetPhiTrg",
"Single Generated Jet Phi - HLT Triggered",100,-4.,4.));
164 _meGenJetPhiTrgLow.push_back(iBooker.
book1D(
"_meGenJetPhiTrgLow",
"Single Generated Jet Phi - HLT Triggered Low",100,-4.,4.));
167 for (
size_t it=0;it<
hltTrgMet.size();it++) {
171 _meHLTMET.push_back(iBooker.
book1D(
"_meHLTMET",
"HLT Missing ET",100,0,500));
172 _meHLTMETTrgMC.push_back(iBooker.
book1D(
"_meHLTMETTrgMC",
"HLT Missing ET - HLT Triggered",100,0,500));
173 _meHLTMETTrg.push_back(iBooker.
book1D(
"_meHLTMETTrg",
"HLT Missing ET - HLT Triggered",100,0,500));
174 _meHLTMETTrgLow.push_back(iBooker.
book1D(
"_meHLTMETTrgLow",
"HLT Missing ET - HLT Triggered Low",100,0,500));
176 _meGenMET.push_back(iBooker.
book1D(
"_meGenMET",
"Generated Missing ET",100,0,500));
177 _meGenMETTrgMC.push_back(iBooker.
book1D(
"_meGenMETTrgMC",
"Generated Missing ET - HLT Triggered",100,0,500));
178 _meGenMETTrg.push_back(iBooker.
book1D(
"_meGenMETTrg",
"Generated Missing ET - HLT Triggered",100,0,500));
179 _meGenMETTrgLow.push_back(iBooker.
book1D(
"_meGenMETTrgLow",
"Generated Missing ET - HLT Triggered Low",100,0,500));
190 using namespace reco;
202 std::vector<bool> myTrigJ;
203 for (
size_t it=0;it<
hltTrgJet.size();it++) myTrigJ.push_back(
false);
204 std::vector<bool> myTrigJLow;
205 for (
size_t it=0;it<
hltTrgJetLow.size();it++) myTrigJLow.push_back(
false);
206 std::vector<bool> myTrigM;
207 for (
size_t it=0;it<
hltTrgMet.size();it++) myTrigM.push_back(
false);
208 std::vector<bool> myTrigMLow;
209 for (
size_t it=0;it<
hltTrgMetLow.size();it++) myTrigMLow.push_back(
false);
224 for (
size_t it=0;it<
hltTrgJet.size();it++) {
245 for (
size_t it=0;it<
hltTrgMet.size();it++) {
272 double pfJetEta=-999.;
273 double pfJetPhi=-999.;
278 for( PFJetCollection::const_iterator
pf = pfJets->begin();
pf != pfJets->end(); ++
pf ) {
284 for (
size_t it=0;it<
hltTrgJet.size();it++) {
291 if (myTrigJ[it] && myTrigJLow[it])
_meHLTJetPtTrg[it]->Fill( pfJetPt );
292 if (myTrigJ[it] && myTrigJLow[it])
_meHLTJetEtaTrg[it]->Fill( pfJetEta );
293 if (myTrigJ[it] && myTrigJLow[it])
_meHLTJetPhiTrg[it]->Fill( pfJetPhi );
311 double genJetEta=-999.;
312 double genJetPhi=-999.;
317 for( GenJetCollection::const_iterator
gen = genJets->begin();
gen != genJets->end(); ++
gen ) {
320 genJetEta=
gen->eta();
321 genJetPhi=
gen->phi();
322 for (
size_t it=0;it<
hltTrgJet.size();it++) {
329 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetPtTrg[it]->Fill( genJetPt );
330 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetEtaTrg[it]->Fill( genJetEta );
331 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetPhiTrg[it]->Fill( genJetPhi );
352 typedef CaloMETCollection::const_iterator cmiter;
354 for ( cmiter
i=recmet->begin();
i!=recmet->end();
i++) {
356 for (
size_t it=0;it<
hltTrgMet.size();it++) {
359 if (myTrigM.size() > it && myTrigMLow.size() > it && myTrigM[it] && myTrigMLow[it])
_meHLTMETTrg[it] ->
Fill(calMet);
374 typedef GenMETCollection::const_iterator cmiter;
375 for ( cmiter
i=genmet->begin();
i!=genmet->end();
i++) {
377 for (
size_t it=0;it<
hltTrgMet.size();it++) {
380 if (myTrigM.size() > it && myTrigMLow.size() > it && myTrigM[it] && myTrigMLow[it])
_meGenMETTrg[it] ->
Fill(genMet);
395 int ntrigs=hltresults.
size();
399 for (
int itrig = 0; itrig != ntrigs; ++itrig){
404 for (
int itrig = 0; itrig != ntrigs; ++itrig){
std::vector< MonitorElement * > _meHLTMETTrgMC
std::vector< std::string > hltTrgMet
std::vector< MonitorElement * > _meGenJetEtaTrgMC
std::vector< MonitorElement * > _meGenJetPt
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
void bookHistograms(DQMStore::IBooker &, edm::Run const &iRun, edm::EventSetup const &iSetup) override
std::vector< MonitorElement * > _meHLTJetPhiTrgLow
bool accept() const
Has at least one path accepted the event?
genmet
do same things for GEN
std::vector< GenJet > GenJetCollection
collection of GenJet objects
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::string patternMetTrg_
std::string patternJetTrg_
std::vector< MonitorElement * > _meGenMET
void dqmBeginRun(edm::Run const &iRun, edm::EventSetup const &iSetup) override
std::vector< MonitorElement * > _meHLTMETTrgLow
std::vector< MonitorElement * > _meGenJetPtTrgMC
std::vector< MonitorElement * > _meGenMETTrgMC
std::vector< std::string > hltTrgMetLow
edm::EDGetTokenT< reco::GenMETCollection > GenMETColl
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)
Container::value_type value_type
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)
std::vector< MonitorElement * > _meGenJetEtaTrg
std::vector< MonitorElement * > _meGenJetPtTrg
std::vector< MonitorElement * > _meGenMETTrg
def gen(fragment, howMuch)
Production test section ####.
std::vector< MonitorElement * > _meGenJetEtaTrgLow
edm::EDGetTokenT< reco::PFJetCollection > PFJetAlgorithm
std::string patternMuTrg_
std::vector< MonitorElement * > _meHLTJetPt
void getHLTResults(const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
edm::EDGetTokenT< reco::GenJetCollection > GenJetAlgorithm
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
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< trigger::TriggerEventWithRefs > triggerEventObject_
InputTag of TriggerEventWithRefs to analyze.
std::vector< std::string > hltTrgJetLow
std::vector< MonitorElement * > _meGenJetPhiTrgLow
std::map< std::string, bool >::iterator trig_iter
~HLTJetMETValidation() override
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
std::vector< MonitorElement * > _meHLTJetEtaTrgMC
edm::EDGetTokenT< reco::CaloMETCollection > CaloMETColl
std::vector< MonitorElement * > _meHLTMET