NpotModule Class Reference

#include <NpotModule.h>

Inheritance diagram for NpotModule:
BeamMonBaseModule JobCModule

List of all members.

Public Member Functions

 NpotModule ()
virtual ~NpotModule ()
void BeginJob ()

Private Member Functions

void Fill (const RawBeamMonHeaderBlock &head, const RawBeamMonBlock &block)

Private Attributes

StripHistfStripHist

Detailed Description

Definition at line 15 of file NpotModule.h.


Constructor & Destructor Documentation

NpotModule::NpotModule (  ) 

Definition at line 30 of file NpotModule.cxx.

References Munits::day, fStripHist, and StripHist::SetStripRange().

00031 {
00032 
00033   fStripHist = new StripHist("Protons Delivered Per Spill",
00034                              "Number of Protons Delivered to NuMI per Spill",
00035                                250,0,25);
00036     fStripHist->SetStripRange(1*Munits::day);
00037 }

NpotModule::~NpotModule (  )  [virtual]

Definition at line 39 of file NpotModule.cxx.

00040 {
00041 }


Member Function Documentation

void NpotModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 44 of file NpotModule.cxx.

References HistMan::Adopt(), StripHist::Draw(), fStripHist, StripHist::GetHist(), and BeamMonBaseModule::GetHistMan().

00045 {
00046     TCanvas* canvas = new TCanvas("Protons Delivered Per Spill",
00047                                   "Number of Protons Delivered to NuMI",
00048                                   500,400);
00049 
00050     TH1D& hist = fStripHist->GetHist();
00051     hist.SetXTitle("Protons Delivered per Spill (1E12)");
00052 
00053     canvas->cd();
00054     fStripHist->Draw("AB");
00055 
00056     HistMan hm = this->GetHistMan();
00057     hm.Adopt("Protons",canvas);
00058 }

void NpotModule::Fill ( const RawBeamMonHeaderBlock header,
const RawBeamMonBlock block 
) [private, virtual]

Subclass implements to visit each RawBeamMonBlock to fill histograms. Booking should be done in BeginJob().

Implements BeamMonBaseModule.

Definition at line 61 of file NpotModule.cxx.

References StripHist::Fill(), Form(), fStripHist, RawBeamData::GetData(), RawBeamData::GetDataLength(), RawBeamData::GetMsecs(), RawBeamData::GetSeconds(), Msg::kDebug, Msg::kWarning, and MSG.

00062 {
00063     const RawBeamData* tortgt = block["E:TORTGT"];
00064     if (!tortgt) {
00065         MSG("BD",Msg::kWarning)
00066             << "No TORTGT in the data\n";
00067         return;
00068     }
00069     if (! tortgt->GetDataLength()) {
00070         MSG("BD",Msg::kWarning)
00071             << "TORTGT exists but w/out data\n";
00072         return;
00073     }
00074 
00075     double npot = tortgt->GetData()[0];
00076     double dae = 1.0*tortgt->GetSeconds() + tortgt->GetMsecs()*0.001;
00077     MSG("BD",Msg::kDebug)
00078         << "npot = " << npot << ", dae = " << Form("%12e",dae) << endl;
00079     
00080     fStripHist->Fill(dae,npot);
00081 }


Member Data Documentation

Definition at line 16 of file NpotModule.h.

Referenced by BeginJob(), Fill(), and NpotModule().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1