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

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

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

Member Function Documentation

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

Definition at line 67 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.

67  {
68  edm::LogInfo("SUSY_HLT_Electron_BJet") << "SUSY_HLT_Electron_BJet::analyze" << std::endl;
69 
70  //-------------------------------
71  //--- Trigger
72  //-------------------------------
74  e.getByToken(triggerResults_,hltresults);
75  if(!hltresults.isValid()){
76  edm::LogError ("SUSY_HLT_Electron_BJet") << "invalid collection: TriggerResults" << "\n";
77  return;
78  }
80  e.getByToken(theTrigSummary_, triggerSummary);
81  if(!triggerSummary.isValid()) {
82  edm::LogError ("SUSY_HLT_Electron_BJet") << "invalid collection: TriggerSummary" << "\n";
83  return;
84  }
85 
86 
87  //get online objects
88  std::vector<float> ptElectron;//, etaElectron, phiElectron;
89  size_t filterIndex = triggerSummary->filterIndex( triggerFilterEle_ );
91  if( !(filterIndex >= triggerSummary->sizeFilters()) ){
92  const trigger::Keys& keys = triggerSummary->filterKeys( filterIndex );
93  for( size_t j = 0; j < keys.size(); ++j ){
94  trigger::TriggerObject foundObject = triggerObjects[keys[j]];
95  if(fabs(foundObject.id()) == 11){ //It's an electron
96 
97  bool same= false;
98  for(unsigned int x=0;x<ptElectron.size();x++){
99  if(fabs(ptElectron[x] - foundObject.pt()) < 0.01)
100  same = true;
101  }
102 
103  if(!same){
104  h_triggerElePt->Fill(foundObject.pt());
105  h_triggerEleEta->Fill(foundObject.eta());
106  h_triggerElePhi->Fill(foundObject.phi());
107  ptElectron.push_back(foundObject.pt());
108  }
109  }
110  }
111  }
112 
113  size_t filterIndex2 = triggerSummary->filterIndex( triggerFilterJet_ );
114  if( !(filterIndex2 >= triggerSummary->sizeFilters()) ){
115  const trigger::Keys& keys = triggerSummary->filterKeys( filterIndex2 );
116  for( size_t j = 0; j < keys.size(); ++j ){
117  trigger::TriggerObject foundObject = triggerObjects[keys[j]];
118  h_triggerJetPt->Fill(foundObject.pt());
119  h_triggerJetEta->Fill(foundObject.eta());
120  h_triggerJetPhi->Fill(foundObject.phi());
121  }
122  }
123 
124 
125 }
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 57 of file SUSY_HLT_Electron_BJet.cc.

References bookHistos().

58 {
59  edm::LogInfo("SUSY_HLT_Electron_BJet") << "SUSY_HLT_Electron_BJet::bookHistograms" << std::endl;
60  //book at beginRun
61  bookHistos(ibooker_);
62 }
void bookHistos(DQMStore::IBooker &)
void SUSY_HLT_Electron_BJet::bookHistos ( DQMStore::IBooker ibooker_)
private

Definition at line 135 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().

136 {
137  ibooker_.cd();
138  ibooker_.setCurrentFolder("HLT/SUSYBSM/" + triggerPath_);
139 
140  //offline quantities
141 
142  //online quantities
143  h_triggerElePt = ibooker_.book1D("triggerElePt", "Trigger Electron Pt; GeV", 50, 0.0, 500.0);
144  h_triggerEleEta = ibooker_.book1D("triggerEleEta", "Trigger Electron Eta", 20, -3.0, 3.0);
145  h_triggerElePhi = ibooker_.book1D("triggerElePhi", "Trigger Electron Phi", 20, -3.5, 3.5);
146 
147  h_triggerJetPt = ibooker_.book1D("triggerJetPt", "Trigger Jet Pt; GeV", 50, 0.0, 500.0);
148  h_triggerJetEta = ibooker_.book1D("triggerJetEta", "Trigger Jet Eta", 20, -3.0, 3.0);
149  h_triggerJetPhi = ibooker_.book1D("triggerJetPhi", "Trigger Jet Phi", 20, -3.5, 3.5);
150 
151 
152  ibooker_.cd();
153 }
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 31 of file SUSY_HLT_Electron_BJet.cc.

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

32 {
33 
34  bool changed;
35 
36  if (!fHltConfig.init(run, e, HLTProcess_, changed)) {
37  edm::LogError("SUSY_HLT_Electron_BJet") << "Initialization of HLTConfigProvider failed!!";
38  return;
39  }
40 
41  bool pathFound = false;
42  const std::vector<std::string> allTrigNames = fHltConfig.triggerNames();
43  for(size_t j = 0; j <allTrigNames.size(); ++j) {
44  if(allTrigNames[j].find(triggerPath_) != std::string::npos) {
45  pathFound = true;
46  }
47  }
48 
49  if(!pathFound) {
50  LogDebug("SUSY_HLT_Electron_BJet") << "Path not found" << "\n";
51  return;
52  }
53 
54  edm::LogInfo("SUSY_HLT_Electron_BJet") << "SUSY_HLT_Electron_BJet::beginRun" << std::endl;
55 }
#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 130 of file SUSY_HLT_Electron_BJet.cc.

131 {
132  edm::LogInfo("SUSY_HLT_Electron_BJet") << "SUSY_HLT_Electron_BJet::endRun" << std::endl;
133 }

Member Data Documentation

double SUSY_HLT_Electron_BJet::etaThrJet_
private

Definition at line 66 of file SUSY_HLT_Electron_BJet.h.

Referenced by SUSY_HLT_Electron_BJet().

HLTConfigProvider SUSY_HLT_Electron_BJet::fHltConfig
private

Definition at line 59 of file SUSY_HLT_Electron_BJet.h.

Referenced by dqmBeginRun().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerEleEta
private

Definition at line 70 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerElePhi
private

Definition at line 71 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerElePt
private

Definition at line 69 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerJetEta
private

Definition at line 74 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerJetPhi
private

Definition at line 75 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_Electron_BJet::h_triggerJetPt
private

Definition at line 73 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and bookHistos().

std::string SUSY_HLT_Electron_BJet::HLTProcess_
private

Definition at line 61 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 65 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 54 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 52 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 53 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 56 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 63 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 64 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 62 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 55 of file SUSY_HLT_Electron_BJet.h.

Referenced by analyze(), and SUSY_HLT_Electron_BJet().