CMS 3D CMS Logo

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

#include <SUSY_HLT_Electron_BJet.h>

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

Public Member Functions

 SUSY_HLT_Electron_BJet (const edm::ParameterSet &ps)
 
 ~SUSY_HLT_Electron_BJet () 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

double etaThrJet_
 
HLTConfigProvider fHltConfig
 
MonitorElementh_triggerEleEta
 
MonitorElementh_triggerElePhi
 
MonitorElementh_triggerElePt
 
MonitorElementh_triggerJetEta
 
MonitorElementh_triggerJetPhi
 
MonitorElementh_triggerJetPt
 
std::string HLTProcess_
 
double ptThrJet_
 
edm::EDGetTokenT< reco::CaloJetCollectiontheCaloJetCollection_
 
edm::EDGetTokenT< reco::GsfElectronCollectiontheElectronCollection_
 
edm::EDGetTokenT< reco::PFJetCollectionthePfJetCollection_
 
edm::EDGetTokenT< trigger::TriggerEventtheTrigSummary_
 
edm::InputTag triggerFilterEle_
 
edm::InputTag triggerFilterJet_
 
std::string triggerPath_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResults_
 

Detailed Description

Definition at line 31 of file SUSY_HLT_Electron_BJet.h.

Constructor & Destructor Documentation

SUSY_HLT_Electron_BJet::SUSY_HLT_Electron_BJet ( const edm::ParameterSet ps)

Definition at line 9 of file SUSY_HLT_Electron_BJet.cc.

References etaThrJet_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLTProcess_, ptThrJet_, AlCaHLTBitMon_QueryRunRegistry::string, theCaloJetCollection_, theElectronCollection_, thePfJetCollection_, theTrigSummary_, triggerFilterEle_, triggerFilterJet_, triggerPath_, and triggerResults_.

9  {
10  edm::LogInfo("SUSY_HLT_Electron_BJet") << "Constructor SUSY_HLT_Electron_BJet::SUSY_HLT_Electron_BJet " << std::endl;
11  // Get parameters from configuration file
12  theTrigSummary_ = consumes<trigger::TriggerEvent>(ps.getParameter<edm::InputTag>("trigSummary"));
13  theElectronCollection_ = consumes<reco::GsfElectronCollection>(ps.getParameter<edm::InputTag>("ElectronCollection"));
14  thePfJetCollection_ = consumes<reco::PFJetCollection>(ps.getParameter<edm::InputTag>("pfJetCollection"));
15  theCaloJetCollection_ = consumes<reco::CaloJetCollection>(ps.getParameter<edm::InputTag>("caloJetCollection"));
16  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResults"));
17  HLTProcess_ = ps.getParameter<std::string>("HLTProcess");
18  triggerPath_ = ps.getParameter<std::string>("TriggerPath");
19  triggerFilterEle_ = ps.getParameter<edm::InputTag>("TriggerFilterEle");
20  triggerFilterJet_ = ps.getParameter<edm::InputTag>("TriggerFilterJet");
21  ptThrJet_ = ps.getUntrackedParameter<double>("PtThrJet");
22  etaThrJet_ = ps.getUntrackedParameter<double>("EtaThrJet");
23 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::GsfElectronCollection > theElectronCollection_
edm::EDGetTokenT< reco::CaloJetCollection > theCaloJetCollection_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
edm::EDGetTokenT< reco::PFJetCollection > thePfJetCollection_
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
SUSY_HLT_Electron_BJet::~SUSY_HLT_Electron_BJet ( )
override

Definition at line 25 of file SUSY_HLT_Electron_BJet.cc.

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

Member Function Documentation

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

Definition at line 60 of file SUSY_HLT_Electron_BJet.cc.

References trigger::TriggerObject::eta(), MonitorElement::Fill(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), edm::Event::getByToken(), trigger::TriggerEvent::getObjects(), h_triggerEleEta, h_triggerElePhi, h_triggerElePt, h_triggerJetEta, h_triggerJetPhi, h_triggerJetPt, trigger::TriggerObject::id(), edm::HandleBase::isValid(), relativeConstraints::keys, trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), trigger::TriggerEvent::sizeFilters(), theTrigSummary_, triggerFilterEle_, triggerFilterJet_, TriggerAnalyzer::triggerObjects, triggerResults_, and x.

