2 #include "Math/GenVector/VectorUtil.h"
12 triggerTag_(ps.getUntrackedParameter<std::
string>(
"DQMFolder",
"SingleJet")),
13 patternJetTrg_(ps.getUntrackedParameter<std::
string>(
"PatternJetTrg",
"")),
14 patternMetTrg_(ps.getUntrackedParameter<std::
string>(
"PatternMetTrg",
"")),
15 patternMuTrg_(ps.getUntrackedParameter<std::
string>(
"PatternMuTrg",
"")),
16 outFile_(ps.getUntrackedParameter<std::
string>(
"OutputFileName",
"")),
19 writeFile_(ps.getUntrackedParameter<bool>(
"WriteFile",
false))
40 bool foundMuTrg =
false;
54 edm::LogError(
"HLTJetMET") <<
"Initialization of HLTConfigProvider failed!!";
58 for (
size_t j = 0;
j < validTriggerNames.size();
j++) {
60 if (TString(validTriggerNames[
j]).Contains(patternMu)) {
62 if (!foundMuTrg) trgMuNm = validTriggerNames[
j].c_str();
66 if (TString(validTriggerNames[j]).Contains(patternJet)) {
67 hltTrgJet.push_back(validTriggerNames[j]);
70 if (TString(validTriggerNames[j]).Contains(patternMet)) {
71 hltTrgMet.push_back(validTriggerNames[j]);
76 for (
size_t it=0;it<
hltTrgJet.size();it++) {
77 if (it==0 && foundMuTrg)
hltTrgJetLow.push_back(trgMuNm);
82 int itm(0), itpm(0), itmh(0), itpmh(0);
83 for (
size_t it=0;it<
hltTrgMet.size();it++) {
84 if (TString(
hltTrgMet[it]).Contains(
"PF")) {
85 if (TString(
hltTrgMet[it]).Contains(
"MHT")) {
93 if (TString(
hltTrgMet[it]).Contains(
"MET")) {
103 if (TString(
hltTrgMet[it]).Contains(
"MHT")) {
111 if (TString(
hltTrgMet[it]).Contains(
"MET")) {
124 for (
size_t it=0;it<
hltTrgJet.size();it++) {
163 for (
size_t it=0;it<
hltTrgMet.size();it++) {
197 using namespace reco;
198 using namespace l1extra;
199 using namespace trigger;
212 std::vector<bool> myTrigJ;
213 for (
size_t it=0;it<
hltTrgJet.size();it++) myTrigJ.push_back(
false);
214 std::vector<bool> myTrigJLow;
215 for (
size_t it=0;it<
hltTrgJetLow.size();it++) myTrigJLow.push_back(
false);
216 std::vector<bool> myTrigM;
217 for (
size_t it=0;it<
hltTrgMet.size();it++) myTrigM.push_back(
false);
218 std::vector<bool> myTrigMLow;
219 for (
size_t it=0;it<
hltTrgMetLow.size();it++) myTrigMLow.push_back(
false);
224 if (! hltresults.isValid() ) {
237 for (
size_t it=0;it<
hltTrgJet.size();it++) {
258 for (
size_t it=0;it<
hltTrgMet.size();it++) {
283 double calJetEta=-999.;
284 double calJetPhi=-999.;
289 for( PFJetCollection::const_iterator cal =
caloJets->begin(); cal !=
caloJets->end(); ++ cal ) {
293 calJetEta=cal->eta();
294 calJetPhi=cal->phi();
295 for (
size_t it=0;it<
hltTrgJet.size();it++) {
302 if (myTrigJ[it] && myTrigJLow[it])
_meRecoJetPtTrg[it]->Fill( calJetPt );
330 double genJetEta=-999.;
331 double genJetPhi=-999.;
333 if (genJets.isValid()) {
336 for( GenJetCollection::const_iterator
gen = genJets->begin();
gen != genJets->end(); ++
gen ) {
340 genJetEta=
gen->eta();
341 genJetPhi=
gen->phi();
342 for (
size_t it=0;it<
hltTrgJet.size();it++) {
349 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetPtTrg[it]->Fill( genJetPt );
350 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetEtaTrg[it]->Fill( genJetEta );
351 if (myTrigJ[it] && myTrigJLow[it])
_meGenJetPhiTrg[it]->Fill( genJetPhi );
379 if (recmet.isValid()) {
380 typedef CaloMETCollection::const_iterator cmiter;
382 for ( cmiter
i=recmet->begin();
i!=recmet->end();
i++) {
384 for (
size_t it=0;it<
hltTrgMet.size();it++) {
400 if (genmet.isValid()) {
401 typedef GenMETCollection::const_iterator cmiter;
403 for ( cmiter
i=genmet->begin();
i!=genmet->end();
i++) {
405 for (
size_t it=0;it<
hltTrgMet.size();it++) {
422 int ntrigs=hltresults.
size();
427 for (
int itrig = 0; itrig != ntrigs; ++itrig){
433 for (
int itrig = 0; itrig != ntrigs; ++itrig){
std::vector< MonitorElement * > _meRecoMET
std::vector< std::string > hltTrgMet
std::vector< MonitorElement * > _meGenJetEtaTrgMC
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< MonitorElement * > _meGenJetPt
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
std::vector< MonitorElement * > _meGenJetPhiTrg
std::vector< std::string > hltTrgJet
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::EDGetTokenT< PFJetCollection > CaloJetAlgorithm
std::map< std::string, bool > hltTriggerMap
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< TriggerEventWithRefs > triggerEventObject_
InputTag of TriggerEventWithRefs to analyze.
edm::EDGetTokenT< GenMETCollection > GenMETColl
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 * > _meRecoJetPtTrgMC
std::vector< MonitorElement * > _meGenMET
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
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)
std::vector< MonitorElement * > _meRecoJetPhiTrgLow
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 * > _meRecoJetPt
std::vector< MonitorElement * > _meGenJetEtaTrg
std::vector< MonitorElement * > _meRecoJetEtaTrgMC
std::vector< MonitorElement * > _meRecoMETTrg
std::vector< MonitorElement * > _meGenJetPtTrg
Container::value_type value_type
std::vector< MonitorElement * > _meGenMETTrg
std::vector< MonitorElement * > _meRecoJetPhiTrgMC
std::vector< MonitorElement * > _meGenJetEtaTrgLow
std::string patternMuTrg_
void getHLTResults(const edm::TriggerResults &, const edm::TriggerNames &triggerNames)
std::vector< MonitorElement * > _meRecoJetPtTrg
std::vector< MonitorElement * > _meGenJetEta
std::vector< MonitorElement * > _meRecoJetPhiTrg
std::string const & triggerName(unsigned int index) const
std::vector< MonitorElement * > _meRecoMETTrgMC
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.)
std::vector< MonitorElement * > _meRecoJetPtTrgLow
HLTConfigProvider hltConfig_
std::vector< MonitorElement * > _meRecoMETTrgLow
std::vector< PFJet > PFJetCollection
collection of PFJet objects
std::vector< std::string > hltTrgJetLow
std::vector< MonitorElement * > _meRecoJetEta
volatile std::atomic< bool > shutdown_flag false
std::vector< MonitorElement * > _meGenJetPhiTrgLow
std::vector< MonitorElement * > _meRecoJetPhi
std::map< std::string, bool >::iterator trig_iter
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< MonitorElement * > _meRecoJetEtaTrgLow
std::vector< MonitorElement * > _meRecoJetEtaTrg
void setCurrentFolder(const std::string &fullpath)