CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
FlavourHistograms< T > Class Template Reference

#include <FlavourHistorgrams.h>

Inheritance diagram for FlavourHistograms< T >:
TrackIPHistograms< T >

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

int * arrayDimension () const
 
std::string baseNameDescription () const
 
std::string baseNameTitle () const
 
void divide (const FlavourHistograms< T > &bHD)
 
void epsPlot (const std::string &name)
 
void fill (const int &flavour, const T &variable) const
 
void fill (const int &flavour, const T &variable, const T &w) const
 
void fill (const int &flavour, const T *variable) const
 
 FlavourHistograms (const std::string &baseNameTitle_, const std::string &baseNameDescription_, const int &nBins_, const double &lowerBound_, const double &upperBound_, const bool &statistics_, const bool &plotLog_, const bool &plotNormalized_, const std::string &plotFirst_, const std::string &folder, const unsigned int &mc, DQMStore::IBooker &ibook)
 
 FlavourHistograms (const std::string &baseNameTitle_, const std::string &baseNameDescription_, const int &nBins_, const double &lowerBound_, const double &upperBound_, const std::string &plotFirst_, const std::string &folder, const unsigned int &mc, DQMStore::IGetter &iget)
 
std::vector< TH1F * > getHistoVector () const
 
TH1F * histo_all () const
 
TH1F * histo_b () const
 
TH1F * histo_c () const
 
TH1F * histo_d () const
 
TH1F * histo_dus () const
 
TH1F * histo_dusg () const
 
TH1F * histo_g () const
 
TH1F * histo_ni () const
 
TH1F * histo_pu () const
 
TH1F * histo_s () const
 
TH1F * histo_u () const
 
int indexToPlot () const
 
double lowerBound () const
 
int maxDimension () const
 
int nBins () const
 
void plot (TPad *theCanvas=nullptr)
 
std::string plotFirst () const
 
bool plotLog () const
 
bool plotNormalized () const
 
void setEfficiencyFlag ()
 
void SetMaximum (const double &max)
 
void SetMinimum (const double &min)
 
void settitle (const char *title)
 
bool statistics () const
 
double upperBound () const
 
virtual ~FlavourHistograms ()
 

Protected Member Functions

double ClopperPearsonUnc (double num, double den)
 
void ComputeEfficiency (TH1F *num, TH1F *den, int bin)
 
void fillVariable (const int &flavour, const T &var, const T &w) const
 

Protected Attributes

int * theArrayDimension
 
std::string theBaseNameDescription
 
std::string theBaseNameTitle
 
TCanvas * theCanvas
 
MonitorElementtheHisto_all
 
MonitorElementtheHisto_b
 
MonitorElementtheHisto_c
 
MonitorElementtheHisto_d
 
MonitorElementtheHisto_dus
 
MonitorElementtheHisto_dusg
 
MonitorElementtheHisto_g
 
MonitorElementtheHisto_ni
 
MonitorElementtheHisto_pu
 
MonitorElementtheHisto_s
 
MonitorElementtheHisto_u
 
int theIndexToPlot
 
double theLowerBound
 
double theMax
 
int theMaxDimension
 
double theMin
 
int theNBins
 
std::string thePlotFirst
 
bool thePlotLog
 
bool thePlotNormalized
 
bool theStatistics
 
double theUpperBound
 

Private Member Functions

 FlavourHistograms ()
 

Private Attributes

unsigned int mcPlots_
 

Detailed Description

template<class T>
class FlavourHistograms< T >

Definition at line 26 of file FlavourHistorgrams.h.

Member Typedef Documentation

◆ DQMStore

template<class T>
typedef dqm::legacy::DQMStore FlavourHistograms< T >::DQMStore

Definition at line 28 of file FlavourHistorgrams.h.

◆ MonitorElement

Definition at line 29 of file FlavourHistorgrams.h.

Constructor & Destructor Documentation

◆ FlavourHistograms() [1/3]

template<class T >
FlavourHistograms< T >::FlavourHistograms ( const std::string &  baseNameTitle_,
const std::string &  baseNameDescription_,
const int &  nBins_,
const double &  lowerBound_,
const double &  upperBound_,
const std::string &  plotFirst_,
const std::string &  folder,
const unsigned int &  mc,
DQMStore::IGetter iget 
)

Definition at line 157 of file FlavourHistorgrams.h.

