CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
SUSY_HLT_PhotonHT Class Reference

#include <SUSY_HLT_PhotonHT.h>

Inheritance diagram for SUSY_HLT_PhotonHT:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 SUSY_HLT_PhotonHT (const edm::ParameterSet &ps)
 
 ~SUSY_HLT_PhotonHT () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 

Private Member Functions

void bookHistos (DQMStore::IBooker &)
 

Private Attributes

MonitorElementh_ht
 
MonitorElementh_htTurnOn_den
 
MonitorElementh_htTurnOn_num
 
MonitorElementh_photonPt
 
MonitorElementh_photonTurnOn_den
 
MonitorElementh_photonTurnOn_num
 
double htThrOffline_
 
double ptThrOffline_
 
edm::EDGetTokenT< reco::PFMETCollectionthePfMETCollection_
 
edm::EDGetTokenT< reco::PhotonCollectionthePhotonCollection_
 
edm::EDGetTokenT< trigger::TriggerEventtheTrigSummary_
 
edm::InputTag triggerFilterHt_
 
edm::InputTag triggerFilterPhoton_
 
std::string triggerPath_
 
std::string triggerPathAuxiliaryForHadronic_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResults_
 

Detailed Description

Definition at line 30 of file SUSY_HLT_PhotonHT.h.

Constructor & Destructor Documentation

SUSY_HLT_PhotonHT::SUSY_HLT_PhotonHT ( const edm::ParameterSet ps)

Definition at line 8 of file SUSY_HLT_PhotonHT.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), htThrOffline_, ptThrOffline_, AlCaHLTBitMon_QueryRunRegistry::string, thePfMETCollection_, thePhotonCollection_, theTrigSummary_, triggerFilterHt_, triggerFilterPhoton_, triggerPath_, triggerPathAuxiliaryForHadronic_, and triggerResults_.

8  {
9  edm::LogInfo("SUSY_HLT_PhotonHT") << "Constructor SUSY_HLT_PhotonHT::SUSY_HLT_PhotonHT " << 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  thePhotonCollection_ = consumes<reco::PhotonCollection>(ps.getParameter<edm::InputTag>("photonCollection"));
14  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResults"));
15  triggerPath_ = ps.getParameter<std::string>("TriggerPath");
16  triggerPathAuxiliaryForHadronic_ = ps.getParameter<std::string>("TriggerPathAuxiliaryForHadronic");
17  triggerFilterPhoton_ = ps.getParameter<edm::InputTag>("TriggerFilterPhoton");
18  triggerFilterHt_ = ps.getParameter<edm::InputTag>("TriggerFilterHt");
19  ptThrOffline_ = ps.getUntrackedParameter<double>("ptThrOffline");
20  htThrOffline_ = ps.getUntrackedParameter<double>("htThrOffline");
21 }
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag triggerFilterHt_
edm::InputTag triggerFilterPhoton_
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
std::string triggerPathAuxiliaryForHadronic_
std::string triggerPath_
edm::EDGetTokenT< reco::PhotonCollection > thePhotonCollection_
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
SUSY_HLT_PhotonHT::~SUSY_HLT_PhotonHT ( )
override

Definition at line 23 of file SUSY_HLT_PhotonHT.cc.

23  {
24  edm::LogInfo("SUSY_HLT_PhotonHT") << "Destructor SUSY_HLT_PhotonHT::~SUSY_HLT_PhotonHT " << std::endl;
25 }

Member Function Documentation

void SUSY_HLT_PhotonHT::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 37 of file SUSY_HLT_PhotonHT.cc.

References edm::HLTGlobalStatus::accept(), MonitorElement::Fill(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), edm::Event::getByToken(), trigger::TriggerEvent::getObjects(), h_ht, h_htTurnOn_den, h_htTurnOn_num, h_photonPt, h_photonTurnOn_den, h_photonTurnOn_num, htThrOffline_, edm::EventBase::isRealData(), edm::HandleBase::isValid(), relativeConstraints::keys, correctedPhotons_cfi::photonCollection, EnergyCorrector::pt, ptThrOffline_, edm::TriggerNames::size(), thePfMETCollection_, thePhotonCollection_, theTrigSummary_, triggerFilterHt_, triggerFilterPhoton_, edm::TriggerNames::triggerName(), edm::Event::triggerNames(), TriggerAnalyzer::triggerObjects, triggerPath_, triggerPathAuxiliaryForHadronic_, triggerResults_, trigNames, and edm::HLTGlobalStatus::wasrun().

