2 #ifndef FlavourHistograms2D_H
3 #define FlavourHistograms2D_H
29 template <
class T,
class G>
35 int nBinsX_ ,
double lowerBoundX_ ,
double upperBoundX_ ,
36 int nBinsY_ ,
double lowerBoundY_ ,
double upperBoundY_ ,
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;
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;
56 void settitle(
const char* titleX,
const char* titleY) ;
108 void fillVariable (
const int & flavour ,
const T & varX ,
const G & varY ,
const float & w)
const;
170 template <
class T,
class G>
172 int nBinsX_ ,
double lowerBoundX_ ,
double upperBoundX_ ,
173 int nBinsY_ ,
double lowerBoundY_ ,
double upperBoundY_ ,
178 theMaxDimension(-1), theIndexToPlot(-1), theBaseNameTitle ( baseNameTitle_ ) , theBaseNameDescription ( baseNameDescription_ ) ,
179 theNBinsX ( nBinsX_ ) , theNBinsY (nBinsY_),
180 theLowerBoundX ( lowerBoundX_ ) , theUpperBoundX ( upperBoundX_ ) ,
181 theLowerBoundY ( lowerBoundY_ ) , theUpperBoundY ( upperBoundY_ ) ,
182 theStatistics ( statistics_ ) , theMin(-1.), theMax(-1.), mcPlots_(mc), createProfile_(createProfile)
338 template <
class T,
class G>
352 template <
class T,
class G>
void
356 fillVariable ( flavour , variableX , variableY , w ) ;
359 template <
class T,
class G>
void
362 fill ( flavour , variableX , variableY , 1. ) ;
365 template <
class T,
class G>
void
368 if ( theArrayDimension == 0 ) {
370 fillVariable ( flavour , *variableX, *variableY , w) ;
373 int iMax = *theArrayDimension ;
374 if ( *theArrayDimension > theMaxDimension ) iMax = theMaxDimension ;
376 for (
int i = 0 ;
i != iMax ; ++
i ) {
378 if ( ( theIndexToPlot < 0 ) || (
i == theIndexToPlot ) ) {
379 fillVariable ( flavour , *(variableX+
i) , *(variableY+
i) , w) ;
384 if ( theIndexToPlot >= iMax ) {
386 const T& theZeroT =
static_cast<T> ( 0.0) ;
387 const G& theZeroG =
static_cast<T> ( 0.0 );
388 fillVariable ( flavour , theZeroT , theZeroG , w ) ;
393 template <
class T,
class G>
void
396 fill ( flavour, variableX , variableY , 1. );
399 template <
class T,
class G>
401 if(theHisto_all) theHisto_all ->setAxisTitle(titleX) ;
402 if(theHisto_all) theHisto_all ->setAxisTitle(titleY, 2) ;
405 if(theHisto_d) theHisto_d ->setAxisTitle(titleX) ;
406 if(theHisto_u) theHisto_u ->setAxisTitle(titleX) ;
407 if(theHisto_s) theHisto_s ->setAxisTitle(titleX) ;
408 if(theHisto_c) theHisto_c ->setAxisTitle(titleX) ;
409 if(theHisto_b) theHisto_b ->setAxisTitle(titleX) ;
410 if(theHisto_g) theHisto_g ->setAxisTitle(titleX) ;
411 if(theHisto_ni) theHisto_ni ->setAxisTitle(titleX) ;
412 if(theHisto_dus) theHisto_dus ->setAxisTitle(titleX) ;
413 if(theHisto_dusg)theHisto_dusg->setAxisTitle(titleX) ;
414 if(theHisto_d) theHisto_d ->setAxisTitle(titleY, 2) ;
415 if(theHisto_u) theHisto_u ->setAxisTitle(titleY, 2) ;
416 if(theHisto_s) theHisto_s ->setAxisTitle(titleY, 2) ;
417 if(theHisto_c) theHisto_c ->setAxisTitle(titleY, 2) ;
418 if(theHisto_b) theHisto_b ->setAxisTitle(titleY, 2) ;
419 if(theHisto_g) theHisto_g ->setAxisTitle(titleY, 2) ;
420 if(theHisto_ni) theHisto_ni ->setAxisTitle(titleY, 2) ;
421 if(theHisto_dus) theHisto_dus ->setAxisTitle(titleY, 2) ;
422 if(theHisto_dusg)theHisto_dusg->setAxisTitle(titleY, 2) ;
426 if(theProfile_all) theProfile_all ->setAxisTitle(titleX) ;
427 if(theProfile_all) theProfile_all ->setAxisTitle(titleY, 2) ;
430 if(theProfile_d) theProfile_d ->setAxisTitle(titleX) ;
431 if(theProfile_u) theProfile_u ->setAxisTitle(titleX) ;
432 if(theProfile_s) theProfile_s ->setAxisTitle(titleX) ;
433 if(theProfile_c) theProfile_c ->setAxisTitle(titleX) ;
434 if(theProfile_b) theProfile_b ->setAxisTitle(titleX) ;
435 if(theProfile_g) theProfile_g ->setAxisTitle(titleX) ;
436 if(theProfile_ni) theProfile_ni ->setAxisTitle(titleX) ;
437 if(theProfile_dus) theProfile_dus ->setAxisTitle(titleX) ;
438 if(theProfile_dusg)theProfile_dusg->setAxisTitle(titleX) ;
439 if(theProfile_d) theProfile_d ->setAxisTitle(titleY, 2) ;
440 if(theProfile_u) theProfile_u ->setAxisTitle(titleY, 2) ;
441 if(theProfile_s) theProfile_s ->setAxisTitle(titleY, 2) ;
442 if(theProfile_c) theProfile_c ->setAxisTitle(titleY, 2) ;
443 if(theProfile_b) theProfile_b ->setAxisTitle(titleY, 2) ;
444 if(theProfile_g) theProfile_g ->setAxisTitle(titleY, 2) ;
445 if(theProfile_ni) theProfile_ni ->setAxisTitle(titleY, 2) ;
446 if(theProfile_dus) theProfile_dus ->setAxisTitle(titleY, 2) ;
447 if(theProfile_dusg)theProfile_dusg->setAxisTitle(titleY, 2) ;
454 template <
class T,
class G>
461 if(theHisto_all) theHisto_all ->getTH2F()->
Divide ( theHisto_all->getTH2F() , bHD.
histo_all () , 1.0 , 1.0 ,
"b" ) ;
468 theHisto_dus ->getTH2F()->
Divide ( theHisto_dus->getTH2F() , bHD.
histo_dus () , 1.0 , 1.0 ,
"b" ) ;
472 theHisto_ni ->getTH2F()->
Divide ( theHisto_ni->getTH2F() , bHD.
histo_ni () , 1.0 , 1.0 ,
"b" ) ;
473 theHisto_dusg ->getTH2F()->
Divide ( theHisto_dusg->getTH2F() , bHD.
histo_dusg() , 1.0 , 1.0 ,
"b" ) ;
478 template <
class T,
class G>
481 if(theHisto_all) theHisto_all->Fill ( varX, varY,w ) ;
484 if(theProfile_all) theProfile_all->Fill( varX, varY);
488 if (!mcPlots_)
return;
493 theHisto_d->Fill( varX, varY,w );
494 theHisto_dus->Fill( varX, varY,w );
496 theHisto_dusg->Fill( varX, varY,w );
502 theProfile_d->Fill(varX, varY);
503 theProfile_dus->Fill(varX, varY);
505 theProfile_dusg->Fill(varX, varY);
510 theHisto_u->Fill( varX, varY,w );
511 theHisto_dus->Fill( varX, varY,w );
513 theHisto_dusg->Fill( varX, varY,w );
519 theProfile_u->Fill(varX, varY);
520 theProfile_dus->Fill(varX, varY);
522 theProfile_dusg->Fill(varX, varY);
527 theHisto_s->Fill( varX, varY,w );
528 theHisto_dus->Fill( varX, varY,w );
530 theHisto_dusg->Fill( varX, varY,w );
536 theProfile_s->Fill(varX, varY);
537 theProfile_dus->Fill(varX, varY);
539 theProfile_dusg->Fill(varX, varY);
543 theHisto_c->Fill( varX, varY,w );
545 if(createProfile_) theProfile_c->Fill(varX, varY);
548 theHisto_b->Fill( varX, varY,w );
550 if(createProfile_) theProfile_b->Fill(varX, varY);
553 if (mcPlots_>2) theHisto_g->Fill( varX, varY,w );
554 theHisto_dusg->Fill( varX, varY,w );
558 if (mcPlots_>2) theProfile_g->Fill(varX, varY);
559 theProfile_dusg->Fill(varX, varY);
563 theHisto_ni->Fill( varX, varY,w );
565 if(createProfile_) theProfile_ni->Fill(varX, varY);
570 template <
class T,
class G>
573 std::vector<TH2F*> histoVector;
574 if(theHisto_all) histoVector.push_back ( theHisto_all->getTH2F() );
577 histoVector.push_back ( theHisto_d->getTH2F() );
578 histoVector.push_back ( theHisto_u->getTH2F() );
579 histoVector.push_back ( theHisto_s->getTH2F() );
580 histoVector.push_back ( theHisto_g ->
getTH2F() );
581 histoVector.push_back ( theHisto_dus->getTH2F() );
583 histoVector.push_back ( theHisto_c->getTH2F() );
584 histoVector.push_back ( theHisto_b->getTH2F() );
585 histoVector.push_back ( theHisto_ni->getTH2F() );
586 histoVector.push_back ( theHisto_dusg->getTH2F());
591 template <
class T,
class G>
594 std::vector<TProfile*> profileVector;
596 if(theProfile_all) profileVector.push_back ( theProfile_all->getTProfile() );
599 profileVector.push_back ( theProfile_d->getTProfile() );
600 profileVector.push_back ( theProfile_u->getTProfile() );
601 profileVector.push_back ( theProfile_s->getTProfile() );
602 profileVector.push_back ( theProfile_g ->
getTProfile() );
603 profileVector.push_back ( theProfile_dus->getTProfile() );
605 profileVector.push_back ( theProfile_c->getTProfile() );
606 profileVector.push_back ( theProfile_b->getTProfile() );
607 profileVector.push_back ( theProfile_ni->getTProfile() );
608 profileVector.push_back ( theProfile_dusg->getTProfile());
611 return profileVector;
TProfile * profile_c() const
std::string theBaseNameDescription
MonitorElement * theProfile_s
double lowerBoundX() const
TProfile * getTProfile(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
double lowerBoundY() const
MonitorElement * theHisto_g
void SetMaximum(const double &max)
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)
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)
virtual ~FlavourHistograms2D()
std::string baseNameTitle() const
TProfile * profile_b() const
std::string theBaseNameTitle
void divide(const FlavourHistograms2D< T, G > &bHD) const
MonitorElement * theHisto_c
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
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
std::vector< TH2F * > getHistoVector() const
MonitorElement * theProfile_d
std::string baseNameDescription() const
TProfile * profile_d() const
MonitorElement * theProfile_dus
MonitorElement * theHisto_all
TProfile * profile_ni() const
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)
TH2F * getTH2F(void) const
MonitorElement * theProfile_g
TProfile * profile_dusg() const
double upperBoundY() const
MonitorElement * theHisto_b
int flavour(const Candidate &part)
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