CMS 3D CMS Logo

SUSY_HLT_PhotonMET.cc
Go to the documentation of this file.
7 
9  edm::LogInfo("SUSY_HLT_PhotonMET") << "Constructor SUSY_HLT_PhotonMET::SUSY_HLT_PhotonMET " << std::endl;
10  // Get parameters from configuration file
11  thePfMETCollection_ = consumes<reco::PFMETCollection>(ps.getParameter<edm::InputTag>("pfMETCollection"));
12  thePhotonCollection_ = consumes<reco::PhotonCollection>(ps.getParameter<edm::InputTag>("photonCollection"));
13  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResults"));
14  triggerPath_ = ps.getParameter<std::string>("TriggerPath");
15  triggerPathBase_ = ps.getParameter<std::string>("TriggerPathBase");
16  ptThrOffline_ = ps.getUntrackedParameter<double>("ptThrOffline");
17  metThrOffline_ = ps.getUntrackedParameter<double>("metThrOffline");
18 }
19 
21  edm::LogInfo("SUSY_HLT_PhotonMET") << "Destructor SUSY_HLT_PhotonMET::~SUSY_HLT_PhotonMET " << std::endl;
22 }
23 
25  edm::LogInfo("SUSY_HLT_PhotonMET") << "SUSY_HLT_PhotonMET::bookHistograms" << std::endl;
26  // book at beginRun
27  bookHistos(ibooker_);
28 }
29 
31  edm::LogInfo("SUSY_HLT_PhotonMET") << "SUSY_HLT_PhotonMET::analyze" << std::endl;
32 
33  //-------------------------------
34  //--- MET
35  //-------------------------------
38  if (!pfMETCollection.isValid()) {
39  edm::LogError("SUSY_HLT_PhotonMET") << "invalid met collection"
40  << "\n";
41  return;
42  }
43  //-------------------------------
44  //--- Photon
45  //-------------------------------
48  if (!photonCollection.isValid()) {
49  edm::LogError("SUSY_HLT_PhotonMET") << "invalid egamma collection"
50  << "\n";
51  return;
52  }
53 
54  // check what is in the menu
56  e.getByToken(triggerResults_, hltresults);
57  if (!hltresults.isValid()) {
58  edm::LogError("SUSY_HLT_PhotonMET") << "invalid collection: TriggerResults"
59  << "\n";
60  return;
61  }
62 
63  // use only events with leading photon in barrel
64  if (photonCollection->empty() || abs(photonCollection->begin()->superCluster()->eta()) > 1.4442)
65  return;
66 
67  // get reco photon and met
68  float const recoPhotonPt = !photonCollection->empty() ? photonCollection->begin()->et() : 0;
69  float const recoMET = !pfMETCollection->empty() ? pfMETCollection->begin()->et() : 0;
70  h_recoPhotonPt->Fill(recoPhotonPt);
71  h_recoMet->Fill(recoMET);
72 
73  // the actual trigger efficiencies
74  bool hasFired = false, hasFiredBaseTrigger = false;
75  edm::TriggerNames const &trigNames = e.triggerNames(*hltresults);
76  unsigned int const numTriggers = trigNames.size();
77  for (unsigned int hltIndex = 0; hltIndex < numTriggers; ++hltIndex) {
78  if (trigNames.triggerName(hltIndex).find(triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) &&
79  hltresults->accept(hltIndex))
80  hasFired = true;
81  if (trigNames.triggerName(hltIndex).find(triggerPathBase_) != std::string::npos && hltresults->wasrun(hltIndex) &&
82  hltresults->accept(hltIndex))
83  hasFiredBaseTrigger = true;
84  }
85 
86  if (hasFiredBaseTrigger || !e.isRealData()) {
87  // passed base trigger
88  if (recoPhotonPt > ptThrOffline_)
89  h_metTurnOn_den->Fill(recoMET);
90  if (recoMET > metThrOffline_)
91  h_photonTurnOn_den->Fill(recoPhotonPt);
92  if (hasFired) {
93  // passed base and signal trigger
94  if (recoPhotonPt > ptThrOffline_)
95  h_metTurnOn_num->Fill(recoMET);
96  if (recoMET > metThrOffline_)
97  h_photonTurnOn_num->Fill(recoPhotonPt);
98  }
99  }
100 }
101 
103  ibooker_.cd();
104  ibooker_.setCurrentFolder("HLT/SUSYBSM/" + triggerPath_);
105 
106  // offline quantities
107  h_recoPhotonPt = ibooker_.book1D("recoPhotonPt", "reco Photon transverse momentum; p_{T} (GeV)", 20, 0, 1000);
108  h_recoMet = ibooker_.book1D("recoMet", "reco Missing transverse energy;E_{T}^{miss} (GeV)", 20, 0, 1000);
109  h_metTurnOn_num = ibooker_.book1D("pfMetTurnOn_num", "PF MET Turn On Numerator", 20, 0, 500);
110  h_metTurnOn_den = ibooker_.book1D("pfMetTurnOn_den", "PF MET Turn On Denominator", 20, 0, 500);
111  h_photonTurnOn_num = ibooker_.book1D("photonTurnOn_num", "Photon Turn On Numerator", 20, 0, 1000);
112  h_photonTurnOn_den = ibooker_.book1D("photonTurnOn_den", "Photon Turn On Denominator", 20, 0, 1000);
113 
114  ibooker_.cd();
115 }
116 
117 // define this as a plug-in
MessageLogger.h
trigNames
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:57
SUSY_HLT_PhotonMET::h_recoMet
MonitorElement * h_recoMet
Definition: SUSY_HLT_PhotonMET.h:56
SUSY_HLT_PhotonMET::h_photonTurnOn_den
MonitorElement * h_photonTurnOn_den
Definition: SUSY_HLT_PhotonMET.h:60
HLTBitAnalyser_cfi.hltresults
hltresults
Definition: HLTBitAnalyser_cfi.py:13
edm::Run
Definition: Run.h:45
SUSY_HLT_PhotonMET
Definition: SUSY_HLT_PhotonMET.h:29
SUSY_HLT_PhotonMET::triggerPathBase_
std::string triggerPathBase_
Definition: SUSY_HLT_PhotonMET.h:48
SUSY_HLT_PhotonMET::h_metTurnOn_num
MonitorElement * h_metTurnOn_num
Definition: SUSY_HLT_PhotonMET.h:57
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< reco::PFMETCollection >
SUSY_HLT_PhotonMET::triggerPath_
std::string triggerPath_
Definition: SUSY_HLT_PhotonMET.h:47
MakerMacros.h
SUSY_HLT_PhotonMET::metThrOffline_
double metThrOffline_
Definition: SUSY_HLT_PhotonMET.h:52
SUSY_HLT_PhotonMET::thePhotonCollection_
edm::EDGetTokenT< reco::PhotonCollection > thePhotonCollection_
Definition: SUSY_HLT_PhotonMET.h:44
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
SUSY_HLT_PhotonMET::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: SUSY_HLT_PhotonMET.cc:24
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
SUSY_HLT_PhotonMET::bookHistos
void bookHistos(DQMStore::IBooker &)
Definition: SUSY_HLT_PhotonMET.cc:102
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SUSY_HLT_PhotonMET::h_recoPhotonPt
MonitorElement * h_recoPhotonPt
Definition: SUSY_HLT_PhotonMET.h:55
SUSY_HLT_PhotonMET::h_metTurnOn_den
MonitorElement * h_metTurnOn_den
Definition: SUSY_HLT_PhotonMET.h:58
edm::ParameterSet
Definition: ParameterSet.h:47
SUSY_HLT_PhotonMET.h
TriggerNames.h
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TriggerObject.h
SUSY_HLT_PhotonMET::ptThrOffline_
double ptThrOffline_
Definition: SUSY_HLT_PhotonMET.h:51
B2GDQM_cfi.pfMETCollection
pfMETCollection
Definition: B2GDQM_cfi.py:27
SUSY_HLT_PhotonMET::triggerResults_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Definition: SUSY_HLT_PhotonMET.h:45
SUSY_HLT_PhotonMET::SUSY_HLT_PhotonMET
SUSY_HLT_PhotonMET(const edm::ParameterSet &ps)
Definition: SUSY_HLT_PhotonMET.cc:8
Frameworkfwd.h
edm::TriggerNames
Definition: TriggerNames.h:55
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::implementation::IBooker
Definition: DQMStore.h:43
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SUSY_HLT_PhotonMET::analyze
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition: SUSY_HLT_PhotonMET.cc:30
ExoticaDQM_cfi.photonCollection
photonCollection
Definition: ExoticaDQM_cfi.py:17
SUSY_HLT_PhotonMET::h_photonTurnOn_num
MonitorElement * h_photonTurnOn_num
Definition: SUSY_HLT_PhotonMET.h:59
edm::Event
Definition: Event.h:73
SUSY_HLT_PhotonMET::thePfMETCollection_
edm::EDGetTokenT< reco::PFMETCollection > thePfMETCollection_
Definition: SUSY_HLT_PhotonMET.h:43
edm::InputTag
Definition: InputTag.h:15
SUSY_HLT_PhotonMET::~SUSY_HLT_PhotonMET
~SUSY_HLT_PhotonMET() override
Definition: SUSY_HLT_PhotonMET.cc:20
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
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37