37  {
38  edm::LogInfo("SUSY_HLT_PhotonHT") << "SUSY_HLT_PhotonHT::analyze" << std::endl;
39 
40  //-------------------------------
41  //--- MET / HT
42  //-------------------------------
43  edm::Handle<reco::PFMETCollection> pfMETCollection;
44  e.getByToken(thePfMETCollection_, pfMETCollection);
45  if (!pfMETCollection.isValid()) {
46  edm::LogError("SUSY_HLT_PhotonHT") << "invalid met collection"
47  << "\n";
48  return;
49  }
50  //-------------------------------
51  //--- Photon
52  //-------------------------------
54  e.getByToken(thePhotonCollection_, photonCollection);
55  if (!photonCollection.isValid()) {
56  edm::LogError("SUSY_HLT_PhotonHT") << "invalid egamma collection"
57  << "\n";
58  return;
59  }
60 
61  // check what is in the menu
63  e.getByToken(triggerResults_, hltresults);
64  if (!hltresults.isValid()) {
65  edm::LogError("SUSY_HLT_PhotonHT") << "invalid collection: TriggerResults"
66  << "\n";
67  return;
68  }
69 
70  //-------------------------------
71  //--- Trigger
72  //-------------------------------
74  e.getByToken(theTrigSummary_, triggerSummary);
75  if (!triggerSummary.isValid()) {
76  edm::LogError("SUSY_HLT_PhotonHT") << "invalid collection: TriggerSummary"
77  << "\n";
78  return;
79  }
80 
81  // get online objects
83 
84  // get the photon object
85  size_t filterIndexPhoton = triggerSummary->filterIndex(triggerFilterPhoton_);
86  if (filterIndexPhoton < triggerSummary->sizeFilters()) {
87  const trigger::Keys &keys = triggerSummary->filterKeys(filterIndexPhoton);
88  if (!keys.empty()) {
89  // take the leading photon
90  float pt = triggerObjects[keys[0]].pt();
91  h_photonPt->Fill(pt);
92  }
93  }
94 
95  // get ht
96  size_t filterIndexHt = triggerSummary->filterIndex(triggerFilterHt_);
97  if (filterIndexHt < triggerSummary->sizeFilters()) {
98  const trigger::Keys &keys = triggerSummary->filterKeys(filterIndexHt);
99  if (!keys.empty()) {
100  float ht = triggerObjects[keys[0]].pt();
101  h_ht->Fill(ht);
102  }
103  }
104 
105  bool hasFired = false, hasFiredAuxiliaryForHadronicLeg = false;
106  const edm::TriggerNames &trigNames = e.triggerNames(*hltresults);
107  unsigned int numTriggers = trigNames.size();
108  for (unsigned int hltIndex = 0; hltIndex < numTriggers; ++hltIndex) {
109  if (trigNames.triggerName(hltIndex).find(triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) &&
110  hltresults->accept(hltIndex))
111  hasFired = true;
112  if (trigNames.triggerName(hltIndex).find(triggerPathAuxiliaryForHadronic_) != std::string::npos &&
113  hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex))
114  hasFiredAuxiliaryForHadronicLeg = true;
115  }
116 
117  if (hasFiredAuxiliaryForHadronicLeg || !e.isRealData()) {
118  float recoPhotonPt = !photonCollection->empty() ? photonCollection->begin()->et() : 0;
119  float recoHt = !pfMETCollection->empty() ? pfMETCollection->begin()->et() : 0;
120 
121  if (hasFired) {
122  if (!photonCollection->empty() && recoHt >= htThrOffline_)
123  h_photonTurnOn_num->Fill(recoPhotonPt);
124  if (!pfMETCollection->empty() && recoPhotonPt >= ptThrOffline_)
125  h_htTurnOn_num->Fill(recoHt);
126  }
127  if (!photonCollection->empty() && recoHt >= htThrOffline_)
128  h_photonTurnOn_den->Fill(recoPhotonPt);
129  if (!pfMETCollection->empty() && recoPhotonPt >= ptThrOffline_)
130  h_htTurnOn_den->Fill(recoPhotonPt);
131  }
132 }
MonitorElement * h_photonTurnOn_den
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
bool wasrun() const
Was at least one path run?
MonitorElement * h_ht
edm::InputTag triggerFilterHt_
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
edm::InputTag triggerFilterPhoton_
Strings::size_type size() const
Definition: TriggerNames.cc:31
void Fill(long long x)
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
MonitorElement * h_htTurnOn_den
MonitorElement * h_photonPt
bool isValid() const
Definition: HandleBase.h:74
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
MonitorElement * h_htTurnOn_num
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:22
std::vector< size_type > Keys
std::string triggerPathAuxiliaryForHadronic_
MonitorElement * h_photonTurnOn_num
std::string triggerPath_
edm::EDGetTokenT< reco::PhotonCollection > thePhotonCollection_
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
void SUSY_HLT_PhotonHT::bookHistograms ( DQMStore::IBooker ibooker_,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 31 of file SUSY_HLT_PhotonHT.cc.

References bookHistos().

31  {
32  edm::LogInfo("SUSY_HLT_PhotonHT") << "SUSY_HLT_PhotonHT::bookHistograms" << std::endl;
33  // book at beginRun
34  bookHistos(ibooker_);
35 }
void bookHistos(DQMStore::IBooker &)
void SUSY_HLT_PhotonHT::bookHistos ( DQMStore::IBooker ibooker_)
private

Definition at line 138 of file SUSY_HLT_PhotonHT.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::cd(), DEFINE_FWK_MODULE, h_ht, h_htTurnOn_den, h_htTurnOn_num, h_photonPt, h_photonTurnOn_den, h_photonTurnOn_num, DQMStore::IBooker::setCurrentFolder(), and triggerPath_.

Referenced by bookHistograms().

138  {
139  ibooker_.cd();
140  ibooker_.setCurrentFolder("HLT/SUSYBSM/" + triggerPath_);
141 
142  // offline quantities
143  h_photonPt = ibooker_.book1D("photonPt", "Photon transverse momentum; p_{T} (GeV)", 20, 0, 500);
144  h_ht = ibooker_.book1D("ht", "Hadronic activity;H_{T} (GeV)", 20, 0, 2000);
145  h_htTurnOn_num = ibooker_.book1D("pfHtTurnOn_num", "PF HT Turn On Numerator", 20, 300, 800);
146  h_htTurnOn_den = ibooker_.book1D("pfHtTurnOn_den", "PF HT Turn On Denominator", 20, 300, 800);
147  h_photonTurnOn_num = ibooker_.book1D("photonTurnOn_num", "Photon Turn On Numerator", 20, 70, 130);
148  h_photonTurnOn_den = ibooker_.book1D("photonTurnOn_den", "Photon Turn On Denominator", 20, 70, 130);
149 
150  ibooker_.cd();
151 }
MonitorElement * h_photonTurnOn_den
MonitorElement * h_ht
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * h_htTurnOn_den
MonitorElement * h_photonPt
MonitorElement * h_htTurnOn_num
MonitorElement * h_photonTurnOn_num
std::string triggerPath_
void SUSY_HLT_PhotonHT::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 27 of file SUSY_HLT_PhotonHT.cc.

27  {
28  edm::LogInfo("SUSY_HLT_PhotonHT") << "SUSY_HLT_PhotonHT::beginRun" << std::endl;
29 }
void SUSY_HLT_PhotonHT::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 134 of file SUSY_HLT_PhotonHT.cc.

134  {
135  edm::LogInfo("SUSY_HLT_PhotonHT") << "SUSY_HLT_PhotonHT::endRun" << std::endl;
136 }

Member Data Documentation

MonitorElement* SUSY_HLT_PhotonHT::h_ht
private

Definition at line 60 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_htTurnOn_den
private

Definition at line 62 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_htTurnOn_num
private

Definition at line 61 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_photonPt
private

Definition at line 59 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_photonTurnOn_den
private

Definition at line 64 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_photonTurnOn_num
private

Definition at line 63 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

double SUSY_HLT_PhotonHT::htThrOffline_
private

Definition at line 56 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

double SUSY_HLT_PhotonHT::ptThrOffline_
private

Definition at line 55 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

edm::EDGetTokenT<reco::PFMETCollection> SUSY_HLT_PhotonHT::thePfMETCollection_
private

Definition at line 46 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

edm::EDGetTokenT<reco::PhotonCollection> SUSY_HLT_PhotonHT::thePhotonCollection_
private

Definition at line 47 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

edm::EDGetTokenT<trigger::TriggerEvent> SUSY_HLT_PhotonHT::theTrigSummary_
private

Definition at line 49 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

edm::InputTag SUSY_HLT_PhotonHT::triggerFilterHt_
private

Definition at line 54 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

edm::InputTag SUSY_HLT_PhotonHT::triggerFilterPhoton_
private

Definition at line 53 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

std::string SUSY_HLT_PhotonHT::triggerPath_
private

Definition at line 51 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), bookHistos(), and SUSY_HLT_PhotonHT().

std::string SUSY_HLT_PhotonHT::triggerPathAuxiliaryForHadronic_
private

Definition at line 52 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

edm::EDGetTokenT<edm::TriggerResults> SUSY_HLT_PhotonHT::triggerResults_
private

Definition at line 48 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().