CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FlavourHistorgrams.h
Go to the documentation of this file.
1 
2 #ifndef FlavourHistograms_H
3 #define FlavourHistograms_H
4 
8 
9 // #include "BTagPlotPrintC.h"
10 
11 #include "TH1F.h"
12 #include "TCanvas.h"
13 #include "TROOT.h"
14 #include "TSystem.h"
15 #include "TStyle.h"
16 
19 #include <iostream>
20 #include <string>
21 
22 //class DQMStore;
23 
24 //
25 // class to describe Histo
26 //
27 template <class T>
29 
30 public:
31  FlavourHistograms (const std::string& baseNameTitle_ , const std::string& baseNameDescription_ ,
32  const int& nBins_ , const double& lowerBound_ , const double& upperBound_ ,
33  const std::string& plotFirst_ , const std::string& folder,
34  const unsigned int& mc, DQMStore::IGetter & iget) ;
35 
36  FlavourHistograms (const std::string& baseNameTitle_ , const std::string& baseNameDescription_ ,
37  const int& nBins_ , const double& lowerBound_ , const double& upperBound_ ,
38  const bool& statistics_ , const bool& plotLog_ , const bool& plotNormalized_ ,
39  const std::string& plotFirst_ , const std::string& folder,
40  const unsigned int& mc, DQMStore::IBooker & ibook) ;
41 
42  virtual ~FlavourHistograms () ;
43 
44  // fill entry
45  // For single variables and arrays (for arrays only a single index can be filled)
46  void fill ( const int & flavour, const T & variable) const;
47  void fill ( const int & flavour, const T & variable, const T & w) const;
48 
49  // For single variables and arrays
50  void fill ( const int & flavour, const T * variable) const;
51 
52 
53  void settitle(const char* title) ;
54 
55  void plot (TPad * theCanvas = 0) ;
56 
57  void epsPlot(const std::string& name);
58 
59  // needed for efficiency computations -> this / b
60  // (void : alternative would be not to overwrite the histos but to return a cloned HistoDescription)
61  void divide ( const FlavourHistograms<T> & bHD ) const ;
62 
63  inline void SetMaximum(const double& max) { theMax = max;}
64  inline void SetMinimum(const double& min) { theMin = min;}
65 
66 
67  // trivial access functions
68  inline std::string baseNameTitle () const { return theBaseNameTitle ; }
70  inline int nBins () const { return theNBins ; }
71  inline double lowerBound () const { return theLowerBound ; }
72  inline double upperBound () const { return theUpperBound ; }
73  inline bool statistics () const { return theStatistics ; }
74  inline bool plotLog () const { return thePlotLog ; }
75  inline bool plotNormalized () const { return thePlotNormalized ; }
76  inline std::string plotFirst () const { return thePlotFirst ; }
77  inline int* arrayDimension () const { return theArrayDimension; }
78  inline int maxDimension () const {return theMaxDimension; }
79  inline int indexToPlot () const {return theIndexToPlot; }
80 
81  // access to the histos
82  inline TH1F * histo_all () const { return theHisto_all->getTH1F() ; }
83  inline TH1F * histo_d () const { return theHisto_d ->getTH1F() ; }
84  inline TH1F * histo_u () const { return theHisto_u->getTH1F() ; }
85  inline TH1F * histo_s () const { return theHisto_s->getTH1F() ; }
86  inline TH1F * histo_c () const { return theHisto_c->getTH1F() ; }
87  inline TH1F * histo_b () const { return theHisto_b->getTH1F() ; }
88  inline TH1F * histo_g () const { return theHisto_g->getTH1F() ; }
89  inline TH1F * histo_ni () const { return theHisto_ni->getTH1F() ; }
90  inline TH1F * histo_dus () const { return theHisto_dus->getTH1F() ; }
91  inline TH1F * histo_dusg () const { return theHisto_dusg->getTH1F() ; }
92  inline TH1F * histo_pu () const { return theHisto_pu->getTH1F() ; }
93 
94  std::vector<TH1F*> getHistoVector() const;
95 
96 
97 protected:
98 
99  void fillVariable ( const int & flavour , const T & var , const T & w) const;
100 
101  //
102  // the data members
103  //
104 
105 // T * theVariable ;
106 
107  // for arrays
110  int theIndexToPlot ; // in case that not the complete array has to be plotted
111 
114  int theNBins ;
115  double theLowerBound ;
116  double theUpperBound ;
118  bool thePlotLog ;
120  std::string thePlotFirst ; // one character; gives flavour to plot first: l (light) , c , b
121  double theMin, theMax;
122 
123  // the histos
135 
136  // DQMStore * dqmStore_;
137 
138 
139  // the canvas to plot
140  TCanvas* theCanvas ;
141  private:
143 
144  unsigned int mcPlots_;
145 
146 } ;
147 
148 template <class T>
149 FlavourHistograms<T>::FlavourHistograms (const std::string& baseNameTitle_, const std::string& baseNameDescription_ ,
150  const int& nBins_ , const double& lowerBound_ , const double& upperBound_ ,
151  const std::string& plotFirst_, const std::string& folder,
152  const unsigned int& mc, DQMStore::IGetter & iget) :
153  theMaxDimension(-1), theIndexToPlot(-1), theBaseNameTitle ( baseNameTitle_ ) , theBaseNameDescription ( baseNameDescription_ ) ,
154  theNBins ( nBins_ ) , theLowerBound ( lowerBound_ ) , theUpperBound ( upperBound_ ) ,
155  theStatistics ( false ) , thePlotLog ( false ) , thePlotNormalized ( false ) ,
156  thePlotFirst ( plotFirst_ ), theMin(-1.), theMax(-1.), mcPlots_(mc)
157 {
158  // defaults for array dimensions
159  theArrayDimension = 0 ;
160 
161  // check plot order string
162  if ( thePlotFirst == "l" || thePlotFirst == "c" || thePlotFirst == "b" ) {
163  // OK
164  }
165  else {
166  // not correct: print warning and set default (l)
167  std::cout << "FlavourHistograms::FlavourHistograms : thePlotFirst was not correct : " << thePlotFirst << std::endl ;
168  std::cout << "FlavourHistograms::FlavourHistograms : Set it to default value (l)! " << std::endl ;
169  thePlotFirst = "l" ;
170  }
171 
172  if(mcPlots_%2==0) theHisto_all = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "ALL" ) ;
173  else theHisto_all = 0;
174  if (mcPlots_) {
175  if (mcPlots_>2 ) {
176  theHisto_d = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "D" ) ;
177  theHisto_u = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "U" ) ;
178  theHisto_s = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "S" ) ;
179  theHisto_g = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "G" ) ;
180  theHisto_dus = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "DUS" ) ;
181  }
182  else{
183  theHisto_d = 0;
184  theHisto_u = 0;
185  theHisto_s = 0;
186  theHisto_g = 0;
187  theHisto_dus = 0;
188  }
189  theHisto_c = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "C" ) ;
190  theHisto_b = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "B" ) ;
191  theHisto_ni = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "NI" ) ;
192  theHisto_dusg = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "DUSG") ;
193  theHisto_pu = iget.get("Btag/" + folder + "/" +theBaseNameTitle + "PU") ;
194  }
195  else{
196  theHisto_d = 0;
197  theHisto_u = 0;
198  theHisto_s = 0;
199  theHisto_c = 0;
200  theHisto_b = 0;
201  theHisto_g = 0;
202  theHisto_ni = 0;
203  theHisto_dus = 0;
204  theHisto_dusg = 0;
205  theHisto_pu = 0;
206  }
207  // defaults for other data members
208  theCanvas = 0 ;
209 }
210 
211 template <class T>
212 FlavourHistograms<T>::FlavourHistograms (const std::string& baseNameTitle_ , const std::string& baseNameDescription_ ,
213  const int& nBins_ , const double& lowerBound_ , const double& upperBound_ ,
214  const bool& statistics_ , const bool& plotLog_ , const bool& plotNormalized_ ,
215  const std::string& plotFirst_, const std::string& folder,
216  const unsigned int& mc, DQMStore::IBooker & ibook) :
217  theMaxDimension(-1), theIndexToPlot(-1), theBaseNameTitle ( baseNameTitle_ ) , theBaseNameDescription ( baseNameDescription_ ) ,
218  theNBins ( nBins_ ) , theLowerBound ( lowerBound_ ) , theUpperBound ( upperBound_ ) ,
219  theStatistics ( statistics_ ) , thePlotLog ( plotLog_ ) , thePlotNormalized ( plotNormalized_ ) ,
220  thePlotFirst ( plotFirst_ ), theMin(-1.), theMax(-1.), mcPlots_(mc)
221 {
222  // defaults for array dimensions
223  theArrayDimension = 0 ;
224 
225  // check plot order string
226  if ( thePlotFirst == "l" || thePlotFirst == "c" || thePlotFirst == "b" ) {
227  // OK
228  }
229  else {
230  // not correct: print warning and set default (l)
231  std::cout << "FlavourHistograms::FlavourHistograms : thePlotFirst was not correct : " << thePlotFirst << std::endl ;
232  std::cout << "FlavourHistograms::FlavourHistograms : Set it to default value (l)! " << std::endl ;
233  thePlotFirst = "l" ;
234  }
235 
236  // book histos
237  HistoProviderDQM prov("Btag",folder,ibook);
238  if(mcPlots_%2==0) theHisto_all = (prov.book1D( theBaseNameTitle + "ALL" , theBaseNameDescription + " all jets" , theNBins , theLowerBound , theUpperBound )) ;
239  else theHisto_all = 0;
240  if (mcPlots_) {
241  if(mcPlots_>2) {
247  }
248  else{
249  theHisto_d = 0;
250  theHisto_u = 0;
251  theHisto_s = 0;
252  theHisto_g = 0;
253  theHisto_dus = 0;
254  }
260  }else{
261  theHisto_d = 0;
262  theHisto_u = 0;
263  theHisto_s = 0;
264  theHisto_c = 0;
265  theHisto_b = 0;
266  theHisto_g = 0;
267  theHisto_ni = 0;
268  theHisto_dus = 0;
269  theHisto_dusg = 0;
270  theHisto_pu = 0;
271  }
272 
273  // statistics if requested
274  if ( theStatistics ) {
275  if(theHisto_all) theHisto_all ->getTH1F()->Sumw2() ;
276  if (mcPlots_ ) {
277  if (mcPlots_>2 ) {
278  theHisto_d ->getTH1F()->Sumw2() ;
279  theHisto_u ->getTH1F()->Sumw2() ;
280  theHisto_s ->getTH1F()->Sumw2() ;
281  theHisto_g ->getTH1F()->Sumw2() ;
282  theHisto_dus ->getTH1F()->Sumw2() ;
283  }
284  theHisto_c ->getTH1F()->Sumw2() ;
285  theHisto_b ->getTH1F()->Sumw2() ;
286  theHisto_ni ->getTH1F()->Sumw2() ;
287  theHisto_dusg->getTH1F()->Sumw2() ;
288  theHisto_pu ->getTH1F()->Sumw2() ;
289  }
290  }
291  // defaults for other data members
292  theCanvas = 0 ;
293 }
294 
295 
296 template <class T>
298  // delete the canvas*/
299  delete theCanvas ;
300 }
301 
302 // fill entry
303 template <class T> void
304 FlavourHistograms<T>::fill ( const int & flavour, const T & variable) const
305 {
306  // For single variables and arrays (for arrays only a single index can be filled)
307  fillVariable ( flavour , variable, 1.) ;
308 }
309 
310 template <class T> void
311 FlavourHistograms<T>::fill ( const int & flavour, const T & variable, const T & w) const
312 {
313  // For single variables and arrays (for arrays only a single index can be filled)
314  fillVariable ( flavour , variable, w) ;
315 }
316 
317 template <class T> void
318 FlavourHistograms<T>::fill ( const int & flavour, const T * variable) const
319 {
320  if ( theArrayDimension == 0 ) {
321  // single variable
322  fillVariable ( flavour , *variable, 1.) ;
323  } else {
324  // array
325  int iMax = (*theArrayDimension > theMaxDimension) ? theMaxDimension : *theArrayDimension ;
326  //
327  for ( int i = 0 ; i != iMax ; ++i ) {
328  // check if only one index to be plotted (<0: switched off -> plot all)
329  if ( ( theIndexToPlot < 0 ) || ( i == theIndexToPlot ) ) {
330  fillVariable ( flavour , *(variable+i) , 1.) ;
331  }
332  }
333 
334  // if single index to be filled but not enough entries: fill 0.0 (convention!)
335  if ( theIndexToPlot >= iMax ) {
336  // cout << "==>> The index to be filled is too big -> fill 0.0 : " << theBaseNameTitle << " : " << theIndexToPlot << " >= " << iMax << endl ;
337  const T& theZero = static_cast<T> ( 0.0 ) ;
338  fillVariable ( flavour , theZero , 1.) ;
339  }
340  }
341 }
342 
343 
344 template <class T>
346  if(theHisto_all) theHisto_all ->setAxisTitle(title) ;
347  if (mcPlots_) {
348  if (mcPlots_>2 ) {
349  theHisto_d ->setAxisTitle(title) ;
350  theHisto_u ->setAxisTitle(title) ;
351  theHisto_s ->setAxisTitle(title) ;
352  theHisto_g ->setAxisTitle(title) ;
353  theHisto_dus ->setAxisTitle(title) ;
354  }
355  theHisto_c ->setAxisTitle(title) ;
356  theHisto_b ->setAxisTitle(title) ;
357  theHisto_ni ->setAxisTitle(title) ;
358  theHisto_dusg->setAxisTitle(title) ;
359  theHisto_pu->setAxisTitle(title) ;
360  }
361 }
362 
363 
364 template <class T>
365 void FlavourHistograms<T>::plot (TPad * theCanvas /* = 0 */) {
366 
367 //fixme:
368  bool btppNI = false;
369  bool btppColour = true;
370 
371  if (theCanvas)
372  theCanvas->cd();
373 
374  RecoBTag::setTDRStyle()->cd();
375  gPad->UseCurrentStyle();
376 // if ( !btppTitle ) gStyle->SetOptTitle ( 0 ) ;
377 //
378 // // here: plot histograms in a canvas
379 // theCanvas = new TCanvas ( "C" + theBaseNameTitle , "C" + theBaseNameDescription ,
380 // btppXCanvas , btppYCanvas ) ;
381 // theCanvas->SetFillColor ( 0 ) ;
382 // theCanvas->cd ( 1 ) ;
383  gPad->SetLogy ( 0 ) ;
384  if ( thePlotLog ) gPad->SetLogy ( 1 ) ;
385  gPad->SetGridx ( 0 ) ;
386  gPad->SetGridy ( 0 ) ;
387  gPad->SetTitle ( 0 ) ;
388 
389  MonitorElement * histo[4];
390  int col[4], lineStyle[4], markerStyle[4];
391  int lineWidth = 1 ;
392 
393  const double markerSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
394 
395  // default (l)
396  histo[0] = theHisto_dusg ;
397  //CW histo_1 = theHisto_dus ;
398  histo[1] = theHisto_b ;
399  histo[2] = theHisto_c ;
400  histo[3]= 0 ;
401 
402  double max = theMax;
403  if (theMax<=0.) {
404  max = theHisto_dusg->getTH1F()->GetMaximum();
405  if (theHisto_b->getTH1F()->GetMaximum() > max) max = theHisto_b->getTH1F()->GetMaximum();
406  if (theHisto_c->getTH1F()->GetMaximum() > max) max = theHisto_c->getTH1F()->GetMaximum();
407  }
408 
409  if (btppNI) {
410  histo[3] = theHisto_ni ;
411  if (theHisto_ni->getTH1F()->GetMaximum() > max) max = theHisto_ni->getTH1F()->GetMaximum();
412  }
413 
414  if ( btppColour ) { // print colours
415  col[0] = 4 ;
416  col[1] = 2 ;
417  col[2] = 6 ;
418  col[3] = 3 ;
419  lineStyle[0] = 1 ;
420  lineStyle[1] = 1 ;
421  lineStyle[2] = 1 ;
422  lineStyle[3] = 1 ;
423  markerStyle[0] = 20 ;
424  markerStyle[1] = 21 ;
425  markerStyle[2] = 22 ;
426  markerStyle[3] = 23 ;
427  lineWidth = 1 ;
428  }
429  else { // different marker/line styles
430  col[1] = 1 ;
431  col[2] = 1 ;
432  col[3] = 1 ;
433  col[0] = 1 ;
434  lineStyle[0] = 2 ;
435  lineStyle[1] = 1 ;
436  lineStyle[2] = 3 ;
437  lineStyle[3] = 4 ;
438  markerStyle[0] = 20 ;
439  markerStyle[1] = 21 ;
440  markerStyle[2] = 22 ;
441  markerStyle[3] = 23 ;
442  }
443 
444  // if changing order (NI stays always last)
445 
446  // c to plot first
447  if ( thePlotFirst == "c" ) {
448  histo[0] = theHisto_c ;
449  if ( btppColour ) col[0] = 6 ;
450  if ( !btppColour ) lineStyle[0] = 3 ;
451  histo[2] = theHisto_dusg ;
452  if ( btppColour ) col[2] = 4 ;
453  if ( !btppColour ) lineStyle[2] = 2 ;
454  }
455 
456  // b to plot first
457  if ( thePlotFirst == "b" ) {
458  histo[0] = theHisto_b ;
459  if ( btppColour ) col[0] = 2 ;
460  if ( !btppColour ) lineStyle[0] = 1 ;
461  histo[1] = theHisto_dusg ;
462  if ( btppColour ) col[1] = 4 ;
463  if ( !btppColour ) lineStyle[1] = 2 ;
464  }
465 
466 
467  histo[0] ->getTH1F()->GetXaxis()->SetTitle ( theBaseNameDescription.c_str() ) ;
468  histo[0] ->getTH1F()->GetYaxis()->SetTitle ( "Arbitrary Units" ) ;
469  histo[0] ->getTH1F()->GetYaxis()->SetTitleOffset(1.25) ;
470 
471  for (int i=0; i != 4; ++i) {
472  if (histo[i]== 0 ) continue;
473  histo[i] ->getTH1F()->SetStats ( false ) ;
474  histo[i] ->getTH1F()->SetLineStyle ( lineStyle[i] ) ;
475  histo[i] ->getTH1F()->SetLineWidth ( lineWidth ) ;
476  histo[i] ->getTH1F()->SetLineColor ( col[i] ) ;
477  histo[i] ->getTH1F()->SetMarkerStyle ( markerStyle[i] ) ;
478  histo[i] ->getTH1F()->SetMarkerColor ( col[i] ) ;
479  histo[i] ->getTH1F()->SetMarkerSize ( markerSize ) ;
480  }
481 
482  if ( thePlotNormalized ) {
483  if (histo[0]->getTH1F()->GetEntries() != 0) {histo[0]->getTH1F() ->DrawNormalized() ;} else { histo[0]->getTH1F() ->SetMaximum(1.0);
484 histo[0] ->getTH1F()->Draw() ;}
485  if (histo[1]->getTH1F()->GetEntries() != 0) histo[1] ->getTH1F()->DrawNormalized("Same") ;
486  if (histo[2]->getTH1F()->GetEntries() != 0) histo[2]->getTH1F() ->DrawNormalized("Same") ;
487  if ((histo[3] != 0) && (histo[3]->getTH1F()->GetEntries() != 0)) histo[3] ->getTH1F()->DrawNormalized("Same") ;
488  }
489  else {
490  histo[0]->getTH1F()->SetMaximum(max*1.05);
491  if (theMin!=-1.) histo[0]->getTH1F()->SetMinimum(theMin);
492  histo[0]->getTH1F()->Draw() ;
493  histo[1]->getTH1F()->Draw("Same") ;
494  histo[2]->getTH1F()->Draw("Same") ;
495  if ( histo[3] != 0 ) histo[3]->getTH1F()->Draw("Same") ;
496  }
497 
498 }
499 
500 template <class T>
502 {
503  TCanvas tc(theBaseNameTitle.c_str() , theBaseNameDescription.c_str());
504 
505  plot(&tc);
506  tc.Print((name + theBaseNameTitle + ".eps").c_str());
507 }
508 
509 
510 // needed for efficiency computations -> this / b
511 // (void : alternative would be not to overwrite the histos but to return a cloned HistoDescription)
512 template <class T>
514  // divide histos using binomial errors
515  //
516  // ATTENTION: It's the responsability of the user to make sure that the HistoDescriptions
517  // involved in this operation have been constructed with the statistics option switched on!!
518  //
519  if(theHisto_all) theHisto_all ->getTH1F()-> Divide ( theHisto_all->getTH1F() , bHD.histo_all () , 1.0 , 1.0 , "b" ) ;
520  if (mcPlots_) {
521  if (mcPlots_>2 ) {
522  theHisto_d ->getTH1F()-> Divide ( theHisto_d ->getTH1F() , bHD.histo_d () , 1.0 , 1.0 , "b" ) ;
523  theHisto_u ->getTH1F()-> Divide ( theHisto_u ->getTH1F() , bHD.histo_u () , 1.0 , 1.0 , "b" ) ;
524  theHisto_s ->getTH1F()-> Divide ( theHisto_s ->getTH1F() , bHD.histo_s () , 1.0 , 1.0 , "b" ) ;
525  theHisto_g ->getTH1F()-> Divide ( theHisto_g ->getTH1F() , bHD.histo_g () , 1.0 , 1.0 , "b" ) ;
526  theHisto_dus ->getTH1F()-> Divide ( theHisto_dus->getTH1F() , bHD.histo_dus () , 1.0 , 1.0 , "b" ) ;
527  }
528  theHisto_c ->getTH1F()-> Divide ( theHisto_c ->getTH1F() , bHD.histo_c () , 1.0 , 1.0 , "b" ) ;
529  theHisto_b ->getTH1F()-> Divide ( theHisto_b ->getTH1F() , bHD.histo_b () , 1.0 , 1.0 , "b" ) ;
530  theHisto_ni ->getTH1F()-> Divide ( theHisto_ni->getTH1F() , bHD.histo_ni () , 1.0 , 1.0 , "b" ) ;
531  theHisto_dusg ->getTH1F()-> Divide ( theHisto_dusg->getTH1F() , bHD.histo_dusg() , 1.0 , 1.0 , "b" ) ;
532  theHisto_pu ->getTH1F()-> Divide ( theHisto_pu->getTH1F() , bHD.histo_pu() , 1.0 , 1.0 , "b" ) ;
533  }
534 }
535 
536 
537 template <class T>
538 void FlavourHistograms<T>::fillVariable ( const int & flavour , const T & var , const T & w) const {
539 
540  // all, except for the Jet Multiplicity which is not filled for each jets but for each events
541  if( (theBaseNameDescription != "Jet Multiplicity" || flavour == -1) && theHisto_all) theHisto_all->Fill ( var ,w) ;
542 
543  // flavour specific
544  if (!mcPlots_ || (theBaseNameDescription == "Jet Multiplicity" && flavour == -1)) return;
545 
546  switch(flavour) {
547  case 1:
548  if (mcPlots_>2 ) {
549  theHisto_d->Fill( var ,w);
550  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dus->Fill( var ,w);
551  }
552  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
553  return;
554  case 2:
555  if (mcPlots_>2 ) {
556  theHisto_u->Fill( var ,w);
557  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dus->Fill( var ,w);
558  }
559  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
560  return;
561  case 3:
562  if (mcPlots_>2 ) {
563  theHisto_s->Fill( var ,w);
564  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dus->Fill( var ,w);
565  }
566  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
567  return;
568  case 4:
569  theHisto_c->Fill( var ,w);
570  return;
571  case 5:
572  theHisto_b->Fill( var ,w);
573  return;
574  case 21:
575  if (mcPlots_>2 ) theHisto_g->Fill( var ,w);
576  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
577  return;
578  case 123:
579  if (mcPlots_>2 && theBaseNameDescription == "Jet Multiplicity") theHisto_dus->Fill( var ,w);
580  return;
581  case 12321:
582  if (theBaseNameDescription == "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
583  return;
584  case 20:
585  theHisto_pu->Fill( var ,w);
586  return;
587  default:
588  theHisto_ni->Fill( var ,w);
589  return;
590  }
591 }
592 
593 template <class T>
594 std::vector<TH1F*> FlavourHistograms<T>::getHistoVector() const
595 {
596  std::vector<TH1F*> histoVector;
597  if(theHisto_all) histoVector.push_back ( theHisto_all->getTH1F() );
598  if (mcPlots_) {
599  if (mcPlots_>2 ) {
600  histoVector.push_back ( theHisto_d->getTH1F() );
601  histoVector.push_back ( theHisto_u->getTH1F() );
602  histoVector.push_back ( theHisto_s->getTH1F() );
603  histoVector.push_back ( theHisto_g ->getTH1F() );
604  histoVector.push_back ( theHisto_dus->getTH1F() );
605  }
606  histoVector.push_back ( theHisto_c->getTH1F() );
607  histoVector.push_back ( theHisto_b->getTH1F() );
608  histoVector.push_back ( theHisto_ni->getTH1F() );
609  histoVector.push_back ( theHisto_dusg->getTH1F());
610  histoVector.push_back ( theHisto_pu->getTH1F());
611  }
612  return histoVector;
613 }
614 #endif
double lowerBound() const
int i
Definition: DBlmapReader.cc:9
MonitorElement * theHisto_g
void plot(TPad *theCanvas=0)
MonitorElement * theHisto_c
void SetMinimum(const double &min)
const double w
Definition: UKUtility.cc:23
TH1F * histo_all() const
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:298
TStyle * setTDRStyle()
Definition: Tools.cc:287
MonitorElement * theHisto_u
int maxDimension() const
TH1F * histo_c() const
void fill(const int &flavour, const T &variable) const
MonitorElement * theHisto_all
std::string baseNameDescription() const
TH1F * histo_dus() const
std::vector< TH1F * > getHistoVector() const
TH1F * histo_b() const
TH1F * histo_g() const
void SetMaximum(const double &max)
void epsPlot(const std::string &name)
virtual MonitorElement * book1D(const std::string &name, const std::string &title, const int &nchX, const double &lowX, const double &highX)
std::string baseNameTitle() const
MonitorElement * theHisto_pu
void settitle(const char *title)
TH1F * histo_d() const
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
int * arrayDimension() const
T min(T a, T b)
Definition: MathUtil.h:58
MonitorElement * theHisto_d
MonitorElement * theHisto_dusg
std::string theBaseNameDescription
TH1F * getTH1F(void) const
MonitorElement * theHisto_b
TH1F * histo_s() const
int indexToPlot() const
TH1F * histo_ni() const
void divide(const FlavourHistograms< T > &bHD) const
std::string plotFirst() const
bool plotNormalized() const
bool plotLog() const
std::string theBaseNameTitle
void fillVariable(const int &flavour, const T &var, const T &w) const
TH1F * histo_u() const
tuple cout
Definition: gather_cfg.py:121
double upperBound() const
volatile std::atomic< bool > shutdown_flag false
MonitorElement * theHisto_s
int col
Definition: cuy.py:1008
bool statistics() const
long double T
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
TH1F * histo_dusg() const
MonitorElement * theHisto_dus
TH1F * histo_pu() const
MonitorElement * theHisto_ni