CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RazorVarAnalyzer Class Reference

#include <RazorVarAnalyzer.h>

Inheritance diagram for RazorVarAnalyzer:
ScoutingAnalyzerBase edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void bookMEs ()
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
 RazorVarAnalyzer (const edm::ParameterSet &)
 
virtual ~RazorVarAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag m_eleCollectionTag
 
edm::InputTag m_jetCollectionTag
 
edm::InputTag m_muCollectionTag
 
edm::InputTag m_razorVarCollectionTag
 
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

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from ScoutingAnalyzerBase
void beginJob ()
 
MonitorElementbookH1 (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 (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1BinArray (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 (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 (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 (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 (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH2withSumw2 (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 (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")
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
std::string newName (const std::string &name)
 
MonitorElementprofileX (MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (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)
 
virtual ~ScoutingAnalyzerBase ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 7 of file RazorVarAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file RazorVarAnalyzer.cc.

16  :
18  m_eleCollectionTag(conf.getUntrackedParameter<edm::InputTag>("eleCollectionName",edm::InputTag("hltPixelMatchElectronsActivity"))),
19  m_jetCollectionTag(conf.getUntrackedParameter<edm::InputTag>("jetCollectionName",edm::InputTag("hltCaloJetIDPassed"))),
20  m_muCollectionTag(conf.getUntrackedParameter<edm::InputTag>("muCollectionName",edm::InputTag("hltL3MuonCandidates"))),
21  m_razorVarCollectionTag(conf.getUntrackedParameter<edm::InputTag>("razorVarCollectionName")){
22 }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag m_muCollectionTag
edm::InputTag m_jetCollectionTag
edm::InputTag m_razorVarCollectionTag
ScoutingAnalyzerBase(const edm::ParameterSet &conf)
edm::InputTag m_eleCollectionTag
RazorVarAnalyzer::~RazorVarAnalyzer ( )
virtual

Definition at line 26 of file RazorVarAnalyzer.cc.

26 {}

Member Function Documentation

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

Reimplemented from ScoutingAnalyzerBase.

Definition at line 30 of file RazorVarAnalyzer.cc.

References MonitorElement::Fill(), edm::Event::getByLabel(), edm::HandleBase::isValid(), m_eleCollectionTag, m_jetCollectionTag, m_muCollectionTag, m_razorVarCollectionTag, 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.

30  {
31 
32  //count the number of jets with a minimal selection
34  iEvent.getByLabel(m_jetCollectionTag,calojets_handle);
35 
36  unsigned int njets = 0;
37  for(reco::CaloJetCollection::const_iterator it = calojets_handle->begin(); it != calojets_handle->end(); ++it){
38  if(it->pt() >= 30. && fabs(it->eta()) <= 3.0){
39  njets++;
40  }
41  }
42 
43  //count the number of muons
45  iEvent.getByLabel(m_muCollectionTag,muon_handle);
46 
47  unsigned int nmu_loose = 0;
48  unsigned int nmu_tight = 0;
49  if(muon_handle.isValid()){
50  for(std::vector<reco::RecoChargedCandidate>::const_iterator it = muon_handle->begin(); it != muon_handle->end(); ++it){
51  if(it->pt() >= 15 && fabs(it->eta()) <= 2.1) nmu_tight++;
52  if(it->pt() >= 10 && fabs(it->eta()) <= 2.4) nmu_loose++;
53  }
54  }
55 
56  //count the number of electrons
58  iEvent.getByLabel(m_eleCollectionTag,ele_handle);
59 
60  unsigned int nele_loose = 0;
61  unsigned int nele_tight = 0;
62  if(ele_handle.isValid()){
63  for(reco::ElectronCollection::const_iterator it = ele_handle->begin(); it != ele_handle->end(); ++it){
64  if(it->pt() >= 20 && fabs(it->eta()) <= 2.5) nele_tight++;
65  if(it->pt() >= 10 && fabs(it->eta()) <= 2.5) nele_loose++;
66  }
67  }
68 
69  //now get the box number: {'MuEle':0,'MuMu':1,'EleEle':2,'Mu':3,'Ele':4,'Had':5}
70  unsigned int box_num = 5;
71  if(nmu_tight > 0 && nele_tight > 0){
72  box_num = 0;
73  }else if(nmu_tight > 0 && nmu_loose > 1){
74  box_num = 1;
75  }else if(nele_tight > 0 && nele_loose > 1){
76  box_num = 2;
77  }else if(nmu_tight > 0){
78  box_num = 3;
79  }else if(nele_tight > 0){
80  box_num = 4;
81  }
82 
83  edm::Handle<std::vector<double> > razorvar_handle;
84  iEvent.getByLabel(m_razorVarCollectionTag,razorvar_handle);
85 
86  if(razorvar_handle->size() > 1){
87  const double MR = razorvar_handle->at(0);
88  const double R = razorvar_handle->at(1);
89  m_rsqMRFullyInc->Fill(MR,R*R);
90  if(njets >= 4) m_rsqMRInc4J->Fill(MR,R*R);
91  if(njets >= 6) m_rsqMRInc6J->Fill(MR,R*R);
92  if(njets >= 8) m_rsqMRInc8J->Fill(MR,R*R);
93  if(njets >= 10) m_rsqMRInc10J->Fill(MR,R*R);
94  if(njets >= 12) m_rsqMRInc12J->Fill(MR,R*R);
95  if(njets >= 14) m_rsqMRInc14J->Fill(MR,R*R);
96 
97  //now fill the boxes
98  if(box_num == 0) m_rsqMREleMu->Fill(MR,R*R);
99  if(box_num == 1) m_rsqMRMuMu->Fill(MR,R*R);
100  if(box_num == 2) m_rsqMREleEle->Fill(MR,R*R);
101  if(box_num == 3) m_rsqMRMu->Fill(MR,R*R);
102  if(box_num == 4) m_rsqMREle->Fill(MR,R*R);
103  if(box_num == 5) m_rsqMRHad->Fill(MR,R*R);
104 
105  //finally the multijet boxes - think ttbar
106  //muon boxes: muons are not in jets
107  if( box_num == 3 && njets >= 4) m_rsqMRMuMJ->Fill(MR,R*R);
108  //ele boxes: electrons are in jets
109  else if( box_num == 4 && njets >= 5) m_rsqMREleMJ->Fill(MR,R*R);
110  //fill the Had box
111  else if( box_num == 5 && njets >= 6) m_rsqMRHadMJ->Fill(MR,R*R);
112  }
113 
114 }
MonitorElement * m_rsqMRInc12J
MonitorElement * m_rsqMRHadMJ
MonitorElement * m_rsqMREle
MonitorElement * m_rsqMRInc6J
edm::InputTag m_muCollectionTag
edm::InputTag m_jetCollectionTag
void Fill(long long x)
MonitorElement * m_rsqMREleMJ
MonitorElement * m_rsqMRInc8J
MonitorElement * m_rsqMRMu
MonitorElement * m_rsqMRMuMJ
edm::InputTag m_razorVarCollectionTag
MonitorElement * m_rsqMREleMu
MonitorElement * m_rsqMRMuMu
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
MonitorElement * m_rsqMRInc14J
MonitorElement * m_rsqMRInc4J
MonitorElement * m_rsqMREleEle
edm::InputTag m_eleCollectionTag
MonitorElement * m_rsqMRHad
MonitorElement * m_rsqMRInc10J
MonitorElement * m_rsqMRFullyInc
void RazorVarAnalyzer::bookMEs ( )
virtual

Reimplemented from ScoutingAnalyzerBase.

Definition at line 121 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, and m_rsqMRMuMu.

121  {
122 
123  //the full inclusive histograms
124  m_rsqMRFullyInc = bookH2withSumw2("rsqMRFullyInc",
125  "M_{R} vs R^{2} (All Events)",
126  400,0.,4000.,
127  50,0.,1.,
128  "M_{R} [GeV]",
129  "R^{2}");
130  m_rsqMRInc4J = bookH2withSumw2("rsqMRInc4J",
131  "M_{R} vs R^{2} (>= 4j)",
132  400,0.,4000.,
133  50,0.,1.,
134  "M_{R} [GeV]",
135  "R^{2}");
136  m_rsqMRInc6J = bookH2withSumw2("rsqMRInc6J",
137  "M_{R} vs R^{2} (>= 6j)",
138  400,0.,4000.,
139  50,0.,1.,
140  "M_{R} [GeV]",
141  "R^{2}");
142  m_rsqMRInc8J = bookH2withSumw2("rsqMRInc8J",
143  "M_{R} vs R^{2} (>= 8j)",
144  400,0.,4000.,
145  50,0.,1.,
146  "M_{R} [GeV]",
147  "R^{2}");
148  m_rsqMRInc10J = bookH2withSumw2("rsqMRInc10J",
149  "M_{R} vs R^{2} (>= 10j)",
150  400,0.,4000.,
151  50,0.,1.,
152  "M_{R} [GeV]",
153  "R^{2}");
154  m_rsqMRInc12J = bookH2withSumw2("rsqMRInc12J",
155  "M_{R} vs R^{2} (>= 12j)",
156  400,0.,4000.,
157  50,0.,1.,
158  "M_{R} [GeV]",
159  "R^{2}");
160  m_rsqMRInc14J = bookH2withSumw2("rsqMRInc14J",
161  "M_{R} vs R^{2} (>= 14j)",
162  400,0.,4000.,
163  50,0.,1.,
164  "M_{R} [GeV]",
165  "R^{2}");
166 
167  //the by box histograms
168  m_rsqMREleMu = bookH2withSumw2("rsqMREleMu",
169  "M_{R} vs R^{2} (EleMu box)",
170  400,0.,4000.,
171  50,0.,1.,
172  "M_{R} [GeV]",
173  "R^{2}");
174  m_rsqMRMuMu = bookH2withSumw2("rsqMRMuMu",
175  "M_{R} vs R^{2} (MuMu box)",
176  400,0.,4000.,
177  50,0.,1.,
178  "M_{R} [GeV]",
179  "R^{2}");
180  m_rsqMREleEle = bookH2withSumw2("rsqMREleEle",
181  "M_{R} vs R^{2} (EleEle box)",
182  400,0.,4000.,
183  50,0.,1.,
184  "M_{R} [GeV]",
185  "R^{2}");
186  m_rsqMRMu = bookH2withSumw2("rsqMRMu",
187  "M_{R} vs R^{2} (Mu box)",
188  400,0.,4000.,
189  50,0.,1.,
190  "M_{R} [GeV]",
191  "R^{2}");
192  m_rsqMREle = bookH2withSumw2("rsqMREle",
193  "M_{R} vs R^{2} (Ele box)",
194  400,0.,4000.,
195  50,0.,1.,
196  "M_{R} [GeV]",
197  "R^{2}");
198  m_rsqMRHad = bookH2withSumw2("rsqMRHad",
199  "M_{R} vs R^{2} (Had box)",
200  400,0.,4000.,
201  50,0.,1.,
202  "M_{R} [GeV]",
203  "R^{2}");
204 
205  //the by box histograms
206  m_rsqMRMuMJ = bookH2withSumw2("rsqMRMuMJ",
207  "M_{R} vs R^{2} (Mu box >= 4j)",
208  400,0.,4000.,
209  50,0.,1.,
210  "M_{R} [GeV]",
211  "R^{2}");
212  m_rsqMREleMJ = bookH2withSumw2("rsqMREleMJ",
213  "M_{R} vs R^{2} (Ele box >= 5j)",
214  400,0.,4000.,
215  50,0.,1.,
216  "M_{R} [GeV]",
217  "R^{2}");
218  m_rsqMRHadMJ = bookH2withSumw2("rsqMRHadMJ",
219  "M_{R} vs R^{2} (Had box >= 6j)",
220  400,0.,4000.,
221  50,0.,1.,
222  "M_{R} [GeV]",
223  "R^{2}");
224 
225 
226 }
MonitorElement * m_rsqMRInc12J
MonitorElement * m_rsqMRHadMJ
MonitorElement * bookH2withSumw2(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_rsqMREle
MonitorElement * m_rsqMRInc6J
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 * m_rsqMREleEle
MonitorElement * m_rsqMRHad
MonitorElement * m_rsqMRInc10J
MonitorElement * m_rsqMRFullyInc
void RazorVarAnalyzer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
virtual

Reimplemented from ScoutingAnalyzerBase.

Definition at line 116 of file RazorVarAnalyzer.cc.

116  {
117 }

Member Data Documentation

edm::InputTag RazorVarAnalyzer::m_eleCollectionTag
private

Definition at line 23 of file RazorVarAnalyzer.h.

Referenced by analyze().

edm::InputTag RazorVarAnalyzer::m_jetCollectionTag
private

Definition at line 24 of file RazorVarAnalyzer.h.

Referenced by analyze().

edm::InputTag RazorVarAnalyzer::m_muCollectionTag
private

Definition at line 25 of file RazorVarAnalyzer.h.

Referenced by analyze().

edm::InputTag RazorVarAnalyzer::m_razorVarCollectionTag
private

Definition at line 26 of file RazorVarAnalyzer.h.

Referenced by analyze().

MonitorElement* RazorVarAnalyzer::m_rsqMREle
private

Definition at line 42 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMREleEle
private

Definition at line 40 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMREleMJ
private

Definition at line 47 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMREleMu
private

Definition at line 38 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRFullyInc
private

Definition at line 29 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRHad
private

Definition at line 43 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRHadMJ
private

Definition at line 48 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc10J
private

Definition at line 33 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc12J
private

Definition at line 34 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc14J
private

Definition at line 35 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc4J
private

Definition at line 30 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc6J
private

Definition at line 31 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRInc8J
private

Definition at line 32 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRMu
private

Definition at line 41 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRMuMJ
private

Definition at line 46 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().

MonitorElement* RazorVarAnalyzer::m_rsqMRMuMu
private

Definition at line 39 of file RazorVarAnalyzer.h.

Referenced by analyze(), and bookMEs().