TExtractor.hh Source File

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

# TExtractor.hh

解説を見る。

    00001 // =====================================================================
    00021 // =====================================================================
    00022 #ifndef __TEXTRACTOR_HH
    00023 #define __TEXTRACTOR_HH
    00024
    00025 #include "Tglobals.h"
    00026 #include "TMatrixElement.hh"
    00027 #include "TDataElementList.hh"
    00028
    00029 class TDataRecord;
    00030 class TDataSection;
    00031 class TDataSegment;
    00032 class TDataElement;
    00033
    00034
    00054 class TExtractor
    00055 {
    00056
    00057   protected:
    00058     Tstring theExtractorID;
    00059     TMatrixElement theMatrixElement;
    00060     Tint theSamplingRate;
    00061     Tbool theDataFoundStatus;
    00062     Tbool theFillMatrixStatus;
    00063
    00064   public:
    00065     TExtractor( const Tstring& id, Tobject_t objecttype, Tint nevents = 0, Tint usec = 0 );
    00066     virtual ~TExtractor();
    00067
    00068   public:
    00069     virtual Tvoid Extract() = 0;
    00070
    00071   public:
    00072     TDataSection FindDataSection( const TDataRecord& record, const Tstring& sectionid );
    00073     TDataSegment FindDataSegment( const TDataSection& section, const Tstring& segmentid );
    00074     TDataSegment FindDataSegment( const TDataRecord& record, const Tstring& sectionid, const Tstring& segmentid );
    00075     TDataSegment FindDataSegment( const TDataRecord& record, Tstring id[ 2 ] );
    00076     TDataElement FindDataElement( const TDataSegment& segment, const Tstring& elementid );
    00077     TDataElement FindDataElement( const TDataRecord& record, const Tstring& sectionid, const Tstring& segmentid, const Tstring& elementid );
    00078     TDataElement FindDataElement( const TDataRecord& record, Tstring id[ 3 ] );
    00079     TDataElement FindDataElement( const TDataRecord& record, const TstringList& id );
    00080
    00081   public:
    00082     const TMatrixElement& GetMatrixElement() const;
    00083     TMatrixElement& GetMatrixElement();
    00084     Tvoid SetMatrixElement( const TMatrixElement& matrix );
    00085     const Tstring& GetExtractorID() const;
    00086     Tvoid SetExtractorID( const Tstring& id );
    00087     Tint GetSamplingRate() const;
    00088     Tvoid SetSamplingRate( Tint usec );
    00089     Tbool DoesDataFound() const;
    00090     Tbool DoesMatrixFill() const;
    00091     Tbool DoesExtractSuccess() const;
    00092
    00093   public:
    00094     Tvoid FillMatrix( const TDataElementList& list );
    00095
    00096   protected:
    00097     Tvoid fillMatrixAs1DHistogram( const TDataElementList& list );
    00098     Tvoid fillMatrixAs2DHistogram( const TDataElementList& list );
    00099     Tvoid fillMatrixAsGraph( const TDataElementList& list );
    00100     Tvoid fillMatrixAsNtuple( const TDataElementList& list );
    00101
    00102 };
    00103
    00104 inline const TMatrixElement& TExtractor::GetMatrixElement() const
    00105 {
    00106   return theMatrixElement;
    00107 }
    00108
    00109 inline TMatrixElement& TExtractor::GetMatrixElement()
    00110 {
    00111   return theMatrixElement;
    00112 }
    00113
    00114 inline Tvoid TExtractor::SetMatrixElement( const TMatrixElement& matrix )
    00115 {
    00116   theMatrixElement = matrix;
    00117   return;
    00118 }
    00119
    00120 inline const Tstring& TExtractor::GetExtractorID() const
    00121 {
    00122   return theExtractorID;
    00123 }
    00124
    00125 inline Tvoid TExtractor::SetExtractorID( const Tstring& id )
    00126 {
    00127   theExtractorID = id;
    00128   return;
    00129 }
    00130
    00131 inline Tbool TExtractor::DoesDataFound() const
    00132 {
    00133   return theDataFoundStatus;
    00134 }
    00135
    00136 inline Tbool TExtractor::DoesMatrixFill() const
    00137 {
    00138   return theFillMatrixStatus;
    00139 }
    00140
    00141 inline Tbool TExtractor::DoesExtractSuccess() const
    00142 {
    00143   return DoesMatrixFill() && DoesDataFound();
    00144 }
    00145
    00146 inline Tint TExtractor::GetSamplingRate() const
    00147 {
    00148   return theSamplingRate;
    00149 }
    00150
    00151 inline Tvoid TExtractor::SetSamplingRate( Tint usec )
    00152 {
    00153   theSamplingRate = usec;
    00154   return;
    00155 }
    00156
    00157 #endif