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

St01DataRecordConversion::St01DataRecordConversion()
  : St01Map( "" ), theConversionSuccess( Tfalse )
{;}

St01DataRecordConversion::~St01DataRecordConversion()
{;}

TDataMultiplicity& St01DataRecordConversion::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;
}
