00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __TEXTRACTOR_HH
00011 #define __TEXTRACTOR_HH
00012
00013 #include "Tglobals.h"
00014 #include "TMatrixElement.hh"
00015 #include "TDataElementList.hh"
00016
00017 class TDataRecord;
00018 class TDataSection;
00019 class TDataSegment;
00020 class TDataElement;
00021
00022 class TExtractor
00023 {
00024
00025 protected:
00026 Tstring theExtractorID;
00027 TMatrixElement theMatrixElement;
00028 Tint theSamplingRate;
00029 Tbool theDataFoundStatus;
00030 Tbool theFillMatrixStatus;
00031
00032 public:
00033 TExtractor( const Tstring& id, Tobject_t objecttype, Tint nevents = 0, Tint usec = 0 );
00034 virtual ~TExtractor();
00035
00036 public:
00037 virtual Tvoid Extract() = 0;
00038
00039 public:
00040 TDataSection FindDataSection( const TDataRecord& record, const Tstring& sectionid );
00041 TDataSegment FindDataSegment( const TDataSection& section, const Tstring& segmentid );
00042 TDataSegment FindDataSegment( const TDataRecord& record, const Tstring& sectionid, const Tstring& segmentid );
00043 TDataSegment FindDataSegment( const TDataRecord& record, Tstring id[ 2 ] );
00044 TDataElement FindDataElement( const TDataSegment& segment, const Tstring& elementid );
00045 TDataElement FindDataElement( const TDataRecord& record, const Tstring& sectionid, const Tstring& segmentid, const Tstring& elementid );
00046 TDataElement FindDataElement( const TDataRecord& record, Tstring id[ 3 ] );
00047 TDataElement FindDataElement( const TDataRecord& record, const TstringList& id );
00048
00049 public:
00050 const TMatrixElement& GetMatrixElement() const;
00051 TMatrixElement& GetMatrixElement();
00052 Tvoid SetMatrixElement( const TMatrixElement& matrix );
00053 const Tstring& GetExtractorID() const;
00054 Tvoid SetExtractorID( const Tstring& id );
00055 Tint GetSamplingRate() const;
00056 Tvoid SetSamplingRate( Tint usec );
00057 Tbool DoesDataFound() const;
00058 Tbool DoesMatrixFill() const;
00059 Tbool DoesExtractSuccess() const;
00060
00061 public:
00062 Tvoid FillMatrix( const TDataElementList& list );
00063
00064 protected:
00065 Tvoid fillMatrixAs1DHistogram( const TDataElementList& list );
00066 Tvoid fillMatrixAs2DHistogram( const TDataElementList& list );
00067 Tvoid fillMatrixAsGraph( const TDataElementList& list );
00068 Tvoid fillMatrixAsNtuple( const TDataElementList& list );
00069
00070 };
00071
00072 inline const TMatrixElement& TExtractor::GetMatrixElement() const
00073 {
00074 return( theMatrixElement );
00075 }
00076
00077 inline TMatrixElement& TExtractor::GetMatrixElement()
00078 {
00079 return( theMatrixElement );
00080 }
00081
00082 inline Tvoid TExtractor::SetMatrixElement( const TMatrixElement& matrix )
00083 {
00084 theMatrixElement = matrix;
00085 return;
00086 }
00087
00088 inline const Tstring& TExtractor::GetExtractorID() const
00089 {
00090 return( theExtractorID );
00091 }
00092
00093 inline Tvoid TExtractor::SetExtractorID( const Tstring& id )
00094 {
00095 theExtractorID = id;
00096 return;
00097 }
00098
00099 inline Tbool TExtractor::DoesDataFound() const
00100 {
00101 return( theDataFoundStatus );
00102 }
00103
00104 inline Tbool TExtractor::DoesMatrixFill() const
00105 {
00106 return( theFillMatrixStatus );
00107 }
00108
00109 inline Tbool TExtractor::DoesExtractSuccess() const
00110 {
00111 return( DoesMatrixFill() && DoesDataFound() );
00112 }
00113
00114 inline Tint TExtractor::GetSamplingRate() const
00115 {
00116 return( theSamplingRate );
00117 }
00118
00119 inline Tvoid TExtractor::SetSamplingRate( Tint usec )
00120 {
00121 theSamplingRate = usec;
00122 return;
00123 }
00124
00125 #endif