NtpBDFullModule Class Reference

#include <NtpBDFullModule.h>

Inheritance diagram for NtpBDFullModule:
JobCModule

List of all members.

Public Member Functions

 NtpBDFullModule ()
 ~NtpBDFullModule ()
void BeginJob ()
void BeginFile ()
void EndJob ()
JobCResult Reco (MomNavigator *mom)

Private Member Functions

void FillToroids (NtpBDFullRecord &ntpbdr_r, const RawBeamMonHeaderBlock &rbmhb, const RawBeamMonBlock &rbmb)

Detailed Description

Definition at line 12 of file NtpBDFullModule.h.


Constructor & Destructor Documentation

NtpBDFullModule::NtpBDFullModule (  ) 

Definition at line 29 of file NtpBDFullModule.cxx.

00030 {}

NtpBDFullModule::~NtpBDFullModule (  ) 

Definition at line 34 of file NtpBDFullModule.cxx.

00035 {}


Member Function Documentation

void NtpBDFullModule::BeginFile (  )  [virtual]

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

Reimplemented from JobCModule.

Definition at line 49 of file NtpBDFullModule.cxx.

References Msg::kDebug, and MSG.

00050 {
00051 //======================================================================
00052 // Get the "run" and "subrun" number from the filename
00053 //======================================================================
00054     MSG("NtpBDFull",Msg::kDebug)<<"In NtpBDFull::BeginFile"<<endl;
00055 }

void NtpBDFullModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 39 of file NtpBDFullModule.cxx.

References Msg::kDebug, and MSG.

00040 {
00041 //======================================================================
00042 // 
00043 //======================================================================
00044     MSG("NtpBDFull",Msg::kDebug)<<"In NtpBDFull::BeginJob"<<endl;
00045 }

void NtpBDFullModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 59 of file NtpBDFullModule.cxx.

References Msg::kDebug, and MSG.

00060 {
00061 //======================================================================
00062 // Print out some summary at the end of the job
00063 //======================================================================
00064     MSG("NtpBDFull",Msg::kDebug)<<"In NtpBDFull::EndJob"<<endl;
00065 }

void NtpBDFullModule::FillToroids ( NtpBDFullRecord ntpbdr_r,
const RawBeamMonHeaderBlock rbmhb,
const RawBeamMonBlock rbmb 
) [private]

Definition at line 114 of file NtpBDFullModule.cxx.

References BDScalar::GetValue(), Msg::kDebug, MSG, NtpBDFullRecord::protonIntensity, and BDScalar::SetSpill().

Referenced by Reco().

00117 {
00118     BDScalar bdpi1(5,10,"E:TRTGTD");
00119     bdpi1.SetSpill(rbmhb, rbmb);
00120     ntpbdr_r.protonIntensity = bdpi1.GetValue();
00121     MSG("NtpBDFull",Msg::kDebug) << "In NtpBDFullModule::FillToroids: PoT = "
00122                                  << ntpbdr_r.protonIntensity << endl;
00123 }

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

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 70 of file NtpBDFullModule.cxx.

References MomNavigator::AdoptFragment(), FillToroids(), RawBeamMonHeaderBlock::GetVldContext(), Msg::kDebug, JobCResult::kFailed, JobCResult::kPassed, Msg::kWarning, and MSG.

00071 {
00072 //======================================================================
00073 // Read in the raw beam monitoring data files and fill the ntuples
00074 //======================================================================
00075     MSG("NtpBDFull",Msg::kDebug)<<"In NtpBDFull::Reco"<<endl;
00076 
00077     JobCResult result(JobCResult::kPassed); // kNoDecision, kFailed, etc.
00078 
00079     vector<const RawBeamMonBlock*> rbmbs = DataUtil::GetRawBlocks<RawBeamMonBlock>(mom);
00080     vector<const RawBeamMonHeaderBlock*> rbmhbs = DataUtil::GetRawBlocks<RawBeamMonHeaderBlock>(mom);
00081 
00082     if (rbmhbs.size() != 1 && rbmbs.size() != 1) {
00083         MSG("BDFull",Msg::kWarning)
00084             << "No beam monitoring data in mom\n";
00085         return JobCResult::kFailed;
00086     }
00087     
00088     const RawBeamMonHeaderBlock& rbmhb = *rbmhbs[0];
00089     const RawBeamMonBlock& rbmb = *rbmbs[0];
00090 
00091     VldContext vc = rbmhb.GetVldContext();
00092     
00093     // make a header
00094     BeamDataLiteHeader bdh(vc);
00095 
00096     // TODO: fill the other members of the BeamDataLiteHeader
00097     
00098     NtpBDFullRecord* ntpbdr = new NtpBDFullRecord(bdh);
00099 
00100     NtpBDFullRecord& ntpbdr_r = *(ntpbdr);
00101     
00102     this->FillToroids(ntpbdr_r,rbmhb, rbmb);
00103         
00104     //give the ntpbdr object to mom, she'll write it to the file
00105     mom->AdoptFragment(ntpbdr);
00106 
00107     return result;
00108 
00109 }


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1