CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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 Member Functions

int * arrayDimension () const
 
std::string baseNameDescription () const
 
std::string baseNameTitle () const
 
void divide (const FlavourHistograms< T > &bHD) const
 
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 bool &update, const std::string &folder, const unsigned int &mc)
 
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_s () const
 
TH1F * histo_u () const
 
int indexToPlot () const
 
double lowerBound () const
 
int maxDimension () const
 
int nBins () const
 
void plot (TPad *theCanvas=0)
 
std::string plotFirst () const
 
bool plotLog () const
 
bool plotNormalized () const
 
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

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_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 28 of file FlavourHistorgrams.h.

Constructor & Destructor Documentation

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 bool &  update,
const std::string &  folder,
const unsigned int &  mc 
)

Definition at line 146 of file FlavourHistorgrams.h.

References HistoProviderDQM::access(), HistoProviderDQM::book1D(), gather_cfg::cout, MonitorElement::getTH1F(), 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_s, FlavourHistograms< T >::theHisto_u, FlavourHistograms< T >::theLowerBound, FlavourHistograms< T >::theNBins, FlavourHistograms< T >::thePlotFirst, FlavourHistograms< T >::theStatistics, and FlavourHistograms< T >::theUpperBound.

149  :
150  // BaseFlavourHistograms () ,
151  // theVariable ( variable_ ) ,
152  theMaxDimension(-1), theIndexToPlot(-1), theBaseNameTitle ( baseNameTitle_ ) , theBaseNameDescription ( baseNameDescription_ ) ,
153  theNBins ( nBins_ ) , theLowerBound ( lowerBound_ ) , theUpperBound ( upperBound_ ) ,
154  theStatistics ( statistics_ ) , thePlotLog ( plotLog_ ) , thePlotNormalized ( plotNormalized_ ) ,
155  thePlotFirst ( plotFirst_ ), theMin(-1.), theMax(-1.), mcPlots_(mc)
156 {
157  // defaults for array dimensions
158  theArrayDimension = 0 ;
159 
160  // check plot order string
161  if ( thePlotFirst == "l" || thePlotFirst == "c" || thePlotFirst == "b" ) {
162  // OK
163  }
164  else {
165  // not correct: print warning and set default (l)
166  std::cout << "FlavourHistograms::FlavourHistograms : thePlotFirst was not correct : " << thePlotFirst << std::endl ;
167  std::cout << "FlavourHistograms::FlavourHistograms : Set it to default value (l)! " << std::endl ;
168  thePlotFirst = "l" ;
169  }
170 
171  if (!update) {
172  // book histos
173  HistoProviderDQM prov("Btag",folder);
174  if(mcPlots_%2==0) theHisto_all = (prov.book1D( theBaseNameTitle + "ALL" , theBaseNameDescription + " all jets" , theNBins , theLowerBound , theUpperBound )) ;
175  else theHisto_all = 0;
176  if (mcPlots_) {
177  if(mcPlots_>2) {
178  theHisto_d = (prov.book1D ( theBaseNameTitle + "D" , theBaseNameDescription + " d-jets" , theNBins , theLowerBound , theUpperBound )) ;
179  theHisto_u = (prov.book1D ( theBaseNameTitle + "U" , theBaseNameDescription + " u-jets" , theNBins , theLowerBound , theUpperBound )) ;
180  theHisto_s = (prov.book1D ( theBaseNameTitle + "S" , theBaseNameDescription + " s-jets" , theNBins , theLowerBound , theUpperBound )) ;
181  theHisto_g = (prov.book1D ( theBaseNameTitle + "G" , theBaseNameDescription + " g-jets" , theNBins , theLowerBound , theUpperBound )) ;
182  theHisto_dus = (prov.book1D ( theBaseNameTitle + "DUS" , theBaseNameDescription + " dus-jets" , theNBins , theLowerBound , theUpperBound )) ;
183  }
184  else{
185  theHisto_d = 0;
186  theHisto_u = 0;
187  theHisto_s = 0;
188  theHisto_g = 0;
189  theHisto_dus = 0;
190  }
191  theHisto_c = (prov.book1D ( theBaseNameTitle + "C" , theBaseNameDescription + " c-jets" , theNBins , theLowerBound , theUpperBound )) ;
192  theHisto_b = (prov.book1D ( theBaseNameTitle + "B" , theBaseNameDescription + " b-jets" , theNBins , theLowerBound , theUpperBound )) ;
193  theHisto_ni = (prov.book1D ( theBaseNameTitle + "NI" , theBaseNameDescription + " ni-jets" , theNBins , theLowerBound , theUpperBound )) ;
194  theHisto_dusg = (prov.book1D ( theBaseNameTitle + "DUSG" , theBaseNameDescription + " dusg-jets" , theNBins , theLowerBound , theUpperBound )) ;
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  }
206 
207  // statistics if requested
208  if ( theStatistics ) {
209  if(theHisto_all) theHisto_all ->getTH1F()->Sumw2() ;
210  if (mcPlots_ ) {
211  if (mcPlots_>2 ) {
212  theHisto_d ->getTH1F()->Sumw2() ;
213  theHisto_u ->getTH1F()->Sumw2() ;
214  theHisto_s ->getTH1F()->Sumw2() ;
215  theHisto_g ->getTH1F()->Sumw2() ;
216  theHisto_dus ->getTH1F()->Sumw2() ;
217  }
218  theHisto_c ->getTH1F()->Sumw2() ;
219  theHisto_b ->getTH1F()->Sumw2() ;
220  theHisto_ni ->getTH1F()->Sumw2() ;
221  theHisto_dusg->getTH1F()->Sumw2() ;
222  }
223  }
224  } else {
225  HistoProviderDQM prov("Btag",folder);
226  if(theHisto_all) theHisto_all = prov.access(theBaseNameTitle + "ALL" ) ;
227  if (mcPlots_) {
228  if (mcPlots_>2 ) {
229  theHisto_d = prov.access(theBaseNameTitle + "D" ) ;
230  theHisto_u = prov.access(theBaseNameTitle + "U" ) ;
231  theHisto_s = prov.access(theBaseNameTitle + "S" ) ;
232  theHisto_g = prov.access(theBaseNameTitle + "G" ) ;
233  theHisto_dus = prov.access(theBaseNameTitle + "DUS" ) ;
234  }
235  theHisto_c = prov.access(theBaseNameTitle + "C" ) ;
236  theHisto_b = prov.access(theBaseNameTitle + "B" ) ;
237  theHisto_ni = prov.access(theBaseNameTitle + "NI" ) ;
238  theHisto_dusg = prov.access(theBaseNameTitle + "DUSG") ;
239  }
240  }
241 
242  // defaults for other data members
243  theCanvas = 0 ;
244 }
MonitorElement * theHisto_g
MonitorElement * theHisto_c
MonitorElement * theHisto_u
MonitorElement * theHisto_all
MonitorElement * theHisto_d
MonitorElement * theHisto_dusg
std::string theBaseNameDescription
TH1F * getTH1F(void) const
MonitorElement * theHisto_b
std::string theBaseNameTitle
#define update(a, b)
tuple cout
Definition: gather_cfg.py:121
MonitorElement * theHisto_s
MonitorElement * theHisto_dus
MonitorElement * theHisto_ni
template<class T >
FlavourHistograms< T >::~FlavourHistograms ( )
virtual

