00001 // ============================================================================ 00002 // $Id: TRecordAssociation.hh,v 1.1 2004/03/01 02:36:25 goiwai Exp $ 00003 // $Name: CLDAQ-1-12-00 $ 00004 // $Log: TRecordAssociation.hh,v $ 00005 // Revision 1.1 2004/03/01 02:36:25 goiwai 00006 // RecordDisplay用のクラス群を置きました. 00007 // お蔵入りになってたものに手直しを加えたものですが, 00008 // まだ不充分な点も在ります.徐々に修正していきたいと思います. 00009 // DataRecordオブジェクトを表示するためのツール群なのでRecordDisplayと呼 00010 // んでいます,多分にオフライン要素が強いです. 00011 // オンラインよりにしたものを後でEventDisplay(Eventを表示)としてコミット 00012 // します. 00013 // 00014 // ============================================================================ 00015 #ifdef __CLDAQ_ROOT_USE 00016 #ifndef CLDAQ__TRECORDASSOCIATION_HH 00017 #define CLDAQ__TRECORDASSOCIATION_HH 00018 00019 class TRecordDisplayCanvas; 00020 class TH1D; 00021 00022 #include <TH1.h> 00023 #include "Tglobals.h" 00024 00025 class TRecordAssociation 00026 { 00027 00028 private: 00029 Tstring theRecordID; 00030 Tstring theSectionID; 00031 Tstring theSegmentID; 00032 Tstring theElementID; 00033 Tint theNumberOfBins; 00034 Tdouble theMinimumX; 00035 Tdouble theMaximumX; 00036 TRecordDisplayCanvas* theCanvas; 00037 TH1D* theHistogram; 00038 Tbool theValidAssociation; 00039 00042 00043 public: 00044 TRecordAssociation( const Tstring& recid = "", 00045 const Tstring& secid = "", 00046 const Tstring& segid = "", 00047 const Tstring& eleid = "", 00048 Tint nbin = -1, 00049 Tdouble xmin = DBL_MAX, 00050 Tdouble xmax = DBL_MIN, 00051 TRecordDisplayCanvas* cv = 0, 00052 TH1D* h = 0 00053 ); 00054 TRecordAssociation( const TRecordAssociation& right ); 00055 ~TRecordAssociation(); 00056 00057 public: 00058 const TRecordAssociation& operator=( const TRecordAssociation& right ); 00059 Tbool operator==( const TRecordAssociation& right ) const; 00060 Tbool operator!=( const TRecordAssociation& right ) const; 00061 00062 public: 00063 friend Tostream& operator<<( Tostream& tos, const TRecordAssociation& right ); 00064 00065 public: 00066 const Tstring& GetRecordID() const; 00067 const Tstring& GetSectionID() const; 00068 const Tstring& GetSegmentID() const; 00069 const Tstring& GetElementID() const; 00070 Tint GetNumberOfBins() const; 00071 Tdouble GetMinimumX() const; 00072 Tdouble GetMaximumX() const; 00073 TRecordDisplayCanvas* GetCanvas() const; 00074 TH1D* GetHistogram() const; 00075 Tvoid SetRecordID( const Tstring& id ); 00076 Tvoid SetSectionID( const Tstring& id ); 00077 Tvoid SetSegmentID( const Tstring& id ); 00078 Tvoid SetElementID( const Tstring& id ); 00079 Tvoid SetNumberOfBins( Tint nbin ); 00080 Tvoid SetMinimumX( Tdouble xmin ); 00081 Tvoid SetMaximumX( Tdouble xmax ); 00082 Tvoid SetCanvas( TRecordDisplayCanvas* cv ); 00083 Tvoid SetHistogram( TH1D* h ); 00084 Tbool IsValid() const; 00085 00086 private: 00087 Tvoid checkValid(); 00088 00089 }; 00090 00091 inline const Tstring& TRecordAssociation::GetRecordID() const 00092 { 00093 return theRecordID; 00094 } 00095 00096 inline const Tstring& TRecordAssociation::GetSectionID() const 00097 { 00098 return theSectionID; 00099 } 00100 00101 inline const Tstring& TRecordAssociation::GetSegmentID() const 00102 { 00103 return theSegmentID; 00104 } 00105 00106 inline const Tstring& TRecordAssociation::GetElementID() const 00107 { 00108 return theElementID; 00109 } 00110 00111 inline Tint TRecordAssociation::GetNumberOfBins() const 00112 { 00113 return theNumberOfBins; 00114 } 00115 00116 inline Tdouble TRecordAssociation::GetMinimumX() const 00117 { 00118 return theMinimumX; 00119 } 00120 00121 inline Tdouble TRecordAssociation::GetMaximumX() const 00122 { 00123 return theMaximumX; 00124 } 00125 00126 inline TRecordDisplayCanvas* TRecordAssociation::GetCanvas() const 00127 { 00128 return theCanvas; 00129 } 00130 00131 inline TH1D* TRecordAssociation::GetHistogram() const 00132 { 00133 return theHistogram; 00134 } 00135 00136 inline Tvoid TRecordAssociation::SetRecordID( const Tstring& id ) 00137 { 00138 theRecordID = id; 00139 checkValid(); 00140 return; 00141 } 00142 00143 inline Tvoid TRecordAssociation::SetSectionID( const Tstring& id ) 00144 { 00145 theSectionID = id; 00146 checkValid(); 00147 return; 00148 } 00149 00150 inline Tvoid TRecordAssociation::SetSegmentID( const Tstring& id ) 00151 { 00152 theSegmentID = id; 00153 checkValid(); 00154 return; 00155 } 00156 00157 inline Tvoid TRecordAssociation::SetElementID( const Tstring& id ) 00158 { 00159 theElementID = id; 00160 checkValid(); 00161 return; 00162 } 00163 00164 inline Tvoid TRecordAssociation::SetNumberOfBins( Tint nbin ) 00165 { 00166 theNumberOfBins = nbin; 00167 checkValid(); 00168 return; 00169 } 00170 00171 inline Tvoid TRecordAssociation::SetMinimumX( Tdouble xmin ) 00172 { 00173 theMinimumX = xmin; 00174 checkValid(); 00175 return; 00176 } 00177 00178 inline Tvoid TRecordAssociation::SetMaximumX( Tdouble xmax ) 00179 { 00180 theMaximumX = xmax; 00181 checkValid(); 00182 return; 00183 } 00184 00185 inline Tvoid TRecordAssociation::SetCanvas( TRecordDisplayCanvas* cv ) 00186 { 00187 theCanvas = cv; 00188 checkValid(); 00189 return; 00190 } 00191 00192 inline Tvoid TRecordAssociation::SetHistogram( TH1D* h ) 00193 { 00194 theHistogram = h; 00195 checkValid(); 00196 return; 00197 } 00198 00199 inline Tbool TRecordAssociation::IsValid() const 00200 { 00201 return theValidAssociation; 00202 } 00203 00204 #endif 00205 #endif