BMFileSummaryFiller Class Reference
[BeamDataDbi]

Fills BeamMonFileSummary table row objects. More...

#include <BMFileSummaryFiller.h>

Inheritance diagram for BMFileSummaryFiller:
BeamMonFiller

List of all members.

Public Member Functions

 BMFileSummaryFiller (const BDScalar &pi)
void SetTclkTrigger (int event, int delay)
void Timestamp (const VldTimeStamp &vts)
void NewFile (const char *filename)
 Called each time a new file is encountered.
void Commit ()

Private Attributes

const BDScalarfPI
BeamMonFileSummaryfFileSummary

Detailed Description

Fills BeamMonFileSummary table row objects.

Author:
(last to touch it)
Author
minoscvs
Version:
Revision
1.4
Date:
Date
2005/04/27 17:36:30

Contact: bv@bnl.gov

Created on: Wed Apr 13 18:15:03 2005

Id
BMFileSummaryFiller.h,v 1.4 2005/04/27 17:36:30 minoscvs Exp

Definition at line 34 of file BMFileSummaryFiller.h.


Constructor & Destructor Documentation

BMFileSummaryFiller::BMFileSummaryFiller ( const BDScalar pi  ) 

Definition at line 25 of file BMFileSummaryFiller.cxx.

00026     : fPI(pi)
00027     , fFileSummary(0)
00028 {
00029 }


Member Function Documentation

void BMFileSummaryFiller::Commit (  ) 

Definition at line 79 of file BMFileSummaryFiller.cxx.

References DbiWriter< T >::Close(), fFileSummary, BeamMonFileSummary::fFirstSpillTime, BeamMonFileSummary::fLastSpillTime, SimFlag::kData, Msg::kDebug, Detector::kFar, Detector::kNear, and MSG.

Referenced by BeamMonDbuModule::EndFile().

00080 {
00081     if (!fFileSummary) {
00082         MSG("BD",Msg::kDebug)
00083             << "Missing BeamMonFileSummary pointer in EndFile.  "
00084             << "Empty file?!\n";
00085         return;
00086     }
00087 
00088     // Write file summary row to DB table
00089     VldRange range(Detector::kNear|Detector::kFar,SimFlag::kData,
00090                    fFileSummary->fFirstSpillTime,fFileSummary->fLastSpillTime
00091                    ,"Beam");
00092     VldTimeStamp now;
00093     DbiWriter<BeamMonFileSummary> writer(range,-1,0,now);
00094     writer << (*fFileSummary) ;
00095     writer.Close();
00096 
00097     delete fFileSummary;
00098     fFileSummary = 0;
00099 }

void BMFileSummaryFiller::NewFile ( const char *   ) 

Called each time a new file is encountered.

Reimplemented from BeamMonFiller.

Definition at line 56 of file BMFileSummaryFiller.cxx.

References BeamMonFileSummary::fFileName, fFileSummary, find_tfile(), Msg::kError, MSG, and BeamMonFileSummary::SetFileInfo().

Referenced by BeamMonDbuModule::BeginFile().

00057 {
00058     // In case Commit fails.  Paranoid....
00059     if (fFileSummary) {
00060         MSG("BD",Msg::kError)
00061             << "Still have a live BeamMonFileSummary for file \""
00062             << fFileSummary->fFileName
00063             << "\"\n";
00064         delete fFileSummary;
00065         fFileSummary = 0;
00066     }
00067 
00068     TFile* tfile = find_tfile(filename);
00069     if (!tfile) {
00070         MSG("BD",Msg::kError)
00071             << "Major badness.  Could not find TFile corresponding to "
00072             << filename << endl;
00073         return;
00074     }
00075     fFileSummary = new BeamMonFileSummary;
00076     fFileSummary->SetFileInfo(*tfile);
00077 }

void BMFileSummaryFiller::SetTclkTrigger ( int  event,
int  delay 
)

Definition at line 31 of file BMFileSummaryFiller.cxx.

References fFileSummary, and BeamMonFileSummary::SetTclkTrigger().

Referenced by BeamMonDbuModule::Process().

00032 {
00033     if (fFileSummary) fFileSummary->SetTclkTrigger(event,delay);
00034 }

void BMFileSummaryFiller::Timestamp ( const VldTimeStamp vts  ) 

Definition at line 36 of file BMFileSummaryFiller.cxx.

References BeamMonFileSummary::AddSpill(), fFileSummary, fPI, and BDScalar::GetValue().

Referenced by BeamMonDbuModule::Process().

00037 {
00038     double pot = fPI.GetValue();
00039     fFileSummary->AddSpill(vts,pot);
00040 }


Member Data Documentation

Definition at line 53 of file BMFileSummaryFiller.h.

Referenced by Commit(), NewFile(), SetTclkTrigger(), and Timestamp().

Definition at line 51 of file BMFileSummaryFiller.h.

Referenced by Timestamp().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1