/**
 * \class BDataQualityModule
 *
 * \ingroup BeamDataMonitoring
 *
 * \brief Per-file BDP data quality histograms.
 *
 * Histogram quantities on a per-file basis that help show any
 * problems with the beam data process.
 *
 * This is slightly different from other BeamMonBaseModules in that it
 * assumes that the SpillTimeND DB table is filled for the data being
 * read in the MOM.  In the Fill() method it will do BDP->STND
 * comparisons and in the EndFile() method it will do STND->BDP
 * comparisons.
 *
 * One can add "HistMan::Put " after this module in the Job Path in
 * order to write out the histograms.  One should set "FileExtension"
 * option of that module to get per-file histograms.  O.w. one gets
 * per-job histograms.
 *
 * \author (last to touch it) $Author: bv $
 *
 * \version $Revision: 1.1 $
 *
 * \date $Date: 2005/12/01 19:10:49 $
 *
 * Contact: bv@bnl.gov
 *
 * Created on: Mon Nov 28 14:53:03 2005
 *
 * $Id: BDataQualityModule.h,v 1.1 2005/12/01 19:10:49 bv Exp $
 *
 */



#ifndef BDPFILEMONITORMODULE_H
#define BDPFILEMONITORMODULE_H


#include <JobControl/JobCModule.h>

class MomNavigator;
class RawBeamMonBlock;
class RawBeamMonHeaderBlock;
class SpillTimeND;
class BeamMonSpill;

class BDataQualityModule : public JobCModule {
public:
    BDataQualityModule();
    virtual ~BDataQualityModule();

    void BeginFile();

    JobCResult Ana(const MomNavigator *mom);

    void EndFile();

private:
    
    void FillFile(const RawBeamMonHeaderBlock& head,
                  const RawBeamMonBlock& block);
    
    double fFirstSpillTime, fLastSpillTime;
};    

#endif  // BDPFILEMONITORMODULE_H
