// =====================================================================
//  $Id: St00DataRecordConversion.cc,v 1.3 2003/10/06 16:28:17 goiwai Exp $
//  $Name: CLDAQ-1-14-03 $
//  $Log: St00DataRecordConversion.cc,v $
//  Revision 1.3  2003/10/06 16:28:17  goiwai
//  *** empty log message ***
//
//  Revision 1.2  2003/07/30 16:15:51  goiwai
//  ファイルにコミットログをつけることにしました.
//
// =====================================================================
#include "St00DataRecordConversion.hh"
#include "TDataRecord.hh"
#include "TDataElement.hh"

St00DataRecordConversion::St00DataRecordConversion()
  : St00Map( "" ), theConversionSuccess( Tfalse )
{;}

St00DataRecordConversion::~St00DataRecordConversion()
{;}

TDataMultiplicity& St00DataRecordConversion::Convert( const TDataRecord& record )
{
  Tstring fadcidset[ 3 ] = { "EVENT", "ADC", "0" };
  TDataElement e;
  if ( record.FindDataElement( fadcidset, e ) ) {
    Tshort* data = e.GetShortData();
    Tint ndata = e.GetNumberOfPrimitives();
    FillMap( data, ndata );
    theConversionSuccess = Ttrue;
  } else {
    theConversionSuccess = Tfalse;
  }

  return theMap;
}