Definition at line 248 of file FlavourHistorgrams.h.

248  {
249  // delete the canvas*/
250  delete theCanvas ;
251 }
template<class T>
FlavourHistograms< T >::FlavourHistograms ( )
inlineprivate

Definition at line 139 of file FlavourHistorgrams.h.

139 {}

Member Function Documentation

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

Definition at line 76 of file FlavourHistorgrams.h.

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

76 { return theArrayDimension; }
template<class T>
std::string FlavourHistograms< T >::baseNameDescription ( ) const
inline

Definition at line 68 of file FlavourHistorgrams.h.

Referenced by EffPurFromHistos::EffPurFromHistos().

68 { return theBaseNameDescription ; }
std::string theBaseNameDescription
template<class T>
std::string FlavourHistograms< T >::baseNameTitle ( ) const
inline

Definition at line 67 of file FlavourHistorgrams.h.

Referenced by EffPurFromHistos::EffPurFromHistos().

67 { return theBaseNameTitle ; }
std::string theBaseNameTitle
template<class T>
void FlavourHistograms< T >::divide ( const FlavourHistograms< T > &  bHD) const

Definition at line 474 of file FlavourHistorgrams.h.

References MultipleCompare::Divide(), getTH1F(), FlavourHistograms< T >::histo_all(), FlavourHistograms< T >::histo_b(), FlavourHistograms< T >::histo_c(), FlavourHistograms< T >::histo_d(), FlavourHistograms< T >::histo_dus(), FlavourHistograms< T >::histo_dusg(), FlavourHistograms< T >::histo_g(), FlavourHistograms< T >::histo_ni(), FlavourHistograms< T >::histo_s(), and FlavourHistograms< T >::histo_u().

