BDTestDataModule Class Reference

Generate the bdtest tree used for npot plot. More...

#include <BDTestDataModule.h>

Inheritance diagram for BDTestDataModule:
JobCModule

List of all members.

Public Member Functions

 BDTestDataModule ()
virtual ~BDTestDataModule ()
void BeginFile ()
void EndFile ()
JobCResult Reco (MomNavigator *mom)

Private Attributes

BDTestDataModuleImpfImp

Detailed Description

Generate the bdtest tree used for npot plot.

Author:
(last to touch it)
Author
bv
Version:
Revision
1.1
Date:
Date
2005/12/15 22:06:32

Contact: bv@bnl.gov

Created on: Mon Dec 12 10:42:57 2005

Id
BDTestDataModule.h,v 1.1 2005/12/15 22:06:32 bv Exp

Definition at line 33 of file BDTestDataModule.h.


Constructor & Destructor Documentation

BDTestDataModule::BDTestDataModule (  ) 

Definition at line 65 of file BDTestDataModule.cxx.

References fImp.

00066 {
00067     fImp = 0;
00068 }

BDTestDataModule::~BDTestDataModule (  )  [virtual]

Definition at line 69 of file BDTestDataModule.cxx.

References fImp.

00070 {
00071     if (fImp) delete fImp;
00072 }


Member Function Documentation

void BDTestDataModule::BeginFile (  )  [virtual]

Implement for notification of begin of file. See GetCurrentFile().

Reimplemented from JobCModule.

Definition at line 74 of file BDTestDataModule.cxx.

References fImp, JobCModule::GetCurrentFile(), and gSystem().

00075 {
00076     if (fImp) {
00077         cerr << "BDTestDataModule::BeginFile: deleting non-zero fImp\n";
00078         delete fImp; fImp = 0;
00079     }
00080 
00081     const char* output_dir = gSystem->Getenv("BEAM_DATA_TESTDATA_DIR");
00082     if (!output_dir || output_dir[0] == '\0') output_dir = ".";
00083     TString file = output_dir;
00084     file += "/";
00085 
00086     const char* input_file = this->GetCurrentFile();
00087     const char* base_name = gSystem->BaseName(input_file);
00088 
00089     file += base_name;
00090     file.Remove(file.Index(".mbeam.root"));
00091     file += ".bdtd.root";
00092     fImp = new BDTestDataModuleImp(file.Data());
00093 }

void BDTestDataModule::EndFile (  )  [virtual]

Implement for notification of end of file. See GetLastFile().

Reimplemented from JobCModule.

Definition at line 95 of file BDTestDataModule.cxx.

References fImp.

00096 {
00097     cerr << "BDTestDataModule::EndFile with fImp at " << (void*)fImp << endl;
00098     if (fImp) delete fImp;
00099     fImp = 0;
00100 }

JobCResult BDTestDataModule::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 102 of file BDTestDataModule.cxx.

References BDTestDataModuleImp::Fill(), fImp, BDUniquify::GetUniqueBlocks(), JobCResult::kAOK, JobCResult::kError, JobCResult::kFailed, Msg::kWarning, and MSG.

00103 {
00104     if (!fImp) {
00105         cerr << "Error: BDTestDataModule::Reco called w/out an implementation\n";
00106         return JobCResult::kError;
00107     }
00108 
00109     static BDUniquify uniqifier;
00110     vector<BDUniquify::BlockPair> blocks = uniqifier.GetUniqueBlocks(*mom);
00111     size_t nblocks = blocks.size();
00112 
00113     if (nblocks == 0) {
00114         MSG("BD",Msg::kWarning)
00115             << "No good beam monitoring data in MOM\n";
00116         return JobCResult::kFailed;
00117     }
00118     for (size_t iblock=0; iblock<nblocks; ++iblock) {
00119         const RawBeamMonHeaderBlock& rbmhb = *blocks[iblock].first;
00120         const RawBeamMonBlock& rbmb = *blocks[iblock].second;
00121 
00122         fImp->Fill(rbmb,rbmhb);
00123     }
00124     return JobCResult::kAOK;
00125 
00126 }


Member Data Documentation

Definition at line 35 of file BDTestDataModule.h.

Referenced by BDTestDataModule(), BeginFile(), EndFile(), Reco(), and ~BDTestDataModule().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1