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 9 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_.

10 {
11  edm::LogInfo("SUSY_HLT_PhotonHT") << "Constructor SUSY_HLT_PhotonHT::SUSY_HLT_PhotonHT " << std::endl;
12  // Get parameters from configuration file
13  theTrigSummary_ = consumes<trigger::TriggerEvent>(ps.getParameter<edm::InputTag>("trigSummary"));
14  thePfMETCollection_ = consumes<reco::PFMETCollection>(ps.getParameter<edm::InputTag>("pfMETCollection"));
15  thePhotonCollection_ = consumes<reco::PhotonCollection>(ps.getParameter<edm::InputTag>("photonCollection"));
16  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResults"));
17  triggerPath_ = ps.getParameter<std::string>("TriggerPath");
18  triggerPathAuxiliaryForHadronic_ = ps.getParameter<std::string>("TriggerPathAuxiliaryForHadronic");
19  triggerFilterPhoton_ = ps.getParameter<edm::InputTag>("TriggerFilterPhoton");
20  triggerFilterHt_ = ps.getParameter<edm::InputTag>("TriggerFilterHt");
21  ptThrOffline_ = ps.getUntrackedParameter<double>("ptThrOffline");
22  htThrOffline_ = ps.getUntrackedParameter<double>("htThrOffline");
23 }
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 25 of file SUSY_HLT_PhotonHT.cc.

26 {
27  edm::LogInfo("SUSY_HLT_PhotonHT") << "Destructor SUSY_HLT_PhotonHT::~SUSY_HLT_PhotonHT " << std::endl;
28 }

Member Function Documentation

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

Definition at line 43 of file SUSY_HLT_PhotonHT.cc.

References edm::HLTGlobalStatus::accept(), MonitorElement::Fill(), HcalObjRepresent::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().

43  {
44  edm::LogInfo("SUSY_HLT_PhotonHT") << "SUSY_HLT_PhotonHT::analyze" << std::endl;
45 
46 
47  //-------------------------------
48  //--- MET / HT
49  //-------------------------------
50  edm::Handle<reco::PFMETCollection> pfMETCollection;
51  e.getByToken(thePfMETCollection_, pfMETCollection);
52  if ( !pfMETCollection.isValid() ){
53  edm::LogError ("SUSY_HLT_PhotonHT") << "invalid met collection" << "\n";
54  return;
55  }
56  //-------------------------------
57  //--- Photon
58  //-------------------------------
60  e.getByToken (thePhotonCollection_, photonCollection);
61  if ( !photonCollection.isValid() ){
62  edm::LogError ("SUSY_HLT_PhotonHT") << "invalid egamma collection" << "\n";
63  return;
64  }
65 
66  //check what is in the menu
68  e.getByToken(triggerResults_,hltresults);
69  if(!hltresults.isValid()){
70  edm::LogError ("SUSY_HLT_PhotonHT") << "invalid collection: TriggerResults" << "\n";
71  return;
72  }
73 
74  //-------------------------------
75  //--- Trigger
76  //-------------------------------
78  e.getByToken(theTrigSummary_, triggerSummary);
79  if(!triggerSummary.isValid()) {
80  edm::LogError ("SUSY_HLT_PhotonHT") << "invalid collection: TriggerSummary" << "\n";
81  return;
82  }
83 
84  // get online objects
86 
87  // get the photon object
88  size_t filterIndexPhoton = triggerSummary->filterIndex( triggerFilterPhoton_ );
89  if( filterIndexPhoton < triggerSummary->sizeFilters() ) {
90  const trigger::Keys& keys = triggerSummary->filterKeys( filterIndexPhoton );
91  if( !keys.empty() ) {
92  // take the leading photon
93  float pt = triggerObjects[ keys[0] ].pt();
94  h_photonPt->Fill( pt );
95  }
96  }
97 
98  // get ht
99  size_t filterIndexHt = triggerSummary->filterIndex( triggerFilterHt_ );
100  if( filterIndexHt < triggerSummary->sizeFilters() ) {
101  const trigger::Keys& keys = triggerSummary->filterKeys( filterIndexHt );
102  if( !keys.empty() ) {
103  float ht = triggerObjects[ keys[0] ].pt();
104  h_ht->Fill( ht );
105  }
106  }
107 
108  bool hasFired = false, hasFiredAuxiliaryForHadronicLeg=false;
109  const edm::TriggerNames& trigNames = e.triggerNames(*hltresults);
110  unsigned int numTriggers = trigNames.size();
111  for( unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ){
112  if (trigNames.triggerName(hltIndex).find(triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex)) hasFired = true;
113  if (trigNames.triggerName(hltIndex).find(triggerPathAuxiliaryForHadronic_) != std::string::npos && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex)) hasFiredAuxiliaryForHadronicLeg = true;
114  }
115 
116  if(hasFiredAuxiliaryForHadronicLeg || !e.isRealData()) {
117  float recoPhotonPt = !photonCollection->empty() ? photonCollection->begin()->et() : 0;
118  float recoHt = !pfMETCollection->empty() ? pfMETCollection->begin()->et() : 0;
119 
120  if(hasFired){
121  if( !photonCollection->empty() && recoHt >= htThrOffline_ ) h_photonTurnOn_num -> Fill( recoPhotonPt );
122  if( !pfMETCollection->empty() && recoPhotonPt >= ptThrOffline_ ) h_htTurnOn_num -> Fill( recoHt );
123  }
124  if( !photonCollection->empty() && recoHt >= htThrOffline_ ) h_photonTurnOn_den -> Fill( recoPhotonPt );
125  if( !pfMETCollection->empty() && recoPhotonPt >= ptThrOffline_ ) h_htTurnOn_den -> Fill( recoPhotonPt );
126  }
127 
128 }
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:39
void Fill(long long x)
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
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:27
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 35 of file SUSY_HLT_PhotonHT.cc.