Referenced by python.rootplot.utilities.Hist::__div__(), cuy.FindIssue::__init__(), and EffPurFromHistos::EffPurFromHistos().

474  {
475  // divide histos using binomial errors
476  //
477  // ATTENTION: It's the responsability of the user to make sure that the HistoDescriptions
478  // involved in this operation have been constructed with the statistics option switched on!!
479  //
480  if(theHisto_all) theHisto_all ->getTH1F()-> Divide ( theHisto_all->getTH1F() , bHD.histo_all () , 1.0 , 1.0 , "b" ) ;
481  if (mcPlots_) {
482  if (mcPlots_>2 ) {
483  theHisto_d ->getTH1F()-> Divide ( theHisto_d ->getTH1F() , bHD.histo_d () , 1.0 , 1.0 , "b" ) ;
484  theHisto_u ->getTH1F()-> Divide ( theHisto_u ->getTH1F() , bHD.histo_u () , 1.0 , 1.0 , "b" ) ;
485  theHisto_s ->getTH1F()-> Divide ( theHisto_s ->getTH1F() , bHD.histo_s () , 1.0 , 1.0 , "b" ) ;
486  theHisto_g ->getTH1F()-> Divide ( theHisto_g ->getTH1F() , bHD.histo_g () , 1.0 , 1.0 , "b" ) ;
487  theHisto_dus ->getTH1F()-> Divide ( theHisto_dus->getTH1F() , bHD.histo_dus () , 1.0 , 1.0 , "b" ) ;
488  }
489  theHisto_c ->getTH1F()-> Divide ( theHisto_c ->getTH1F() , bHD.histo_c () , 1.0 , 1.0 , "b" ) ;
490  theHisto_b ->getTH1F()-> Divide ( theHisto_b ->getTH1F() , bHD.histo_b () , 1.0 , 1.0 , "b" ) ;
491  theHisto_ni ->getTH1F()-> Divide ( theHisto_ni->getTH1F() , bHD.histo_ni () , 1.0 , 1.0 , "b" ) ;
492  theHisto_dusg ->getTH1F()-> Divide ( theHisto_dusg->getTH1F() , bHD.histo_dusg() , 1.0 , 1.0 , "b" ) ;
493  }
494 }
MonitorElement * theHisto_g
MonitorElement * theHisto_c
TH1F * histo_all() const
MonitorElement * theHisto_u
TH1F * histo_c() const
MonitorElement * theHisto_all
TH1F * histo_dus() const
TH1F * histo_b() const
TH1F * histo_g() const
TH1F * histo_d() const
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
MonitorElement * theHisto_d
MonitorElement * theHisto_dusg
TH1F * getTH1F(void) const
MonitorElement * theHisto_b
TH1F * histo_s() const
TH1F * histo_ni() const
TH1F * histo_u() const
MonitorElement * theHisto_s
TH1F * histo_dusg() const
MonitorElement * theHisto_dus
MonitorElement * theHisto_ni
template<class T >
void FlavourHistograms< T >::epsPlot ( const std::string &  name)
template<class T>
void FlavourHistograms< T >::fill ( const int &  flavour,
const T variable 
) const

Definition at line 265 of file FlavourHistorgrams.h.

