メインページ   モジュール   名前空間一覧   クラス階層   アルファベット順一覧   構成   ファイル一覧   構成メンバ   ファイルメンバ   関連ページ    

TRecordAssociation.cc

解説を見る。
00001 // ============================================================================
00002 //  $Id: TRecordAssociation.cc,v 1.2 2004/03/07 10:30:27 goiwai Exp $
00003 //  $Name: CLDAQ-1-14-03 $
00004 //  $Log: TRecordAssociation.cc,v $
00005 //  Revision 1.2  2004/03/07 10:30:27  goiwai
00006 //  ROOTに組みこむためのおまじないマクロを埋めこみました。
00007 //  全てにおいて完全に動作するわけではありません。
00008 //
00009 //  Revision 1.1  2004/03/01 02:36:25  goiwai
00010 //  RecordDisplay用のクラス群を置きました.
00011 //  お蔵入りになってたものに手直しを加えたものですが,
00012 //  まだ不充分な点も在ります.徐々に修正していきたいと思います.
00013 //  DataRecordオブジェクトを表示するためのツール群なのでRecordDisplayと呼
00014 //  んでいます,多分にオフライン要素が強いです.
00015 //  オンラインよりにしたものを後でEventDisplay(Eventを表示)としてコミット
00016 //  します.
00017 //
00018 // ============================================================================
00019 #ifdef __CLDAQ_ROOT_USE
00020 #include "TRecordAssociation.hh"
00021 #include "TRecordDisplayCanvas.hh"
00022 
00023 TRecordAssociation::TRecordAssociation( const Tstring& recid, const Tstring& secid, const Tstring& segid, const Tstring& eleid, Tint nbin, Tdouble xmin, Tdouble xmax, TRecordDisplayCanvas* cv, TH1D* h )
00024   : theRecordID( recid ),
00025     theSectionID( secid ),
00026     theSegmentID( segid ),
00027     theElementID( eleid ),
00028     theNumberOfBins( nbin ),
00029     theMinimumX( xmin ),
00030     theMaximumX( xmax ),
00031     theCanvas( cv ),
00032     theHistogram( h ),
00033     theValidAssociation( Tfalse )
00034 {
00035   checkValid();
00036 }
00037 
00038 TRecordAssociation::TRecordAssociation( const TRecordAssociation& right )
00039   : theRecordID( right.theRecordID ),
00040     theSectionID( right.theSectionID ),
00041     theSegmentID( right.theSegmentID ),
00042     theElementID( right.theElementID ),
00043     theNumberOfBins( right.theNumberOfBins ),
00044     theMinimumX( right.theMinimumX ),
00045     theMaximumX( right.theMaximumX ),
00046     theCanvas( right.theCanvas ),
00047     theHistogram( right.theHistogram ),
00048     theValidAssociation( Tfalse )
00049 {
00050   checkValid();
00051 }
00052 
00053 TRecordAssociation::~TRecordAssociation()
00054 {;}
00055 
00056 const TRecordAssociation& TRecordAssociation::operator=( const TRecordAssociation& right )
00057 {
00058   theRecordID = right.theRecordID;
00059   theSectionID = right.theSectionID;
00060   theSegmentID = right.theSegmentID;
00061   theElementID = right.theElementID;
00062   theNumberOfBins = right.theNumberOfBins;
00063   theMinimumX = right.theMinimumX;
00064   theMaximumX = right.theMaximumX;
00065   theCanvas = right.theCanvas;
00066   theHistogram = right.theHistogram;
00067   theValidAssociation = Tfalse;
00068   checkValid();
00069   return *this;
00070 }
00071 
00072 Tbool TRecordAssociation::operator==( const TRecordAssociation& right ) const
00073 {
00074   Tbool retval = Ttrue;
00075 
00076   retval &= ( theRecordID == right.theRecordID );
00077   retval &= ( theSectionID == right.theSectionID );
00078   retval &= ( theSegmentID == right.theSegmentID );
00079   retval &= ( theElementID == right.theElementID );
00080 
00081   return retval;
00082 }
00083 
00084 Tbool TRecordAssociation::operator!=( const TRecordAssociation& right ) const
00085 {
00086   Tbool retval = Tfalse;
00087 
00088   retval |= ( theRecordID != right.theRecordID );
00089   retval |= ( theSectionID != right.theSectionID );
00090   retval |= ( theSegmentID != right.theSegmentID );
00091   retval |= ( theElementID != right.theElementID );
00092 
00093   return retval;
00094 }
00095 
00096 Tostream& operator<<( Tostream& tos, const TRecordAssociation& right )
00097 {
00098   //if ( right.theValidAssociation ) {
00099   tos << "ID: " << right.theRecordID << "/";
00100   tos << right.theSectionID << "/";
00101   tos << right.theSegmentID << "/";
00102   tos << right.theElementID;
00103   tos << ", Cv: " << right.theCanvas;
00104   tos << ", H1: " << right.theHistogram;
00105   if ( ! right.theValidAssociation ) {
00106     tos << " (Invalid)";
00107   }
00108   //} else {
00109   //tos << "invalid association";
00110   //}
00111   //tos << Tflush;
00112   return tos;
00113 }
00114 
00115 Tvoid TRecordAssociation::checkValid()
00116 {
00117   theValidAssociation = Tfalse;
00118   if ( theRecordID.empty() || theRecordID == "" ) {
00119     return;
00120   } else if ( theSectionID.empty() || theSectionID == "" ) {
00121     return;
00122   } else if ( theSegmentID.empty() || theSegmentID == "" ) {
00123     return;
00124   } else if ( theElementID.empty() || theElementID == "" ) {
00125     return;
00126   } else if ( theNumberOfBins < 0 ) {
00127     return;
00128   } else if ( !theCanvas || !theHistogram ) {
00129     return;
00130   } else {
00131     theValidAssociation = Ttrue;
00132     return;
00133   }
00134 }
00135 
00136 #endif
00137 
00138 #ifdef __CLDAQ_ROOT_DLL
00139     ClassImp(TRecordAssociation)
00140 #endif


CLDAQ - a Class Library for DataAcQuisition (Version 1.14.3)
Go IWAI -- goiwai at users.sourceforge.jp