References bookHistos().

36 {
37  edm::LogInfo("SUSY_HLT_PhotonHT") << "SUSY_HLT_PhotonHT::bookHistograms" << std::endl;
38  //book at beginRun
39  bookHistos(ibooker_);
40 }
void bookHistos(DQMStore::IBooker &)
void SUSY_HLT_PhotonHT::bookHistos ( DQMStore::IBooker ibooker_)
private

Definition at line 137 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 30 of file SUSY_HLT_PhotonHT.cc.

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

Definition at line 132 of file SUSY_HLT_PhotonHT.cc.

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

Member Data Documentation

MonitorElement* SUSY_HLT_PhotonHT::h_ht
private

Definition at line 61 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_htTurnOn_den
private

Definition at line 63 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_htTurnOn_num
private

Definition at line 62 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_photonPt
private

Definition at line 60 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_photonTurnOn_den
private

Definition at line 65 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_PhotonHT::h_photonTurnOn_num
private

Definition at line 64 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and bookHistos().

double SUSY_HLT_PhotonHT::htThrOffline_
private

Definition at line 57 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

double SUSY_HLT_PhotonHT::ptThrOffline_
private

Definition at line 56 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 47 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 48 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 50 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

edm::InputTag SUSY_HLT_PhotonHT::triggerFilterHt_
private

Definition at line 55 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

edm::InputTag SUSY_HLT_PhotonHT::triggerFilterPhoton_
private

Definition at line 54 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().

std::string SUSY_HLT_PhotonHT::triggerPath_
private

Definition at line 52 of file SUSY_HLT_PhotonHT.h.

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

std::string SUSY_HLT_PhotonHT::triggerPathAuxiliaryForHadronic_
private

Definition at line 53 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 49 of file SUSY_HLT_PhotonHT.h.

Referenced by analyze(), and SUSY_HLT_PhotonHT().