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) ;
110 void fillVariable (
const int & flavour ,
const T & varX ,
const G & varY ,
const float & w)
const;
174 template <
class T,
class G>
176 int nBinsX_ ,
double lowerBoundX_ ,
double upperBoundX_ ,
177 int nBinsY_ ,
double lowerBoundY_ ,
double upperBoundY_ ,
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)
352 template <
class T,
class G>
366 template <
class T,
class G>
void
370 fillVariable ( flavour , variableX , variableY , w ) ;
373 template <
class T,
class G>
void
376 fill ( flavour , variableX , variableY , 1. ) ;
379 template <
class T,
class G>
void
382 if ( theArrayDimension == 0 ) {
384 fillVariable ( flavour , *variableX, *variableY , w) ;
387 int iMax = *theArrayDimension ;
388 if ( *theArrayDimension > theMaxDimension ) iMax = theMaxDimension ;
390 for (
int i = 0 ;
i != iMax ; ++
i ) {
392 if ( ( theIndexToPlot < 0 ) || (
i == theIndexToPlot ) ) {
393 fillVariable ( flavour , *(variableX+
i) , *(variableY+
i) , w) ;
398 if ( theIndexToPlot >= iMax ) {
400 const T& theZeroT =
static_cast<T> ( 0.0) ;
401 const G& theZeroG =
static_cast<T> ( 0.0 );
402 fillVariable ( flavour , theZeroT , theZeroG , w ) ;
407 template <
class T,
class G>
void
410 fill ( flavour, variableX , variableY , 1. );
413 template <
class T,
class G>
415 if(theHisto_all) theHisto_all ->setAxisTitle(titleX) ;
416 if(theHisto_all) theHisto_all ->setAxisTitle(titleY, 2) ;
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) ;
441 if(theProfile_all) theProfile_all ->setAxisTitle(titleX) ;
442 if(theProfile_all) theProfile_all ->setAxisTitle(titleY, 2) ;
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) ;
470 template <
class T,
class G>
477 if(theHisto_all) theHisto_all ->getTH2F()->
Divide ( theHisto_all->getTH2F() , bHD.
histo_all () , 1.0 , 1.0 ,
"b" ) ;
484 theHisto_dus ->getTH2F()->
Divide ( theHisto_dus->getTH2F() , bHD.
histo_dus () , 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" ) ;
495 template <
class T,
class G>
498 if(theHisto_all) theHisto_all->Fill ( varX, varY,w ) ;
501 if(theProfile_all) theProfile_all->Fill( varX, varY);
505 if (!mcPlots_)
return;
510 theHisto_d->Fill( varX, varY,w );
511 theHisto_dus->Fill( varX, varY,w );
513 theHisto_dusg->Fill( varX, varY,w );
519 theProfile_d->Fill(varX, varY);
520 theProfile_dus->Fill(varX, varY);
522 theProfile_dusg->Fill(varX, varY);
527 theHisto_u->Fill( varX, varY,w );
528 theHisto_dus->Fill( varX, varY,w );
530 theHisto_dusg->Fill( varX, varY,w );
536 theProfile_u->Fill(varX, varY);
537 theProfile_dus->Fill(varX, varY);
539 theProfile_dusg->Fill(varX, varY);
544 theHisto_s->Fill( varX, varY,w );
545 theHisto_dus->Fill( varX, varY,w );
547 theHisto_dusg->Fill( varX, varY,w );
553 theProfile_s->Fill(varX, varY);
554 theProfile_dus->Fill(varX, varY);
556 theProfile_dusg->Fill(varX, varY);
560 theHisto_c->Fill( varX, varY,w );
562 if(createProfile_) theProfile_c->Fill(varX, varY);
565 theHisto_b->Fill( varX, varY,w );
567 if(createProfile_) theProfile_b->Fill(varX, varY);
570 if (mcPlots_>2) theHisto_g->Fill( varX, varY,w );
571 theHisto_dusg->Fill( varX, varY,w );
575 if (mcPlots_>2) theProfile_g->Fill(varX, varY);
576 theProfile_dusg->Fill(varX, varY);
580 theHisto_pu->Fill( varX, varY,w );
582 if(createProfile_) theProfile_pu->Fill(varX, varY);
585 theHisto_ni->Fill( varX, varY,w );
587 if(createProfile_) theProfile_ni->Fill(varX, varY);
592 template <
class T,
class G>
595 std::vector<TH2F*> histoVector;
596 if(theHisto_all) histoVector.push_back ( theHisto_all->getTH2F() );
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() );
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() );
614 template <
class T,
class G>
617 std::vector<TProfile*> profileVector;
619 if(theProfile_all) profileVector.push_back ( theProfile_all->getTProfile() );
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() );
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() );
635 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 * 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
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