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 Types | Private Member Functions | Private Attributes | Static Private Attributes
MuonIsolationDQM Class Reference

#include <MuonIsolationDQM.h>

Inheritance diagram for MuonIsolationDQM:
edm::EDAnalyzer

Public Member Functions

 MuonIsolationDQM (const edm::ParameterSet &)
 
 ~MuonIsolationDQM ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Types

enum  { NOAXIS, XAXIS, YAXIS, ZAXIS }
 
typedef edm::Handle
< reco::IsoDepositMap
MuIsoDepHandle
 
typedef const reco::IsoDeposit MuIsoDepRef
 
typedef edm::RefToBase
< reco::Muon
MuonBaseRef
 
typedef edm::View< reco::Muon >
::const_iterator 
MuonIterator
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
virtual void endJob ()
 
void FillHistos ()
 
TH1 * GetTH1FromMonitorElement (MonitorElement *me)
 
void InitHistos ()
 
void InitStatics ()
 
void NormalizeHistos ()
 
void RecordData (MuonIterator muon)
 

Private Attributes

std::vector< std::string > axis_titles
 
DQMStoredbe
 
std::string dirName
 
edm::InputTag ecalIsoDeposit_Tag
 
std::vector< MonitorElement * > h_1D
 
MonitorElementh_nMuons
 
edm::InputTag hcalIsoDeposit_Tag
 
edm::InputTag hoIsoDeposit_Tag
 
std::vector< int > isContinuous
 
double L_BIN_WIDTH
 
int LOG_BINNING_ENABLED
 
double LOG_BINNING_RATIO
 
std::vector< std::string > main_titles
 
edm::InputTag Muon_Tag
 
std::vector< std::string > names
 
int nEvents
 
int nGLBMuons
 
int nSTAMuons
 
int nTRKMuons
 
int NUM_LOG_BINS
 
std::vector< std::vector
< double > > 
param
 
bool requireGLBMuon
 
bool requireSTAMuon
 
bool requireTRKMuon
 
std::string rootfilename
 
double S_BIN_WIDTH
 
double theData [NUM_VARS]
 
int theMuonData
 
std::string title_cone
 
std::string title_sam
 
edm::InputTag tkIsoDeposit_Tag
 

Static Private Attributes

static const int NUM_VARS = 24
 

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 edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 56 of file MuonIsolationDQM.h.

Member Typedef Documentation

Definition at line 60 of file MuonIsolationDQM.h.

Definition at line 61 of file MuonIsolationDQM.h.

Definition at line 59 of file MuonIsolationDQM.h.

typedef edm::View<reco::Muon>::const_iterator MuonIsolationDQM::MuonIterator
private

Definition at line 58 of file MuonIsolationDQM.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

MuonIsolationDQM::MuonIsolationDQM ( const edm::ParameterSet iConfig)
explicit

Definition at line 63 of file MuonIsolationDQM.cc.

References DQMStore::cd(), dbe, dirName, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), h_1D, InitStatics(), Muon_Tag, nEvents, nGLBMuons, nSTAMuons, nTRKMuons, NUM_VARS, cppFunctionSkipper::operator, requireGLBMuon, requireSTAMuon, and requireTRKMuon.

