HornModule Class Reference

#include <HornModule.h>

Inheritance diagram for HornModule:
BeamMonBaseModule JobCModule

List of all members.

Public Member Functions

 HornModule ()
virtual ~HornModule ()
virtual void BeginJob ()

Private Member Functions

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

Private Attributes

std::map< std::string,
StripHist * > 
fStripHist

Detailed Description

Definition at line 19 of file HornModule.h.


Constructor & Destructor Documentation

HornModule::HornModule (  ) 

Definition at line 44 of file HornModule.cxx.

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

00045 {
00046 
00047     for (int ind=0; ind <5; ++ind) {
00048 
00049         StripHist* sh = 0;
00050 
00051         int max = 50;
00052         if (!ind) max = 200;
00053         sh = new StripHist(get_name(ind), get_name(ind), 2*max,-1.0*max,1.0*max);
00054         fStripHist[get_name(ind)] = sh;
00055         sh->SetStripRange(1*Munits::day);
00056         sh->GetHist().SetXTitle("Current (kAmp)");
00057         //sh->GetStrip().GetHistogram()->SetYTitle("Current (kAmp)");
00058     }
00059 }

HornModule::~HornModule (  )  [virtual]

Definition at line 60 of file HornModule.cxx.

00061 {
00062 }


Member Function Documentation

void HornModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 65 of file HornModule.cxx.

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

00066 {
00067     HistMan hm = this->GetHistMan();
00068     StripHistMap::iterator mit, done=fStripHist.end();
00069     for (mit=fStripHist.begin(); mit != done; ++mit) {
00070         StripHist* sh = mit->second;
00071         TCanvas* canvas = new TCanvas(mit->first.c_str(),sh->GetHist().GetTitle(),500,400);
00072         sh->Draw("AL");
00073         hm.Adopt("Horn",canvas);
00074     }
00075 }

void HornModule::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 77 of file HornModule.cxx.

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

00078 {
00079     char dev[16] = "E:NSLIN ";
00080     double dae = 0, total = 0;
00081     for (int ind=4; ind>0; --ind) {
00082         dev[7] = 'A' + ind -1;  // Assume ASCII
00083         const RawBeamData* hc = block[dev];
00084 
00085         if (!(hc && hc->GetDataLength())) {
00086             MSG("BD",Msg::kDebug)
00087                 << "No " << dev << " in the data\n";
00088             continue;
00089         }
00090 
00091         StripHist* sh = fStripHist[get_name(ind)];
00092 
00093         double val = hc->GetData()[0];
00094         dae = hc->GetSeconds() + 1.0e-6*hc->GetMsecs();
00095         sh->Fill(dae,val);
00096         total += val;
00097     }
00098     fStripHist[get_name(0)]->Fill(dae,total);
00099 }


Member Data Documentation

std::map<std::string,StripHist*> HornModule::fStripHist [private]

Definition at line 20 of file HornModule.h.

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


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1