166  : theMaxDimension(-1),
167  theIndexToPlot(-1),
168  theBaseNameTitle(baseNameTitle_),
169  theBaseNameDescription(baseNameDescription_),
170  theNBins(nBins_),
171  theLowerBound(lowerBound_),
172  theUpperBound(upperBound_),
173  theStatistics(false),
174  thePlotLog(false),
175  thePlotNormalized(false),
176  thePlotFirst(plotFirst_),
177  theMin(-1.),
178  theMax(-1.),
179  mcPlots_(mc) {
180  // defaults for array dimensions
181  theArrayDimension = nullptr;
182 
183  // check plot order string
184  if (thePlotFirst == "l" || thePlotFirst == "c" || thePlotFirst == "b") {
185  // OK
186  } else {
187  // not correct: print warning and set default (l)
188  std::cout << "FlavourHistograms::FlavourHistograms : thePlotFirst was not correct : " << thePlotFirst << std::endl;
189  std::cout << "FlavourHistograms::FlavourHistograms : Set it to default value (l)! " << std::endl;
190  thePlotFirst = "l";
191  }
192 
193  if (mcPlots_ % 2 == 0)
194  theHisto_all = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "ALL");
195  else
196  theHisto_all = nullptr;
197  if (mcPlots_) {
198  if (mcPlots_ > 2) {
199  theHisto_d = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "D");
200  theHisto_u = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "U");
201  theHisto_s = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "S");
202  theHisto_g = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "G");
203  theHisto_dus = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "DUS");
204  } else {
205  theHisto_d = nullptr;
206  theHisto_u = nullptr;
207  theHisto_s = nullptr;
208  theHisto_g = nullptr;
209  theHisto_dus = nullptr;
210  }
211  theHisto_c = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "C");
212  theHisto_b = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "B");
213  theHisto_ni = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "NI");
214  theHisto_dusg = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "DUSG");
215  theHisto_pu = iget.get("Btag/" + folder + "/" + theBaseNameTitle + "PU");
216  } else {
217  theHisto_d = nullptr;
218  theHisto_u = nullptr;
219  theHisto_s = nullptr;
220  theHisto_c = nullptr;
221  theHisto_b = nullptr;
222  theHisto_g = nullptr;
223  theHisto_ni = nullptr;
224  theHisto_dus = nullptr;
225  theHisto_dusg = nullptr;
226  theHisto_pu = nullptr;
227  }
228  // defaults for other data members
229  theCanvas = nullptr;
230 }

References gather_cfg::cout, printsummarytable::folder, dqm::implementation::IGetter::get(), FlavourHistograms< T >::mcPlots_, FlavourHistograms< T >::theArrayDimension, FlavourHistograms< T >::theBaseNameTitle, FlavourHistograms< T >::theCanvas, FlavourHistograms< T >::theHisto_all, FlavourHistograms< T >::theHisto_b, FlavourHistograms< T >::theHisto_c, FlavourHistograms< T >::theHisto_d, FlavourHistograms< T >::theHisto_dus, FlavourHistograms< T >::theHisto_dusg, FlavourHistograms< T >::theHisto_g, FlavourHistograms< T >::theHisto_ni, FlavourHistograms< T >::theHisto_pu, FlavourHistograms< T >::theHisto_s, FlavourHistograms< T >::theHisto_u, and FlavourHistograms< T >::thePlotFirst.

◆ FlavourHistograms() [2/3]

template<class T >
FlavourHistograms< T >::FlavourHistograms ( const std::string &  baseNameTitle_,
const std::string &  baseNameDescription_,
const int &  nBins_,
const double &  lowerBound_,
const double &  upperBound_,
const bool &  statistics_,
const bool &  plotLog_,
const bool &  plotNormalized_,
const std::string &  plotFirst_,
const std::string &  folder,
const unsigned int &  mc,
DQMStore::IBooker ibook 
)

Definition at line 233 of file FlavourHistorgrams.h.

