TestCalibModule Class Reference

#include <TestCalibModule.h>

Inheritance diagram for TestCalibModule:
JobCModule

List of all members.

Public Member Functions

 TestCalibModule ()
virtual ~TestCalibModule ()
JobCResult Ana (const MomNavigator *mom)
void BeginJob ()
void EndJob ()

Private Attributes

BDHadMuMonfHadMu [4]

Detailed Description

Definition at line 7 of file TestCalibModule.h.


Constructor & Destructor Documentation

TestCalibModule::TestCalibModule (  ) 

Definition at line 27 of file TestCalibModule.cxx.

References fHadMu.

00028 {
00029     for (int ind=0; ind<4; ++ind) {
00030         fHadMu[ind] = new BDHadMuMon;
00031     }
00032 }

TestCalibModule::~TestCalibModule (  )  [virtual]

Definition at line 33 of file TestCalibModule.cxx.

00034 {
00035 }


Member Function Documentation

JobCResult TestCalibModule::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 63 of file TestCalibModule.cxx.

References dump_hadmus(), fHadMu, JobCModule::Get(), BDDevices::HadMuMonitors(), JobCResult::kAOK, Msg::kDebug, JobCResult::kFailed, Msg::kWarning, MSG, and BDHadMuMon::SetData().

00064 {
00065     vector<const RawBeamMonBlock*> rbmbs = GetRawBlocks<RawBeamMonBlock>(mom);
00066     vector<const RawBeamMonHeaderBlock*> rbmhbs = GetRawBlocks<RawBeamMonHeaderBlock>(mom);
00067 
00068     if (rbmhbs.size() != 1 && rbmbs.size() != 1) {
00069         MSG("BD",Msg::kWarning)
00070             << "No beam monitoring data in mom\n";
00071         return JobCResult::kFailed;
00072     }
00073 
00074     const RawBeamMonHeaderBlock& rbmhb = *rbmhbs[0];
00075     const RawBeamMonBlock& rbmb = *rbmbs[0];
00076 
00077     vector<string> hadmu_name = BDDevices::HadMuMonitors();
00078     for (int ind=0; ind<4; ++ind) {
00079         const RawBeamData* d = rbmb[hadmu_name[ind].c_str()];
00080         if (!d) {
00081             MSG("BD",Msg::kDebug)
00082                 << "No device data for " << hadmu_name[ind] << ", skipping\n";
00083             continue;
00084         }
00085         fHadMu[ind]->SetData(*d);
00086     }
00087     cerr << "Before calibration\n";
00088     dump_hadmus(fHadMu);
00089 
00090     BDSwicCalibrator::Get().Calibrate(rbmhb,rbmb);
00091 
00092     cerr << "After calibration\n";
00093     dump_hadmus(fHadMu);
00094 
00095     cerr << endl;
00096 
00097     return JobCResult::kAOK;
00098 }

void TestCalibModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 99 of file TestCalibModule.cxx.

00100 {
00101 }

void TestCalibModule::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 102 of file TestCalibModule.cxx.

00103 {
00104 }


Member Data Documentation

Definition at line 15 of file TestCalibModule.h.

Referenced by Ana(), and TestCalibModule().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1