60  {
61  edm::LogInfo("SUSY_HLT_Electron_BJet") << "SUSY_HLT_Electron_BJet::analyze" << std::endl;
62 
63  //-------------------------------
64  //--- Trigger
65  //-------------------------------
67  e.getByToken(triggerResults_, hltresults);
68  if (!hltresults.isValid()) {
69  edm::LogError("SUSY_HLT_Electron_BJet") << "invalid collection: TriggerResults"
70  << "\n";
71  return;
72  }
74  e.getByToken(theTrigSummary_, triggerSummary);
75  if (!triggerSummary.isValid()) {
76  edm::LogError("SUSY_HLT_Electron_BJet") << "invalid collection: TriggerSummary"
77  << "\n";
78  return;
79  }
80 
81  // get online objects
82  std::vector<float> ptElectron; //, etaElectron, phiElectron;
83  size_t filterIndex = triggerSummary->filterIndex(triggerFilterEle_);
85  if (!(filterIndex >= triggerSummary->sizeFilters())) {
86  const trigger::Keys &keys = triggerSummary->filterKeys(filterIndex);
87  for (size_t j = 0; j < keys.size(); ++j) {
88  trigger::TriggerObject foundObject = triggerObjects[keys[j]];
89  if (fabs(foundObject.id()) == 11) { // It's an electron
90 
91  bool same = false;
92  for (unsigned int x = 0; x < ptElectron.size(); x++) {
93  if (fabs(ptElectron[x] - foundObject.pt()) < 0.01)
94  same = true;
95  }
96 
97  if (!same) {
98  h_triggerElePt->Fill(foundObject.pt());
99  h_triggerEleEta->Fill(foundObject.eta());
100  h_triggerElePhi->Fill(foundObject.phi());
101  ptElectron.push_back(foundObject.pt());
102  }
103  }
104  }
105  }
106 
107  size_t filterIndex2 = triggerSummary->filterIndex(triggerFilterJet_);
108  if (!(filterIndex2 >= triggerSummary->sizeFilters())) {
109  const trigger::Keys &keys = triggerSummary->filterKeys(filterIndex2);
110  for (size_t j = 0; j < keys.size(); ++j) {
111  trigger::TriggerObject foundObject = triggerObjects[keys[j]];
112  h_triggerJetPt->Fill(foundObject.pt());
113  h_triggerJetEta->Fill(foundObject.eta());
114  h_triggerJetPhi->Fill(foundObject.phi());
115  }
116  }
117 }
int id() const
getters
Definition: TriggerObject.h:55
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
float phi() const
Definition: TriggerObject.h:58
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
float eta() const
Definition: TriggerObject.h:57
MonitorElement * h_triggerJetPhi
void Fill(long long x)
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
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
std::vector< size_type > Keys
MonitorElement * h_triggerJetEta
MonitorElement * h_triggerElePhi
MonitorElement * h_triggerEleEta
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
void SUSY_HLT_Electron_BJet::bookHistograms ( DQMStore::IBooker ibooker_,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 54 of file SUSY_HLT_Electron_BJet.cc.

References bookHistos().

54  {
55  edm::LogInfo("SUSY_HLT_Electron_BJet") << "SUSY_HLT_Electron_BJet::bookHistograms" << std::endl;
56  // book at beginRun
57  bookHistos(ibooker_);
58 }
void bookHistos(DQMStore::IBooker &)
void SUSY_HLT_Electron_BJet::bookHistos ( DQMStore::IBooker ibooker_)
private

Definition at line 123 of file SUSY_HLT_Electron_BJet.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::cd(), DEFINE_FWK_MODULE, h_triggerEleEta, h_triggerElePhi, h_triggerElePt, h_triggerJetEta, h_triggerJetPhi, h_triggerJetPt, DQMStore::IBooker::setCurrentFolder(), and triggerPath_.

Referenced by bookHistograms().

123  {
124  ibooker_.cd();
125  ibooker_.setCurrentFolder("HLT/SUSYBSM/" + triggerPath_);
126 
127  // offline quantities
128 
129  // online quantities
130  h_triggerElePt = ibooker_.book1D("triggerElePt", "Trigger Electron Pt; GeV", 50, 0.0, 500.0);
131  h_triggerEleEta = ibooker_.book1D("triggerEleEta", "Trigger Electron Eta", 20, -3.0, 3.0);
132  h_triggerElePhi = ibooker_.book1D("triggerElePhi", "Trigger Electron Phi", 20, -3.5, 3.5);
133 
134  h_triggerJetPt = ibooker_.book1D("triggerJetPt", "Trigger Jet Pt; GeV", 50, 0.0, 500.0);
135  h_triggerJetEta = ibooker_.book1D("triggerJetEta", "Trigger Jet Eta", 20, -3.0, 3.0);
136  h_triggerJetPhi = ibooker_.book1D("triggerJetPhi", "Trigger Jet Phi", 20, -3.5, 3.5);
137 
138  ibooker_.cd();
139 }
MonitorElement * h_triggerJetPhi
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * h_triggerJetEta
MonitorElement * h_triggerElePhi
MonitorElement * h_triggerEleEta
void SUSY_HLT_Electron_BJet::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  e 
)
overrideprotected

