#include <CHistogram.h>
Inheritance diagram for CHistogram:

Public Member Functions | |
| CHistogram (TH1 *h1, const TObject *inputsource, TH1 *subtracthisto=0, TH1 *refhisto=0) | |
| CHistogram (const CHistogram &chisto) | |
| CHistogram (const CObject &cobj) | |
| CHistogram () | |
| virtual | ~CHistogram () |
| TH1 * | GetSubtractHisto () const |
| TH1 * | GetRefHisto () const |
| void | SetSubtractHisto (TH1 *) |
| void | SetRefHisto (TH1 *) |
| TH1 * | SubtractedHisto () |
| virtual void | Draw (Option_t *option="") |
| virtual void | Paint (Option_t *option="") |
| TH1 * | GetHistoDrawn () const |
| CHistogram & | operator= (const CHistogram &chisto) |
Protected Member Functions | |
| virtual void | UpdateHisto () |
Protected Attributes | |
| TH1 * | fSubtractHisto |
| TH1 * | fRefHisto |
| TH1 * | fHistoDrawn |
Private Member Functions | |
| void | free () |
| void | copy (const CHistogram &chisto) |
|
||||||||||||||||||||
|
Definition at line 28 of file CHistogram.cxx. References SetSubtractHisto(), and UpdateHisto(). 00030 : CObject(h1, inputsource),fSubtractHisto(NULL), fRefHisto(refhisto), 00031 fHistoDrawn(NULL) 00032 { 00033 SetSubtractHisto( subtracthisto ); 00034 UpdateHisto(); 00035 }
|
|
|
Definition at line 37 of file CHistogram.cxx. References copy().
|
|
|
Definition at line 44 of file CHistogram.cxx. References CHistogram(), CObject::GetInputSource(), and CObject::GetTObject(). 00045 :CObject() 00046 { 00047 TObject *obj = cobj.GetTObject(); 00048 if ( obj && obj->InheritsFrom(TH1::Class()) ) 00049 CHistogram( (TH1*)obj, cobj.GetInputSource(), 0, 0); 00050 }
|
|
|
Definition at line 52 of file CHistogram.cxx. Referenced by CHistogram(). 00052 :CObject(){}
|
|
|
Definition at line 93 of file CHistogram.cxx. References free(). 00093 {
00094 free();
00095 }
|
|
|
Definition at line 55 of file CHistogram.cxx. References fRefHisto, CObject::fTObject, CObject::GetInputSource(), GetRefHisto(), GetSubtractHisto(), CObject::GetTObject(), SetSubtractHisto(), and UpdateHisto(). Referenced by CHistogram(), and operator=(). 00056 {
00057 TH1 *histo = (TH1*) chisto.GetTObject();
00058
00059 if ( !histo ) return;
00060
00061 if ( fTObject && fTObject != chisto.fTObject ) delete fTObject;
00062 //fTObject = histo->Clone();
00063 fTObject = histo;
00064
00065 fInputSource = chisto.GetInputSource();
00066
00067 TH1 *subtracthisto = (TH1*) chisto.GetSubtractHisto() ;
00068 SetSubtractHisto( subtracthisto );
00069
00070 fRefHisto = chisto.GetRefHisto();
00071
00072 UpdateHisto();
00073
00074 }
|
|
|
Reimplemented from CObject. Definition at line 176 of file CHistogram.cxx. References option. Referenced by HistoDisplay::DrawOnTheCanvas(), and HistoDisplay::ReplacePad(). 00177 {
00178 //if ( fHistoDrawn ) fHistoDrawn->Draw( option );
00179
00180 if ( option == "" ) option = fTObject->GetOption();
00181
00182 TString opt = option;
00183 opt.ToLower();
00184 if (gPad && !opt.Contains("same")) {
00185 //the following statement is necessary in case one attempts to draw
00186 //a temporary histogram already in the current pad
00187 if ( TestBit(kCanDelete) ) gPad->GetListOfPrimitives()->Remove(this);
00188 gPad->Clear();
00189 }
00190 AppendPad(opt.Data());
00191
00192 }
|
|
|
Reimplemented from CObject. Definition at line 76 of file CHistogram.cxx. References fHistoDrawn, and fSubtractHisto. Referenced by operator=(), and ~CHistogram(). 00077 {
00078 if ( fSubtractHisto ) {
00079 delete fSubtractHisto;
00080 fSubtractHisto = 0;
00081 }
00082
00083 if ( fHistoDrawn ) {
00084 delete fHistoDrawn;
00085 fHistoDrawn = 0;
00086 }
00087
00088 //if ( fTObject ) delete fTObject; // done by ~CObject()
00089
00090 }
|
|
|
Definition at line 61 of file CHistogram.h. 00061 { return fHistoDrawn; }
|
|
|
Definition at line 50 of file CHistogram.h. Referenced by copy(). 00050 { return fRefHisto; }
|
|
|
Definition at line 49 of file CHistogram.h. Referenced by copy(). 00049 { return fSubtractHisto; }
|
|
|
Definition at line 98 of file CHistogram.cxx. References copy(), and free(). 00098 {
00099 if (this != &chisto) {
00100 free();
00101 copy(chisto);
00102 }
00103 return *this;
00104 }
|
|
|
Reimplemented from CObject. Definition at line 195 of file CHistogram.cxx. References fHistoDrawn, and option. 00196 {
00197 if ( fHistoDrawn ) fHistoDrawn->Paint( option );
00198 }
|
|
|
Definition at line 124 of file CHistogram.cxx. References fRefHisto. 00124 {
00125 fRefHisto = refhisto;
00126 }
|
|
|
Definition at line 106 of file CHistogram.cxx. References fSubtractHisto, and UpdateHisto(). Referenced by HistoDisplay::AddSubtractHisto(), CHistogram(), and copy(). 00106 {
00107 // Set histo to be subtracted.
00108 // subtracthisto's clone is stored internally.
00109
00110 if ( fSubtractHisto && fSubtractHisto != subtracthisto )
00111 delete fSubtractHisto;
00112
00113 if ( subtracthisto ) {
00114 fSubtractHisto = (TH1*) subtracthisto->Clone();
00115 }
00116 else {
00117 fSubtractHisto = 0;
00118 }
00119
00120 UpdateHisto();
00121
00122 }
|
|
|
Definition at line 129 of file CHistogram.cxx. Referenced by HistoDisplay::DrawHisto(), HistoDisplay::ReplacePad(), and UpdateHisto(). 00130 {
00131 // return subtracted histogram.
00132
00133 TH1 *histo;
00134 if ( fTObject && fTObject->InheritsFrom( TH1::Class() ) ) {
00135 histo = (TH1*)fTObject;
00136 }
00137 else {
00138 return 0;
00139 }
00140
00141 TH1* histonew = (TH1*)( histo->Clone() );
00142
00143 TH1 *subtracthisto = fSubtractHisto;
00144
00145 if ( histonew && subtracthisto) {
00146
00147 histonew->Add(subtracthisto, -1.);
00148
00149 histonew
00150 ->SetEntries( histo->GetEntries()
00151 - subtracthisto->GetEntries() );
00152
00153 // After Root Version 2.23.12
00154 Stat_t s1[10], s2[10];
00155 Int_t i;
00156 for (i=0;i<10;i++) {s1[i] = s2[i] = 0;}
00157 histo->GetStats(s1);
00158 subtracthisto->GetStats(s2);
00159 for (i=0;i<10;i++) s1[i] -= s2[i];
00160 histonew->PutStats(s1);
00161 //-
00162
00163 } //if (histonew && subtracthisto)
00164
00165 return histonew;
00166 }
|
|
|
Definition at line 169 of file CHistogram.cxx. References fHistoDrawn, and SubtractedHisto(). Referenced by CHistogram(), copy(), and SetSubtractHisto(). 00170 {
00171 if ( fHistoDrawn ) delete fHistoDrawn;
00172 fHistoDrawn = SubtractedHisto();
00173 }
|
|
|
Definition at line 28 of file CHistogram.h. Referenced by free(), Paint(), and UpdateHisto(). |
|
|
Definition at line 26 of file CHistogram.h. Referenced by copy(), and SetRefHisto(). |
|
|
Definition at line 25 of file CHistogram.h. Referenced by free(), and SetSubtractHisto(). |
1.3.9.1