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