ATLAS Offline Software
Loading...
Searching...
No Matches
tPlotter< T > Class Template Reference

generic plotter class - better to have one of these - make sure it can be configured however you like, line styles, marker types, legends etc now a template so can be used for TH1D and TH2D etc More...

#include <computils.h>

Collaboration diagram for tPlotter< T >:

Public Member Functions

 tPlotter (T *fo_htest=0, T *fo_href=0, const std::string &s="", TGraphAsymmErrors *fo_tgtest=0, TGraphAsymmErrors *fo_tgref=0)
 tPlotter (const tPlotter &p)
 ~tPlotter ()
 sadly, root manages all the histograms (does it really?
void xlo (double x)
void xhi (double x)
double xlo () const
double xhi () const
const std::string & plotfilename () const
void trim_errors (bool b)
bool trim_errors () const
void SetRange (double lo, double hi)
void Draw (int i, Legend *lleg, bool mean=false, bool first=true, bool drawlegend=false)
void DrawLegend (int i, Legend &leg, bool mean=false, bool first=true, bool drawlegend=false)
void Print (const std::string &s="")
 print the output
T * htest ()
T * href ()
bool mc (bool b)
bool mc () const
TGraphAsymmErrors * tgtest ()
TGraphAsymmErrors * tgref ()
void max_entries (int i)
void xaxis (const AxisInfo *a)
void yaxis (const AxisInfo *a)
const AxisInfo * xaxis () const
const AxisInfo * yaxis () const

Static Public Member Functions

static void setplotref (bool b)
static void setmeanplotref (bool b)

Private Attributes

T * m_htest
 actual histograms
T * m_href
TGraphAsymmErrors * m_tgtest
TGraphAsymmErrors * m_tgref
std::string m_plotfilename
size_t m_max_entries
size_t m_entries
bool m_trim_errors
bool m_mc
double m_lo
double m_hi
double m_xlo
double m_xhi
const AxisInfo * m_xaxis
const AxisInfo * m_yaxis

Static Private Attributes

static bool s_plotref
static bool s_meanplotref

Detailed Description

template<typename T>
class tPlotter< T >

generic plotter class - better to have one of these - make sure it can be configured however you like, line styles, marker types, legends etc now a template so can be used for TH1D and TH2D etc

Definition at line 473 of file computils.h.

Constructor & Destructor Documentation

◆ tPlotter() [1/2]

template<typename T>
tPlotter< T >::tPlotter ( T * fo_htest = 0,
T * fo_href = 0,
const std::string & s = "",
TGraphAsymmErrors * fo_tgtest = 0,
TGraphAsymmErrors * fo_tgref = 0 )
inline

Definition at line 477 of file computils.h.

477 :
481 m_max_entries(4),
482 m_entries(0),
483 m_trim_errors(false),
484 m_mc(false),
485 m_lo(-999), m_hi(-999),
486 m_xlo(-999), m_xhi(-999),
487 m_xaxis(0), m_yaxis(0) {
488 }
generic plotter class - better to have one of these - make sure it can be configured however you like...
Definition computils.h:473
double m_xlo
Definition computils.h:1164
T * m_htest
actual histograms
Definition computils.h:1143
double m_xhi
Definition computils.h:1165
const AxisInfo * m_yaxis
Definition computils.h:1168
std::string m_plotfilename
Definition computils.h:1149
bool m_mc
Definition computils.h:1159
bool m_trim_errors
Definition computils.h:1157
size_t m_max_entries
Definition computils.h:1154
size_t m_entries
Definition computils.h:1155
TGraphAsymmErrors * m_tgtest
Definition computils.h:1146
double m_hi
Definition computils.h:1162
const AxisInfo * m_xaxis
Definition computils.h:1167
double m_lo
Definition computils.h:1161
TGraphAsymmErrors * m_tgref
Definition computils.h:1147

◆ tPlotter() [2/2]

template<typename T>
tPlotter< T >::tPlotter ( const tPlotter< T > & p)
inline

Definition at line 491 of file computils.h.

◆ ~tPlotter()

template<typename T>
tPlotter< T >::~tPlotter ( )
inline

sadly, root manages all the histograms (does it really?

who can tell) so we mustn't delete anything just in case NO, NO, NO, don't delete the objects, root need them because it is TOO STUPID to allow objects to be used as actual objects

Definition at line 509 of file computils.h.

509{ }

Member Function Documentation

◆ Draw()

template<typename T>
void tPlotter< T >::Draw ( int i,
Legend * lleg,
bool mean = false,
bool first = true,
bool drawlegend = false )
inline

this is a hack, and should be removed

filled ...

this is also a hack and needs to be removed ...

not quite yet ...

Definition at line 526 of file computils.h.

526 {
527
528 std::cout << "Draw " << __LINE__ << std::endl;
529
530 double phibeam = 0;
531 double xbeam = 0;
532 double ybeam = 0;
533 double offbeam = 0;
534
535
536 if ( htest() ) {
537
538 gStyle->SetOptStat(0);
539
540#if 1
541 if ( first ) {
542
543 // double lo = xlo();
544 // double hi = xhi();
545
546 double lo = htest()->GetBinLowEdge(1);
547 double hi = htest()->GetBinLowEdge(htest()->GetNbinsX()+1);
548
549 std::cout << "aes lo: " << lo << std::endl;
550 std::cout << "ase hi: " << hi << std::endl;
551
552 std::cout << "ase m_lo: " << m_lo << std::endl;
553 std::cout << "ase m_hi: " << m_hi << std::endl;
554
555
556 if ( m_xaxis ) {
557 std::cout << "xaxis: " << *m_xaxis << std::endl;
558 std::cout << "xaxis: lo; " << m_xaxis->m_lo << std::endl;
559 std::cout << "xaxis: hi: " << m_xaxis->m_hi << std::endl;
560
561 if ( m_xaxis->m_lo!=0 || m_xaxis->m_hi!=0 ) {
562 // hnull->GetXaxis()->SetRangeUser( m_xaxis->m_lo, m_xaxis->m_hi!=0 );
563
564 // if ( lo>m_xaxis->m_lo ) lo = m_xaxis->m_lo;
565 // if ( hi<m_xaxis->m_hi ) hi = m_xaxis->m_hi;
566
567 lo = m_xaxis->m_lo;
568 hi = m_xaxis->m_hi;
569 }
570 else {
571 if ( m_lo!=m_hi ) {
572 if ( m_lo>lo ) lo = m_lo;
573 if ( m_hi<hi ) hi = m_hi;
574 }
575 }
576 }
577
578
579 std::cout << "hist lo: " << lo << std::endl;
580 std::cout << "hist hi: " << hi << std::endl;
581
582 TH1D* hnull = new TH1D("hnull", htest()->GetTitle(), 100, lo, hi ); // htest()->GetBinLowEdge(1), htest()->GetBinLowEdge(htest()->GetNbinsX()+1) );
583 hnull->SetDirectory(0);
584
585 hnull->SetMaximum(htest()->GetMaximum());
586 hnull->SetMinimum(htest()->GetMinimum());
587 hnull->GetXaxis()->SetMoreLogLabels(true);
588
589 hnull->GetXaxis()->SetTitle(htest()->GetXaxis()->GetTitle());
590 hnull->GetYaxis()->SetTitle(htest()->GetYaxis()->GetTitle());
591
592 for ( int ib=1 ; ib<101 ; ib++ ) hnull->SetBinContent(ib, hnull->GetMinimum()-1e10);
593
594 hnull->DrawCopy();
595
596 std::cout << htest()->GetTitle() << std::endl;
597 std::cout << hnull->GetXaxis()->GetTitle() << std::endl;
598 std::cout << hnull->GetYaxis()->GetTitle() << std::endl;
599
600 first = false;
601 }
602#endif
603
604 if ( href() ) {
605 href()->SetLineColor(colours[i%6]);
606 href()->SetLineStyle(2);
607 href()->SetMarkerStyle(0);
608 }
609
610 if ( LINEF ) htest()->SetLineColor(colours[i%6]);
611
612 if ( JLflag ) {
613 if ( contains( std::string(htest()->GetName()), "vs_mu") ) htest()->GetXaxis()->SetRangeUser( 18, 58 );
614 if ( contains( std::string(htest()->GetName()), "a0_eff") ) htest()->GetXaxis()->SetRangeUser( -200, 200 );
615
616 std::cout << "TEST: " << htest()->GetName() << " " << mc() << "\t" << std::endl;
617 }
618
619 htest()->SetLineStyle(1);
620
621 if ( LINEF ) htest()->SetMarkerColor(htest()->GetLineColor());
622
623 if ( LINEF ) htest()->SetMarkerStyle(markers[i%6]);
624 // if ( LINEF && htest()->GetMarkerStyle() == 20 )
625
626 if ( LINEF ) htest()->SetMarkerSize( msizes[i%6]*htest()->GetMarkerSize() );
627
628 if ( htest() ) std::cout << "\tentries: " << plotable( htest() );
629
631
632
633 if ( first ) {
634
635 if ( !mc() ) {
636 if ( tgtest() ) {
637
638#if 0
639 TH1F* h = (TH1F*)htest()->Clone("h"); h->SetDirectory(0);
640
641 zeroErrors(h);
642 h->GetXaxis()->SetMoreLogLabels(true);
643 if ( trim_errors() ) trim_tgraph( h, tgtest() );
644
645 if ( m_xlo!=-999 && m_xhi!=-999 ) {
646 TH1D* hnull = nrew TH1D( "hnull", "", 100, m_xlo, m_xhi );
647 hnull->SetMinimum( h->GetMinimum() );
648 hnull->SetMaximum( h->GetMaximum() );
649 hnull->SetTitle( h->GetTitle() );
650 hnull->DrawCopy();
651 h->Draw("ep same");
652 }
653 else {
654 h->Draw("ep");
655 first = false;
656 }
657
658 if ( LINES ) h->Draw("lhistsame");
659 setParameters( h, tgtest() );
660 tgtest()->Draw("esame");
661#else
662 zeroErrors(htest());
663
664 std::cout << "shte lo: " << m_lo << std::endl;
665 std::cout << "shte hi: " << m_hi << std::endl;
666
667
668 htest()->GetXaxis()->SetMoreLogLabels(true);
669 if ( trim_errors() ) trim_tgraph( htest(), tgtest() );
670
671
672 htest()->Draw("ep");
673 if ( LINES ) htest()->Draw("lhistsame");
674 setParameters( htest(), tgtest() );
675 tgtest()->Draw("esame");
676 first = false;
677
678
679#endif
680 }
681 else {
682
683 std::cout << "cck lo: " << m_lo << std::endl;
684 std::cout << "cck hi: " << m_hi << std::endl;
685
686 htest()->GetXaxis()->SetMoreLogLabels(true);
687 htest()->Draw("ep");
688 first = false;
689 if ( LINES ) htest()->Draw("lhistsame");
690 }
691 }
692
693 }
694
695 if ( s_plotref && href() ) {
696 if ( contains(href()->GetName(),"_vs_") ||
697 contains(href()->GetName(),"sigma") ||
698 contains(href()->GetName(),"mean") ||
699 contains(href()->GetName(),"_eff") ||
700 contains(href()->GetName(),"Res_") ||
701 contains(href()->GetName(),"Eff_") ) href()->Draw("hist same][");
702 else href()->Draw("hist same");
703 }
704
705 if ( !mc() && tgtest() ) {
706 zeroErrors(htest());
707
708 if ( trim_errors() ) trim_tgraph( htest(), tgtest() );
709 setParameters( htest(), tgtest() );
710 tgtest()->Draw("e1same");
711 if ( LINES ) tgtest()->Draw("lsame");
712
713 }
714
715#if 0
717 if ( htest()->GetMarkerStyle()>23 ) {
718 TH1D* hnull = (TH1D*)htest()->Clone("duff"); hnull->SetDirectory(0);
719 zeroErrors( hnull );
720 hnull->SetLineColor(kWhite);
721 hnull->SetMarkerStyle( htest()->GetMarkerStyle()-4 );
722 // hnull->SetMarkerStyle( 0 );
723 hnull->SetMarkerColor(kWhite);
724 hnull->SetMarkerSize( htest()->GetMarkerSize()*0.75 );
725 // hnull->SetMarkerSize( 0 );
726 hnull->DrawCopy("l same");
727
728 std::cout << "cnt lo: " << m_lo << std::endl;
729 std::cout << "cnt hi: " << m_hi << std::endl;
730
731
732 delete hnull;
733 }
734#endif
735
736 std::cout << "TEST MC: " << htest()->GetName() << " " << mc() << std::endl;
737
738 TH1* h = htest();
739
740 TList* ccklist = h->GetListOfFunctions();
741
742 size_t tlsize = ccklist->GetSize();
743
744 std::cout << "tlsize: " << tlsize << std::endl;
745
746
747 for ( size_t icck=0 ; icck<tlsize ; icck++ ) {
748 std::cout << "tlist: " << icck << " " << ccklist->At(icck)->GetName() << std::endl;
749
750 TF1* cck = (TF1*)ccklist->At(icck);
751
752 cck->SetLineColor(htest()->GetLineColor());
753
754 if ( std::string(cck->GetName()) == "sinus" ) {
755 phibeam = cck->GetParameter(1);
756 xbeam = cck->GetParameter(0)*cos(phibeam);
757 ybeam = cck->GetParameter(0)*sin(phibeam);
758 offbeam = cck->GetParameter(2);
759
760 std::cout << "phi = " << phibeam
761 << "\nx = " << xbeam
762 << " mm\ny = " << ybeam
763 << " mm\noff = " << offbeam << " mm" << std::endl;
764
765 }
766
767 }
768
769 // if ( tlsize > 0 ) std::exit(0);
770
771
772 if ( !mc() ) {
773
774 std::cout << "TEST mtype " << htest()->GetMarkerStyle() << " " << htest()->GetMarkerColor() << std::endl;
775
776 if ( contains( std::string(h->GetName()), "a0_eff") ) {
777 // h->GetXaxis()->SetRangeUser( -200,200 );
778
780 std::cout << "STUFF" << std::endl;
781
782
783 for (int i=0 ; i<h->GetNbinsX() ; i++ ) {
784 if (h->GetBinCenter(i)<-200 ) {
785 h->SetBinContent(i,0);
786 h->SetBinError(i,0);
787 }
788 }
789 }
790
791 htest()->Draw("ep same");
792 if ( LINES ) htest()->Draw("lhist same");
793 }
794 else {
795
796#if 1
797 std::cout << "colour: " << htest()->GetMarkerColor() << std::endl;
798
799#if 1
801 htest()->SetFillStyle(455);
802 htest()->SetFillColor(htest()->GetMarkerColor());
803 htest()->SetMarkerStyle(0);
804#endif
805
807 if ( contains( std::string(h->GetName()), "vs_mu") ) h->GetXaxis()->SetRangeUser( 18, 58 );
808 if ( contains( std::string(h->GetName()), "a0_eff") ) {
809 h->GetXaxis()->SetRangeUser( -200,200 );
810
811 std::cout << "STUFF" << std::endl;
812
813 for (int i=0 ; i<h->GetNbinsX() ; i++ ) {
814 if (h->GetBinCenter(i)<-200 ) {
815 h->SetBinContent(i,0);
816 h->SetBinError(i,0);
817 }
818 }
819
820 }
821
822 htest()->Draw("e3lhistsame");
823
825
826 if ( LINES ) htest()->Draw("e3lhist same");
827#endif
828 }
829
831
832 static TH1D* hnull = new TH1D("hnull", "", 1, 0, 1);
833 hnull->SetMarkerColor(kWhite);
834 hnull->SetLineColor(kWhite);
835 hnull->SetMarkerStyle(0);
836 hnull->SetLineStyle(0);
837 hnull->SetLineWidth(0);
838 hnull->SetMarkerSize(0);
839
840
841 if ( lleg ) {
842
843 Legend& leg = *lleg;
844
845 if ( mean ) {
846
847 char meanrefc[64];
848 bool displayref = false;
849 if ( s_meanplotref && href() ) {
850 displayref = true;
851 true_mean muref( href() );
852 std::snprintf( meanrefc, 64, " <t> = %3.2f #pm %3.2f ms (ref)", muref.mean(), muref.error() );
853 }
854 else {
855 std::snprintf( meanrefc, 64, "%s", "" );
856 }
857
859 char meanc[64];
860 std::snprintf( meanc, 64, " <t> = %3.2f #pm %3.2f ms", mutest.mean(), mutest.error() );
861
863
864 std::string remove[7] = { "TIME_", "Time_", "All_", "Algorithm_", "Class_", "HLT_", "Chain_HLT_" };
865
866 if ( dkey.find("Chain")!=std::string::npos ) {
867 if ( dkey.find("__")!=std::string::npos ) dkey.erase( 0, dkey.find("__")+2 );
868 }
869
870
871 for ( int ir=0 ; ir<7 ; ir++ ) {
872 if ( dkey.find( remove[ir] )!=std::string::npos ) dkey.erase( dkey.find( remove[ir]), remove[ir].size() );
873 }
874
876
877
878 if ( LINEF || leg.size() < m_max_entries ) {
879 dkey += std::string(" : ");
880
881 if ( (dkey+meanc).size()>58 ) {
882 leg.AddEntry( htest(), dkey, "p" );
883 leg.AddEntry( hnull, meanc, "p" );
884 }
885 else {
886 leg.AddEntry( htest(), (dkey+meanc).c_str(), "p" );
887 }
888
889 if ( displayref ) {
890 rkey += std::string(" : ");
892 // leg.AddEntry( hnull, "", "l" );
893
894 if ( (rkey+meanrefc).size()>58 ) {
895 leg.AddEntry( href(), rkey, "l" );
896 leg.AddEntry( hnull, meanrefc, "l" );
897 }
898 else {
899 leg.AddEntry( href(), (rkey+meanrefc).c_str(), "l" );
900 }
901 }
902 }
903
904 }
905 else {
906 if ( !mc() ) {
907 if ( LINEF || leg.size()<m_max_entries ) leg.AddEntry( htest(), key, "p" );
908 }
909 else {
910 if ( LINEF || leg.size()<m_max_entries ) leg.AddEntry( htest(), key, "f" );
911 }
912 }
913
914 m_entries++;
915
916 if ( drawlegend ) leg.Draw();
917
918
919 if ( xbeam!=0 || ybeam!=0 ) {
920 // DrawLabel( 0.19, 0.24+i*0.085, label( "x_{beam} = %6.3lf mm", int(1000*xbeam + 0.5)*0.001), htest()->GetLineColor() );
921 // DrawLabel( 0.19, 0.20+i*0.085, label( "y_{beam} = %6.3lf mm", int(1000*ybeam + 0.5)*0.001), htest()->GetLineColor() );
922 DrawLabel( 0.19, 0.20+i*0.045, label( "x =%6.3lf mm y =%6.3lf mm off =%6.3lf mm", xbeam, ybeam, offbeam, 0 ), htest()->GetLineColor() );
923 // DrawLabel( 0.19, 0.20+i*0.045,
924 // int(1000*xbeam + 0.5)*0.001,
925 // int(1000*ybeam + 0.5)*0.001,
926 // int(1000*offbeam + 0.5)*0.001 ),
927 // htest()->GetLineColor() );
928 }
929
930 }
931
932 }
933 }
int DrawLabel(float xstart, float ystart, string label)
size_t size() const
Number of registered mappings.
bool mc() const
Definition computils.h:1122
bool trim_errors() const
Definition computils.h:522
void Draw(int i, Legend *lleg, bool mean=false, bool first=true, bool drawlegend=false)
Definition computils.h:526
static bool s_meanplotref
Definition computils.h:1152
T * href()
Definition computils.h:1118
T * htest()
Definition computils.h:1117
static bool s_plotref
Definition computils.h:1151
TGraphAsymmErrors * tgtest()
Definition computils.h:1124
double plotable(TH1 *h)
bool contains(const std::string &s, const std::string &p)
does a string contain the substring
Definition hcg.cxx:116
void zeroErrors(T *)
Definition computils.h:462
void band_plot(TH1 *h, double xlo, double xhi, double ylo=-999, double yhi=-999)
void trim_tgraph(TH1 *h, TGraphAsymmErrors *t)
void setParameters(T *h, TGraphAsymmErrors *tg)
Definition computils.h:451
std::string label(const std::string &format, int i)
Definition label.h:19

◆ DrawLegend()

template<typename T>
void tPlotter< T >::DrawLegend ( int i,
Legend & leg,
bool mean = false,
bool first = true,
bool drawlegend = false )
inline

Definition at line 937 of file computils.h.

937 {
938
939 if ( htest() ) {
940 gStyle->SetOptStat(0);
941 if ( href() ) {
942 href()->SetLineColor(colours[i%6]);
943 href()->SetLineStyle(2);
944 href()->SetMarkerStyle(0);
945 }
946
947 if ( LINEF ) htest()->SetLineColor(colours[i%6]);
948 htest()->SetLineStyle(1);
949 if ( LINEF ) htest()->SetMarkerColor(htest()->GetLineColor());
950 if ( LINEF ) htest()->SetMarkerStyle(markers[i%6]);
951
952 if ( htest() ) std::cout << "\tentries: " << plotable( htest() );
954
955 if ( first ) {
956
957 if ( tgtest() ) {
958 zeroErrors(htest());
959 htest()->GetXaxis()->SetMoreLogLabels(true);
960 if ( trim_errors() ) trim_tgraph( htest(), tgtest() );
961
962
963 // htest()->Draw("ep");
964 if ( LINES ) htest()->Draw("lhistsame");
965 setParameters( htest(), tgtest() );
966 // tgtest()->Draw("esame");
967 }
968 else {
969 htest()->GetXaxis()->SetMoreLogLabels(true);
970 // htest()->Draw("ep");
971 // if ( LINES ) htest()->Draw("lhistsame");
972 }
973
974 }
975
976
977#if 0
978 if ( s_plotref && href() ) {
979 if ( contains(href()->GetName(),"_vs_") ||
980 contains(href()->GetName(),"sigma") ||
981 contains(href()->GetName(),"mean") ||
982 contains(href()->GetName(),"_eff") ||
983 contains(href()->GetName(),"Res_") ||
984 contains(href()->GetName(),"Eff_") ) href()->Draw("hist same][");
985 else href()->Draw("hist same");
986 }
987
988 if ( tgtest() ) {
989 zeroErrors(htest());
990
991 if ( trim_errors() ) trim_tgraph( htest(), tgtest() );
992 setParameters( htest(), tgtest() );
993 tgtest()->Draw("e1same");
994 if ( LINES ) tgtest()->Draw("lsame");
995
996 }
997#endif
998
999
1000#if 0
1002 if ( htest()->GetMarkerStyle()>23 ) {
1003 TH1D* hnull = (TH1D*)htest()->Clone("duff"); hnull->SetDirectory(0);
1004 zeroErrors( hnull );
1005 hnull->SetLineColor(kWhite);
1006 hnull->SetMarkerStyle( htest()->GetMarkerStyle()-4 );
1007 // hnull->SetMarkerStyle( 0 );
1008 hnull->SetMarkerColor(kWhite);
1009 hnull->SetMarkerSize( htest()->GetMarkerSize()*0.75 );
1010 // hnull->SetMarkerSize( 0 );
1011 hnull->DrawCopy("l same");
1012 delete hnull;
1013 }
1014#endif
1015
1016 // htest()->Draw("ep same");
1017 // if ( LINES ) htest()->Draw("lhist same");
1018
1019 // href()->Draw("lhistsame");
1020 // htest()->Draw("lhistsame");
1021
1023
1024 static TH1D* hnull = new TH1D("hnull", "", 1, 0, 1);
1025 hnull->SetMarkerColor(kWhite);
1026 hnull->SetLineColor(kWhite);
1027 hnull->SetMarkerStyle(0);
1028 hnull->SetLineStyle(0);
1029 hnull->SetLineWidth(0);
1030 hnull->SetMarkerSize(0);
1031
1032
1033 if ( mean ) {
1034
1035 char meanrefc[64];
1036 bool displayref = false;
1037 if ( s_meanplotref && href() ) {
1038 displayref = true;
1039 true_mean muref( href() );
1040 std::sprintf( meanrefc, " <t> = %3.2f #pm %3.2f ms (ref)", muref.mean(), muref.error() );
1041 }
1042 else {
1043 std::sprintf( meanrefc, "%s", "" );
1044 }
1045
1046
1047 true_mean mutest( htest() );
1048 char meanc[64];
1049 std::sprintf( meanc, " <t> = %3.2f #pm %3.2f ms", mutest.mean(), mutest.error() );
1050
1052
1053 std::string remove[7] = { "TIME_", "Time_", "All_", "Algorithm_", "Class_", "HLT_", "Chain_HLT_" };
1054
1055 if ( dkey.find("Chain")!=std::string::npos ) {
1056 if ( dkey.find("__")!=std::string::npos ) dkey.erase( 0, dkey.find("__")+2 );
1057 }
1058
1059
1060 for ( int ir=0 ; ir<7 ; ir++ ) {
1061 if ( dkey.find( remove[ir] )!=std::string::npos ) dkey.erase( dkey.find( remove[ir]), remove[ir].size() );
1062 }
1063
1065
1066
1067 if ( LINEF || leg.size() < m_max_entries ) {
1068 dkey += std::string(" : ");
1069
1070 if ( (dkey+meanc).size()>58 ) {
1071 leg.AddEntry( htest(), dkey, "p" );
1072 leg.AddEntry( hnull, meanc, "p" );
1073 }
1074 else {
1075 leg.AddEntry( htest(), (dkey+meanc).c_str(), "p" );
1076 }
1077
1078 if ( displayref ) {
1079 rkey += std::string(" : ");
1080 // leg.AddEntry( hnull, "", "l" );
1081
1082 if ( (rkey+meanrefc).size()>58 ) {
1083 leg.AddEntry( href(), rkey, "l" );
1084 leg.AddEntry( hnull, meanrefc, "l" );
1085 }
1086 else {
1087 leg.AddEntry( href(), (rkey+meanrefc).c_str(), "l" );
1088 }
1089 }
1090 }
1091
1092 }
1093 else {
1094 if ( !mc() ) {
1095 if ( LINEF || leg.size()<m_max_entries ) leg.AddEntry( htest(), key, "p" );
1096 }
1097 else {
1098 if ( LINEF || leg.size()<m_max_entries ) leg.AddEntry( htest(), key, "f" );
1099 }
1100 }
1101
1102 m_entries++;
1103
1104 if ( drawlegend ) leg.Draw();
1105
1106 }
1107 }

◆ href()

template<typename T>
T * tPlotter< T >::href ( )
inline

Definition at line 1118 of file computils.h.

1118{ return m_href; }

◆ htest()

template<typename T>
T * tPlotter< T >::htest ( )
inline

Definition at line 1117 of file computils.h.

1117{ return m_htest; }

◆ max_entries()

template<typename T>
void tPlotter< T >::max_entries ( int i)
inline

Definition at line 1127 of file computils.h.

1127{ m_max_entries = i; }

◆ mc() [1/2]

template<typename T>
bool tPlotter< T >::mc ( ) const
inline

Definition at line 1122 of file computils.h.

1122{ return m_mc; }

◆ mc() [2/2]

template<typename T>
bool tPlotter< T >::mc ( bool b)
inline

Definition at line 1120 of file computils.h.

1120{ return m_mc=b; }

◆ plotfilename()

template<typename T>
const std::string & tPlotter< T >::plotfilename ( ) const
inline

Definition at line 518 of file computils.h.

518{ return m_plotfilename; }

◆ Print()

template<typename T>
void tPlotter< T >::Print ( const std::string & s = "")
inline

print the output

Definition at line 1112 of file computils.h.

1112 {
1113 if ( s!="" ) gPad->Print(s.c_str());
1114 else gPad->Print(m_plotfilename.c_str());
1115 }
void Print(const std::string &s="")
print the output
Definition computils.h:1112

◆ setmeanplotref()

template<typename T>
void tPlotter< T >::setmeanplotref ( bool b)
inlinestatic

Definition at line 1132 of file computils.h.

1132{ s_meanplotref=b; }

◆ setplotref()

template<typename T>
void tPlotter< T >::setplotref ( bool b)
inlinestatic

Definition at line 1131 of file computils.h.

◆ SetRange()

template<typename T>
void tPlotter< T >::SetRange ( double lo,
double hi )
inline

Definition at line 524 of file computils.h.

524{ m_lo=lo, m_hi=hi; }

◆ tgref()

template<typename T>
TGraphAsymmErrors * tPlotter< T >::tgref ( )
inline

Definition at line 1125 of file computils.h.

1125{ return m_tgref; }

◆ tgtest()

template<typename T>
TGraphAsymmErrors * tPlotter< T >::tgtest ( )
inline

Definition at line 1124 of file computils.h.

1124{ return m_tgtest; }

◆ trim_errors() [1/2]

template<typename T>
bool tPlotter< T >::trim_errors ( ) const
inline

Definition at line 522 of file computils.h.

522{ return m_trim_errors; }

◆ trim_errors() [2/2]

template<typename T>
void tPlotter< T >::trim_errors ( bool b)
inline

Definition at line 520 of file computils.h.

520{ m_trim_errors=b; }

◆ xaxis() [1/2]

template<typename T>
const AxisInfo * tPlotter< T >::xaxis ( ) const
inline

Definition at line 1137 of file computils.h.

1137{ return m_xaxis; }

◆ xaxis() [2/2]

template<typename T>
void tPlotter< T >::xaxis ( const AxisInfo * a)
inline

Definition at line 1134 of file computils.h.

1134{ m_xaxis = a; }

◆ xhi() [1/2]

template<typename T>
double tPlotter< T >::xhi ( ) const
inline

Definition at line 516 of file computils.h.

516{ return m_xhi; }

◆ xhi() [2/2]

template<typename T>
void tPlotter< T >::xhi ( double x)
inline

Definition at line 513 of file computils.h.

513{ m_xhi = x; }

◆ xlo() [1/2]

template<typename T>
double tPlotter< T >::xlo ( ) const
inline

Definition at line 515 of file computils.h.

515{ return m_xlo; }

◆ xlo() [2/2]

template<typename T>
void tPlotter< T >::xlo ( double x)
inline

Definition at line 512 of file computils.h.

512{ m_xlo = x; }

◆ yaxis() [1/2]

template<typename T>
const AxisInfo * tPlotter< T >::yaxis ( ) const
inline

Definition at line 1138 of file computils.h.

1138{ return m_yaxis; }

◆ yaxis() [2/2]

template<typename T>
void tPlotter< T >::yaxis ( const AxisInfo * a)
inline

Definition at line 1135 of file computils.h.

1135{ m_yaxis = a; }

Member Data Documentation

◆ m_entries

template<typename T>
size_t tPlotter< T >::m_entries
private

Definition at line 1155 of file computils.h.

◆ m_hi

template<typename T>
double tPlotter< T >::m_hi
private

Definition at line 1162 of file computils.h.

◆ m_href

template<typename T>
T* tPlotter< T >::m_href
private

Definition at line 1144 of file computils.h.

◆ m_htest

template<typename T>
T* tPlotter< T >::m_htest
private

actual histograms

Definition at line 1143 of file computils.h.

◆ m_lo

template<typename T>
double tPlotter< T >::m_lo
private

Definition at line 1161 of file computils.h.

◆ m_max_entries

template<typename T>
size_t tPlotter< T >::m_max_entries
private

Definition at line 1154 of file computils.h.

◆ m_mc

template<typename T>
bool tPlotter< T >::m_mc
private

Definition at line 1159 of file computils.h.

◆ m_plotfilename

template<typename T>
std::string tPlotter< T >::m_plotfilename
private

Definition at line 1149 of file computils.h.

◆ m_tgref

template<typename T>
TGraphAsymmErrors* tPlotter< T >::m_tgref
private

Definition at line 1147 of file computils.h.

◆ m_tgtest

template<typename T>
TGraphAsymmErrors* tPlotter< T >::m_tgtest
private

Definition at line 1146 of file computils.h.

◆ m_trim_errors

template<typename T>
bool tPlotter< T >::m_trim_errors
private

Definition at line 1157 of file computils.h.

◆ m_xaxis

template<typename T>
const AxisInfo* tPlotter< T >::m_xaxis
private

Definition at line 1167 of file computils.h.

◆ m_xhi

template<typename T>
double tPlotter< T >::m_xhi
private

Definition at line 1165 of file computils.h.

◆ m_xlo

template<typename T>
double tPlotter< T >::m_xlo
private

Definition at line 1164 of file computils.h.

◆ m_yaxis

template<typename T>
const AxisInfo* tPlotter< T >::m_yaxis
private

Definition at line 1168 of file computils.h.

◆ s_meanplotref

template<typename T>
bool tPlotter< T >::s_meanplotref
staticprivate

Definition at line 1152 of file computils.h.

◆ s_plotref

template<typename T>
bool tPlotter< T >::s_plotref
staticprivate

Definition at line 1151 of file computils.h.


The documentation for this class was generated from the following file: