CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FlavourHistorgrams2D.h
Go to the documentation of this file.
1 
2 #ifndef FlavourHistograms2D_H
3 #define FlavourHistograms2D_H
4 
8 
9 // #include "BTagPlotPrintC.h"
10 
11 #include "TH2F.h"
12 #include "TProfile.h"
13 #include "TCanvas.h"
14 #include "TROOT.h"
15 #include "TSystem.h"
16 #include "TStyle.h"
17 
20 
21 #include <iostream>
22 #include <vector>
23 #include <string>
24 //class DQMStore;
25 
26 //
27 // class to describe Histo
28 //
29 template <class T, class G>
31 
32 public:
33 
34  FlavourHistograms2D (TString baseNameTitle_ , TString baseNameDescription_ ,
35  int nBinsX_ , double lowerBoundX_ , double upperBoundX_ ,
36  int nBinsY_ , double lowerBoundY_ , double upperBoundY_ ,
37  bool statistics_ , bool update, std::string folder, unsigned int mc,
38  bool createProfile, DQMStore::IBooker & ibook) ;
39 
40  virtual ~FlavourHistograms2D () ;
41 
42 
43  // define arrays (if needed)
44 // void defineArray ( int * dimension , int max , int indexToPlot ) ;
45 
46  // fill entry
47  // For single variables and arrays (for arrays only a single index can be filled)
48  void fill ( const int & flavour, const T & variableX, const G & variableY) const;
49  void fill ( const int & flavour, const T & variableX, const G & variableY, const float & w) const;
50 
51  // For single variables and arrays
52  void fill ( const int & flavour, const T * variableX, const G * variableY) const;
53  void fill ( const int & flavour, const T * variableX, const G * variableY, const float & w) const;
54 
55 
56  void settitle(const char* titleX, const char* titleY) ;
57 
58  // needed for efficiency computations -> this / b
59  // (void : alternative would be not to overwrite the histos but to return a cloned HistoDescription)
60  void divide ( const FlavourHistograms2D<T, G> & bHD ) const ;
61 
62  inline void SetMaximum(const double& max) { theMax = max;}
63  inline void SetMinimum(const double& min) { theMin = min;}
64 
65 
66  // trivial access functions
67  inline std::string baseNameTitle () const { return theBaseNameTitle ; }
69  inline int nBinsX () const { return theNBinsX ; }
70  inline int nBinsY () const { return theNBinsY ; }
71  inline double lowerBoundX () const { return theLowerBoundX ; }
72  inline double upperBoundX () const { return theUpperBoundX ; }
73  inline double lowerBoundY () const { return theLowerBoundY ; }
74  inline double upperBoundY () const { return theUpperBoundY ; }
75  inline bool statistics () const { return theStatistics ; }
76 
77  // access to the histos
78  inline TH2F * histo_all () const { return theHisto_all->getTH2F() ; }
79  inline TH2F * histo_d () const { return theHisto_d ->getTH2F() ; }
80  inline TH2F * histo_u () const { return theHisto_u->getTH2F() ; }
81  inline TH2F * histo_s () const { return theHisto_s->getTH2F() ; }
82  inline TH2F * histo_c () const { return theHisto_c->getTH2F() ; }
83  inline TH2F * histo_b () const { return theHisto_b->getTH2F() ; }
84  inline TH2F * histo_g () const { return theHisto_g->getTH2F() ; }
85  inline TH2F * histo_ni () const { return theHisto_ni->getTH2F() ; }
86  inline TH2F * histo_dus () const { return theHisto_dus->getTH2F() ; }
87  inline TH2F * histo_dusg () const { return theHisto_dusg->getTH2F() ; }
88  inline TH2F * histo_pu () const { return theHisto_pu->getTH2F() ; }
89 
90  TProfile * profile_all () const { return theProfile_all->getTProfile() ; }
91  TProfile * profile_d () const { return theProfile_d ->getTProfile() ; }
92  TProfile * profile_u () const { return theProfile_u->getTProfile() ; }
93  TProfile * profile_s () const { return theProfile_s->getTProfile() ; }
94  TProfile * profile_c () const { return theProfile_c->getTProfile() ; }
95  TProfile * profile_b () const { return theProfile_b->getTProfile() ; }
96  TProfile * profile_g () const { return theProfile_g->getTProfile() ; }
97  TProfile * profile_ni () const { return theProfile_ni->getTProfile() ; }
98  TProfile * profile_dus () const { return theProfile_dus->getTProfile() ; }
99  TProfile * profile_dusg () const { return theProfile_dusg->getTProfile() ; }
100  TProfile * profile_pu () const { return theProfile_pu->getTProfile() ; }
101 
102  std::vector<TH2F*> getHistoVector() const;
103 
104  std::vector<TProfile*> getProfileVector() const;
105 
106 
107 
108 protected:
109 
110  void fillVariable ( const int & flavour , const T & varX , const G & varY , const float & w) const;
111 
112  //
113  // the data members
114  //
115 
116 // T * theVariable ;
117 
118  // for arrays
121  int theIndexToPlot ; // in case that not the complete array has to be plotted
122 
125  int theNBinsX ;
126  int theNBinsY ;
127  double theLowerBoundX ;
128  double theUpperBoundX ;
129  double theLowerBoundY ;
130  double theUpperBoundY ;
132  double theMin, theMax;
133 
134  // the histos
146 
147  // the profiles
159 
160  // DQMStore * dqmStore_;
161 
162 
163  // the canvas to plot
164  private:
166 
167  unsigned int mcPlots_;
169 
170 } ;
171 
172 
173 
174 template <class T, class G>
175 FlavourHistograms2D<T, G>::FlavourHistograms2D (TString baseNameTitle_ , TString baseNameDescription_ ,
176  int nBinsX_ , double lowerBoundX_ , double upperBoundX_ ,
177  int nBinsY_ , double lowerBoundY_ , double upperBoundY_ ,
178  bool statistics_ , bool update, std::string folder,
179  unsigned int mc, bool createProfile, DQMStore::IBooker & ibook) :
180  // BaseFlavourHistograms2D () ,
181  // theVariable ( variable_ ) ,
182  theMaxDimension(-1), theIndexToPlot(-1), theBaseNameTitle ( baseNameTitle_ ) , theBaseNameDescription ( baseNameDescription_ ) ,
183  theNBinsX ( nBinsX_ ) , theNBinsY (nBinsY_),
184  theLowerBoundX ( lowerBoundX_ ) , theUpperBoundX ( upperBoundX_ ) ,
185  theLowerBoundY ( lowerBoundY_ ) , theUpperBoundY ( upperBoundY_ ) ,
186  theStatistics ( statistics_ ) , theMin(-1.), theMax(-1.), mcPlots_(mc), createProfile_(createProfile)
187 {
188  // defaults for array dimensions
189  theArrayDimension = 0 ;
190 
191  if (!update) {
192  // book histos
193  HistoProviderDQM prov("Btag",folder,ibook);
195  else theHisto_all = 0;
196  if (mcPlots_) {
197  if (mcPlots_>2) {
203  }
204  else {
205  theHisto_d = 0;
206  theHisto_u = 0;
207  theHisto_s = 0;
208  theHisto_g = 0;
209  theHisto_dus = 0;
210  }
216  }else{
217  theHisto_d = 0;
218  theHisto_u = 0;
219  theHisto_s = 0;
220  theHisto_c = 0;
221  theHisto_b = 0;
222  theHisto_g = 0;
223  theHisto_ni = 0;
224  theHisto_dus = 0;
225  theHisto_dusg = 0;
226  theHisto_pu = 0;
227  }
228 
229  if (createProfile_) {
231  else theProfile_all = 0;
232  if (mcPlots_) {
233  if (mcPlots_>2) {
239  }
240  else {
241  theProfile_d = 0;
242  theProfile_u = 0;
243  theProfile_s = 0;
244  theProfile_g = 0;
245  theProfile_dus = 0;
246  }
252  } else{
253  theProfile_d = 0;
254  theProfile_u = 0;
255  theProfile_s = 0;
256  theProfile_c = 0;
257  theProfile_b = 0;
258  theProfile_g = 0;
259  theProfile_ni = 0;
260  theProfile_dus = 0;
261  theProfile_dusg = 0;
262  theProfile_pu = 0;
263  }
264  } else {
265  theProfile_all = 0;
266  theProfile_d = 0;
267  theProfile_u = 0;
268  theProfile_s = 0;
269  theProfile_c = 0;
270  theProfile_b = 0;
271  theProfile_g = 0;
272  theProfile_ni = 0;
273  theProfile_dus = 0;
274  theProfile_dusg = 0;
275  theProfile_pu = 0;
276  }
277  // statistics if requested
278  if ( theStatistics ) {
279  if(theHisto_all) theHisto_all ->getTH2F()->Sumw2() ;
280  if(createProfile)
281  if(theProfile_all) theProfile_all ->getTProfile()->Sumw2() ;
282  if (mcPlots_) {
283  if (mcPlots_>2) {
284  theHisto_d ->getTH2F()->Sumw2() ;
285  theHisto_u ->getTH2F()->Sumw2() ;
286  theHisto_s ->getTH2F()->Sumw2() ;
287  theHisto_g ->getTH2F()->Sumw2() ;
288  theHisto_dus ->getTH2F()->Sumw2() ;
289  }
290  theHisto_c ->getTH2F()->Sumw2() ;
291  theHisto_b ->getTH2F()->Sumw2() ;
292  theHisto_ni ->getTH2F()->Sumw2() ;
293  theHisto_dusg->getTH2F()->Sumw2() ;
294  theHisto_pu ->getTH2F()->Sumw2() ;
295 
296  if(createProfile) {
297  if (mcPlots_>2) {
298  theProfile_d ->getTProfile()->Sumw2() ;
299  theProfile_u ->getTProfile()->Sumw2() ;
300  theProfile_s ->getTProfile()->Sumw2() ;
301  theProfile_g ->getTProfile()->Sumw2() ;
302  theProfile_dus ->getTProfile()->Sumw2() ;
303  }
304  theProfile_c ->getTProfile()->Sumw2() ;
305  theProfile_b ->getTProfile()->Sumw2() ;
306  theProfile_ni ->getTProfile()->Sumw2() ;
307  theProfile_dusg->getTProfile()->Sumw2() ;
308  theProfile_pu ->getTProfile()->Sumw2() ;
309  }
310  }
311  }
312  } else {
313  //is it useful? anyway access function is deprecated...
314  HistoProviderDQM prov("Btag",folder,ibook);
315  if(theHisto_all) theHisto_all = prov.access(theBaseNameTitle + "ALL" ) ;
316  if (mcPlots_) {
317  if (mcPlots_>2) {
318  theHisto_d = prov.access(theBaseNameTitle + "D" ) ;
319  theHisto_u = prov.access(theBaseNameTitle + "U" ) ;
320  theHisto_s = prov.access(theBaseNameTitle + "S" ) ;
321  theHisto_g = prov.access(theBaseNameTitle + "G" ) ;
322  theHisto_dus = prov.access(theBaseNameTitle + "DUS" ) ;
323  }
324  theHisto_c = prov.access(theBaseNameTitle + "C" ) ;
325  theHisto_b = prov.access(theBaseNameTitle + "B" ) ;
326  theHisto_ni = prov.access(theBaseNameTitle + "NI" ) ;
327  theHisto_dusg = prov.access(theBaseNameTitle + "DUSG") ;
328  theHisto_pu = prov.access(theBaseNameTitle + "PU" ) ;
329  }
330 
331  if(createProfile_) {
332  if(theProfile_all) theProfile_all = prov.access(theBaseNameTitle + "_Profile_ALL");
333  if(mcPlots_) {
334  if (mcPlots_>2) {
335  theProfile_d = prov.access(theBaseNameTitle + "_Profile_D" ) ;
336  theProfile_u = prov.access(theBaseNameTitle + "_Profile_U" ) ;
337  theProfile_s = prov.access(theBaseNameTitle + "_Profile_S" ) ;
338  theProfile_g = prov.access(theBaseNameTitle + "_Profile_G" ) ;
339  theProfile_dus = prov.access(theBaseNameTitle + "_Profile_DUS" ) ;
340  }
341  theProfile_c = prov.access(theBaseNameTitle + "_Profile_C" ) ;
342  theProfile_b = prov.access(theBaseNameTitle + "_Profile_B" ) ;
343  theProfile_ni = prov.access(theBaseNameTitle + "_Profile_NI" ) ;
344  theProfile_dusg = prov.access(theBaseNameTitle + "_Profile_DUSG") ;
345  theProfile_pu = prov.access(theBaseNameTitle + "_Profile_PU" ) ;
346  }
347  }
348  }
349 }
350 
351 
352 template <class T, class G>
354 
355 
356 // define arrays (if needed)
357 // template <class T, class G>
358 // void FlavourHistograms2D<T, G>::defineArray ( int * dimension , int max , int indexToPlot ) {
359 // // indexToPlot < 0 if all to be plotted
360 // theArrayDimension = dimension ;
361 // theMaxDimension = max ;
362 // theIndexToPlot = indexToPlot ;
363 // }
364 
365 // fill entry
366 template <class T, class G> void
367  FlavourHistograms2D<T, G>::fill ( const int & flavour, const T & variableX, const G & variableY, const float & w) const
368 {
369  // For single variables and arrays (for arrays only a single index can be filled)
370  fillVariable ( flavour , variableX , variableY , w ) ;
371 }
372 
373 template <class T, class G> void
374 FlavourHistograms2D<T, G>::fill ( const int & flavour, const T & variableX, const G & variableY) const
375 {
376  fill ( flavour , variableX , variableY , 1. ) ;
377 }
378 
379 template <class T, class G> void
380  FlavourHistograms2D<T, G>::fill ( const int & flavour, const T * variableX, const G * variableY, const float & w) const
381 {
382  if ( theArrayDimension == 0 ) {
383  // single variable
384  fillVariable ( flavour , *variableX, *variableY , w) ;
385  } else {
386  // array
387  int iMax = *theArrayDimension ;
388  if ( *theArrayDimension > theMaxDimension ) iMax = theMaxDimension ;
389  //
390  for ( int i = 0 ; i != iMax ; ++i ) {
391  // check if only one index to be plotted (<0: switched off -> plot all)
392  if ( ( theIndexToPlot < 0 ) || ( i == theIndexToPlot ) ) {
393  fillVariable ( flavour , *(variableX+i) , *(variableY+i) , w) ;
394  }
395  }
396 
397  // if single index to be filled but not enough entries: fill 0.0 (convention!)
398  if ( theIndexToPlot >= iMax ) {
399  // cout << "==>> The index to be filled is too big -> fill 0.0 : " << theBaseNameTitle << " : " << theIndexToPlot << " >= " << iMax << endl ;
400  const T& theZeroT = static_cast<T> ( 0.0) ;
401  const G& theZeroG = static_cast<T> ( 0.0 );
402  fillVariable ( flavour , theZeroT , theZeroG , w ) ;
403  }
404  }
405 }
406 
407 template <class T, class G> void
408  FlavourHistograms2D<T, G>::fill ( const int & flavour, const T * variableX, const G * variableY) const
409 {
410  fill ( flavour, variableX , variableY , 1. );
411 }
412 
413 template <class T, class G>
414 void FlavourHistograms2D<T, G>::settitle(const char* titleX, const char* titleY) {
415  if(theHisto_all) theHisto_all ->setAxisTitle(titleX) ;
416  if(theHisto_all) theHisto_all ->setAxisTitle(titleY, 2) ;
417  if (mcPlots_) {
418 
419  if(theHisto_d) theHisto_d ->setAxisTitle(titleX) ;
420  if(theHisto_u) theHisto_u ->setAxisTitle(titleX) ;
421  if(theHisto_s) theHisto_s ->setAxisTitle(titleX) ;
422  if(theHisto_c) theHisto_c ->setAxisTitle(titleX) ;
423  if(theHisto_b) theHisto_b ->setAxisTitle(titleX) ;
424  if(theHisto_g) theHisto_g ->setAxisTitle(titleX) ;
425  if(theHisto_ni) theHisto_ni ->setAxisTitle(titleX) ;
426  if(theHisto_dus) theHisto_dus ->setAxisTitle(titleX) ;
427  if(theHisto_dusg)theHisto_dusg->setAxisTitle(titleX) ;
428  if(theHisto_d) theHisto_d ->setAxisTitle(titleY, 2) ;
429  if(theHisto_u) theHisto_u ->setAxisTitle(titleY, 2) ;
430  if(theHisto_s) theHisto_s ->setAxisTitle(titleY, 2) ;
431  if(theHisto_c) theHisto_c ->setAxisTitle(titleY, 2) ;
432  if(theHisto_b) theHisto_b ->setAxisTitle(titleY, 2) ;
433  if(theHisto_g) theHisto_g ->setAxisTitle(titleY, 2) ;
434  if(theHisto_ni) theHisto_ni ->setAxisTitle(titleY, 2) ;
435  if(theHisto_dus) theHisto_dus ->setAxisTitle(titleY, 2) ;
436  if(theHisto_dusg)theHisto_dusg->setAxisTitle(titleY, 2) ;
437  if(theHisto_pu) theHisto_pu ->setAxisTitle(titleY, 2) ;
438  }
439 
440  if(createProfile_) {
441  if(theProfile_all) theProfile_all ->setAxisTitle(titleX) ;
442  if(theProfile_all) theProfile_all ->setAxisTitle(titleY, 2) ;
443  if (mcPlots_) {
444 
445  if(theProfile_d) theProfile_d ->setAxisTitle(titleX) ;
446  if(theProfile_u) theProfile_u ->setAxisTitle(titleX) ;
447  if(theProfile_s) theProfile_s ->setAxisTitle(titleX) ;
448  if(theProfile_c) theProfile_c ->setAxisTitle(titleX) ;
449  if(theProfile_b) theProfile_b ->setAxisTitle(titleX) ;
450  if(theProfile_g) theProfile_g ->setAxisTitle(titleX) ;
451  if(theProfile_ni) theProfile_ni ->setAxisTitle(titleX) ;
452  if(theProfile_dus) theProfile_dus ->setAxisTitle(titleX) ;
453  if(theProfile_dusg)theProfile_dusg->setAxisTitle(titleX) ;
454  if(theProfile_d) theProfile_d ->setAxisTitle(titleY, 2) ;
455  if(theProfile_u) theProfile_u ->setAxisTitle(titleY, 2) ;
456  if(theProfile_s) theProfile_s ->setAxisTitle(titleY, 2) ;
457  if(theProfile_c) theProfile_c ->setAxisTitle(titleY, 2) ;
458  if(theProfile_b) theProfile_b ->setAxisTitle(titleY, 2) ;
459  if(theProfile_g) theProfile_g ->setAxisTitle(titleY, 2) ;
460  if(theProfile_ni) theProfile_ni ->setAxisTitle(titleY, 2) ;
461  if(theProfile_dus) theProfile_dus ->setAxisTitle(titleY, 2) ;
462  if(theProfile_dusg)theProfile_dusg->setAxisTitle(titleY, 2) ;
463  if(theProfile_pu) theProfile_pu ->setAxisTitle(titleY, 2) ;
464  }
465  }
466 }
467 
468 // needed for efficiency computations -> this / b
469 // (void : alternative would be not to overwrite the histos but to return a cloned HistoDescription)
470 template <class T, class G>
472  // divide histos using binomial errors
473  //
474  // ATTENTION: It's the responsability of the user to make sure that the HistoDescriptions
475  // involved in this operation have been constructed with the statistics option switched on!!
476  //
477  if(theHisto_all) theHisto_all ->getTH2F()-> Divide ( theHisto_all->getTH2F() , bHD.histo_all () , 1.0 , 1.0 , "b" ) ;
478  if (mcPlots_) {
479  if (mcPlots_>2) {
480  theHisto_d ->getTH2F()-> Divide ( theHisto_d ->getTH2F() , bHD.histo_d () , 1.0 , 1.0 , "b" ) ;
481  theHisto_u ->getTH2F()-> Divide ( theHisto_u ->getTH2F() , bHD.histo_u () , 1.0 , 1.0 , "b" ) ;
482  theHisto_s ->getTH2F()-> Divide ( theHisto_s ->getTH2F() , bHD.histo_s () , 1.0 , 1.0 , "b" ) ;
483  theHisto_g ->getTH2F()-> Divide ( theHisto_g ->getTH2F() , bHD.histo_g () , 1.0 , 1.0 , "b" ) ;
484  theHisto_dus ->getTH2F()-> Divide ( theHisto_dus->getTH2F() , bHD.histo_dus () , 1.0 , 1.0 , "b" ) ;
485  }
486  theHisto_c ->getTH2F()-> Divide ( theHisto_c ->getTH2F() , bHD.histo_c () , 1.0 , 1.0 , "b" ) ;
487  theHisto_b ->getTH2F()-> Divide ( theHisto_b ->getTH2F() , bHD.histo_b () , 1.0 , 1.0 , "b" ) ;
488  theHisto_ni ->getTH2F()-> Divide ( theHisto_ni->getTH2F() , bHD.histo_ni () , 1.0 , 1.0 , "b" ) ;
489  theHisto_dusg ->getTH2F()-> Divide ( theHisto_dusg->getTH2F() , bHD.histo_dusg() , 1.0 , 1.0 , "b" ) ;
490  theHisto_pu ->getTH2F()-> Divide ( theHisto_pu->getTH2F() , bHD.histo_pu () , 1.0 , 1.0 , "b" ) ;
491  }
492 }
493 
494 
495 template <class T, class G>
496  void FlavourHistograms2D<T, G>::fillVariable ( const int & flavour , const T & varX , const G & varY , const float & w) const {
497  // all
498  if(theHisto_all) theHisto_all->Fill ( varX, varY,w ) ;
499  if(createProfile_)
500  //if(theProfile_all) theProfile_all->Fill( varX, varY, w );
501  if(theProfile_all) theProfile_all->Fill( varX, varY);
502 
503  //exit(-1);
504  // flavour specific
505  if (!mcPlots_) return;
506 
507  switch( flavour ) {
508  case 1:
509  if (mcPlots_>2) {
510  theHisto_d->Fill( varX, varY,w );
511  theHisto_dus->Fill( varX, varY,w );
512  }
513  theHisto_dusg->Fill( varX, varY,w );
514  if(createProfile_) {
515  //theProfile_d->Fill(varX, varY,w);
516  //theProfile_dus->Fill(varX, varY,w);
517  //theProfile_dusg->Fill(varX, varY,w);
518  if (mcPlots_>2) {
519  theProfile_d->Fill(varX, varY);
520  theProfile_dus->Fill(varX, varY);
521  }
522  theProfile_dusg->Fill(varX, varY);
523  }
524  return;
525  case 2:
526  if (mcPlots_>2) {
527  theHisto_u->Fill( varX, varY,w );
528  theHisto_dus->Fill( varX, varY,w );
529  }
530  theHisto_dusg->Fill( varX, varY,w );
531  if(createProfile_) {
532  //theProfile_u->Fill(varX, varY,w);
533  //theProfile_dus->Fill(varX, varY,w);
534  //theProfile_dusg->Fill(varX, varY,w);
535  if (mcPlots_>2) {
536  theProfile_u->Fill(varX, varY);
537  theProfile_dus->Fill(varX, varY);
538  }
539  theProfile_dusg->Fill(varX, varY);
540  }
541  return;
542  case 3:
543  if (mcPlots_>2) {
544  theHisto_s->Fill( varX, varY,w );
545  theHisto_dus->Fill( varX, varY,w );
546  }
547  theHisto_dusg->Fill( varX, varY,w );
548  if(createProfile_) {
549  //theProfile_s->Fill(varX, varY,w);
550  //theProfile_dus->Fill(varX, varY,w);
551  //theProfile_dusg->Fill(varX, varY,w);
552  if (mcPlots_>2) {
553  theProfile_s->Fill(varX, varY);
554  theProfile_dus->Fill(varX, varY);
555  }
556  theProfile_dusg->Fill(varX, varY);
557  }
558  return;
559  case 4:
560  theHisto_c->Fill( varX, varY,w );
561  //if(createProfile_) theProfile_c->Fill(varX, varY,w);
562  if(createProfile_) theProfile_c->Fill(varX, varY);
563  return;
564  case 5:
565  theHisto_b->Fill( varX, varY,w );
566  //if(createProfile_) theProfile_b->Fill(varX, varY,w);
567  if(createProfile_) theProfile_b->Fill(varX, varY);
568  return;
569  case 21:
570  if (mcPlots_>2) theHisto_g->Fill( varX, varY,w );
571  theHisto_dusg->Fill( varX, varY,w );
572  if(createProfile_) {
573  //theProfile_g->Fill(varX, varY,w);
574  //theProfile_dusg->Fill(varX, varY,w);
575  if (mcPlots_>2) theProfile_g->Fill(varX, varY);
576  theProfile_dusg->Fill(varX, varY);
577  }
578  return;
579  case 20:
580  theHisto_pu->Fill( varX, varY,w );
581  //if(createProfile_) theProfile_pu->Fill(varX, varY,w);
582  if(createProfile_) theProfile_pu->Fill(varX, varY);
583  return;
584  default:
585  theHisto_ni->Fill( varX, varY,w );
586  //if(createProfile_) theProfile_ni->Fill(varX, varY,w);
587  if(createProfile_) theProfile_ni->Fill(varX, varY);
588  return;
589  }
590 }
591 
592 template <class T, class G>
594 {
595  std::vector<TH2F*> histoVector;
596  if(theHisto_all) histoVector.push_back ( theHisto_all->getTH2F() );
597  if (mcPlots_) {
598  if (mcPlots_>2) {
599  histoVector.push_back ( theHisto_d->getTH2F() );
600  histoVector.push_back ( theHisto_u->getTH2F() );
601  histoVector.push_back ( theHisto_s->getTH2F() );
602  histoVector.push_back ( theHisto_g ->getTH2F() );
603  histoVector.push_back ( theHisto_dus->getTH2F() );
604  }
605  histoVector.push_back ( theHisto_c->getTH2F() );
606  histoVector.push_back ( theHisto_b->getTH2F() );
607  histoVector.push_back ( theHisto_ni->getTH2F() );
608  histoVector.push_back ( theHisto_dusg->getTH2F());
609  histoVector.push_back ( theHisto_pu->getTH2F() );
610  }
611  return histoVector;
612 }
613 
614 template <class T, class G>
615 std::vector<TProfile*> FlavourHistograms2D<T, G>::getProfileVector() const
616 {
617  std::vector<TProfile*> profileVector;
618  if(createProfile_) {
619  if(theProfile_all) profileVector.push_back ( theProfile_all->getTProfile() );
620  if (mcPlots_) {
621  if (mcPlots_>2) {
622  profileVector.push_back ( theProfile_d->getTProfile() );
623  profileVector.push_back ( theProfile_u->getTProfile() );
624  profileVector.push_back ( theProfile_s->getTProfile() );
625  profileVector.push_back ( theProfile_g ->getTProfile() );
626  profileVector.push_back ( theProfile_dus->getTProfile() );
627  }
628  profileVector.push_back ( theProfile_c->getTProfile() );
629  profileVector.push_back ( theProfile_b->getTProfile() );
630  profileVector.push_back ( theProfile_ni->getTProfile() );
631  profileVector.push_back ( theProfile_dusg->getTProfile());
632  profileVector.push_back ( theProfile_pu->getTProfile() );
633  }
634  }
635  return profileVector;
636 }
637 
638 #endif
TProfile * profile_c() const
std::string theBaseNameDescription
MonitorElement * theProfile_s
int i
Definition: DBlmapReader.cc:9
MonitorElement * theProfile_pu
double lowerBoundX() const
TProfile * getTProfile(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
string fill
Definition: lumiContext.py:319
double lowerBoundY() const
MonitorElement * theHisto_g
void SetMaximum(const double &max)
TH2F * histo_all() const
MonitorElement * theProfile_dusg
void settitle(const char *titleX, const char *titleY)
MonitorElement * theHisto_dusg
MonitorElement * theHisto_u
virtual MonitorElement * bookProfile(const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
TProfile * profile_pu() const
virtual MonitorElement * book2D(const std::string &name, const std::string &title, const int &nchX, const double &lowX, const double &highX, const int &nchY, const double &lowY, const double &highY)
std::string baseNameTitle() const
TProfile * profile_b() const
void divide(const FlavourHistograms2D< T, G > &bHD) const
MonitorElement * theHisto_c
MonitorElement * theHisto_pu
void fill(const int &flavour, const T &variableX, const G &variableY) const
MonitorElement * theProfile_all
MonitorElement * theProfile_ni
const T & max(const T &a, const T &b)
MonitorElement * theHisto_dus
TH2F * histo_dusg() const
MonitorElement * theProfile_u
MonitorElement * theHisto_s
TH2F * histo_dus() const
std::vector< TProfile * > getProfileVector() const
TProfile * profile_u() const
TProfile * profile_all() const
MonitorElement * theProfile_b
void SetMinimum(const double &min)
MonitorElement * theProfile_c
double upperBoundX() const
tuple G
Definition: callgraph.py:12
std::vector< TH2F * > getHistoVector() const
MonitorElement * theProfile_d
std::string baseNameDescription() const
TProfile * profile_d() const
MonitorElement * theProfile_dus
TH2F * histo_pu() const
TH2F * histo_ni() const
MonitorElement * theHisto_all
TProfile * profile_ni() const
#define update(a, b)
TProfile * getTProfile(void) const
TH2F * getTH2F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
TProfile * profile_s() const
virtual MonitorElement * access(const std::string &name)
T w() const
TH2F * getTH2F(void) const
MonitorElement * theProfile_g
TProfile * profile_dusg() const
double upperBoundY() const
long double T
MonitorElement * theHisto_b
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
TProfile * profile_dus() const
void fillVariable(const int &flavour, const T &varX, const G &varY, const float &w) const
TProfile * profile_g() const
MonitorElement * theHisto_ni
MonitorElement * theHisto_d