/**
 * \class BeamDataLiteHeader
 *
 * \ingroup BeamDataNtuple
 *
 * \brief Header class for the beam monitoring data lite ntuples
 *
 *
 * \author (last to touch it) $Author: minoscvs $
 *
 * \version $Revision: 1.2 $
 *
 * \date $Date: 2005/05/11 22:50:29 $
 *
 * Contact: mdier@bnl.gov
 *
 * Created on: Thu Apr 21 18:38:59 2005
 *
 * $Id: BeamDataLiteHeader.h,v 1.2 2005/05/11 22:50:29 minoscvs Exp $
 *
 */

#ifndef BEAMDATALITEHEADER_H
#define BEAMDATALITEHEADER_H

#include "Validity/VldContext.h"
#include "Validity/VldTimeStamp.h"
#include "Record/RecHeader.h"



class BeamDataLiteHeader: public RecHeader
{

public:

    // Con/de-structors:
    BeamDataLiteHeader();
    BeamDataLiteHeader(const VldContext &vld);
    virtual ~BeamDataLiteHeader();

    // State testing member functions:
    virtual std::ostream &Print(std::ostream &os) const;
    virtual void Print(Option_t *option="") const;

    /// Get the earliest timestamp
    const VldTimeStamp GetEarliestTimeStamp() const;
    /// Get the time difference between primary stream and spill
    const Double_t GetTimeDiffStreamSpill() const;
    /// See if a DB entry was found 
    const Bool_t GetFoundBD() const;
    /// Get the status bits field
    const UInt_t GetStatus() const;
    
    /// Set the earliesst timestamp
    void SetEarliestTimeStamp(VldTimeStamp ets);
    /// Set the time difference between primary stream and spill
    void SetTimeDiffStreamSpill(Double_t td);
    /// Set whether a db entry was found 
    void SetFoundBD(Bool_t fbd);
    /// Set the status bit field
    void SetStatus(UInt_t fst);
    
private:

    /// The earliest timestamp of VME devices, or DAE if no VME readout.
    VldTimeStamp fEarliestTimeStamp; 
    /// time difference between primary stream and found spill
    Double_t fTimeDiffStreamSpill;   
    /// Found matching spill?                                    
    Bool_t fFoundBD;                 
    /// bits field for status of beam mon devices, see BeamDataUtil/BeamMonSpill.h
    UInt_t fStatus;                   
    
    ClassDef(BeamDataLiteHeader, 1)
};                              // end of class BeamDataLiteHeader

inline const VldTimeStamp BeamDataLiteHeader::GetEarliestTimeStamp() const {return fEarliestTimeStamp;}
inline const Double_t BeamDataLiteHeader::GetTimeDiffStreamSpill() const {return fTimeDiffStreamSpill;}
inline const Bool_t BeamDataLiteHeader::GetFoundBD() const {return fFoundBD;}
inline const UInt_t BeamDataLiteHeader::GetStatus() const {return fStatus;}

inline void BeamDataLiteHeader::SetEarliestTimeStamp(VldTimeStamp ets) {fEarliestTimeStamp=ets;}
inline void BeamDataLiteHeader::SetTimeDiffStreamSpill(Double_t td) {fTimeDiffStreamSpill=td;}
inline void BeamDataLiteHeader::SetFoundBD(Bool_t fbd) {fFoundBD=fbd;}
inline void BeamDataLiteHeader::SetStatus(UInt_t fst) {fStatus=fst;}

#endif  // BEAMDATALITEHEADER_H
