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_ ,
41 int nBinsX_ ,
double lowerBoundX_ ,
double upperBoundX_ ,
42 int nBinsY_ ,
double lowerBoundY_ ,
double upperBoundY_ ,
43 bool statistics_ ,
std::string folder,
unsigned int mc,
54 void fill (
const int &
flavour,
const T & variableX,
const G & variableY)
const;
55 void fill (
const int & flavour,
const T & variableX,
const G & variableY,
const float &
w)
const;
58 void fill (
const int & flavour,
const T * variableX,
const G * variableY)
const;
59 void fill (
const int & flavour,
const T * variableX,
const G * variableY,
const float & w)
const;
62 void settitle(
const char* titleX,
const char* titleY) ;
116 void fillVariable (
const int & flavour ,
const T & varX ,
const G & varY ,
const float & w)
const;
180 template <
class T,
class G>
182 int nBinsX_ ,
double lowerBoundX_ ,
double upperBoundX_ ,
183 int nBinsY_ ,
double lowerBoundY_ ,
double upperBoundY_ ,
std::string folder,
187 theMaxDimension(-1), theIndexToPlot(-1), theBaseNameTitle ( baseNameTitle_ ) , theBaseNameDescription ( baseNameDescription_ ) ,
188 theNBinsX ( nBinsX_ ) , theNBinsY (nBinsY_),
189 theLowerBoundX ( lowerBoundX_ ) , theUpperBoundX ( upperBoundX_ ) ,
190 theLowerBoundY ( lowerBoundY_ ) , theUpperBoundY ( upperBoundY_ ) ,
191 theMin(-1.), theMax(-1.), mcPlots_(mc), createProfile_(createProfile)
284 template <
class T,
class G>
286 int nBinsX_ ,
double lowerBoundX_ ,
double upperBoundX_ ,
287 int nBinsY_ ,
double lowerBoundY_ ,
double upperBoundY_ ,
290 theMaxDimension(-1), theIndexToPlot(-1), theBaseNameTitle ( baseNameTitle_ ) , theBaseNameDescription ( baseNameDescription_ ) ,
291 theNBinsX ( nBinsX_ ) , theNBinsY (nBinsY_),
292 theLowerBoundX ( lowerBoundX_ ) , theUpperBoundX ( upperBoundX_ ) ,
293 theLowerBoundY ( lowerBoundY_ ) , theUpperBoundY ( upperBoundY_ ) ,
294 theStatistics ( statistics_ ) , theMin(-1.), theMax(-1.), mcPlots_(mc), createProfile_(createProfile)
421 template <
class T,
class G>
425 template <
class T,
class G>
void
429 fillVariable ( flavour , variableX , variableY , w ) ;
432 template <
class T,
class G>
void
435 fill ( flavour , variableX , variableY , 1. ) ;
438 template <
class T,
class G>
void
441 if ( theArrayDimension == 0 ) {
443 fillVariable ( flavour , *variableX, *variableY , w) ;
446 int iMax = *theArrayDimension ;
447 if ( *theArrayDimension > theMaxDimension ) iMax = theMaxDimension ;
449 for (
int i = 0 ;
i != iMax ; ++
i ) {
451 if ( ( theIndexToPlot < 0 ) || (
i == theIndexToPlot ) ) {
452 fillVariable ( flavour , *(variableX+
i) , *(variableY+
i) , w) ;
457 if ( theIndexToPlot >= iMax ) {
459 const T& theZeroT =
static_cast<T> ( 0.0) ;
460 const G& theZeroG =
static_cast<T> ( 0.0 );
461 fillVariable ( flavour , theZeroT , theZeroG , w ) ;
466 template <
class T,
class G>
void
469 fill ( flavour, variableX , variableY , 1. );
472 template <
class T,
class G>
474 if(theHisto_all) theHisto_all ->setAxisTitle(titleX) ;
475 if(theHisto_all) theHisto_all ->setAxisTitle(titleY, 2) ;
478 if(theHisto_d) theHisto_d ->setAxisTitle(titleX) ;
479 if(theHisto_u) theHisto_u ->setAxisTitle(titleX) ;
480 if(theHisto_s) theHisto_s ->setAxisTitle(titleX) ;
481 if(theHisto_c) theHisto_c ->setAxisTitle(titleX) ;
482 if(theHisto_b) theHisto_b ->setAxisTitle(titleX) ;
483 if(theHisto_g) theHisto_g ->setAxisTitle(titleX) ;
484 if(theHisto_ni) theHisto_ni ->setAxisTitle(titleX) ;
485 if(theHisto_dus) theHisto_dus ->setAxisTitle(titleX) ;
486 if(theHisto_dusg)theHisto_dusg->setAxisTitle(titleX) ;
487 if(theHisto_d) theHisto_d ->setAxisTitle(titleY, 2) ;
488 if(theHisto_u) theHisto_u ->setAxisTitle(titleY, 2) ;
489 if(theHisto_s) theHisto_s ->setAxisTitle(titleY, 2) ;
490 if(theHisto_c) theHisto_c ->setAxisTitle(titleY, 2) ;
491 if(theHisto_b) theHisto_b ->setAxisTitle(titleY, 2) ;
492 if(theHisto_g) theHisto_g ->setAxisTitle(titleY, 2) ;
493 if(theHisto_ni) theHisto_ni ->setAxisTitle(titleY, 2) ;
494 if(theHisto_dus) theHisto_dus ->setAxisTitle(titleY, 2) ;
495 if(theHisto_dusg)theHisto_dusg->setAxisTitle(titleY, 2) ;
496 if(theHisto_pu) theHisto_pu ->setAxisTitle(titleY, 2) ;
500 if(theProfile_all) theProfile_all ->setAxisTitle(titleX) ;
501 if(theProfile_all) theProfile_all ->setAxisTitle(titleY, 2) ;
504 if(theProfile_d) theProfile_d ->setAxisTitle(titleX) ;
505 if(theProfile_u) theProfile_u ->setAxisTitle(titleX) ;
506 if(theProfile_s) theProfile_s ->setAxisTitle(titleX) ;
507 if(theProfile_c) theProfile_c ->setAxisTitle(titleX) ;
508 if(theProfile_b) theProfile_b ->setAxisTitle(titleX) ;
509 if(theProfile_g) theProfile_g ->setAxisTitle(titleX) ;
510 if(theProfile_ni) theProfile_ni ->setAxisTitle(titleX) ;
511 if(theProfile_dus) theProfile_dus ->setAxisTitle(titleX) ;
512 if(theProfile_dusg)theProfile_dusg->setAxisTitle(titleX) ;
513 if(theProfile_d) theProfile_d ->setAxisTitle(titleY, 2) ;
514 if(theProfile_u) theProfile_u ->setAxisTitle(titleY, 2) ;
515 if(theProfile_s) theProfile_s ->setAxisTitle(titleY, 2) ;
516 if(theProfile_c) theProfile_c ->setAxisTitle(titleY, 2) ;
517 if(theProfile_b) theProfile_b ->setAxisTitle(titleY, 2) ;
518 if(theProfile_g) theProfile_g ->setAxisTitle(titleY, 2) ;
519 if(theProfile_ni) theProfile_ni ->setAxisTitle(titleY, 2) ;
520 if(theProfile_dus) theProfile_dus ->setAxisTitle(titleY, 2) ;
521 if(theProfile_dusg)theProfile_dusg->setAxisTitle(titleY, 2) ;
522 if(theProfile_pu) theProfile_pu ->setAxisTitle(titleY, 2) ;
529 template <
class T,
class G>
536 if(theHisto_all) theHisto_all ->getTH2F()->
Divide ( theHisto_all->getTH2F() , bHD.
histo_all () , 1.0 , 1.0 ,
"b" ) ;
543 theHisto_dus ->getTH2F()->
Divide ( theHisto_dus->getTH2F() , bHD.
histo_dus () , 1.0 , 1.0 ,
"b" ) ;
547 theHisto_ni ->getTH2F()->
Divide ( theHisto_ni->getTH2F() , bHD.
histo_ni () , 1.0 , 1.0 ,
"b" ) ;
548 theHisto_dusg ->getTH2F()->
Divide ( theHisto_dusg->getTH2F() , bHD.
histo_dusg() , 1.0 , 1.0 ,
"b" ) ;
549 theHisto_pu ->getTH2F()->
Divide ( theHisto_pu->getTH2F() , bHD.
histo_pu () , 1.0 , 1.0 ,
"b" ) ;
554 template <
class T,
class G>
557 if(theHisto_all) theHisto_all->Fill ( varX, varY,w ) ;
560 if(theProfile_all) theProfile_all->Fill( varX, varY);
564 if (!mcPlots_)
return;
569 theHisto_d->Fill( varX, varY,w );
570 theHisto_dus->Fill( varX, varY,w );
572 theHisto_dusg->Fill( varX, varY,w );
578 theProfile_d->Fill(varX, varY);
579 theProfile_dus->Fill(varX, varY);
581 theProfile_dusg->Fill(varX, varY);
586 theHisto_u->Fill( varX, varY,w );
587 theHisto_dus->Fill( varX, varY,w );
589 theHisto_dusg->Fill( varX, varY,w );
595 theProfile_u->Fill(varX, varY);
596 theProfile_dus->Fill(varX, varY);
598 theProfile_dusg->Fill(varX, varY);
603 theHisto_s->Fill( varX, varY,w );
604 theHisto_dus->Fill( varX, varY,w );
606 theHisto_dusg->Fill( varX, varY,w );
612 theProfile_s->Fill(varX, varY);
613 theProfile_dus->Fill(varX, varY);
615 theProfile_dusg->Fill(varX, varY);
619 theHisto_c->Fill( varX, varY,w );
621 if(createProfile_) theProfile_c->Fill(varX, varY);
624 theHisto_b->Fill( varX, varY,w );
626 if(createProfile_) theProfile_b->Fill(varX, varY);
629 if (mcPlots_>2) theHisto_g->Fill( varX, varY,w );
630 theHisto_dusg->Fill( varX, varY,w );
634 if (mcPlots_>2) theProfile_g->Fill(varX, varY);
635 theProfile_dusg->Fill(varX, varY);
639 theHisto_pu->Fill( varX, varY,w );
641 if(createProfile_) theProfile_pu->Fill(varX, varY);
644 theHisto_ni->Fill( varX, varY,w );
646 if(createProfile_) theProfile_ni->Fill(varX, varY);
651 template <
class T,
class G>
654 std::vector<TH2F*> histoVector;
655 if(theHisto_all) histoVector.push_back ( theHisto_all->getTH2F() );
658 histoVector.push_back ( theHisto_d->getTH2F() );
659 histoVector.push_back ( theHisto_u->getTH2F() );
660 histoVector.push_back ( theHisto_s->getTH2F() );
661 histoVector.push_back ( theHisto_g ->
getTH2F() );
662 histoVector.push_back ( theHisto_dus->getTH2F() );
664 histoVector.push_back ( theHisto_c->getTH2F() );
665 histoVector.push_back ( theHisto_b->getTH2F() );
666 histoVector.push_back ( theHisto_ni->getTH2F() );
667 histoVector.push_back ( theHisto_dusg->getTH2F());
668 histoVector.push_back ( theHisto_pu->getTH2F() );
673 template <
class T,
class G>
676 std::vector<TProfile*> profileVector;
678 if(theProfile_all) profileVector.push_back ( theProfile_all->getTProfile() );
681 profileVector.push_back ( theProfile_d->getTProfile() );
682 profileVector.push_back ( theProfile_u->getTProfile() );
683 profileVector.push_back ( theProfile_s->getTProfile() );
684 profileVector.push_back ( theProfile_g ->
getTProfile() );
685 profileVector.push_back ( theProfile_dus->getTProfile() );
687 profileVector.push_back ( theProfile_c->getTProfile() );
688 profileVector.push_back ( theProfile_b->getTProfile() );
689 profileVector.push_back ( theProfile_ni->getTProfile() );
690 profileVector.push_back ( theProfile_dusg->getTProfile());
691 profileVector.push_back ( theProfile_pu->getTProfile() );
694 return profileVector;
TProfile * profile_c() const
std::string theBaseNameDescription
MonitorElement * theProfile_s
MonitorElement * theProfile_pu
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 * get(const std::string &path)
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)
virtual ~FlavourHistograms2D()
std::string baseNameTitle() const
TProfile * profile_b() const
std::string theBaseNameTitle
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
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
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