CMS 3D CMS Logo

SUSY_HLT_InclusiveHT.cc
Go to the documentation of this file.
7 
9  edm::LogInfo("SUSY_HLT_InclusiveHT") << "Constructor SUSY_HLT_InclusiveHT::SUSY_HLT_InclusiveHT " << std::endl;
10  // Get parameters from configuration file
11  theTrigSummary_ = consumes<trigger::TriggerEvent>(ps.getParameter<edm::InputTag>("trigSummary"));
12  thePfMETCollection_ = consumes<reco::PFMETCollection>(ps.getParameter<edm::InputTag>("pfMETCollection"));
13  thePfJetCollection_ = consumes<reco::PFJetCollection>(ps.getParameter<edm::InputTag>("pfJetCollection"));
14  theCaloJetCollection_ = consumes<reco::CaloJetCollection>(ps.getParameter<edm::InputTag>("caloJetCollection"));
15  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResults"));
16  triggerPath_ = ps.getParameter<std::string>("TriggerPath");
17  triggerPathAuxiliaryForHadronic_ = ps.getParameter<std::string>("TriggerPathAuxiliaryForHadronic");
18  triggerFilter_ = ps.getParameter<edm::InputTag>("TriggerFilter");
19  ptThrJet_ = ps.getUntrackedParameter<double>("PtThrJet");
20  etaThrJet_ = ps.getUntrackedParameter<double>("EtaThrJet");
21 }
22 
24  edm::LogInfo("SUSY_HLT_InclusiveHT") << "Destructor SUSY_HLT_InclusiveHT::~SUSY_HLT_InclusiveHT " << std::endl;
25 }
26 
28  edm::LogInfo("SUSY_HLT_InclusiveHT") << "SUSY_HLT_InclusiveHT::bookHistograms" << std::endl;
29  // book at beginRun
30  bookHistos(ibooker_);
31 }
32 
34  edm::LogInfo("SUSY_HLT_InclusiveHT") << "SUSY_HLT_InclusiveHT::analyze" << std::endl;
35 
36  //-------------------------------
37  //--- MET
38  //-------------------------------
41  if (!pfMETCollection.isValid()) {
42  edm::LogError("SUSY_HLT_InclusiveHT") << "invalid collection: PFMET"
43  << "\n";
44  return;
45  }
46  //-------------------------------
47  //--- Jets
48  //-------------------------------
51  if (!pfJetCollection.isValid()) {
52  edm::LogError("SUSY_HLT_InclusiveHT") << "invalid collection: PFJets"
53  << "\n";
54  return;
55  }
58  if (!caloJetCollection.isValid()) {
59  edm::LogError("SUSY_HLT_InclusiveHT") << "invalid collection: CaloJets"
60  << "\n";
61  return;
62  }
63 
64  // check what is in the menu
66  e.getByToken(triggerResults_, hltresults);
67  if (!hltresults.isValid()) {
68  edm::LogError("SUSY_HLT_InclusiveHT") << "invalid collection: TriggerResults"
69  << "\n";
70  return;
71  }
72 
73  //-------------------------------
74  //--- Trigger
75  //-------------------------------
77  e.getByToken(theTrigSummary_, triggerSummary);
78  if (!triggerSummary.isValid()) {
79  edm::LogError("SUSY_HLT_InclusiveHT") << "invalid collection: TriggerSummary"
80  << "\n";
81  return;
82  }
83 
84  // get online objects
85  size_t filterIndex = triggerSummary->filterIndex(triggerFilter_);
87  if (!(filterIndex >= triggerSummary->sizeFilters())) {
88  const trigger::Keys &keys = triggerSummary->filterKeys(filterIndex);
89  for (size_t j = 0; j < keys.size(); ++j) {
91  // if(foundObject.id() == 85 && foundObject.pt() > 40.0 &&
92  // fabs(foundObject.eta()) < 3.0){
93  // h_triggerJetPt->Fill(foundObject.pt());
94  // h_triggerJetEta->Fill(foundObject.eta());
95  // h_triggerJetPhi->Fill(foundObject.phi());
96  //}
97  if (foundObject.id() == 87) {
98  h_triggerMetPt->Fill(foundObject.pt());
99  h_triggerMetPhi->Fill(foundObject.phi());
100  }
101  if (foundObject.id() == 89) {
102  h_triggerHT->Fill(foundObject.pt());
103  }
104  }
105  }
106 
107  bool hasFired = false, hasFiredAuxiliaryForHadronicLeg = false;
108  const edm::TriggerNames &trigNames = e.triggerNames(*hltresults);
109  unsigned int numTriggers = trigNames.size();
110  for (unsigned int hltIndex = 0; hltIndex < numTriggers; ++hltIndex) {
111  if (trigNames.triggerName(hltIndex).find(triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) &&
112  hltresults->accept(hltIndex))
113  hasFired = true;
114  if (trigNames.triggerName(hltIndex).find(triggerPathAuxiliaryForHadronic_) != std::string::npos &&
115  hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex))
116  hasFiredAuxiliaryForHadronicLeg = true;
117  }
118 
119  if (hasFiredAuxiliaryForHadronicLeg || !e.isRealData()) {
120  float caloHT = 0.0;
121  float pfHT = 0.0;
122  for (reco::PFJetCollection::const_iterator i_pfjet = pfJetCollection->begin(); i_pfjet != pfJetCollection->end();
123  ++i_pfjet) {
124  if (i_pfjet->pt() < ptThrJet_)
125  continue;
126  if (fabs(i_pfjet->eta()) > etaThrJet_)
127  continue;
128  pfHT += i_pfjet->pt();
129  }
130 
131  if (hasFired) {
132  for (reco::CaloJetCollection::const_iterator i_calojet = caloJetCollection->begin();
133  i_calojet != caloJetCollection->end();
134  ++i_calojet) {
135  if (i_calojet->pt() < ptThrJet_)
136  continue;
137  if (fabs(i_calojet->eta()) > etaThrJet_)
138  continue;
139  h_caloJetPt->Fill(i_calojet->pt());
140  h_caloJetEta->Fill(i_calojet->eta());
141  h_caloJetPhi->Fill(i_calojet->phi());
142  caloHT += i_calojet->pt();
143  }
144  for (reco::PFJetCollection::const_iterator i_pfjet = pfJetCollection->begin(); i_pfjet != pfJetCollection->end();
145  ++i_pfjet) {
146  if (i_pfjet->pt() < ptThrJet_)
147  continue;
148  if (fabs(i_pfjet->eta()) > etaThrJet_)
149  continue;
150  h_pfJetPt->Fill(i_pfjet->pt());
151  h_pfJetEta->Fill(i_pfjet->eta());
152  h_pfJetPhi->Fill(i_pfjet->phi());
153  }
154  h_pfMet->Fill(pfMETCollection->begin()->et());
155  h_pfMetPhi->Fill(pfMETCollection->begin()->phi());
156  h_pfHT->Fill(pfHT);
157  h_caloHT->Fill(caloHT);
158 
159  h_pfMetTurnOn_num->Fill(pfMETCollection->begin()->et());
160  h_pfHTTurnOn_num->Fill(pfHT);
161  }
162  // fill denominator histograms for all events, used for turn on curves
163  h_pfMetTurnOn_den->Fill(pfMETCollection->begin()->et());
164  h_pfHTTurnOn_den->Fill(pfHT);
165  }
166 }
167 
169  ibooker_.cd();
170  ibooker_.setCurrentFolder("HLT/SUSYBSM/" + triggerPath_);
171 
172  // offline quantities
173  h_pfMet = ibooker_.book1D("pfMet", "PF Missing E_{T}; GeV", 20, 0.0, 500.0);
174  h_pfMetPhi = ibooker_.book1D("pfMetPhi", "PF MET Phi", 20, -3.5, 3.5);
175  h_pfHT = ibooker_.book1D("pfHT", "PF H_{T}; GeV", 30, 0.0, 1500.0);
176  h_caloHT = ibooker_.book1D("caloHT", "Calo H_{T}; GeV", 30, 0.0, 1500.0);
177  h_pfJetPt = ibooker_.book1D("pfJetPt", "PFJet P_{T}; GeV", 20, 0.0, 500.0);
178  h_pfJetEta = ibooker_.book1D("pfJetEta", "PFJet Eta", 20, -3.0, 3.0);
179  h_pfJetPhi = ibooker_.book1D("pfJetPhi", "PFJet Phi", 20, -3.5, 3.5);
180  h_caloJetPt = ibooker_.book1D("caloJetPt", "CaloJet P_{T}; GeV", 20, 0.0, 500.0);
181  h_caloJetEta = ibooker_.book1D("caloJetEta", "CaloJet Eta", 20, -3.0, 3.0);
182  h_caloJetPhi = ibooker_.book1D("caloJetPhi", "CaloJet Phi", 20, -3.5, 3.5);
183 
184  // online quantities
185  // h_triggerJetPt = ibooker_.book1D("triggerJetPt", "Trigger Jet Pt; GeV", 20,
186  // 0.0, 500.0); h_triggerJetEta = ibooker_.book1D("triggerJetEta", "Trigger
187  // Jet Eta", 20, -3.0, 3.0); h_triggerJetPhi =
188  // ibooker_.book1D("triggerJetPhi", "Trigger Jet Phi", 20, -3.5, 3.5);
189  h_triggerMetPt = ibooker_.book1D("triggerMetPt", "Trigger Met Pt; GeV", 20, 0.0, 500.0);
190  h_triggerMetPhi = ibooker_.book1D("triggerMetPhi", "Trigger Met Phi", 20, -3.5, 3.5);
191  h_triggerHT = ibooker_.book1D("triggerHT", "Trigger HT; GeV", 30, 0.0, 1500.0);
192 
193  // num and den hists to be divided in harvesting step to make turn on curves
194  h_pfMetTurnOn_num = ibooker_.book1D("pfMetTurnOn_num", "PF MET Turn On Numerator", 20, 0.0, 500.0);
195  h_pfMetTurnOn_den = ibooker_.book1D("pfMetTurnOn_den", "PF MET Turn OnDenominator", 20, 0.0, 500.0);
196  h_pfHTTurnOn_num = ibooker_.book1D("pfHTTurnOn_num", "PF HT Turn On Numerator", 30, 0.0, 1500.0);
197  h_pfHTTurnOn_den = ibooker_.book1D("pfHTTurnOn_den", "PF HT Turn On Denominator", 30, 0.0, 1500.0);
198 
199  ibooker_.cd();
200 }
201 
202 // define this as a plug-in
trigger::TriggerObject::phi
float phi() const
Definition: TriggerObject.h:54
SUSY_HLT_InclusiveHT::ptThrJet_
double ptThrJet_
Definition: SUSY_HLT_InclusiveHT.h:49
SUSY_HLT_InclusiveHT::etaThrJet_
double etaThrJet_
Definition: SUSY_HLT_InclusiveHT.h:50
SUSY_HLT_InclusiveHT.h
SUSY_HLT_InclusiveHT::bookHistos
void bookHistos(DQMStore::IBooker &)
Definition: SUSY_HLT_InclusiveHT.cc:168
MessageLogger.h
trigNames
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:57
triggerMatchMonitor_cfi.triggerObjects
triggerObjects
Definition: triggerMatchMonitor_cfi.py:15
HLTBitAnalyser_cfi.hltresults
hltresults
Definition: HLTBitAnalyser_cfi.py:13
edm::Run
Definition: Run.h:45
SUSY_HLT_InclusiveHT::analyze
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition: SUSY_HLT_InclusiveHT.cc:33
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
SUSY_HLT_InclusiveHT::triggerPath_
std::string triggerPath_
Definition: SUSY_HLT_InclusiveHT.h:46
SUSY_HLT_InclusiveHT::theCaloJetCollection_
edm::EDGetTokenT< reco::CaloJetCollection > theCaloJetCollection_
Definition: SUSY_HLT_InclusiveHT.h:42
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
SUSY_HLT_InclusiveHT::theTrigSummary_
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
Definition: SUSY_HLT_InclusiveHT.h:44
SUSY_HLT_InclusiveHT::triggerFilter_
edm::InputTag triggerFilter_
Definition: SUSY_HLT_InclusiveHT.h:48
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HLTMuonOfflineAnalyzer_cfi.triggerSummary
triggerSummary
Definition: HLTMuonOfflineAnalyzer_cfi.py:86
edm::Handle< reco::PFMETCollection >
SUSY_HLT_InclusiveHT::triggerResults_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Definition: SUSY_HLT_InclusiveHT.h:43
SUSY_HLT_InclusiveHT::h_pfMetPhi
MonitorElement * h_pfMetPhi
Definition: SUSY_HLT_InclusiveHT.h:54
MakerMacros.h
trigger::TriggerObject::pt
float pt() const
Definition: TriggerObject.h:52
SUSY_HLT_InclusiveHT::h_caloJetPt
MonitorElement * h_caloJetPt
Definition: SUSY_HLT_InclusiveHT.h:60
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
SUSY_HLT_InclusiveHT::SUSY_HLT_InclusiveHT
SUSY_HLT_InclusiveHT(const edm::ParameterSet &ps)
Definition: SUSY_HLT_InclusiveHT.cc:8
SUSY_HLT_InclusiveHT::h_pfMetTurnOn_den
MonitorElement * h_pfMetTurnOn_den
Definition: SUSY_HLT_InclusiveHT.h:70
SUSY_HLT_InclusiveHT::h_triggerMetPt
MonitorElement * h_triggerMetPt
Definition: SUSY_HLT_InclusiveHT.h:66
ExoticaDQM_cfi.pfJetCollection
pfJetCollection
Definition: ExoticaDQM_cfi.py:19
SUSY_HLT_InclusiveHT::~SUSY_HLT_InclusiveHT
~SUSY_HLT_InclusiveHT() override
Definition: SUSY_HLT_InclusiveHT.cc:23
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
SUSY_HLT_InclusiveHT::triggerPathAuxiliaryForHadronic_
std::string triggerPathAuxiliaryForHadronic_
Definition: SUSY_HLT_InclusiveHT.h:47
trigger::TriggerObject
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
SUSY_HLT_InclusiveHT::h_pfMet
MonitorElement * h_pfMet
Definition: SUSY_HLT_InclusiveHT.h:53
SUSY_HLT_InclusiveHT::h_caloJetPhi
MonitorElement * h_caloJetPhi
Definition: SUSY_HLT_InclusiveHT.h:62
SUSY_HLT_InclusiveHT::h_pfHT
MonitorElement * h_pfHT
Definition: SUSY_HLT_InclusiveHT.h:55
SUSY_HLT_InclusiveHT::h_pfJetPhi
MonitorElement * h_pfJetPhi
Definition: SUSY_HLT_InclusiveHT.h:59
edm::ParameterSet
Definition: ParameterSet.h:47
trigger::TriggerObjectCollection
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
trigger::TriggerObject::id
int id() const
getters
Definition: TriggerObject.h:51
SUSY_HLT_InclusiveHT::h_pfHTTurnOn_den
MonitorElement * h_pfHTTurnOn_den
Definition: SUSY_HLT_InclusiveHT.h:72
TriggerNames.h
SUSY_HLT_InclusiveHT::h_triggerMetPhi
MonitorElement * h_triggerMetPhi
Definition: SUSY_HLT_InclusiveHT.h:67
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SUSY_HLT_InclusiveHT::thePfMETCollection_
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
Definition: SUSY_HLT_InclusiveHT.h:40
TriggerObject.h
SUSY_HLT_InclusiveHT::h_pfHTTurnOn_num
MonitorElement * h_pfHTTurnOn_num
Definition: SUSY_HLT_InclusiveHT.h:71
B2GDQM_cfi.pfMETCollection
pfMETCollection
Definition: B2GDQM_cfi.py:27
Frameworkfwd.h
SUSY_HLT_InclusiveHT
Definition: SUSY_HLT_InclusiveHT.h:26
edm::TriggerNames
Definition: TriggerNames.h:55
SUSY_HLT_InclusiveHT::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: SUSY_HLT_InclusiveHT.cc:27
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::implementation::IBooker
Definition: DQMStore.h:43
SUSY_HLT_InclusiveHT::h_caloHT
MonitorElement * h_caloHT
Definition: SUSY_HLT_InclusiveHT.h:56
SUSY_HLT_InclusiveHT::h_pfMetTurnOn_num
MonitorElement * h_pfMetTurnOn_num
Definition: SUSY_HLT_InclusiveHT.h:69
SUSY_HLT_InclusiveHT::h_pfJetPt
MonitorElement * h_pfJetPt
Definition: SUSY_HLT_InclusiveHT.h:57
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Event
Definition: Event.h:73
pdwgLeptonRecoSkim_cfi.caloJetCollection
caloJetCollection
Definition: pdwgLeptonRecoSkim_cfi.py:8
SUSY_HLT_InclusiveHT::h_triggerHT
MonitorElement * h_triggerHT
Definition: SUSY_HLT_InclusiveHT.h:68
edm::InputTag
Definition: InputTag.h:15
SUSY_HLT_InclusiveHT::h_caloJetEta
MonitorElement * h_caloJetEta
Definition: SUSY_HLT_InclusiveHT.h:61
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
SUSY_HLT_InclusiveHT::thePfJetCollection_
edm::EDGetTokenT< reco::PFJetCollection > thePfJetCollection_
Definition: SUSY_HLT_InclusiveHT.h:41
SUSY_HLT_InclusiveHT::h_pfJetEta
MonitorElement * h_pfJetEta
Definition: SUSY_HLT_InclusiveHT.h:58
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37