64 {
65 
66  // rootfilename = iConfig.getUntrackedParameter<string>("rootfilename"); // comment out for inclusion
67  requireSTAMuon = iConfig.getUntrackedParameter<bool>("requireSTAMuon");
68  requireTRKMuon = iConfig.getUntrackedParameter<bool>("requireTRKMuon");
69  requireGLBMuon = iConfig.getUntrackedParameter<bool>("requireGLBMuon");
70  dirName = iConfig.getParameter<std::string>("directory");
71  // subDirName = iConfig.getParameter<std::string>("@module_label");
72 
73  // dirName += subDirName;
74 
75  //--------Initialize tags-------
76  Muon_Tag = iConfig.getUntrackedParameter<edm::InputTag>("Global_Muon_Label");
77 
78  //-------Initialize counters----------------
79  nEvents = 0;
80  nSTAMuons = 0;
81  nTRKMuons = 0;
82  nGLBMuons = 0;
83 
84  InitStatics();
85 
86  //Set up DAQ
87  dbe = 0;
89 
90  //------"allocate" space for the data vectors-------
91 
92  /*
93  h_1D is a 2D vector with indices [var][muon#]
94  cd_plots is a 2D vector with indices [var][muon#]
95  */
96  //NOTE:the total number of muons and events is initially unknown,
97  // so that dimension is not initialized. Hence, theMuonData
98  // needs no resizing.
99 
100  h_1D.resize (NUM_VARS);
101  /* cd_plots.resize(NUM_VARS); */
102 
103  dbe->cd();
104 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string dirName
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
std::vector< MonitorElement * > h_1D
edm::InputTag Muon_Tag
static const int NUM_VARS
MuonIsolationDQM::~MuonIsolationDQM ( )

Definition at line 109 of file MuonIsolationDQM.cc.

109  {
110 
111  //Deallocate memory
112 
113 }

Member Function Documentation

void MuonIsolationDQM::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 290 of file MuonIsolationDQM.cc.

References DQMStore::cd(), dbe, dirName, MonitorElement::Fill(), FillHistos(), edm::Event::getByLabel(), h_nMuons, metsig::muon, Muon_Tag, nEvents, nGLBMuons, nSTAMuons, nTRKMuons, RecordData(), requireGLBMuon, requireSTAMuon, requireTRKMuon, DQMStore::setCurrentFolder(), and theMuonData.

290  {
291 
292  ++nEvents;
293  edm::LogInfo("Tutorial") << "\nInvestigating event #" << nEvents<<"\n";
294 
295  // Get Muon Collection
296  edm::Handle<edm::View<reco::Muon> > muonsHandle; //
297  iEvent.getByLabel(Muon_Tag, muonsHandle);
298 
299  //Fill event entry in histogram of number of muons
300  edm::LogInfo("Tutorial") << "Number of Muons: " << muonsHandle->size();
301  theMuonData = muonsHandle->size();
303 
304  //Fill historgams concerning muon isolation
305  uint iMuon=0;
306  dbe->setCurrentFolder(dirName.c_str());
307  for (MuonIterator muon = muonsHandle->begin(); muon != muonsHandle->end(); ++muon, ++iMuon ) {
308  // ++nMuons;
309  if (requireSTAMuon && muon->isStandAloneMuon()) {
310  ++nSTAMuons;
311  RecordData(muon);
312  FillHistos();
313  }
314  else if (requireTRKMuon && muon->isTrackerMuon()) {
315  ++nTRKMuons;
316  RecordData(muon);
317  FillHistos();
318  }
319  else if (requireGLBMuon && muon->isGlobalMuon()) {
320  ++nGLBMuons;
321  RecordData(muon);
322  FillHistos();
323  }
324  }
325  dbe->cd();
326 
327 }
void RecordData(MuonIterator muon)
std::string dirName
MonitorElement * h_nMuons
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
edm::View< reco::Muon >::const_iterator MuonIterator
void Fill(long long x)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
edm::InputTag Muon_Tag
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void MuonIsolationDQM::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 373 of file MuonIsolationDQM.cc.

References DQMStore::cd(), dbe, dirName, InitHistos(), and DQMStore::setCurrentFolder().

374 {
375 
376  edm::LogInfo("Tutorial") << "\n#########################################\n\n"
377  << "Lets get started! "
378  << "\n\n#########################################\n";
379  dbe->setCurrentFolder(dirName.c_str());
380  InitHistos();
381  dbe->cd();
382 
383 }
std::string dirName
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void MuonIsolationDQM::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 387 of file MuonIsolationDQM.cc.

References dbe, dirName, DQMStore::get(), nEvents, and NormalizeHistos().

387  {
388 
389  // check if ME still there (and not killed by MEtoEDM for memory saving)
390  if( dbe )
391  {
392  // check existence of first histo in the list
393  if (! dbe->get(dirName+"/nMuons")) return;
394  }
395  else
396  return;
397 
398  edm::LogInfo("Tutorial") << "\n#########################################\n\n"
399  << "Total Number of Events: " << nEvents
400  << "\n\n#########################################\n"
401  << "\nInitializing Histograms...\n";
402 
403  edm::LogInfo("Tutorial") << "\nIntializing Finished. Filling...\n";
404  NormalizeHistos();
405  edm::LogInfo("Tutorial") << "\nFilled. Saving...\n";
406  // dbe->save(rootfilename); // comment out for incorporation
407  edm::LogInfo("Tutorial") << "\nSaved. Peace, homie, I'm out.\n";
408 
409 }
std::string dirName
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void MuonIsolationDQM::FillHistos ( )
private

Definition at line 482 of file MuonIsolationDQM.cc.

References GetTH1FromMonitorElement(), h_1D, NUM_VARS, param, and theData.

Referenced by analyze().

482  {
483 
484  int overFlowBin;
485  double overFlow = 0;
486 
487  //----------Fill 1D histograms---------------
488  for(int var=0; var<NUM_VARS; var++){
489  h_1D[var]->Fill(theData[var]);
490  // cd_plots[var]->Fill(theData[var]);//right now, this is a regular PDF (just like h_1D)
491  if (theData[var] > param[var][2]) {
492  // fill the overflow bin
493  overFlowBin = (int) param[var][0] + 1;
494  overFlow = GetTH1FromMonitorElement(h_1D[var])->GetBinContent(overFlowBin);
495  GetTH1FromMonitorElement(h_1D[var])->SetBinContent(overFlowBin, overFlow + 1);
496  }
497  }//Finish 1D
498 
499 }
std::vector< MonitorElement * > h_1D
std::vector< std::vector< double > > param
static const int NUM_VARS
double theData[NUM_VARS]
TH1 * GetTH1FromMonitorElement(MonitorElement *me)
TH1 * MuonIsolationDQM::GetTH1FromMonitorElement ( MonitorElement me)
private

Definition at line 501 of file MuonIsolationDQM.cc.

References MonitorElement::getTH1().

Referenced by FillHistos(), InitHistos(), and NormalizeHistos().

501  {
502  return me->getTH1();
503 }
TH1 * getTH1(void) const
void MuonIsolationDQM::InitHistos ( )
private

Definition at line 411 of file MuonIsolationDQM.cc.

References axis_titles, DQMStore::book1D(), dbe, GetTH1FromMonitorElement(), h_1D, h_nMuons, main_titles, names, NUM_VARS, param, MonitorElement::setAxisTitle(), title_cone, title_sam, XAXIS, and YAXIS.

Referenced by beginJob().

411  {
412 
413  //---initialize number of muons histogram---
414  h_nMuons = dbe->book1D("nMuons", title_sam + "Number of Muons", 20, 0., 20.);
415  h_nMuons->setAxisTitle("Number of Muons",XAXIS);
416  h_nMuons->setAxisTitle("Fraction of Events",YAXIS);
417 
418 
419  //---Initialize 1D Histograms---
420  for(int var = 0; var < NUM_VARS; var++){
421  h_1D[var] = dbe->book1D(
422  names[var],
423  title_sam + main_titles[var] + title_cone,
424  (int)param[var][0],
425  param[var][1],
426  param[var][2]
427  );
428  /* cd_plots[var] = dbe->book1D(
429  names[var] + "_cd",
430  title_sam + title_cd + main_titles[var] + title_cone,
431  (int)param[var][0],
432  param[var][1],
433  param[var][2]
434  );
435  */
436 
437  h_1D[var]->setAxisTitle(axis_titles[var],XAXIS);
438  // h_1D[var]->setAxisTitle("Fraction of Muons",YAXIS);
439  GetTH1FromMonitorElement(h_1D[var])->Sumw2();
440 
441  /* cd_plots[var]->setAxisTitle(axis_titles[var],XAXIS);
442  cd_plots[var]->setAxisTitle("Fraction of Muons",YAXIS);
443  GetTH1FromMonitorElement(cd_plots[var])->Sumw2();
444  */
445 
446  }//Finish 1D
447 
448  //avg pT not defined for zero tracks.
449  //MonitorElement is inflxible and won't let me change the
450  //number of bins! I guess all I'm doing here is changing
451  //range of the x axis when it is printed, not the actual
452  //bins that are filled
453  // p_2D[4][9]->setAxisRange(0.5,15.5,XAXIS);
454 
455 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * h_nMuons
std::vector< MonitorElement * > h_1D
std::vector< std::string > main_titles
std::vector< std::string > names
std::vector< std::vector< double > > param
std::string title_sam
std::string title_cone
std::vector< std::string > axis_titles
static const int NUM_VARS
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
TH1 * GetTH1FromMonitorElement(MonitorElement *me)
void MuonIsolationDQM::InitStatics ( )
private

Definition at line 118 of file MuonIsolationDQM.cc.

References axis_titles, isContinuous, L_BIN_WIDTH, LOG_BINNING_ENABLED, LOG_BINNING_RATIO, main_titles, names, NUM_LOG_BINS, NUM_VARS, param, S_BIN_WIDTH, title_cone, and title_sam.

Referenced by MuonIsolationDQM().

118  {
119 
120  //-----------Initialize primatives-----------
121  S_BIN_WIDTH = 1.0;//in GeV
122  L_BIN_WIDTH = 2.0;//in GeV
124  NUM_LOG_BINS = 15;
125  LOG_BINNING_RATIO = 1.1;//ratio by which each bin is wider than the last for log binning
126  //i.e. bin widths are (x), (r*x), (r^2*x), ..., (r^(nbins)*x)
127 
128 
129  //-------Initialize Titles---------
130  title_sam = "";//"[Sample b-jet events] ";
131  title_cone = "";//" [in R=0.3 IsoDeposit Cone]";
132  //The above two pieces of info will be printed on the title of the whole page,
133  //not for each individual histogram
134  // title_cd = "C.D. of ";
135 
136  //-------"Allocate" memory for vectors
137  main_titles.resize(NUM_VARS);
138  axis_titles.resize(NUM_VARS);
139  names.resize(NUM_VARS);
140  param.resize(NUM_VARS, vector<double>(3) );
141  isContinuous.resize(NUM_VARS);
142 
143  //-----Titles of the plots-----------
144  main_titles[0 ] = "Total Tracker Momentum, #Delta R = 0.3";
145  main_titles[1 ] = "Total EM Cal Energy, #Delta R = 0.3";
146  main_titles[2 ] = "Total Had Cal Energy, #Delta R = 0.3";
147  main_titles[3 ] = "Total HO Cal Energy, #Delta R = 0.3";
148  main_titles[4 ] = "Number of Tracker Tracks, #Delta R = 0.3";
149  main_titles[5 ] = "Number of Jets around Muon, #Delta R = 0.3";
150  main_titles[6 ] = "Tracker p_{T} within veto cone, #Delta R = 0.3";
151  main_titles[7 ] = "EM E_{T} within veto cone, #Delta R = 0.3";
152  main_titles[8 ] = "Had E_{T} within veto cone, #Delta R = 0.3";
153  main_titles[9 ] = "HO E_{T} within veto cone, #Delta R = 0.3";
154  main_titles[10] = "Average Momentum per Track, #Delta R = 0.3";
155  main_titles[11] = "Weighted Energy, #Delta R = 0.3";
156 
157  main_titles[12] = "Total Tracker Momentum, #Delta R = 0.5";
158  main_titles[13] = "Total EM Cal Energy, #Delta R = 0.5";
159  main_titles[14] = "Total Had Cal Energy, #Delta R = 0.5";
160  main_titles[15] = "Total HO Cal Energy, #Delta R = 0.5";
161  main_titles[16] = "Number of Tracker Tracks, #Delta R = 0.5";
162  main_titles[17] = "Number of Jets around Muon, #Delta R = 0.5";
163  main_titles[18] = "Tracker p_{T} within veto cone, #Delta R = 0.5";
164  main_titles[19] = "EM E_{T} within veto cone, #Delta R = 0.5";
165  main_titles[20] = "Had E_{T} within veto cone, #Delta R = 0.5";
166  main_titles[21] = "HO E_{T} within veto cone, #Delta R = 0.5";
167  main_titles[22] = "Average Momentum per Track, #Delta R = 0.5";
168  main_titles[23] = "Weighted Energy, #Delta R = 0.5";
169 
170  //------Titles on the X or Y axis------------
171  axis_titles[0 ] = "#Sigma p_{T} (GeV)";
172  axis_titles[1 ] = "#Sigma E_{T}^{EM} (GeV)";
173  axis_titles[2 ] = "#Sigma E_{T}^{Had} (GeV)";
174  axis_titles[3 ] = "#Sigma E_{T}^{HO} (GeV)";
175  axis_titles[4 ] = "N_{Tracks}";
176  axis_titles[5 ] = "N_{Jets}";
177  axis_titles[6 ] = "#Sigma p_{T,veto} (GeV)";
178  axis_titles[7 ] = "#Sigma E_{T,veto}^{EM} (GeV)";
179  axis_titles[8 ] = "#Sigma E_{T,veto}^{Had} (GeV)";
180  axis_titles[9 ] = "#Sigma E_{T,veto}^{HO} (GeV)";
181  axis_titles[10] = "#Sigma p_{T} / N_{Tracks} (GeV)";
182  axis_titles[11] = "(1.5) X #Sigma E_{T}^{EM} + #Sigma E_{T}^{Had}";
183 
184  axis_titles[12] = "#Sigma p_{T} (GeV)";
185  axis_titles[13] = "#Sigma E_{T}^{EM} (GeV)";
186  axis_titles[14] = "#Sigma E_{T}^{Had} (GeV)";
187  axis_titles[15] = "#Sigma E_{T}^{HO} (GeV)";
188  axis_titles[16] = "N_{Tracks}";
189  axis_titles[17] = "N_{Jets}";
190  axis_titles[18] = "#Sigma p_{T,veto} (GeV)";
191  axis_titles[19] = "#Sigma E_{T,veto}^{EM} (GeV)";
192  axis_titles[20] = "#Sigma E_{T,veto}^{Had} (GeV)";
193  axis_titles[21] = "#Sigma E_{T,veto}^{HO} (GeV)";
194  axis_titles[22] = "#Sigma p_{T} / N_{Tracks} (GeV)";
195  axis_titles[23] = "(1.5) X #Sigma E_{T}^{EM} + #Sigma E_{T}^{Had}";
196 
197  //-----------Names given for the root file----------
198  names[0 ] = "sumPt_R03";
199  names[1 ] = "emEt_R03";
200  names[2 ] = "hadEt_R03";
201  names[3 ] = "hoEt_R03";
202  names[4 ] = "nTracks_R03";
203  names[5 ] = "nJets_R03";
204  names[6 ] = "trackerVetoPt_R03";
205  names[7 ] = "emVetoEt_R03";
206  names[8 ] = "hadVetoEt_R03";
207  names[9 ] = "hoVetoEt_R03";
208  names[10] = "avgPt_R03";
209  names[11] = "weightedEt_R03";
210 
211  names[12] = "sumPt_R05";
212  names[13] = "emEt_R05";
213  names[14] = "hadEt_R05";
214  names[15] = "hoEt_R05";
215  names[16] = "nTracks_R05";
216  names[17] = "nJets_R05";
217  names[18] = "trackerVetoPt_R05";
218  names[19] = "emVetoEt_R05";
219  names[20] = "hadVetoEt_R05";
220  names[21] = "hoVetoEt_R05";
221  names[22] = "avgPt_R05";
222  names[23] = "weightedEt_R05";
223 
224  //----------Parameters for binning of histograms---------
225  //param[var][0] is the number of bins
226  //param[var][1] is the low edge of the low bin
227  //param[var][2] is the high edge of the high bin
228  //
229  // maximum value------,
230  // |
231  // V
232  param[0 ][0]= (int)( 20.0/S_BIN_WIDTH); param[0 ][1]= 0.0; param[0 ][2]= param[0 ][0]*S_BIN_WIDTH;
233  param[1 ][0]= (int)( 20.0/S_BIN_WIDTH); param[1 ][1]= 0.0; param[1 ][2]= param[1 ][0]*S_BIN_WIDTH;
234  param[2 ][0]= (int)( 20.0/S_BIN_WIDTH); param[2 ][1]= 0.0; param[2 ][2]= param[2 ][0]*S_BIN_WIDTH;
235  param[3 ][0]= 20; param[3 ][1]= 0.0; param[3 ][2]= 2.0;
236  param[4 ][0]= 16; param[4 ][1]= -0.5; param[4 ][2]= param[4 ][0]-0.5;
237  param[5 ][0]= 4; param[5 ][1]= -0.5; param[5 ][2]= param[5 ][0]-0.5;
238  param[6 ][0]= (int)( 40.0/S_BIN_WIDTH); param[6 ][1]= 0.0; param[6 ][2]= param[6 ][0]*S_BIN_WIDTH;
239  param[7 ][0]= 20; param[7 ][1]= 0.0; param[7 ][2]= 10.0;
240  param[8 ][0]= (int)( 20.0/S_BIN_WIDTH); param[8 ][1]= 0.0; param[8 ][2]= param[8 ][0]*S_BIN_WIDTH;
241  param[9 ][0]= 20; param[9 ][1]= 0.0; param[9 ][2]= 5.0;
242  param[10][0]= (int)( 15.0/S_BIN_WIDTH); param[10][1]= 0.0; param[10][2]= param[10][0]*S_BIN_WIDTH;
243  param[11][0]= (int)( 20.0/S_BIN_WIDTH); param[11][1]= 0.0; param[11][2]= param[11][0]*S_BIN_WIDTH;
244 
245  param[12][0]= (int)( 20.0/S_BIN_WIDTH); param[12][1]= 0.0; param[12][2]= param[12][0]*S_BIN_WIDTH;
246  param[13][0]= (int)( 20.0/S_BIN_WIDTH); param[13][1]= 0.0; param[13][2]= param[13][0]*S_BIN_WIDTH;
247  param[14][0]= (int)( 20.0/S_BIN_WIDTH); param[14][1]= 0.0; param[14][2]= param[14][0]*S_BIN_WIDTH;
248  param[15][0]= 20; param[15][1]= 0.0; param[15][2]= 2.0;
249  param[16][0]= 16; param[16][1]= -0.5; param[16][2]= param[16][0]-0.5;
250  param[17][0]= 4; param[17][1]= -0.5; param[17][2]= param[17][0]-0.5;
251  param[18][0]= (int)( 40.0/S_BIN_WIDTH); param[18][1]= 0.0; param[18][2]= param[18][0]*S_BIN_WIDTH;
252  param[19][0]= 20; param[19][1]= 0.0; param[19][2]= 10.0;
253  param[20][0]= (int)( 20.0/S_BIN_WIDTH); param[20][1]= 0.0; param[20][2]= param[20][0]*S_BIN_WIDTH;
254  param[21][0]= 20; param[21][1]= 0.0; param[21][2]= 5.0;
255  param[22][0]= (int)( 15.0/S_BIN_WIDTH); param[22][1]= 0.0; param[22][2]= param[22][0]*S_BIN_WIDTH;
256  param[23][0]= (int)( 20.0/S_BIN_WIDTH); param[23][1]= 0.0; param[23][2]= param[23][0]*S_BIN_WIDTH;
257 
258  //--------------Is the variable continuous (i.e. non-integer)?-------------
259  //---------(Log binning will only be used for continuous variables)--------
260  isContinuous[0 ] = 1;
261  isContinuous[1 ] = 1;
262  isContinuous[2 ] = 1;
263  isContinuous[3 ] = 1;
264  isContinuous[4 ] = 0;
265  isContinuous[5 ] = 0;
266  isContinuous[6 ] = 1;
267  isContinuous[7 ] = 1;
268  isContinuous[8 ] = 1;
269  isContinuous[9 ] = 1;
270  isContinuous[10] = 1;
271  isContinuous[11] = 1;
272 
273  isContinuous[12] = 1;
274  isContinuous[13] = 1;
275  isContinuous[14] = 1;
276  isContinuous[15] = 1;
277  isContinuous[16] = 0;
278  isContinuous[17] = 0;
279  isContinuous[18] = 1;
280  isContinuous[19] = 1;
281  isContinuous[20] = 1;
282  isContinuous[21] = 1;
283  isContinuous[22] = 1;
284  isContinuous[23] = 1;
285 
286 }
std::vector< std::string > main_titles
std::vector< std::string > names
std::vector< std::vector< double > > param
std::string title_sam
std::string title_cone
std::vector< int > isContinuous
std::vector< std::string > axis_titles
static const int NUM_VARS
void MuonIsolationDQM::NormalizeHistos ( )
private

Definition at line 457 of file MuonIsolationDQM.cc.

References python.tagInventory::entries, GetTH1FromMonitorElement(), h_1D, and NUM_VARS.

Referenced by endJob().

457  {
458  for(int var=0; var<NUM_VARS; var++){
459  //turn cd_plots into CDF's
460  //underflow -> bin #0. overflow -> bin #(nbins+1)
461  //0th bin doesn't need changed
462 
463  double entries = GetTH1FromMonitorElement(h_1D[var])->GetEntries();
464 
465  /* int n_max = int(param[var][0])+1;
466  for(int n=1; n<=n_max; ++n){
467  cd_plots[var]->setBinContent(n, cd_plots[var]->getBinContent(n) + cd_plots[var]->getBinContent(n-1)); //Integrate.
468  }
469  */
470  //----normalize------
471  /* if (requireCombinedMuon) {
472  GetTH1FromMonitorElement(h_1D[var])->Scale(1./entries);
473  GetTH1FromMonitorElement(cd_plots[var])->Scale(1./entries);
474  }
475  else {
476  */
477  GetTH1FromMonitorElement(h_1D[var])->Scale(1./entries);
478  // GetTH1FromMonitorElement(cd_plots[var])->Scale(1./entries);
479  }
480 }
std::vector< MonitorElement * > h_1D
static const int NUM_VARS
TH1 * GetTH1FromMonitorElement(MonitorElement *me)
void MuonIsolationDQM::RecordData ( MuonIterator  muon)
private

Definition at line 330 of file MuonIsolationDQM.cc.

References theData.

Referenced by analyze().

330  {
331 
332 
333  theData[0] = muon->isolationR03().sumPt;
334  theData[1] = muon->isolationR03().emEt;
335  theData[2] = muon->isolationR03().hadEt;
336  theData[3] = muon->isolationR03().hoEt;
337 
338  theData[4] = muon->isolationR03().nTracks;
339  theData[5] = muon->isolationR03().nJets;
340  theData[6] = muon->isolationR03().trackerVetoPt;
341  theData[7] = muon->isolationR03().emVetoEt;
342  theData[8] = muon->isolationR03().hadVetoEt;
343  theData[9] = muon->isolationR03().hoVetoEt;
344 
345  // make sure nTracks != 0 before filling this one
346  if (theData[4] != 0) theData[10] = (double)theData[0] / (double)theData[4];
347  else theData[10] = -99;
348 
349  theData[11] = 1.5 * theData[1] + theData[2];
350 
351  theData[12] = muon->isolationR05().sumPt;
352  theData[13] = muon->isolationR05().emEt;
353  theData[14] = muon->isolationR05().hadEt;
354  theData[15] = muon->isolationR05().hoEt;
355 
356  theData[16] = muon->isolationR05().nTracks;
357  theData[17] = muon->isolationR05().nJets;
358  theData[18] = muon->isolationR05().trackerVetoPt;
359  theData[19] = muon->isolationR05().emVetoEt;
360  theData[20] = muon->isolationR05().hadVetoEt;
361  theData[21] = muon->isolationR05().hoVetoEt;
362 
363  // make sure nTracks != 0 before filling this one
364  if (theData[16] != 0) theData[22] = (double)theData[12] / (double)theData[16];
365  else theData[22] = -99;
366 
367  theData[23] = 1.5 * theData[13] + theData[14];
368 
369 }
double theData[NUM_VARS]

Member Data Documentation

std::vector<std::string> MuonIsolationDQM::axis_titles
private

Definition at line 112 of file MuonIsolationDQM.h.

Referenced by InitHistos(), and InitStatics().

DQMStore* MuonIsolationDQM::dbe
private

Definition at line 120 of file MuonIsolationDQM.h.

Referenced by analyze(), beginJob(), endJob(), InitHistos(), and MuonIsolationDQM().

std::string MuonIsolationDQM::dirName
private
edm::InputTag MuonIsolationDQM::ecalIsoDeposit_Tag
private

Definition at line 87 of file MuonIsolationDQM.h.

std::vector<MonitorElement*> MuonIsolationDQM::h_1D
private

Definition at line 128 of file MuonIsolationDQM.h.

Referenced by FillHistos(), InitHistos(), MuonIsolationDQM(), and NormalizeHistos().

MonitorElement* MuonIsolationDQM::h_nMuons
private

Definition at line 127 of file MuonIsolationDQM.h.

Referenced by analyze(), and InitHistos().

edm::InputTag MuonIsolationDQM::hcalIsoDeposit_Tag
private

Definition at line 86 of file MuonIsolationDQM.h.

edm::InputTag MuonIsolationDQM::hoIsoDeposit_Tag
private

Definition at line 88 of file MuonIsolationDQM.h.

std::vector<int> MuonIsolationDQM::isContinuous
private

Definition at line 115 of file MuonIsolationDQM.h.

Referenced by InitStatics().

double MuonIsolationDQM::L_BIN_WIDTH
private

Definition at line 98 of file MuonIsolationDQM.h.

Referenced by InitStatics().

int MuonIsolationDQM::LOG_BINNING_ENABLED
private

Definition at line 100 of file MuonIsolationDQM.h.

Referenced by InitStatics().

double MuonIsolationDQM::LOG_BINNING_RATIO
private

Definition at line 102 of file MuonIsolationDQM.h.

Referenced by InitStatics().

std::vector<std::string> MuonIsolationDQM::main_titles
private

Definition at line 111 of file MuonIsolationDQM.h.

Referenced by InitHistos(), and InitStatics().

edm::InputTag MuonIsolationDQM::Muon_Tag
private

Definition at line 84 of file MuonIsolationDQM.h.

Referenced by analyze(), and MuonIsolationDQM().

std::vector<std::string> MuonIsolationDQM::names
private

Definition at line 113 of file MuonIsolationDQM.h.

Referenced by InitHistos(), and InitStatics().

int MuonIsolationDQM::nEvents
private

Definition at line 132 of file MuonIsolationDQM.h.

Referenced by analyze(), endJob(), and MuonIsolationDQM().

int MuonIsolationDQM::nGLBMuons
private

Definition at line 134 of file MuonIsolationDQM.h.

Referenced by analyze(), and MuonIsolationDQM().

int MuonIsolationDQM::nSTAMuons
private

Definition at line 133 of file MuonIsolationDQM.h.

Referenced by analyze(), and MuonIsolationDQM().

int MuonIsolationDQM::nTRKMuons
private

Definition at line 135 of file MuonIsolationDQM.h.

Referenced by analyze(), and MuonIsolationDQM().

int MuonIsolationDQM::NUM_LOG_BINS
private

Definition at line 101 of file MuonIsolationDQM.h.

Referenced by InitStatics().

const int MuonIsolationDQM::NUM_VARS = 24
staticprivate
std::vector< std::vector<double> > MuonIsolationDQM::param
private

Definition at line 114 of file MuonIsolationDQM.h.

Referenced by FillHistos(), InitHistos(), and InitStatics().

bool MuonIsolationDQM::requireGLBMuon
private

Definition at line 103 of file MuonIsolationDQM.h.

Referenced by analyze(), and MuonIsolationDQM().

bool MuonIsolationDQM::requireSTAMuon
private

Definition at line 104 of file MuonIsolationDQM.h.

Referenced by analyze(), and MuonIsolationDQM().

bool MuonIsolationDQM::requireTRKMuon
private

Definition at line 105 of file MuonIsolationDQM.h.

Referenced by analyze(), and MuonIsolationDQM().

std::string MuonIsolationDQM::rootfilename
private

Definition at line 91 of file MuonIsolationDQM.h.

double MuonIsolationDQM::S_BIN_WIDTH
private

Definition at line 99 of file MuonIsolationDQM.h.

Referenced by InitStatics().

double MuonIsolationDQM::theData[NUM_VARS]
private

Definition at line 124 of file MuonIsolationDQM.h.

Referenced by FillHistos(), and RecordData().

int MuonIsolationDQM::theMuonData
private

Definition at line 123 of file MuonIsolationDQM.h.

Referenced by analyze().

std::string MuonIsolationDQM::title_cone
private

Definition at line 108 of file MuonIsolationDQM.h.

Referenced by InitHistos(), and InitStatics().

std::string MuonIsolationDQM::title_sam
private

Definition at line 107 of file MuonIsolationDQM.h.

Referenced by InitHistos(), and InitStatics().

edm::InputTag MuonIsolationDQM::tkIsoDeposit_Tag
private

Definition at line 85 of file MuonIsolationDQM.h.