Referenced by SoftLeptonTagPlotter::analyzeTag(), TrackCountingTagPlotter::analyzeTag(), TrackIPTagPlotter::analyzeTag(), JetTagPlotter::analyzeTag(), and TrackIPHistograms< T >::fill().

266 {
267  // For single variables and arrays (for arrays only a single index can be filled)
268  fillVariable ( flavour , variable, 1.) ;
269 }
void fillVariable(const int &flavour, const T &var, const T &w) const
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
template<class T>
void FlavourHistograms< T >::fill ( const int &  flavour,
const T variable,
const T w 
) const

Definition at line 272 of file FlavourHistorgrams.h.

273 {
274  // For single variables and arrays (for arrays only a single index can be filled)
275  fillVariable ( flavour , variable, w) ;
276 }
void fillVariable(const int &flavour, const T &var, const T &w) const
T w() const
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
template<class T>
void FlavourHistograms< T >::fill ( const int &  flavour,
const T variable 
) const

Definition at line 279 of file FlavourHistorgrams.h.

References i.

280 {
281  if ( theArrayDimension == 0 ) {
282  // single variable
283  fillVariable ( flavour , *variable, 1.) ;
284  } else {
285  // array
287  //
288  for ( int i = 0 ; i != iMax ; ++i ) {
289  // check if only one index to be plotted (<0: switched off -> plot all)
290  if ( ( theIndexToPlot < 0 ) || ( i == theIndexToPlot ) ) {
291  fillVariable ( flavour , *(variable+i) , 1.) ;
292  }
293  }
294 
295  // if single index to be filled but not enough entries: fill 0.0 (convention!)
296  if ( theIndexToPlot >= iMax ) {
297  // cout << "==>> The index to be filled is too big -> fill 0.0 : " << theBaseNameTitle << " : " << theIndexToPlot << " >= " << iMax << endl ;
298  const T& theZero = static_cast<T> ( 0.0 ) ;
299  fillVariable ( flavour , theZero , 1.) ;
300  }
301  }
302 }
int i
Definition: DBlmapReader.cc:9
void fillVariable(const int &flavour, const T &var, const T &w) const
long double T
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
template<class T>
void FlavourHistograms< T >::fillVariable ( const int &  flavour,
const T var,
const T w 
) const
protected

Definition at line 498 of file FlavourHistorgrams.h.

