CMS 3D CMS Logo

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

#include <RazorVarAnalyzer.h>

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 RazorVarAnalyzer (const edm::ParameterSet &)
 
 ~RazorVarAnalyzer () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Attributes

edm::InputTag m_eleCollectionTag
 
edm::EDGetTokenT< reco::ElectronCollectionm_eleCollectionTagToken_
 
edm::InputTag m_jetCollectionTag
 
edm::EDGetTokenT< reco::CaloJetCollectionm_jetCollectionTagToken_
 
edm::InputTag m_muCollectionTag
 
edm::EDGetTokenT< std::vector< reco::RecoChargedCandidate > > m_muCollectionTagToken_
 
edm::InputTag m_razorVarCollectionTag
 
edm::EDGetTokenT< std::vector< double > > m_razorVarCollectionTagToken_
 
MonitorElementm_rsqMREle
 
MonitorElementm_rsqMREleEle
 
MonitorElementm_rsqMREleMJ
 
MonitorElementm_rsqMREleMu
 
MonitorElementm_rsqMRFullyInc
 
MonitorElementm_rsqMRHad
 
MonitorElementm_rsqMRHadMJ
 
MonitorElementm_rsqMRInc10J
 
MonitorElementm_rsqMRInc12J
 
MonitorElementm_rsqMRInc14J
 
MonitorElementm_rsqMRInc4J
 
MonitorElementm_rsqMRInc6J
 
MonitorElementm_rsqMRInc8J
 
MonitorElementm_rsqMRMu
 
MonitorElementm_rsqMRMuMJ
 
MonitorElementm_rsqMRMuMu
 

Additional Inherited Members

