CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuIsoValidation.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // MuIsoValidation.cc
3 // Package: Muon Isolation Validation
4 // Class: MuIsoValidation
5 //
6 /*
7 
8 
9  Description: Muon Isolation Validation class
10 
11  Implementation: This code will accept a data set and generate plots of
12  various quantities relevent to the Muon Isolation module. We will
13  be using the IsoDeposit class, *not* the MuonIsolation struct.
14 
15  The sequence of events is...
16  * initalize statics (which variables to plot, axis limtis, etc.)
17  * run over events
18  * for each event, run over the muons in that event
19  *record IsoDeposit data
20  * transfer data to histograms, profile plots
21  * save histograms to a root file
22 
23  Easy-peasy.
24 
25 */
26 //
27 // Original Author: "C. Jess Riedel", UC Santa Barbara
28 // Created: Tue Jul 17 15:58:24 CDT 2007
29 //
30 
31 //Class header file
33 
34 //System included files
35 #include <memory>
36 #include <string>
37 #include <typeinfo>
38 #include <utility>
39 
40 //Root included files
41 #include "TH1.h"
42 #include "TH2.h"
43 #include "TProfile.h"
44 
45 //Event framework included files
49 
50 //Other included files
52 
53 //Using declarations
54 using std::vector;
55 using std::pair;
56 using std::string;
57 
58 
59 
60 //
61 //-----------------Constructors---------------------
62 //
64 {
65 
66  // rootfilename = iConfig.getUntrackedParameter<string>("rootfilename"); // comment out for inclusion
67  requireCombinedMuon = iConfig.getUntrackedParameter<bool>("requireCombinedMuon");
68  dirName = iConfig.getParameter<std::string>("directory");
69  // subDirName = iConfig.getParameter<std::string>("@module_label");
70 
71  // dirName += subDirName;
72 
73  //--------Initialize tags-------
74  Muon_Tag = iConfig.getUntrackedParameter<edm::InputTag>("Global_Muon_Label");
75  Muon_Token = consumes<edm::View<reco::Muon> >(Muon_Tag);
76 
77  //-------Initialize counters----------------
78  nEvents = 0;
79  nIncMuons = 0;
80  // nCombinedMuons = 0;
81 
82  InitStatics();
83 
84  //Set up DAQ
85  dbe = 0;
87 
88  //------"allocate" space for the data vectors-------
89 
90  /*
91  h_1D is a 2D vector with indices [var][muon#]
92  cd_plots is a 2D vector with indices [var][muon#]
93  h_2D is a 3D vector with indices [var][var][muon#]
94  p_2D is a 3D vector with indices [var][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  // h_2D.resize(NUM_VARS, vector<MonitorElement*> (NUM_VARS));
103  p_2D.resize(NUM_VARS, vector<MonitorElement*>(NUM_VARS));
104 
105  dbe->cd();
106 }
107 
108 //
109 //----------Destructor-----------------
110 //
112 
113  //Deallocate memory
114 
115 }
116 
117 //
118 //------------Methods-----------------------
119 //
121 
122  //-----------Initialize primatives-----------
123  S_BIN_WIDTH = 1.0;//in GeV
124  L_BIN_WIDTH = 2.0;//in GeV
126  NUM_LOG_BINS = 15;
127  LOG_BINNING_RATIO = 1.1;//ratio by which each bin is wider than the last for log binning
128  //i.e. bin widths are (x), (r*x), (r^2*x), ..., (r^(nbins)*x)
129 
130 
131  //-------Initialize Titles---------
132  title_sam = "";//"[Sample b-jet events] ";
133  title_cone = "";//" [in R=0.3 IsoDeposit Cone]";
134  //The above two pieces of info will be printed on the title of the whole page,
135  //not for each individual histogram
136  title_cd = "C.D. of ";
137 
138  //-------"Allocate" memory for vectors
139  main_titles.resize(NUM_VARS);
140  axis_titles.resize(NUM_VARS);
141  names.resize(NUM_VARS);
142  param.resize(NUM_VARS, vector<double>(3) );
143  isContinuous.resize(NUM_VARS);
144  cdCompNeeded.resize(NUM_VARS);
145 
146  //-----Titles of the plots-----------
147  main_titles[0 ] = "Total Tracker Momentum";
148  main_titles[1 ] = "Total EM Cal Energy";
149  main_titles[2 ] = "Total Had Cal Energy";
150  main_titles[3 ] = "Total HO Cal Energy";
151  main_titles[4 ] = "Number of Tracker Tracks";
152  main_titles[5 ] = "Number of Jets around Muon";
153  main_titles[6 ] = "Tracker p_{T} within veto cone";
154  main_titles[7 ] = "EM E_{T} within veto cone";
155  main_titles[8 ] = "Had E_{T} within veto cone";
156  main_titles[9 ] = "HO E_{T} within veto cone";
157  main_titles[10] = "Muon p_{T}";
158  main_titles[11] = "Muon #eta";
159  main_titles[12] = "Muon #phi";
160  main_titles[13] = "Average Momentum per Track ";
161  main_titles[14] = "Weighted Energy";
162  main_titles[15] = "PF Sum of Charged Hadron Pt";
163  main_titles[16] = "PF Sum of Total Hadron Pt";
164  main_titles[17] = "PF Sum of E,Mu Pt";
165  main_titles[18] = "PF Sum of Neutral Hadron Et";
166  main_titles[19] = "PF Sum of Photon Et";
167  main_titles[20] = "PF Sum of Pt from non-PV";
168 
169  //------Titles on the X or Y axis------------
170  axis_titles[0 ] = "#Sigma p_{T} (GeV)";
171  axis_titles[1 ] = "#Sigma E_{T}^{EM} (GeV)";
172  axis_titles[2 ] = "#Sigma E_{T}^{Had} (GeV)";
173  axis_titles[3 ] = "#Sigma E_{T}^{HO} (GeV)";
174  axis_titles[4 ] = "N_{Tracks}";
175  axis_titles[5 ] = "N_{Jets}";
176  axis_titles[6 ] = "#Sigma p_{T,veto} (GeV)";
177  axis_titles[7 ] = "#Sigma E_{T,veto}^{EM} (GeV)";
178  axis_titles[8 ] = "#Sigma E_{T,veto}^{Had} (GeV)";
179  axis_titles[9 ] = "#Sigma E_{T,veto}^{HO} (GeV)";
180  axis_titles[10] = "p_{T,#mu} (GeV)";
181  axis_titles[11] = "#eta_{#mu}";
182  axis_titles[12] = "#phi_{#mu}";
183  axis_titles[13] = "#Sigma p_{T} / N_{Tracks} (GeV)";
184  axis_titles[14] = "(1.5) X #Sigma E_{T}^{EM} + #Sigma E_{T}^{Had}";
185  axis_titles[15] = "#Sigma p_{T}^{PFHadCha} (GeV)";
186  axis_titles[16] = "#Sigma p_{T}^{PFTotCha} (GeV)";
187  axis_titles[17] = "#Sigma p_{T}^{PFEMu} (GeV)";
188  axis_titles[18] = "#Sigma E_{T}^{PFHadNeu} (GeV)";
189  axis_titles[19] = "#Sigma E_{T}^{PFPhot} (GeV)";
190  axis_titles[20] = "#Sigma p_{T}^{PFPU} (GeV)";
191 
192  //-----------Names given for the root file----------
193  names[0 ] = "sumPt";
194  names[1 ] = "emEt";
195  names[2 ] = "hadEt";
196  names[3 ] = "hoEt";
197  names[4 ] = "nTracks";
198  names[5 ] = "nJets";
199  names[6 ] = "trackerVetoPt";
200  names[7 ] = "emVetoEt";
201  names[8 ] = "hadVetoEt";
202  names[9 ] = "hoVetoEt";
203  names[10] = "muonPt";
204  names[11] = "muonEta";
205  names[12] = "muonPhi";
206  names[13] = "avgPt";
207  names[14] = "weightedEt";
208  names[15] = "PFsumChargedHadronPt";
209  names[16] = "PFsumChargedTotalPt";
210  names[17] = "PFsumEMuPt";
211  names[18] = "PFsumNeutralHadronEt";
212  names[19] = "PFsumPhotonEt";
213  names[20] = "PFsumPUPt";
214 
215  //----------Parameters for binning of histograms---------
216  //param[var][0] is the number of bins
217  //param[var][1] is the low edge of the low bin
218  //param[var][2] is the high edge of the high bin
219  //
220  // maximum value------,
221  // |
222  // V
223  param[0 ][0]= (int)( 20.0/S_BIN_WIDTH); param[0 ][1]= 0.0; param[0 ][2]= param[0 ][0]*S_BIN_WIDTH;
224  param[1 ][0]= (int)( 20.0/S_BIN_WIDTH); param[1 ][1]= 0.0; param[1 ][2]= param[1 ][0]*S_BIN_WIDTH;
225  param[2 ][0]= (int)( 20.0/S_BIN_WIDTH); param[2 ][1]= 0.0; param[2 ][2]= param[2 ][0]*S_BIN_WIDTH;
226  param[3 ][0]= 20; param[3 ][1]= 0.0; param[3 ][2]= 2.0;
227  param[4 ][0]= 16; param[4 ][1]= -0.5; param[4 ][2]= param[4 ][0]-0.5;
228  param[5 ][0]= 4; param[5 ][1]= -0.5; param[5 ][2]= param[5 ][0]-0.5;
229  param[6 ][0]= (int)( 40.0/S_BIN_WIDTH); param[6 ][1]= 0.0; param[6 ][2]= param[6 ][0]*S_BIN_WIDTH;
230  param[7 ][0]= 20; param[7 ][1]= 0.0; param[7 ][2]= 10.0;
231  param[8 ][0]= (int)( 20.0/S_BIN_WIDTH); param[8 ][1]= 0.0; param[8 ][2]= param[8 ][0]*S_BIN_WIDTH;
232  param[9 ][0]= 20; param[9 ][1]= 0.0; param[9 ][2]= 5.0;
233  param[10][0]= (int)( 40.0/S_BIN_WIDTH); param[10][1]= 0.0; param[10][2]= param[10][0]*S_BIN_WIDTH;
234  param[11][0]= 24; param[11][1]= -2.4; param[11][2]= 2.4;
235  param[12][0]= 32; param[12][1]= -3.2; param[12][2]= 3.2;
236  param[13][0]= (int)( 15.0/S_BIN_WIDTH); param[13][1]= 0.0; param[13][2]= param[13][0]*S_BIN_WIDTH;
237  param[14][0]= (int)( 20.0/S_BIN_WIDTH); param[14][1]= 0.0; param[14][2]= param[14][0]*S_BIN_WIDTH;
238  param[15][0]= (int)( 20.0/S_BIN_WIDTH); param[15][1]= 0.0; param[15][2]= param[15][0]*S_BIN_WIDTH;
239  param[16][0]= (int)( 20.0/S_BIN_WIDTH); param[15][1]= 0.0; param[16][2]= param[16][0]*S_BIN_WIDTH;
240  param[17][0]= (int)( 20.0/S_BIN_WIDTH)+1; param[17][1]= -S_BIN_WIDTH; param[17][2]= param[17][0]*S_BIN_WIDTH;
241  param[18][0]= (int)( 20.0/S_BIN_WIDTH); param[18][1]= 0.0; param[18][2]= param[18][0]*S_BIN_WIDTH;
242  param[19][0]= (int)( 20.0/S_BIN_WIDTH); param[19][1]= 0.0; param[19][2]= param[19][0]*S_BIN_WIDTH;
243  param[20][0]= (int)( 20.0/S_BIN_WIDTH); param[20][1]= 0.0; param[20][2]= param[20][0]*S_BIN_WIDTH;
244 
245  //--------------Is the variable continuous (i.e. non-integer)?-------------
246  //---------(Log binning will only be used for continuous variables)--------
247  isContinuous[0 ] = 1;
248  isContinuous[1 ] = 1;
249  isContinuous[2 ] = 1;
250  isContinuous[3 ] = 1;
251  isContinuous[4 ] = 0;
252  isContinuous[5 ] = 0;
253  isContinuous[6 ] = 1;
254  isContinuous[7 ] = 1;
255  isContinuous[8 ] = 1;
256  isContinuous[9 ] = 1;
257  isContinuous[10] = 1;
258  isContinuous[11] = 1;
259  isContinuous[12] = 1;
260  isContinuous[13] = 1;
261  isContinuous[14] = 1;
262  isContinuous[15] = 1;
263  isContinuous[16] = 1;
264  isContinuous[17] = 1;
265  isContinuous[18] = 1;
266  isContinuous[19] = 1;
267  isContinuous[20] = 1;
268 
269  //----Should the cumulative distribution be calculated for this variable?-----
270  cdCompNeeded[0 ] = 1;
271  cdCompNeeded[1 ] = 1;
272  cdCompNeeded[2 ] = 1;
273  cdCompNeeded[3 ] = 1;
274  cdCompNeeded[4 ] = 1;
275  cdCompNeeded[5 ] = 1;
276  cdCompNeeded[6 ] = 1;
277  cdCompNeeded[7 ] = 1;
278  cdCompNeeded[8 ] = 1;
279  cdCompNeeded[9 ] = 1;
280  cdCompNeeded[10] = 0;
281  cdCompNeeded[11] = 0;
282  cdCompNeeded[12] = 0;
283  cdCompNeeded[13] = 1;
284  cdCompNeeded[14] = 1;
285  cdCompNeeded[15] = 1;
286  cdCompNeeded[16] = 1;
287  cdCompNeeded[17] = 1;
288  cdCompNeeded[18] = 1;
289  cdCompNeeded[19] = 1;
290  cdCompNeeded[20] = 1;
291 }
292 
293 
294 // ------------ method called for each event ------------
296 
297  ++nEvents;
298  edm::LogInfo("Tutorial") << "\nInvestigating event #" << nEvents<<"\n";
299 
300  // Get Muon Collection
301  edm::Handle<edm::View<reco::Muon> > muonsHandle; //
302  iEvent.getByToken(Muon_Token, muonsHandle);
303 
304  //Fill event entry in histogram of number of muons
305  edm::LogInfo("Tutorial") << "Number of Muons: " << muonsHandle->size();
306  theMuonData = muonsHandle->size();
308 
309  //Fill historgams concerning muon isolation
310  uint iMuon=0;
311  dbe->setCurrentFolder(dirName.c_str());
312  for (MuonIterator muon = muonsHandle->begin(); muon != muonsHandle->end(); ++muon, ++iMuon ) {
313  ++nIncMuons;
314  if (requireCombinedMuon) {
315  if (muon->combinedMuon().isNull()) continue;
316  }
317  // ++nCombinedMuons;
318  RecordData(muon);
319  FillHistos();
320  }
321  dbe->cd();
322 
323 }
324 
325 //---------------Record data for a signle muon's data---------------------
327 
328 
329  theData[0] = muon->isolationR03().sumPt;
330  theData[1] = muon->isolationR03().emEt;
331  theData[2] = muon->isolationR03().hadEt;
332  theData[3] = muon->isolationR03().hoEt;
333 
334  theData[4] = muon->isolationR03().nTracks;
335  theData[5] = muon->isolationR03().nJets;
336  theData[6] = muon->isolationR03().trackerVetoPt;
337  theData[7] = muon->isolationR03().emVetoEt;
338  theData[8] = muon->isolationR03().hadVetoEt;
339  theData[9] = muon->isolationR03().hoVetoEt;
340 
341  theData[10] = muon->pt();
342  theData[11] = muon->eta();
343  theData[12] = muon->phi();
344 
345  // make sure nTracks != 0 before filling this one
346  if (theData[4] != 0) theData[13] = (double)theData[0] / (double)theData[4];
347  else theData[13] = -99;
348 
349  theData[14] = 1.5 * theData[1] + theData[2];
350 
351  // Now PF isolation
352  theData[15] = -99.;
353  theData[16] = -99.;
354  theData[17] = -99.;
355  theData[18] = -99.;
356  theData[19] = -99.;
357  theData[20] = -99.;
358  if ( muon->isPFMuon() && muon->isPFIsolationValid() ) {
359  theData[15] = muon->pfIsolationR03().sumChargedHadronPt;
360  theData[16] = muon->pfIsolationR03().sumChargedParticlePt;
361  theData[17] = muon->pfIsolationR03().sumChargedParticlePt-muon->pfIsolationR03().sumChargedHadronPt;
362  theData[18] = muon->pfIsolationR03().sumNeutralHadronEt;
363  theData[19] = muon->pfIsolationR03().sumPhotonEt;
364  theData[20] = muon->pfIsolationR03().sumPUPt;
365  }
366 
367 }
368 
369 // ------------ method called once each job just before starting event loop ------------
370 void
372 {
373 
374  edm::LogInfo("Tutorial") << "\n#########################################\n\n"
375  << "Lets get started! "
376  << "\n\n#########################################\n";
377  dbe->setCurrentFolder(dirName.c_str());
378  InitHistos();
379  dbe->cd();
380 
381 }
382 
383 // ------------ method called once each job just after ending the event loop ------------
384 void
386 
387  // check if ME still there (and not killed by MEtoEDM for memory saving)
388  if( dbe )
389  {
390  // check existence of first histo in the list
391  if (! dbe->get(dirName+"/nMuons")) return;
392  }
393  else
394  return;
395 
396  edm::LogInfo("Tutorial") << "\n#########################################\n\n"
397  << "Total Number of Events: " << nEvents
398  << "\nTotal Number of Muons: " << nIncMuons
399  << "\n\n#########################################\n"
400  << "\nInitializing Histograms...\n";
401 
402  edm::LogInfo("Tutorial") << "\nIntializing Finished. Filling...\n";
403  NormalizeHistos();
404  edm::LogInfo("Tutorial") << "\nFilled. Saving...\n";
405  // dbe->save(rootfilename); // comment out for incorporation
406  edm::LogInfo("Tutorial") << "\nSaved. Peace, homie, I'm out.\n";
407 
408 }
409 
411 
412  //---initialize number of muons histogram---
413  h_nMuons = dbe->book1D("nMuons", title_sam + "Number of Muons", 20, 0., 20.);
414  h_nMuons->setAxisTitle("Number of Muons",XAXIS);
415  h_nMuons->setAxisTitle("Fraction of Events",YAXIS);
416 
417 
418  //---Initialize 1D Histograms---
419  for(int var = 0; var < NUM_VARS; var++){
420  h_1D[var] = dbe->book1D(
421  names[var],
422  title_sam + main_titles[var] + title_cone,
423  (int)param[var][0],
424  param[var][1],
425  param[var][2]
426  );
427  h_1D[var]->setAxisTitle(axis_titles[var],XAXIS);
428  h_1D[var]->setAxisTitle("Fraction of Muons",YAXIS);
429  GetTH1FromMonitorElement(h_1D[var])->Sumw2();
430 
431  if (cdCompNeeded[var]) {
432  cd_plots[var] = dbe->book1D(
433  names[var] + "_cd",
435  (int)param[var][0],
436  param[var][1],
437  param[var][2]
438  );
439  cd_plots[var]->setAxisTitle(axis_titles[var],XAXIS);
440  cd_plots[var]->setAxisTitle("Fraction of Muons",YAXIS);
441  GetTH1FromMonitorElement(cd_plots[var])->Sumw2();
442  }
443  }//Finish 1D
444 
445  //---Initialize 2D Histograms---
446  for(int var1 = 0; var1 < NUM_VARS; var1++){
447  for(int var2 = 0; var2 < NUM_VARS; var2++){
448  if(var1 == var2) continue;
449 
450  /* h_2D[var1][var2] = dbe->book2D(
451  names[var1] + "_" + names[var2] + "_s",
452  //title is in "y-var vs. x-var" format
453  title_sam + main_titles[var2] + " <vs> " + main_titles[var1] + title_cone,
454  (int)param[var1][0],
455  param[var1][1],
456  param[var1][2],
457  (int)param[var2][0],
458  param[var2][1],
459  param[var2][2]
460  );
461  */
462  //Monitor elements is weird and takes y axis parameters as well
463  //as x axis parameters for a 1D profile plot
464  p_2D[var1][var2] = dbe->bookProfile(
465  names[var1] + "_" + names[var2],
466  title_sam + main_titles[var2] + " <vs> " + main_titles[var1] + title_cone,
467  (int)param[var1][0],
468  param[var1][1],
469  param[var1][2],
470  (int)param[var2][0], //documentation says this is disregarded
471  param[var2][1], //does this do anything?
472  param[var2][2], //does this do anything?
473  " " //profile errors = spread/sqrt(num_datums)
474  );
475 
476  if(LOG_BINNING_ENABLED && isContinuous[var1]){
477  Double_t * bin_edges = new Double_t[NUM_LOG_BINS+1];
478  // nbins+1 because there is one more edge than there are bins
479  MakeLogBinsForProfile(bin_edges, param[var1][1], param[var1][2]);
480  GetTProfileFromMonitorElement(p_2D[var1][var2])->SetBins(NUM_LOG_BINS, bin_edges);
481  delete[] bin_edges;
482  }
483  /* h_2D[var1][var2]->setAxisTitle(axis_titles[var1],XAXIS);
484  h_2D[var1][var2]->setAxisTitle(axis_titles[var2],YAXIS);
485  GetTH2FromMonitorElement(h_2D[var1][var2])->Sumw2();
486  */
487 
488  p_2D[var1][var2]->setAxisTitle(axis_titles[var1],XAXIS);
489  p_2D[var1][var2]->setAxisTitle(axis_titles[var2],YAXIS);
490  // GetTProfileFromMonitorElement(p_2D[var1][var2])->Sumw2();
491  }
492  }//Finish 2D
493 
494 
495 
496  //avg pT not defined for zero tracks.
497  //MonitorElement is inflxible and won't let me change the
498  //number of bins! I guess all I'm doing here is changing
499  //range of the x axis when it is printed, not the actual
500  //bins that are filled
501  p_2D[4][9]->setAxisRange(0.5,15.5,XAXIS);
502 
503 }
504 
506  const double max){
507 
508  const double &r = LOG_BINNING_RATIO;
509  const int &nbins = NUM_LOG_BINS;
510 
511  const double first_bin_width = (r > 1.0) ? //so we don't divide by zero
512  (max - min)*(1-r)/(1-pow(r,nbins)) :
513  (max - min)/nbins;
514 
515  bin_edges[0] = min;
516  bin_edges[1] = min + first_bin_width;
517  for(int n = 2; n<nbins; ++n){
518  bin_edges[n] = bin_edges[n-1] + (bin_edges[n-1] - bin_edges[n-2])*r;
519  }
520  bin_edges[nbins] = max;
521 }
522 
524  for(int var=0; var<NUM_VARS; var++){
525  //turn cd_plots into CDF's
526  //underflow -> bin #0. overflow -> bin #(nbins+1)
527  //0th bin doesn't need changed
528 
529  //----normalize------
530  double entries = GetTH1FromMonitorElement(h_1D[var])->GetEntries();
531  if (entries==0)continue;
532  GetTH1FromMonitorElement(h_1D[var])->Scale(1./entries);
533 
534  if (cdCompNeeded[var]) {
535  int n_max = int(param[var][0])+1;
536  for(int n=1; n<=n_max; ++n){
537  cd_plots[var]->setBinContent(n, cd_plots[var]->getBinContent(n) + cd_plots[var]->getBinContent(n-1)); //Integrate.
538  }
539  //----normalize------
540  GetTH1FromMonitorElement(cd_plots[var])->Scale(1./entries);
541  }
542  }
543 }
544 
546 
547  int overFlowBin;
548  double overFlow = 0;
549 
550  //----------Fill 1D histograms---------------
551  for(int var=0; var<NUM_VARS; var++){
552  h_1D[var]->Fill(theData[var]);
553  if (cdCompNeeded[var]) cd_plots[var]->Fill(theData[var]);//right now, this is a regular PDF (just like h_1D)
554  if (theData[var] > param[var][2]) {
555  // fill the overflow bin
556  overFlowBin = (int) param[var][0] + 1;
557  overFlow = GetTH1FromMonitorElement(h_1D[var])->GetBinContent(overFlowBin);
558  GetTH1FromMonitorElement(h_1D[var])->SetBinContent(overFlowBin, overFlow + 1);
559  }
560  }//Finish 1D
561 
562  //----------Fill 2D histograms---------------
563  for(int var1=0; var1<NUM_VARS; ++var1){
564  for(int var2=0; var2<NUM_VARS; ++var2){
565  if(var1 == var2) continue;
566  //change below to regular int interating!
567  // h_2D[var1][var2]->Fill(theData[var1], theData[var2]);
568  p_2D[var1][var2]->Fill(theData[var1], theData[var2]);
569  }
570  }//Finish 2D
571 }
572 
574  return me->getTH1();
575 }
576 
578  return me->getTH2F();
579 }
580 
582  return me->getTProfile();
583 }
584 
585 
586 //define this as a plug-in
void RecordData(MuonIterator muon)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > isContinuous
TH1 * GetTH1FromMonitorElement(MonitorElement *me)
std::vector< std::vector< MonitorElement * > > p_2D
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
std::vector< std::string > names
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::string title_cd
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:561
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
edm::View< reco::Muon >::const_iterator MuonIterator
std::vector< std::string > main_titles
TH2 * GetTH2FromMonitorElement(MonitorElement *me)
double theData[NUM_VARS]
virtual void beginJob()
MuIsoValidation(const edm::ParameterSet &)
std::vector< MonitorElement * > h_1D
TProfile * GetTProfileFromMonitorElement(MonitorElement *me)
edm::EDGetTokenT< edm::View< reco::Muon > > Muon_Token
void Fill(long long x)
MonitorElement * h_nMuons
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int iEvent
Definition: GenABIO.cc:243
std::string title_sam
const T & max(const T &a, const T &b)
std::vector< MonitorElement * > cd_plots
std::string dirName
std::string title_cone
TH1 * getTH1(void) const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1186
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
static const int NUM_VARS
std::vector< std::vector< double > > param
TProfile * getTProfile(void) const
void MakeLogBinsForProfile(Double_t *bin_edges, const double min, const double max)
std::vector< std::string > axis_titles
TH2F * getTH2F(void) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
edm::InputTag Muon_Tag
virtual void endJob()
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
std::vector< int > cdCompNeeded