Definition at line 29 of file SUSY_HLT_Electron_BJet.cc.

References fHltConfig, spr::find(), HLTProcess_, HLTConfigProvider::init(), LogDebug, HLTConfigProvider::triggerNames(), and triggerPath_.

29  {
30  bool changed;
31 
32  if (!fHltConfig.init(run, e, HLTProcess_, changed)) {
33  edm::LogError("SUSY_HLT_Electron_BJet") << "Initialization of HLTConfigProvider failed!!";
34  return;
35  }
36 
37  bool pathFound = false;
38  const std::vector<std::string> allTrigNames = fHltConfig.triggerNames();
39  for (size_t j = 0; j < allTrigNames.size(); ++j) {
40  if (allTrigNames[j].find(triggerPath_) != std::string::npos) {
41  pathFound = true;
42  }
43  }
44 
45  if (!pathFound) {
46  LogDebug("SUSY_HLT_Electron_BJet") << "Path not found"
47  << "\n";
48  return;
49  }
50 
51  edm::LogInfo("SUSY_HLT_Electron_BJet") << "SUSY_HLT_Electron_BJet::beginRun" << std::endl;
52 }
#define LogDebug(id)
const std::vector< std::string > & triggerNames() const
names of trigger paths
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void SUSY_HLT_Electron_BJet::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 119 of file SUSY_HLT_Electron_BJet.cc.

119  {
120  edm::LogInfo("SUSY_HLT_Electron_BJet") << "SUSY_HLT_Electron_BJet::endRun" << std::endl;
121 }

Member Data Documentation

double SUSY_HLT_Electron_BJet::etaThrJet_
private

Definition at line 60 of file SUSY_HLT_Electron_BJet.h.

Referenced by SUSY_HLT_Electron_BJet().

HLTConfigProvider SUSY_HLT_Electron_BJet::fHltConfig
private

Definition at line 53 of file SUSY_HLT_Electron_BJet.h.

Referenced by dqmBeginRun().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerEleEta
private

Definition at line 64 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerElePhi
private

Definition at line 65 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerElePt
private

Definition at line 63 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerJetEta
private

Definition at line 68 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerJetPhi
private

Definition at line 69 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerJetPt
private

Definition at line 67 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

std::string SUSY_HLT_Electron_BJet::HLTProcess_
private

Definition at line 55 of file SUSY_HLT_Electron_BJet.h.

Referenced by dqmBeginRun(), and SUSY_HLT_Electron_BJet().

double SUSY_HLT_Electron_BJet::ptThrJet_
private

Definition at line 59 of file SUSY_HLT_Electron_BJet.h.

Referenced by SUSY_HLT_Electron_BJet().

edm::EDGetTokenT<reco::CaloJetCollection> SUSY_HLT_Electron_BJet::theCaloJetCollection_
private

Definition at line 49 of file SUSY_HLT_Electron_BJet.h.

Referenced by SUSY_HLT_Electron_BJet().

edm::EDGetTokenT<reco::GsfElectronCollection> SUSY_HLT_Electron_BJet::theElectronCollection_
private

Definition at line 47 of file SUSY_HLT_Electron_BJet.h.

Referenced by SUSY_HLT_Electron_BJet().

edm::EDGetTokenT<reco::PFJetCollection> SUSY_HLT_Electron_BJet::thePfJetCollection_
private

Definition at line 48 of file SUSY_HLT_Electron_BJet.h.

Referenced by SUSY_HLT_Electron_BJet().

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

Definition at line 51 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and SUSY_HLT_Electron_BJet().

edm::InputTag SUSY_HLT_Electron_BJet::triggerFilterEle_
private

Definition at line 57 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and SUSY_HLT_Electron_BJet().

edm::InputTag SUSY_HLT_Electron_BJet::triggerFilterJet_
private

Definition at line 58 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and SUSY_HLT_Electron_BJet().

std::string SUSY_HLT_Electron_BJet::triggerPath_
private

Definition at line 56 of file SUSY_HLT_Electron_BJet.h.

Referenced by bookHistos(), dqmBeginRun(), and SUSY_HLT_Electron_BJet().

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

Definition at line 50 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and SUSY_HLT_Electron_BJet().