245  : theMaxDimension(-1),
246  theIndexToPlot(-1),
247  theBaseNameTitle(baseNameTitle_),
248  theBaseNameDescription(baseNameDescription_),
249  theNBins(nBins_),
250  theLowerBound(lowerBound_),
251  theUpperBound(upperBound_),
252  theStatistics(statistics_),
253  thePlotLog(plotLog_),
254  thePlotNormalized(plotNormalized_),
255  thePlotFirst(plotFirst_),
256  theMin(-1.),
257  theMax(-1.),
258  mcPlots_(mc) {
259  // defaults for array dimensions
260  theArrayDimension = nullptr;
261 
262  // check plot order string
263  if (thePlotFirst == "l" || thePlotFirst == "c" || thePlotFirst == "b") {
264  // OK
265  } else {
266  // not correct: print warning and set default (l)
267  std::cout << "FlavourHistograms::FlavourHistograms : thePlotFirst was not correct : " << thePlotFirst << std::endl;
268  std::cout << "FlavourHistograms::FlavourHistograms : Set it to default value (l)! " << std::endl;
269  thePlotFirst = "l";
270  }
271 
272  // book histos
273  HistoProviderDQM prov("Btag", folder, ibook);
274  if (mcPlots_ % 2 == 0)
275  theHisto_all = (prov.book1D(
277  else
278  theHisto_all = nullptr;
279  if (mcPlots_) {
280  if (mcPlots_ > 2) {
281  theHisto_d = (prov.book1D(
283  theHisto_u = (prov.book1D(
285  theHisto_s = (prov.book1D(
287  theHisto_g = (prov.book1D(
289  theHisto_dus = (prov.book1D(
291  } else {
292  theHisto_d = nullptr;
293  theHisto_u = nullptr;
294  theHisto_s = nullptr;
295  theHisto_g = nullptr;
296  theHisto_dus = nullptr;
297  }
298  theHisto_c = (prov.book1D(
300  theHisto_b = (prov.book1D(
302  theHisto_ni = (prov.book1D(
304  theHisto_dusg = (prov.book1D(
306  theHisto_pu = (prov.book1D(
308  } else {
309  theHisto_d = nullptr;
310  theHisto_u = nullptr;
311  theHisto_s = nullptr;
312  theHisto_c = nullptr;
313  theHisto_b = nullptr;
314  theHisto_g = nullptr;
315  theHisto_ni = nullptr;
316  theHisto_dus = nullptr;
317  theHisto_dusg = nullptr;
318  theHisto_pu = nullptr;
319  }
320 
321  // statistics if requested
322  if (theStatistics) {
323  if (theHisto_all)
325  if (mcPlots_) {
326  if (mcPlots_ > 2) {
332  }
338  }
339  }
340  // defaults for other data members
341  theCanvas = nullptr;
342 }

References HistoProviderDQM::book1D(), gather_cfg::cout, dqm::impl::MonitorElement::enableSumw2(), printsummarytable::folder, FlavourHistograms< T >::mcPlots_, FlavourHistograms< T >::theArrayDimension, FlavourHistograms< T >::theBaseNameDescription, FlavourHistograms< T >::theBaseNameTitle, FlavourHistograms< T >::theCanvas, FlavourHistograms< T >::theHisto_all, FlavourHistograms< T >::theHisto_b, FlavourHistograms< T >::theHisto_c, FlavourHistograms< T >::theHisto_d, FlavourHistograms< T >::theHisto_dus, FlavourHistograms< T >::theHisto_dusg, FlavourHistograms< T >::theHisto_g, FlavourHistograms< T >::theHisto_ni, FlavourHistograms< T >::theHisto_pu, FlavourHistograms< T >::theHisto_s, FlavourHistograms< T >::theHisto_u, FlavourHistograms< T >::theLowerBound, FlavourHistograms< T >::theNBins, FlavourHistograms< T >::thePlotFirst, FlavourHistograms< T >::theStatistics, and FlavourHistograms< T >::theUpperBound.

◆ ~FlavourHistograms()

template<class T >
FlavourHistograms< T >::~FlavourHistograms ( )
virtual

Definition at line 345 of file FlavourHistorgrams.h.

345  {
346  // delete the canvas*/
347  delete theCanvas;
348 }

◆ FlavourHistograms() [3/3]

template<class T>
FlavourHistograms< T >::FlavourHistograms ( )
inlineprivate

Definition at line 151 of file FlavourHistorgrams.h.

151 {}

Member Function Documentation

◆ arrayDimension()

template<class T>
int* FlavourHistograms< T >::arrayDimension ( ) const
inline

Definition at line 86 of file FlavourHistorgrams.h.

86 { return theArrayDimension; }

References FlavourHistograms< T >::theArrayDimension.

Referenced by TrackIPHistograms< T >::fill().

◆ baseNameDescription()

template<class T>
std::string FlavourHistograms< T >::baseNameDescription ( ) const
inline

◆ baseNameTitle()

template<class T>
std::string FlavourHistograms< T >::baseNameTitle ( ) const
inline

Definition at line 77 of file FlavourHistorgrams.h.

77 { return theBaseNameTitle; }

References FlavourHistograms< T >::theBaseNameTitle.

Referenced by EffPurFromHistos::EffPurFromHistos().

◆ ClopperPearsonUnc()

template<class T >
double FlavourHistograms< T >::ClopperPearsonUnc ( double  num,
double  den 
)
protected

Definition at line 570 of file FlavourHistorgrams.h.

570  {
571  double effVal = num / den;
572  double errLo = TEfficiency::ClopperPearson(static_cast<int>(den), static_cast<int>(num), 0.683, false);
573  double errUp = TEfficiency::ClopperPearson(static_cast<int>(den), static_cast<int>(num), 0.683, true);
574  return std::max(effVal - errLo, errUp - effVal);
575 }

References SiStripPI::max, and EgammaValidation_cff::num.

◆ ComputeEfficiency()

template<class T >
void FlavourHistograms< T >::ComputeEfficiency ( TH1F *  num,
TH1F *  den,
int  bin 
)
protected

Definition at line 578 of file FlavourHistorgrams.h.

578  {
579  double effVal = 1.;
580  double errVal = 0.;
581  double numVal = num->GetBinContent(bin);
582  double denVal = den->GetBinContent(bin);
583  if (denVal > 0 && numVal <= denVal) {
584  effVal = numVal / denVal;
585  errVal = ClopperPearsonUnc(numVal, denVal);
586  }
587  num->SetBinContent(bin, effVal);
588  num->SetBinError(bin, errVal);
589 }

References newFWLiteAna::bin, and EgammaValidation_cff::num.

◆ divide()

template<class T >
void FlavourHistograms< T >::divide ( const FlavourHistograms< T > &  bHD)

◆ epsPlot()

template<class T >
void FlavourHistograms< T >::epsPlot ( const std::string &  name)

Definition at line 562 of file FlavourHistorgrams.h.

562  {
563  TCanvas tc(theBaseNameTitle.c_str(), theBaseNameDescription.c_str());
564 
565  plot(&tc);
566  tc.Print((name + theBaseNameTitle + ".eps").c_str());
567 }

References Skims_PA_cff::name, and plotFactory::plot.

◆ fill() [1/3]

template<class T >
void FlavourHistograms< T >::fill ( const int &  flavour,
const T variable 
) const

Definition at line 352 of file FlavourHistorgrams.h.

352  {
353  // For single variables and arrays (for arrays only a single index can be filled)
355 }

References taus_updatedMVAIds_cff::variable.

Referenced by TrackIPHistograms< T >::fill().

◆ fill() [2/3]

template<class T >
void FlavourHistograms< T >::fill ( const int &  flavour,
const T variable,
const T w 
) const

Definition at line 358 of file FlavourHistorgrams.h.

358  {
359  // For single variables and arrays (for arrays only a single index can be filled)
361 }

References taus_updatedMVAIds_cff::variable, and w.

◆ fill() [3/3]

template<class T >
void FlavourHistograms< T >::fill ( const int &  flavour,
const T variable 
) const

Definition at line 364 of file FlavourHistorgrams.h.

364  {
365  if (theArrayDimension == nullptr) {
366  // single variable
368  } else {
369  // array
371  //
372  for (int i = 0; i != iMax; ++i) {
373  // check if only one index to be plotted (<0: switched off -> plot all)
374  if ((theIndexToPlot < 0) || (i == theIndexToPlot)) {
375  fillVariable(flavour, *(variable + i), 1.);
376  }
377  }
378 
379  // if single index to be filled but not enough entries: fill 0.0 (convention!)
380  if (theIndexToPlot >= iMax) {
381  // cout << "==>> The index to be filled is too big -> fill 0.0 : " << theBaseNameTitle << " : " << theIndexToPlot << " >= " << iMax << endl ;
382  const T& theZero = static_cast<T>(0.0);
383  fillVariable(flavour, theZero, 1.);
384  }
385  }
386 }

References mps_fire::i, and taus_updatedMVAIds_cff::variable.

◆ fillVariable()

template<class T >
void FlavourHistograms< T >::fillVariable ( const int &  flavour,
const T var,
const T w 
) const
protected

Definition at line 634 of file FlavourHistorgrams.h.

634  {
635  // all, except for the Jet Multiplicity which is not filled for each jets but for each events
636  if ((theBaseNameDescription != "Jet Multiplicity" || flavour == -1) && theHisto_all)
637  theHisto_all->Fill(var, w);
638 
639  // flavour specific
640  if (!mcPlots_ || (theBaseNameDescription == "Jet Multiplicity" && flavour == -1))
641  return;
642 
643  switch (flavour) {
644  case 1:
645  if (mcPlots_ > 2) {
646  theHisto_d->Fill(var, w);
647  if (theBaseNameDescription != "Jet Multiplicity")
648  theHisto_dus->Fill(var, w);
649  }
650  if (theBaseNameDescription != "Jet Multiplicity")
651  theHisto_dusg->Fill(var, w);
652  return;
653  case 2:
654  if (mcPlots_ > 2) {
655  theHisto_u->Fill(var, w);
656  if (theBaseNameDescription != "Jet Multiplicity")
657  theHisto_dus->Fill(var, w);
658  }
659  if (theBaseNameDescription != "Jet Multiplicity")
660  theHisto_dusg->Fill(var, w);
661  return;
662  case 3:
663  if (mcPlots_ > 2) {
664  theHisto_s->Fill(var, w);
665  if (theBaseNameDescription != "Jet Multiplicity")
666  theHisto_dus->Fill(var, w);
667  }
668  if (theBaseNameDescription != "Jet Multiplicity")
669  theHisto_dusg->Fill(var, w);
670  return;
671  case 4:
672  theHisto_c->Fill(var, w);
673  return;
674  case 5:
675  theHisto_b->Fill(var, w);
676  return;
677  case 21:
678  if (mcPlots_ > 2)
679  theHisto_g->Fill(var, w);
680  if (theBaseNameDescription != "Jet Multiplicity")
681  theHisto_dusg->Fill(var, w);
682  return;
683  case 123:
684  if (mcPlots_ > 2 && theBaseNameDescription == "Jet Multiplicity")
685  theHisto_dus->Fill(var, w);
686  return;
687  case 12321:
688  if (theBaseNameDescription == "Jet Multiplicity")
689  theHisto_dusg->Fill(var, w);
690  return;
691  case 20:
692  theHisto_pu->Fill(var, w);
693  return;
694  default:
695  theHisto_ni->Fill(var, w);
696  return;
697  }
698 }

References trigObjTnPSource_cfi::var, and w.

◆ getHistoVector()

template<class T >
std::vector< TH1F * > FlavourHistograms< T >::getHistoVector ( ) const

Definition at line 701 of file FlavourHistorgrams.h.

701  {
702  std::vector<TH1F*> histoVector;
703  if (theHisto_all)
704  histoVector.push_back(theHisto_all->getTH1F());
705  if (mcPlots_) {
706  if (mcPlots_ > 2) {
707  histoVector.push_back(theHisto_d->getTH1F());
708  histoVector.push_back(theHisto_u->getTH1F());
709  histoVector.push_back(theHisto_s->getTH1F());
710  histoVector.push_back(theHisto_g->getTH1F());
711  histoVector.push_back(theHisto_dus->getTH1F());
712  }
713  histoVector.push_back(theHisto_c->getTH1F());
714  histoVector.push_back(theHisto_b->getTH1F());
715  histoVector.push_back(theHisto_ni->getTH1F());
716  histoVector.push_back(theHisto_dusg->getTH1F());
717  histoVector.push_back(theHisto_pu->getTH1F());
718  }
719  return histoVector;
720 }

Referenced by EffPurFromHistos::EffPurFromHistos().

◆ histo_all()

template<class T>
TH1F* FlavourHistograms< T >::histo_all ( ) const
inline

◆ histo_b()

template<class T>
TH1F* FlavourHistograms< T >::histo_b ( ) const
inline

◆ histo_c()

template<class T>
TH1F* FlavourHistograms< T >::histo_c ( ) const
inline

◆ histo_d()

template<class T>
TH1F* FlavourHistograms< T >::histo_d ( ) const
inline

◆ histo_dus()

template<class T>
TH1F* FlavourHistograms< T >::histo_dus ( ) const
inline

◆ histo_dusg()

template<class T>
TH1F* FlavourHistograms< T >::histo_dusg ( ) const
inline

◆ histo_g()

template<class T>
TH1F* FlavourHistograms< T >::histo_g ( ) const
inline

◆ histo_ni()

template<class T>
TH1F* FlavourHistograms< T >::histo_ni ( ) const
inline

◆ histo_pu()

template<class T>
TH1F* FlavourHistograms< T >::histo_pu ( ) const
inline

◆ histo_s()

template<class T>
TH1F* FlavourHistograms< T >::histo_s ( ) const
inline

◆ histo_u()

template<class T>
TH1F* FlavourHistograms< T >::histo_u ( ) const
inline

◆ indexToPlot()

template<class T>
int FlavourHistograms< T >::indexToPlot ( ) const
inline

Definition at line 88 of file FlavourHistorgrams.h.

88 { return theIndexToPlot; }

References FlavourHistograms< T >::theIndexToPlot.

Referenced by TrackIPHistograms< T >::fill().

◆ lowerBound()

template<class T>
double FlavourHistograms< T >::lowerBound ( ) const
inline

Definition at line 80 of file FlavourHistorgrams.h.

80 { return theLowerBound; }

References FlavourHistograms< T >::theLowerBound.

Referenced by EffPurFromHistos::EffPurFromHistos().

◆ maxDimension()

template<class T>
int FlavourHistograms< T >::maxDimension ( ) const
inline

Definition at line 87 of file FlavourHistorgrams.h.

87 { return theMaxDimension; }

References FlavourHistograms< T >::theMaxDimension.

Referenced by TrackIPHistograms< T >::fill().

◆ nBins()

template<class T>
int FlavourHistograms< T >::nBins ( ) const
inline

Definition at line 79 of file FlavourHistorgrams.h.

79 { return theNBins; }

References FlavourHistograms< T >::theNBins.

Referenced by EffPurFromHistos::EffPurFromHistos().

◆ plot()

template<class T >
void FlavourHistograms< T >::plot ( TPad *  theCanvas = nullptr)

Definition at line 409 of file FlavourHistorgrams.h.

409  {
410  //fixme:
411  bool btppNI = false;
412  bool btppColour = true;
413 
414  if (theCanvas)
415  theCanvas->cd();
416 
417  RecoBTag::setTDRStyle()->cd();
418  gPad->UseCurrentStyle();
419  // if ( !btppTitle ) gStyle->SetOptTitle ( 0 ) ;
420  //
421  // // here: plot histograms in a canvas
422  // theCanvas = new TCanvas ( "C" + theBaseNameTitle , "C" + theBaseNameDescription ,
423  // btppXCanvas , btppYCanvas ) ;
424  // theCanvas->SetFillColor ( 0 ) ;
425  // theCanvas->cd ( 1 ) ;
426  gPad->SetLogy(0);
427  if (thePlotLog)
428  gPad->SetLogy(1);
429  gPad->SetGridx(0);
430  gPad->SetGridy(0);
431  gPad->SetTitle(nullptr);
432 
433  MonitorElement* histo[4];
434  int col[4], lineStyle[4], markerStyle[4];
435  int lineWidth = 1;
436 
437  const double markerSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
438 
439  // default (l)
440  histo[0] = theHisto_dusg;
441  //CW histo_1 = theHisto_dus ;
442  histo[1] = theHisto_b;
443  histo[2] = theHisto_c;
444  histo[3] = nullptr;
445 
446  double max = theMax;
447  if (theMax <= 0.) {
448  max = theHisto_dusg->getTH1F()->GetMaximum();
449  if (theHisto_b->getTH1F()->GetMaximum() > max)
450  max = theHisto_b->getTH1F()->GetMaximum();
451  if (theHisto_c->getTH1F()->GetMaximum() > max)
452  max = theHisto_c->getTH1F()->GetMaximum();
453  }
454 
455  if (btppNI) {
456  histo[3] = theHisto_ni;
457  if (theHisto_ni->getTH1F()->GetMaximum() > max)
458  max = theHisto_ni->getTH1F()->GetMaximum();
459  }
460 
461  if (btppColour) { // print colours
462  col[0] = 4;
463  col[1] = 2;
464  col[2] = 6;
465  col[3] = 3;
466  lineStyle[0] = 1;
467  lineStyle[1] = 1;
468  lineStyle[2] = 1;
469  lineStyle[3] = 1;
470  markerStyle[0] = 20;
471  markerStyle[1] = 21;
472  markerStyle[2] = 22;
473  markerStyle[3] = 23;
474  lineWidth = 1;
475  } else { // different marker/line styles
476  col[1] = 1;
477  col[2] = 1;
478  col[3] = 1;
479  col[0] = 1;
480  lineStyle[0] = 2;
481  lineStyle[1] = 1;
482  lineStyle[2] = 3;
483  lineStyle[3] = 4;
484  markerStyle[0] = 20;
485  markerStyle[1] = 21;
486  markerStyle[2] = 22;
487  markerStyle[3] = 23;
488  }
489 
490  // if changing order (NI stays always last)
491 
492  // c to plot first
493  if (thePlotFirst == "c") {
494  histo[0] = theHisto_c;
495  if (btppColour)
496  col[0] = 6;
497  if (!btppColour)
498  lineStyle[0] = 3;
499  histo[2] = theHisto_dusg;
500  if (btppColour)
501  col[2] = 4;
502  if (!btppColour)
503  lineStyle[2] = 2;
504  }
505 
506  // b to plot first
507  if (thePlotFirst == "b") {
508  histo[0] = theHisto_b;
509  if (btppColour)
510  col[0] = 2;
511  if (!btppColour)
512  lineStyle[0] = 1;
513  histo[1] = theHisto_dusg;
514  if (btppColour)
515  col[1] = 4;
516  if (!btppColour)
517  lineStyle[1] = 2;
518  }
519 
520  histo[0]->setAxisTitle(theBaseNameDescription);
521  histo[0]->getTH1F()->GetYaxis()->SetTitle("Arbitrary Units");
522  histo[0]->getTH1F()->GetYaxis()->SetTitleOffset(1.25);
523 
524  for (int i = 0; i != 4; ++i) {
525  if (histo[i] == nullptr)
526  continue;
527  histo[i]->getTH1F()->SetStats(false);
528  histo[i]->getTH1F()->SetLineStyle(lineStyle[i]);
529  histo[i]->getTH1F()->SetLineWidth(lineWidth);
530  histo[i]->getTH1F()->SetLineColor(col[i]);
531  histo[i]->getTH1F()->SetMarkerStyle(markerStyle[i]);
532  histo[i]->getTH1F()->SetMarkerColor(col[i]);
533  histo[i]->getTH1F()->SetMarkerSize(markerSize);
534  }
535 
536  if (thePlotNormalized) {
537  if (histo[0]->getTH1F()->GetEntries() != 0) {
538  histo[0]->getTH1F()->DrawNormalized();
539  } else {
540  histo[0]->getTH1F()->SetMaximum(1.0);
541  histo[0]->getTH1F()->Draw();
542  }
543  if (histo[1]->getTH1F()->GetEntries() != 0)
544  histo[1]->getTH1F()->DrawNormalized("Same");
545  if (histo[2]->getTH1F()->GetEntries() != 0)
546  histo[2]->getTH1F()->DrawNormalized("Same");
547  if ((histo[3] != nullptr) && (histo[3]->getTH1F()->GetEntries() != 0))
548  histo[3]->getTH1F()->DrawNormalized("Same");
549  } else {
550  histo[0]->getTH1F()->SetMaximum(max * 1.05);
551  if (theMin != -1.)
552  histo[0]->getTH1F()->SetMinimum(theMin);
553  histo[0]->getTH1F()->Draw();
554  histo[1]->getTH1F()->Draw("Same");
555  histo[2]->getTH1F()->Draw("Same");
556  if (histo[3] != nullptr)
557  histo[3]->getTH1F()->Draw("Same");
558  }
559 }

References cuy::col, timingPdfMaker::histo, mps_fire::i, RecoTauValidation_cfi::lineStyle, RecoTauValidation_cfi::lineWidth, RecoTauValidation_cfi::markerSize, RecoTauValidation_cfi::markerStyle, SiStripPI::max, and RecoBTag::setTDRStyle().

◆ plotFirst()

template<class T>
std::string FlavourHistograms< T >::plotFirst ( ) const
inline

Definition at line 85 of file FlavourHistorgrams.h.

85 { return thePlotFirst; }

References FlavourHistograms< T >::thePlotFirst.

◆ plotLog()

template<class T>
bool FlavourHistograms< T >::plotLog ( ) const
inline

Definition at line 83 of file FlavourHistorgrams.h.

83 { return thePlotLog; }

References FlavourHistograms< T >::thePlotLog.

◆ plotNormalized()

template<class T>
bool FlavourHistograms< T >::plotNormalized ( ) const
inline

Definition at line 84 of file FlavourHistorgrams.h.

84 { return thePlotNormalized; }

References FlavourHistograms< T >::thePlotNormalized.

◆ setEfficiencyFlag()

template<class T >
void FlavourHistograms< T >::setEfficiencyFlag ( )

Definition at line 614 of file FlavourHistorgrams.h.

◆ SetMaximum()

template<class T>
void FlavourHistograms< T >::SetMaximum ( const double &  max)
inline

Definition at line 73 of file FlavourHistorgrams.h.

73 { theMax = max; }

References SiStripPI::max, and FlavourHistograms< T >::theMax.

◆ SetMinimum()

template<class T>
void FlavourHistograms< T >::SetMinimum ( const double &  min)
inline

Definition at line 74 of file FlavourHistorgrams.h.

74 { theMin = min; }

References min(), and FlavourHistograms< T >::theMin.

◆ settitle()

template<class T >
void FlavourHistograms< T >::settitle ( const char *  title)

◆ statistics()

template<class T>
bool FlavourHistograms< T >::statistics ( ) const
inline

Definition at line 82 of file FlavourHistorgrams.h.

82 { return theStatistics; }

References FlavourHistograms< T >::theStatistics.

◆ upperBound()

template<class T>
double FlavourHistograms< T >::upperBound ( ) const
inline

Definition at line 81 of file FlavourHistorgrams.h.

81 { return theUpperBound; }

References FlavourHistograms< T >::theUpperBound.

Referenced by EffPurFromHistos::EffPurFromHistos().

Member Data Documentation

◆ mcPlots_

template<class T>
unsigned int FlavourHistograms< T >::mcPlots_
private

Definition at line 153 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::FlavourHistograms().

◆ theArrayDimension

template<class T>
int* FlavourHistograms< T >::theArrayDimension
protected

◆ theBaseNameDescription

template<class T>
std::string FlavourHistograms< T >::theBaseNameDescription
protected

◆ theBaseNameTitle

template<class T>
std::string FlavourHistograms< T >::theBaseNameTitle
protected

◆ theCanvas

template<class T>
TCanvas* FlavourHistograms< T >::theCanvas
protected

Definition at line 148 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::FlavourHistograms().

◆ theHisto_all

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_all
protected

◆ theHisto_b

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_b
protected

◆ theHisto_c

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_c
protected

◆ theHisto_d

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_d
protected

◆ theHisto_dus

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_dus
protected

◆ theHisto_dusg

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_dusg
protected

◆ theHisto_g

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_g
protected

◆ theHisto_ni

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_ni
protected

◆ theHisto_pu

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_pu
protected

◆ theHisto_s

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_s
protected

◆ theHisto_u

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_u
protected

◆ theIndexToPlot

template<class T>
int FlavourHistograms< T >::theIndexToPlot
protected

Definition at line 119 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::indexToPlot().

◆ theLowerBound

template<class T>
double FlavourHistograms< T >::theLowerBound
protected

◆ theMax

template<class T>
double FlavourHistograms< T >::theMax
protected

Definition at line 130 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::SetMaximum().

◆ theMaxDimension

template<class T>
int FlavourHistograms< T >::theMaxDimension
protected

Definition at line 118 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::maxDimension().

◆ theMin

template<class T>
double FlavourHistograms< T >::theMin
protected

Definition at line 130 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::SetMinimum().

◆ theNBins

template<class T>
int FlavourHistograms< T >::theNBins
protected

◆ thePlotFirst

template<class T>
std::string FlavourHistograms< T >::thePlotFirst
protected

◆ thePlotLog

template<class T>
bool FlavourHistograms< T >::thePlotLog
protected

Definition at line 127 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::plotLog().

◆ thePlotNormalized

template<class T>
bool FlavourHistograms< T >::thePlotNormalized
protected

Definition at line 128 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::plotNormalized().

◆ theStatistics

template<class T>
bool FlavourHistograms< T >::theStatistics
protected

◆ theUpperBound

template<class T>
double FlavourHistograms< T >::theUpperBound
protected
RecoBTag::setTDRStyle
TStyle * setTDRStyle()
Definition: Tools.cc:343
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
FlavourHistograms::theHisto_s
MonitorElement * theHisto_s
Definition: FlavourHistorgrams.h:136
FlavourHistograms::theHisto_c
MonitorElement * theHisto_c
Definition: FlavourHistorgrams.h:137
CaloTowersParam_cfi.mc
mc
Definition: CaloTowersParam_cfi.py:8
FlavourHistograms::theHisto_u
MonitorElement * theHisto_u
Definition: FlavourHistorgrams.h:135
FlavourHistograms::histo_ni
TH1F * histo_ni() const
Definition: FlavourHistorgrams.h:98
min
T min(T a, T b)
Definition: MathUtil.h:58
printsummarytable.folder
folder
Definition: printsummarytable.py:7
FlavourHistograms::theArrayDimension
int * theArrayDimension
Definition: FlavourHistorgrams.h:117
FlavourHistograms::ComputeEfficiency
void ComputeEfficiency(TH1F *num, TH1F *den, int bin)
Definition: FlavourHistorgrams.h:578
cuy.col
col
Definition: cuy.py:1009
gather_cfg.cout
cout
Definition: gather_cfg.py:144
FlavourHistograms::theCanvas
TCanvas * theCanvas
Definition: FlavourHistorgrams.h:148
FlavourHistograms::thePlotLog
bool thePlotLog
Definition: FlavourHistorgrams.h:127
FlavourHistograms::theHisto_all
MonitorElement * theHisto_all
Definition: FlavourHistorgrams.h:133
dqm::impl::MonitorElement::setEfficiencyFlag
void setEfficiencyFlag()
Definition: MonitorElement.h:267
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:278
FlavourHistograms::histo_g
TH1F * histo_g() const
Definition: FlavourHistorgrams.h:97
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
FlavourHistograms::histo_pu
TH1F * histo_pu() const
Definition: FlavourHistorgrams.h:101
FlavourHistograms::histo_u
TH1F * histo_u() const
Definition: FlavourHistorgrams.h:93
FlavourHistograms::histo_c
TH1F * histo_c() const
Definition: FlavourHistorgrams.h:95
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:479
FlavourHistograms::theStatistics
bool theStatistics
Definition: FlavourHistorgrams.h:126
FlavourHistograms::histo_dusg
TH1F * histo_dusg() const
Definition: FlavourHistorgrams.h:100
FlavourHistograms::theMaxDimension
int theMaxDimension
Definition: FlavourHistorgrams.h:118
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
RecoTauValidation_cfi.markerStyle
markerStyle
Definition: RecoTauValidation_cfi.py:301
FlavourHistograms::theHisto_pu
MonitorElement * theHisto_pu
Definition: FlavourHistorgrams.h:143
w
const double w
Definition: UKUtility.cc:23
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
RecoTauValidation_cfi.lineStyle
lineStyle
Definition: RecoTauValidation_cfi.py:303
FlavourHistograms::theMax
double theMax
Definition: FlavourHistorgrams.h:130
FlavourHistograms::ClopperPearsonUnc
double ClopperPearsonUnc(double num, double den)
Definition: FlavourHistorgrams.h:570
FlavourHistograms::histo_dus
TH1F * histo_dus() const
Definition: FlavourHistorgrams.h:99
FlavourHistograms::theBaseNameDescription
std::string theBaseNameDescription
Definition: FlavourHistorgrams.h:122
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
FlavourHistograms::theHisto_dusg
MonitorElement * theHisto_dusg
Definition: FlavourHistorgrams.h:142
FlavourHistograms::theHisto_d
MonitorElement * theHisto_d
Definition: FlavourHistorgrams.h:134
FlavourHistograms::theBaseNameTitle
std::string theBaseNameTitle
Definition: FlavourHistorgrams.h:121
FlavourHistograms::mcPlots_
unsigned int mcPlots_
Definition: FlavourHistorgrams.h:153
RecoTauValidation_cfi.markerSize
markerSize
Definition: RecoTauValidation_cfi.py:300
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:33
FlavourHistograms::theHisto_b
MonitorElement * theHisto_b
Definition: FlavourHistorgrams.h:138
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
FlavourHistograms::histo_s
TH1F * histo_s() const
Definition: FlavourHistorgrams.h:94
RecoTauValidation_cfi.lineWidth
lineWidth
Definition: RecoTauValidation_cfi.py:304
FlavourHistograms::histo_b
TH1F * histo_b() const
Definition: FlavourHistorgrams.h:96
taus_updatedMVAIds_cff.variable
variable
Definition: taus_updatedMVAIds_cff.py:33
T
long double T
Definition: Basic3DVectorLD.h:48
FlavourHistograms::thePlotFirst
std::string thePlotFirst
Definition: FlavourHistorgrams.h:129
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
FlavourHistograms::theHisto_ni
MonitorElement * theHisto_ni
Definition: FlavourHistorgrams.h:140
FlavourHistograms::theUpperBound
double theUpperBound
Definition: FlavourHistorgrams.h:125
FlavourHistograms::theHisto_g
MonitorElement * theHisto_g
Definition: FlavourHistorgrams.h:139
HistoProviderDQM
Definition: HistoProviderDQM.h:8
dqm::impl::MonitorElement::enableSumw2
virtual void enableSumw2()
Definition: MonitorElement.cc:872
FlavourHistograms::theMin
double theMin
Definition: FlavourHistorgrams.h:130
FlavourHistograms::histo_d
TH1F * histo_d() const
Definition: FlavourHistorgrams.h:92
FlavourHistograms::theLowerBound
double theLowerBound
Definition: FlavourHistorgrams.h:124
FlavourHistograms::theHisto_dus
MonitorElement * theHisto_dus
Definition: FlavourHistorgrams.h:141
FlavourHistograms::theIndexToPlot
int theIndexToPlot
Definition: FlavourHistorgrams.h:119
FlavourHistograms::fillVariable
void fillVariable(const int &flavour, const T &var, const T &w) const
Definition: FlavourHistorgrams.h:634
FlavourHistograms::plot
void plot(TPad *theCanvas=nullptr)
Definition: FlavourHistorgrams.h:409
FlavourHistograms::theNBins
int theNBins
Definition: FlavourHistorgrams.h:123
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
FlavourHistograms::thePlotNormalized
bool thePlotNormalized
Definition: FlavourHistorgrams.h:128
DiLeptonHelp::flavour
flavour
Definition: DiLeptonVertexHelpers.h:46
FlavourHistograms::histo_all
TH1F * histo_all() const
Definition: FlavourHistorgrams.h:91