498  {
499 
500  // all, except for the Jet Multiplicity which is not filled for each jets but for each events
501  if( (theBaseNameDescription != "Jet Multiplicity" || flavour == -1) && theHisto_all) theHisto_all->Fill ( var ,w) ;
502 
503  // flavour specific
504  if (!mcPlots_ || (theBaseNameDescription == "Jet Multiplicity" && flavour == -1)) return;
505 
506  switch(flavour) {
507  case 1:
508  if (mcPlots_>2 ) {
509  theHisto_d->Fill( var ,w);
510  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dus->Fill( var ,w);
511  }
512  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
513  return;
514  case 2:
515  if (mcPlots_>2 ) {
516  theHisto_u->Fill( var ,w);
517  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dus->Fill( var ,w);
518  }
519  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
520  return;
521  case 3:
522  if (mcPlots_>2 ) {
523  theHisto_s->Fill( var ,w);
524  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dus->Fill( var ,w);
525  }
526  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
527  return;
528  case 4:
529  theHisto_c->Fill( var ,w);
530  return;
531  case 5:
532  theHisto_b->Fill( var ,w);
533  return;
534  case 21:
535  if (mcPlots_>2 ) theHisto_g->Fill( var ,w);
536  if(theBaseNameDescription != "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
537  return;
538  case 123:
539  if (mcPlots_>2 && theBaseNameDescription == "Jet Multiplicity") theHisto_dus->Fill( var ,w);
540  return;
541  case 12321:
542  if (theBaseNameDescription == "Jet Multiplicity") theHisto_dusg->Fill( var ,w);
543  return;
544  default:
545  theHisto_ni->Fill( var ,w);
546  return;
547  }
548 }
MonitorElement * theHisto_g
MonitorElement * theHisto_c
MonitorElement * theHisto_u
MonitorElement * theHisto_all
void Fill(long long x)
MonitorElement * theHisto_d
MonitorElement * theHisto_dusg
std::string theBaseNameDescription
MonitorElement * theHisto_b
T w() const
MonitorElement * theHisto_s
int flavour(const Candidate &part)
Definition: pdgIdUtils.h:31
MonitorElement * theHisto_dus
MonitorElement * theHisto_ni
template<class T >
std::vector< TH1F * > FlavourHistograms< T >::getHistoVector ( ) const

Definition at line 551 of file FlavourHistorgrams.h.

References getTH1F().

Referenced by EffPurFromHistos::EffPurFromHistos().

552 {
553  std::vector<TH1F*> histoVector;
554  if(theHisto_all) histoVector.push_back ( theHisto_all->getTH1F() );
555  if (mcPlots_) {
556  if (mcPlots_>2 ) {
557  histoVector.push_back ( theHisto_d->getTH1F() );
558  histoVector.push_back ( theHisto_u->getTH1F() );
559  histoVector.push_back ( theHisto_s->getTH1F() );
560  histoVector.push_back ( theHisto_g ->getTH1F() );
561  histoVector.push_back ( theHisto_dus->getTH1F() );
562  }
563  histoVector.push_back ( theHisto_c->getTH1F() );
564  histoVector.push_back ( theHisto_b->getTH1F() );
565  histoVector.push_back ( theHisto_ni->getTH1F() );
566  histoVector.push_back ( theHisto_dusg->getTH1F());
567  }
568  return histoVector;
569 }
MonitorElement * theHisto_g
MonitorElement * theHisto_c
MonitorElement * theHisto_u
MonitorElement * theHisto_all
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
MonitorElement * theHisto_d
MonitorElement * theHisto_dusg
TH1F * getTH1F(void) const
MonitorElement * theHisto_b
MonitorElement * theHisto_s
MonitorElement * theHisto_dus
MonitorElement * theHisto_ni
template<class T>
TH1F* FlavourHistograms< T >::histo_all ( ) const
inline

Definition at line 81 of file FlavourHistorgrams.h.

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

81 { return theHisto_all->getTH1F() ; }
MonitorElement * theHisto_all
TH1F * getTH1F(void) const
template<class T>
TH1F* FlavourHistograms< T >::histo_b ( ) const
inline

Definition at line 86 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

86 { return theHisto_b->getTH1F() ; }
TH1F * getTH1F(void) const
MonitorElement * theHisto_b
template<class T>
TH1F* FlavourHistograms< T >::histo_c ( ) const
inline

Definition at line 85 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

85 { return theHisto_c->getTH1F() ; }
MonitorElement * theHisto_c
TH1F * getTH1F(void) const
template<class T>
TH1F* FlavourHistograms< T >::histo_d ( ) const
inline

Definition at line 82 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

82 { return theHisto_d ->getTH1F() ; }
MonitorElement * theHisto_d
TH1F * getTH1F(void) const
template<class T>
TH1F* FlavourHistograms< T >::histo_dus ( ) const
inline

Definition at line 89 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

89 { return theHisto_dus->getTH1F() ; }
TH1F * getTH1F(void) const
MonitorElement * theHisto_dus
template<class T>
TH1F* FlavourHistograms< T >::histo_dusg ( ) const
inline

Definition at line 90 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

90 { return theHisto_dusg->getTH1F() ; }
MonitorElement * theHisto_dusg
TH1F * getTH1F(void) const
template<class T>
TH1F* FlavourHistograms< T >::histo_g ( ) const
inline

Definition at line 87 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

87 { return theHisto_g->getTH1F() ; }
MonitorElement * theHisto_g
TH1F * getTH1F(void) const
template<class T>
TH1F* FlavourHistograms< T >::histo_ni ( ) const
inline

Definition at line 88 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

88 { return theHisto_ni->getTH1F() ; }
TH1F * getTH1F(void) const
MonitorElement * theHisto_ni
template<class T>
TH1F* FlavourHistograms< T >::histo_s ( ) const
inline

Definition at line 84 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

84 { return theHisto_s->getTH1F() ; }
TH1F * getTH1F(void) const
MonitorElement * theHisto_s
template<class T>
TH1F* FlavourHistograms< T >::histo_u ( ) const
inline

Definition at line 83 of file FlavourHistorgrams.h.

Referenced by FlavourHistograms< T >::divide(), and EffPurFromHistos::EffPurFromHistos().

83 { return theHisto_u->getTH1F() ; }
MonitorElement * theHisto_u
TH1F * getTH1F(void) const
template<class T>
int FlavourHistograms< T >::indexToPlot ( ) const
inline

Definition at line 78 of file FlavourHistorgrams.h.

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

78 {return theIndexToPlot; }
template<class T>
double FlavourHistograms< T >::lowerBound ( ) const
inline

Definition at line 70 of file FlavourHistorgrams.h.

Referenced by EffPurFromHistos::EffPurFromHistos().

70 { return theLowerBound ; }
template<class T>
int FlavourHistograms< T >::maxDimension ( ) const
inline

Definition at line 77 of file FlavourHistorgrams.h.

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

77 {return theMaxDimension; }
template<class T>
int FlavourHistograms< T >::nBins ( ) const
inline

Definition at line 69 of file FlavourHistorgrams.h.

Referenced by EffPurFromHistos::EffPurFromHistos().

69 { return theNBins ; }
template<class T >
void FlavourHistograms< T >::plot ( TPad *  theCanvas = 0)

Definition at line 325 of file FlavourHistorgrams.h.

References cuy::col, getTH1F(), MonitorElement::getTH1F(), timingPdfMaker::histo, i, max(), and RecoBTag::setTDRStyle().

Referenced by cuy.FindIssue::__init__(), SoftLeptonTagPlotter::psPlot(), TrackCountingTagPlotter::psPlot(), TrackIPTagPlotter::psPlot(), TrackProbabilityTagPlotter::psPlot(), and JetTagPlotter::psPlot().

325  {
326 
327 //fixme:
328  bool btppNI = false;
329  bool btppColour = true;
330 
331  if (theCanvas)
332  theCanvas->cd();
333 
334  RecoBTag::setTDRStyle()->cd();
335  gPad->UseCurrentStyle();
336 // if ( !btppTitle ) gStyle->SetOptTitle ( 0 ) ;
337 //
338 // // here: plot histograms in a canvas
339 // theCanvas = new TCanvas ( "C" + theBaseNameTitle , "C" + theBaseNameDescription ,
340 // btppXCanvas , btppYCanvas ) ;
341 // theCanvas->SetFillColor ( 0 ) ;
342 // theCanvas->cd ( 1 ) ;
343  gPad->SetLogy ( 0 ) ;
344  if ( thePlotLog ) gPad->SetLogy ( 1 ) ;
345  gPad->SetGridx ( 0 ) ;
346  gPad->SetGridy ( 0 ) ;
347  gPad->SetTitle ( 0 ) ;
348 
349  MonitorElement * histo[4];
350  int col[4], lineStyle[4], markerStyle[4];
351  int lineWidth = 1 ;
352 
353  const double markerSize = gPad->GetWh() * gPad->GetHNDC() / 500.;
354 
355  // default (l)
356  histo[0] = theHisto_dusg ;
357  //CW histo_1 = theHisto_dus ;
358  histo[1] = theHisto_b ;
359  histo[2] = theHisto_c ;
360  histo[3]= 0 ;
361 
362  double max = theMax;
363  if (theMax<=0.) {
364  max = theHisto_dusg->getTH1F()->GetMaximum();
365  if (theHisto_b->getTH1F()->GetMaximum() > max) max = theHisto_b->getTH1F()->GetMaximum();
366  if (theHisto_c->getTH1F()->GetMaximum() > max) max = theHisto_c->getTH1F()->GetMaximum();
367  }
368 
369  if (btppNI) {
370  histo[3] = theHisto_ni ;
371  if (theHisto_ni->getTH1F()->GetMaximum() > max) max = theHisto_ni->getTH1F()->GetMaximum();
372  }
373 
374  if ( btppColour ) { // print colours
375  col[0] = 4 ;
376  col[1] = 2 ;
377  col[2] = 6 ;
378  col[3] = 3 ;
379  lineStyle[0] = 1 ;
380  lineStyle[1] = 1 ;
381  lineStyle[2] = 1 ;
382  lineStyle[3] = 1 ;
383  markerStyle[0] = 20 ;
384  markerStyle[1] = 21 ;
385  markerStyle[2] = 22 ;
386  markerStyle[3] = 23 ;
387  lineWidth = 1 ;
388  }
389  else { // different marker/line styles
390  col[1] = 1 ;
391  col[2] = 1 ;
392  col[3] = 1 ;
393  col[0] = 1 ;
394  lineStyle[0] = 2 ;
395  lineStyle[1] = 1 ;
396  lineStyle[2] = 3 ;
397  lineStyle[3] = 4 ;
398  markerStyle[0] = 20 ;
399  markerStyle[1] = 21 ;
400  markerStyle[2] = 22 ;
401  markerStyle[3] = 23 ;
402  }
403 
404  // if changing order (NI stays always last)
405 
406  // c to plot first
407  if ( thePlotFirst == "c" ) {
408  histo[0] = theHisto_c ;
409  if ( btppColour ) col[0] = 6 ;
410  if ( !btppColour ) lineStyle[0] = 3 ;
411  histo[2] = theHisto_dusg ;
412  if ( btppColour ) col[2] = 4 ;
413  if ( !btppColour ) lineStyle[2] = 2 ;
414  }
415 
416  // b to plot first
417  if ( thePlotFirst == "b" ) {
418  histo[0] = theHisto_b ;
419  if ( btppColour ) col[0] = 2 ;
420  if ( !btppColour ) lineStyle[0] = 1 ;
421  histo[1] = theHisto_dusg ;
422  if ( btppColour ) col[1] = 4 ;
423  if ( !btppColour ) lineStyle[1] = 2 ;
424  }
425 
426 
427  histo[0] ->getTH1F()->GetXaxis()->SetTitle ( theBaseNameDescription.c_str() ) ;
428  histo[0] ->getTH1F()->GetYaxis()->SetTitle ( "Arbitrary Units" ) ;
429  histo[0] ->getTH1F()->GetYaxis()->SetTitleOffset(1.25) ;
430 
431  for (int i=0; i != 4; ++i) {
432  if (histo[i]== 0 ) continue;
433  histo[i] ->getTH1F()->SetStats ( false ) ;
434  histo[i] ->getTH1F()->SetLineStyle ( lineStyle[i] ) ;
435  histo[i] ->getTH1F()->SetLineWidth ( lineWidth ) ;
436  histo[i] ->getTH1F()->SetLineColor ( col[i] ) ;
437  histo[i] ->getTH1F()->SetMarkerStyle ( markerStyle[i] ) ;
438  histo[i] ->getTH1F()->SetMarkerColor ( col[i] ) ;
439  histo[i] ->getTH1F()->SetMarkerSize ( markerSize ) ;
440  }
441 
442  if ( thePlotNormalized ) {
443 // cout <<histo[0]->GetEntries() <<" "<< histo[1]->GetEntries() <<" "<< histo[2]->GetEntries()<<" "<<histo[3]->GetEntries()<<endl;
444  if (histo[0]->getTH1F()->GetEntries() != 0) {histo[0]->getTH1F() ->DrawNormalized() ;} else { histo[0]->getTH1F() ->SetMaximum(1.0);
445 histo[0] ->getTH1F()->Draw() ;}
446  if (histo[1]->getTH1F()->GetEntries() != 0) histo[1] ->getTH1F()->DrawNormalized("Same") ;
447  if (histo[2]->getTH1F()->GetEntries() != 0) histo[2]->getTH1F() ->DrawNormalized("Same") ;
448  if ((histo[3] != 0) && (histo[3]->getTH1F()->GetEntries() != 0)) histo[3] ->getTH1F()->DrawNormalized("Same") ;
449  }
450  else {
451  histo[0]->getTH1F()->SetMaximum(max*1.05);
452  if (theMin!=-1.) histo[0]->getTH1F()->SetMinimum(theMin);
453  histo[0]->getTH1F()->Draw() ;
454  histo[1]->getTH1F()->Draw("Same") ;
455  histo[2]->getTH1F()->Draw("Same") ;
456  if ( histo[3] != 0 ) histo[3]->getTH1F()->Draw("Same") ;
457  }
458 
459 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * theHisto_c
TStyle * setTDRStyle()
Definition: Tools.cc:287
const T & max(const T &a, const T &b)
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
MonitorElement * theHisto_dusg
std::string theBaseNameDescription
TH1F * getTH1F(void) const
MonitorElement * theHisto_b
int col
Definition: cuy.py:1008
MonitorElement * theHisto_ni
template<class T>
std::string FlavourHistograms< T >::plotFirst ( ) const
inline

Definition at line 75 of file FlavourHistorgrams.h.

75 { return thePlotFirst ; }
template<class T>
bool FlavourHistograms< T >::plotLog ( ) const
inline

Definition at line 73 of file FlavourHistorgrams.h.

73 { return thePlotLog ; }
template<class T>
bool FlavourHistograms< T >::plotNormalized ( ) const
inline

Definition at line 74 of file FlavourHistorgrams.h.

74 { return thePlotNormalized ; }
template<class T>
void FlavourHistograms< T >::SetMaximum ( const double &  max)
inline

Definition at line 62 of file FlavourHistorgrams.h.

62 { theMax = max;}
const T & max(const T &a, const T &b)
template<class T>
void FlavourHistograms< T >::SetMinimum ( const double &  min)
inline

Definition at line 63 of file FlavourHistorgrams.h.

Referenced by EffPurFromHistos::EffPurFromHistos().

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

Definition at line 306 of file FlavourHistorgrams.h.

Referenced by JetTagPlotter::JetTagPlotter(), and TrackIPHistograms< T >::settitle().

306  {
308  if (mcPlots_) {
309  if (mcPlots_>2 ) {
315  }
320  }
321 }
MonitorElement * theHisto_g
MonitorElement * theHisto_c
MonitorElement * theHisto_u
MonitorElement * theHisto_all
MonitorElement * theHisto_d
MonitorElement * theHisto_dusg
MonitorElement * theHisto_b
MonitorElement * theHisto_s
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * theHisto_dus
MonitorElement * theHisto_ni
template<class T>
bool FlavourHistograms< T >::statistics ( ) const
inline

Definition at line 72 of file FlavourHistorgrams.h.

72 { return theStatistics ; }
template<class T>
double FlavourHistograms< T >::upperBound ( ) const
inline

Definition at line 71 of file FlavourHistorgrams.h.

Referenced by EffPurFromHistos::EffPurFromHistos().

71 { return theUpperBound ; }

Member Data Documentation

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

Definition at line 141 of file FlavourHistorgrams.h.

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

template<class T>
int* FlavourHistograms< T >::theArrayDimension
protected
template<class T>
std::string FlavourHistograms< T >::theBaseNameDescription
protected
template<class T>
std::string FlavourHistograms< T >::theBaseNameTitle
protected
template<class T>
TCanvas* FlavourHistograms< T >::theCanvas
protected

Definition at line 137 of file FlavourHistorgrams.h.

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

template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_all
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_b
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_c
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_d
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_dus
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_dusg
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_g
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_ni
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_s
protected
template<class T>
MonitorElement* FlavourHistograms< T >::theHisto_u
protected
template<class T>
int FlavourHistograms< T >::theIndexToPlot
protected

Definition at line 108 of file FlavourHistorgrams.h.

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

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

Definition at line 119 of file FlavourHistorgrams.h.

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

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

Definition at line 107 of file FlavourHistorgrams.h.

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

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

Definition at line 119 of file FlavourHistorgrams.h.

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

template<class T>
int FlavourHistograms< T >::theNBins
protected
template<class T>
std::string FlavourHistograms< T >::thePlotFirst
protected
template<class T>
bool FlavourHistograms< T >::thePlotLog
protected

Definition at line 116 of file FlavourHistorgrams.h.

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

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

Definition at line 117 of file FlavourHistorgrams.h.

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

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