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

St02DataRecordConversion::St02DataRecordConversion()
  : St02Map( "" ), theConversionSuccess( Tfalse )
{;}

St02DataRecordConversion::~St02DataRecordConversion()
{;}

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