- Protected Member Functions inherited from ScoutingAnalyzerBase
void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
MonitorElementbookH1 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1andDivide (DQMStore::IBooker &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1BinArray (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, float *xbinsize, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2BinArray (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, float *xbinsize, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookH2andDivide (DQMStore::IBooker &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH2withSumw2 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookP1 (DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
 
std::string newName (const std::string &name)
 
void prepareBooking (DQMStore::IBooker &)
 
MonitorElementprofileX (DQMStore::IBooker &, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (DQMStore::IBooker &, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
 ScoutingAnalyzerBase (const edm::ParameterSet &conf)
 
 ~ScoutingAnalyzerBase () override
 

Detailed Description

Definition at line 10 of file RazorVarAnalyzer.h.

Constructor & Destructor Documentation

RazorVarAnalyzer::RazorVarAnalyzer ( const edm::ParameterSet conf)
explicit

Definition at line 16 of file RazorVarAnalyzer.cc.

References edm::ParameterSet::getUntrackedParameter(), m_eleCollectionTagToken_, m_jetCollectionTagToken_, m_muCollectionTagToken_, and m_razorVarCollectionTagToken_.

17  : ScoutingAnalyzerBase(conf),
18  m_eleCollectionTag(conf.getUntrackedParameter<edm::InputTag>("eleCollectionName",
19  edm::InputTag("hltPixelMatchElectronsActivity"))),
21  conf.getUntrackedParameter<edm::InputTag>("jetCollectionName", edm::InputTag("hltCaloJetIDPassed"))),
23  conf.getUntrackedParameter<edm::InputTag>("muCollectionName", edm::InputTag("hltL3MuonCandidates"))),
24  m_razorVarCollectionTag(conf.getUntrackedParameter<edm::InputTag>("razorVarCollectionName")) {
25  // set Token(-s)
26  m_jetCollectionTagToken_ = consumes<reco::CaloJetCollection>(
27  conf.getUntrackedParameter<edm::InputTag>("jetCollectionName", edm::InputTag("hltCaloJetIDPassed")));
28  m_muCollectionTagToken_ = consumes<std::vector<reco::RecoChargedCandidate>>(
29  conf.getUntrackedParameter<edm::InputTag>("muCollectionName", edm::InputTag("hltL3MuonCandidates")));
30  m_eleCollectionTagToken_ = consumes<reco::ElectronCollection>(
31  conf.getUntrackedParameter<edm::InputTag>("eleCollectionName", edm::InputTag("hltPixelMatchElectronsActivity")));
33  consumes<std::vector<double>>(conf.getUntrackedParameter<edm::InputTag>("razorVarCollectionName"));
34 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< std::vector< double > > m_razorVarCollectionTagToken_
edm::EDGetTokenT< reco::ElectronCollection > m_eleCollectionTagToken_
edm::InputTag m_muCollectionTag
edm::InputTag m_jetCollectionTag
edm::EDGetTokenT< std::vector< reco::RecoChargedCandidate > > m_muCollectionTagToken_
edm::InputTag m_razorVarCollectionTag
ScoutingAnalyzerBase(const edm::ParameterSet &conf)
edm::InputTag m_eleCollectionTag
edm::EDGetTokenT< reco::CaloJetCollection > m_jetCollectionTagToken_
RazorVarAnalyzer::~RazorVarAnalyzer ( )
override

Definition at line 36 of file RazorVarAnalyzer.cc.

36 {}

Member Function Documentation

void RazorVarAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup c 
)
override

Definition at line 81 of file RazorVarAnalyzer.cc.

References MonitorElement::Fill(), edm::Event::getByToken(), edm::HandleBase::isValid(), m_eleCollectionTagToken_, m_jetCollectionTagToken_, m_muCollectionTagToken_, m_razorVarCollectionTagToken_, m_rsqMREle, m_rsqMREleEle, m_rsqMREleMJ, m_rsqMREleMu, m_rsqMRFullyInc, m_rsqMRHad, m_rsqMRHadMJ, m_rsqMRInc10J, m_rsqMRInc12J, m_rsqMRInc14J, m_rsqMRInc4J, m_rsqMRInc6J, m_rsqMRInc8J, m_rsqMRMu, m_rsqMRMuMJ, m_rsqMRMuMu, and dttmaxenums::R.

81  {
82  // count the number of jets with a minimal selection
84  iEvent.getByToken(m_jetCollectionTagToken_, calojets_handle);
85 
86  unsigned int njets = 0;
87  for (reco::CaloJetCollection::const_iterator it = calojets_handle->begin(); it != calojets_handle->end(); ++it) {
88  if (it->pt() >= 30. && fabs(it->eta()) <= 3.0) {
89  njets++;
90  }
91  }
92 
93  // count the number of muons
95  iEvent.getByToken(m_muCollectionTagToken_, muon_handle);
96 
97  unsigned int nmu_loose = 0;
98  unsigned int nmu_tight = 0;
99  if (muon_handle.isValid()) {
100  for (std::vector<reco::RecoChargedCandidate>::const_iterator it = muon_handle->begin(); it != muon_handle->end();
101  ++it) {
102  if (it->pt() >= 15 && fabs(it->eta()) <= 2.1)
103  nmu_tight++;
104  if (it->pt() >= 10 && fabs(it->eta()) <= 2.4)
105  nmu_loose++;
106  }
107  }
108 
109  // count the number of electrons
111  iEvent.getByToken(m_eleCollectionTagToken_, ele_handle);
112 
113  unsigned int nele_loose = 0;
114  unsigned int nele_tight = 0;
115  if (ele_handle.isValid()) {
116  for (reco::ElectronCollection::const_iterator it = ele_handle->begin(); it != ele_handle->end(); ++it) {
117  if (it->pt() >= 20 && fabs(it->eta()) <= 2.5)
118  nele_tight++;
119  if (it->pt() >= 10 && fabs(it->eta()) <= 2.5)
120  nele_loose++;
121  }
122  }
123 
124  // now get the box number:
125  // {'MuEle':0,'MuMu':1,'EleEle':2,'Mu':3,'Ele':4,'Had':5}
126  unsigned int box_num = 5;
127  if (nmu_tight > 0 && nele_tight > 0) {
128  box_num = 0;
129  } else if (nmu_tight > 0 && nmu_loose > 1) {
130  box_num = 1;
131  } else if (nele_tight > 0 && nele_loose > 1) {
132  box_num = 2;
133  } else if (nmu_tight > 0) {
134  box_num = 3;
135  } else if (nele_tight > 0) {
136  box_num = 4;
137  }
138 
139  edm::Handle<std::vector<double>> razorvar_handle;
140  iEvent.getByToken(m_razorVarCollectionTagToken_, razorvar_handle);
141  if (razorvar_handle->size() > 1) {
142  const double MR = razorvar_handle->at(0);
143  const double R = razorvar_handle->at(1);
144  m_rsqMRFullyInc->Fill(MR, R * R);
145  if (njets >= 4)
146  m_rsqMRInc4J->Fill(MR, R * R);
147  if (njets >= 6)
148  m_rsqMRInc6J->Fill(MR, R * R);
149  if (njets >= 8)
150  m_rsqMRInc8J->Fill(MR, R * R);
151  if (njets >= 10)
152  m_rsqMRInc10J->Fill(MR, R * R);
153  if (njets >= 12)
154  m_rsqMRInc12J->Fill(MR, R * R);
155  if (njets >= 14)
156  m_rsqMRInc14J->Fill(MR, R * R);
157 
158  // now fill the boxes
159  if (box_num == 0)
160  m_rsqMREleMu->Fill(MR, R * R);
161  if (box_num == 1)
162  m_rsqMRMuMu->Fill(MR, R * R);
163  if (box_num == 2)
164  m_rsqMREleEle->Fill(MR, R * R);
165  if (box_num == 3)
166  m_rsqMRMu->Fill(MR, R * R);
167  if (box_num == 4)
168  m_rsqMREle->Fill(MR, R * R);
169  if (box_num == 5)
170  m_rsqMRHad->Fill(MR, R * R);
171 
172  // finally the multijet boxes - think ttbar
173  // muon boxes: muons are not in jets
174  if (box_num == 3 && njets >= 4)
175  m_rsqMRMuMJ->Fill(MR, R * R);
176  // ele boxes: electrons are in jets
177  else if (box_num == 4 && njets >= 5)
178  m_rsqMREleMJ->Fill(MR, R * R);
179  // fill the Had box
180  else if (box_num == 5 && njets >= 6)
181  m_rsqMRHadMJ->Fill(MR, R * R);
182  }
183 }
MonitorElement * m_rsqMRInc12J
MonitorElement * m_rsqMRHadMJ
edm::EDGetTokenT< std::vector< double > > m_razorVarCollectionTagToken_
edm::EDGetTokenT< reco::ElectronCollection > m_eleCollectionTagToken_
MonitorElement * m_rsqMREle
MonitorElement * m_rsqMRInc6J
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void Fill(long long x)
MonitorElement * m_rsqMREleMJ
MonitorElement * m_rsqMRInc8J
MonitorElement * m_rsqMRMu
MonitorElement * m_rsqMRMuMJ
edm::EDGetTokenT< std::vector< reco::RecoChargedCandidate > > m_muCollectionTagToken_
MonitorElement * m_rsqMREleMu
MonitorElement * m_rsqMRMuMu
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * m_rsqMRInc14J
MonitorElement * m_rsqMRInc4J
MonitorElement * m_rsqMREleEle
edm::EDGetTokenT< reco::CaloJetCollection > m_jetCollectionTagToken_
MonitorElement * m_rsqMRHad
MonitorElement * m_rsqMRInc10J
MonitorElement * m_rsqMRFullyInc
void RazorVarAnalyzer::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 39 of file RazorVarAnalyzer.cc.

References ScoutingAnalyzerBase::bookH2withSumw2(), m_rsqMREle, m_rsqMREleEle, m_rsqMREleMJ, m_rsqMREleMu, m_rsqMRFullyInc, m_rsqMRHad, m_rsqMRHadMJ, m_rsqMRInc10J, m_rsqMRInc12J, m_rsqMRInc14J, m_rsqMRInc4J, m_rsqMRInc6J, m_rsqMRInc8J, m_rsqMRMu, m_rsqMRMuMJ, m_rsqMRMuMu, and ScoutingAnalyzerBase::prepareBooking().

39  {
41  // the full inclusive histograms
43  iBooker, "rsqMRFullyInc", "M_{R} vs R^{2} (All Events)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
45  iBooker, "rsqMRInc4J", "M_{R} vs R^{2} (>= 4j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
47  iBooker, "rsqMRInc6J", "M_{R} vs R^{2} (>= 6j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
49  iBooker, "rsqMRInc8J", "M_{R} vs R^{2} (>= 8j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
51  iBooker, "rsqMRInc10J", "M_{R} vs R^{2} (>= 10j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
53  iBooker, "rsqMRInc12J", "M_{R} vs R^{2} (>= 12j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
55  iBooker, "rsqMRInc14J", "M_{R} vs R^{2} (>= 14j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
56 
57  // the by box histograms
59  iBooker, "rsqMREleMu", "M_{R} vs R^{2} (EleMu box)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
61  iBooker, "rsqMRMuMu", "M_{R} vs R^{2} (MuMu box)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
63  iBooker, "rsqMREleEle", "M_{R} vs R^{2} (EleEle box)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
65  iBooker, "rsqMRMu", "M_{R} vs R^{2} (Mu box)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
67  iBooker, "rsqMREle", "M_{R} vs R^{2} (Ele box)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
69  iBooker, "rsqMRHad", "M_{R} vs R^{2} (Had box)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
70 
71  // the by box histograms
73  iBooker, "rsqMRMuMJ", "M_{R} vs R^{2} (Mu box >= 4j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
75  iBooker, "rsqMREleMJ", "M_{R} vs R^{2} (Ele box >= 5j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
77  iBooker, "rsqMRHadMJ", "M_{R} vs R^{2} (Had box >= 6j)", 400, 0., 4000., 50, 0., 1., "M_{R} [GeV]", "R^{2}");
78 }
MonitorElement * m_rsqMRInc12J
MonitorElement * m_rsqMRHadMJ
MonitorElement * m_rsqMREle
MonitorElement * m_rsqMRInc6J
void prepareBooking(DQMStore::IBooker &)
MonitorElement * m_rsqMREleMJ
MonitorElement * m_rsqMRInc8J
MonitorElement * m_rsqMRMu
MonitorElement * m_rsqMRMuMJ
MonitorElement * m_rsqMREleMu
MonitorElement * m_rsqMRMuMu
MonitorElement * m_rsqMRInc14J
MonitorElement * m_rsqMRInc4J
MonitorElement * bookH2withSumw2(DQMStore::IBooker &, const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
MonitorElement * m_rsqMREleEle
MonitorElement * m_rsqMRHad
MonitorElement * m_rsqMRInc10J
MonitorElement * m_rsqMRFullyInc

Member Data Documentation

edm::InputTag RazorVarAnalyzer::m_eleCollectionTag
private

Definition at line 18 of file RazorVarAnalyzer.h.

edm::EDGetTokenT<reco::ElectronCollection> RazorVarAnalyzer::m_eleCollectionTagToken_
private

Definition at line 48 of file RazorVarAnalyzer.h.

Referenced by analyze(), and RazorVarAnalyzer().

edm::InputTag RazorVarAnalyzer::m_jetCollectionTag
private

Definition at line 19 of file RazorVarAnalyzer.h.

edm::EDGetTokenT<reco::CaloJetCollection> RazorVarAnalyzer::m_jetCollectionTagToken_
private

Definition at line 46 of file RazorVarAnalyzer.h.

Referenced by analyze(), and RazorVarAnalyzer().

edm::InputTag RazorVarAnalyzer::m_muCollectionTag
private

Definition at line 20 of file RazorVarAnalyzer.h.

edm::EDGetTokenT<std::vector<reco::RecoChargedCandidate> > RazorVarAnalyzer::m_muCollectionTagToken_
private

Definition at line 47 of file RazorVarAnalyzer.h.

Referenced by analyze(), and RazorVarAnalyzer().

edm::InputTag RazorVarAnalyzer::m_razorVarCollectionTag
private

Definition at line 21 of file RazorVarAnalyzer.h.

edm::EDGetTokenT<std::vector<double> > RazorVarAnalyzer::m_razorVarCollectionTagToken_
private

Definition at line 49 of file RazorVarAnalyzer.h.

Referenced by analyze(), and RazorVarAnalyzer().

MonitorElement* RazorVarAnalyzer::m_rsqMREle
private

Definition at line 37 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMREleEle
private

Definition at line 35 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMREleMJ
private

Definition at line 42 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMREleMu
private

Definition at line 33 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRFullyInc
private

Definition at line 24 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRHad
private

Definition at line 38 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRHadMJ
private

Definition at line 43 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc10J
private

Definition at line 28 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc12J
private

Definition at line 29 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc14J
private

Definition at line 30 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc4J
private

Definition at line 25 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc6J
private

Definition at line 26 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc8J
private

Definition at line 27 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRMu
private

Definition at line 36 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRMuMJ
private

Definition at line 41 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* RazorVarAnalyzer::m_rsqMRMuMu
private

Definition at line 34 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookHistograms().