TempModule Class Reference

#include <TempModule.h>

Inheritance diagram for TempModule:
BeamMonBaseModule JobCModule

List of all members.

Public Member Functions

 TempModule ()
virtual ~TempModule ()
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 22 of file TempModule.h.


Constructor & Destructor Documentation

TempModule::TempModule (  ) 

Definition at line 42 of file TempModule.cxx.

References Munits::day, fStripHist, Msg::kVerbose, MSG, StripHist::SetStripRange(), and temp_desc.

00043 {
00044 
00045     for (int ind=0; temp_desc[ind][0]; ++ind) {
00046         StripHist* sh = new StripHist(temp_desc[ind][0],
00047                                       temp_desc[ind][1],
00048                                       100,0,100);
00049         fStripHist[temp_desc[ind][0]] = sh;
00050         sh->SetStripRange(1*Munits::day);
00051         MSG("BD",Msg::kVerbose)
00052             << "Creating:" << temp_desc[ind][1] << endl;
00053     }
00054 }

TempModule::~TempModule (  )  [virtual]

Definition at line 56 of file TempModule.cxx.

00057 {
00058 }


Member Function Documentation

void TempModule::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 60 of file TempModule.cxx.

References HistMan::Adopt(), StripHist::Draw(), fStripHist, StripHist::GetHist(), BeamMonBaseModule::GetHistMan(), Msg::kVerbose, MSG, and temp_desc.

00061 {
00062     HistMan hm = this->GetHistMan();
00063 
00064     for (int ind=0; temp_desc[ind][0]; ++ind) {
00065         const char* name = temp_desc[ind][0];
00066         const char* title = temp_desc[ind][1];
00067 
00068         TCanvas* canvas = new TCanvas(name,title,500,400);
00069 
00070         StripHist* sh = fStripHist[name];
00071         assert(sh);
00072 
00073         TH1D& hist = sh->GetHist();
00074         hist.SetXTitle("Temperature (degree C)");
00075 
00076         canvas->cd();
00077         sh->Draw("AL");
00078 
00079         hm.Adopt("Temperatures",canvas);
00080         MSG("BD",Msg::kVerbose)
00081             << "Adopting " << canvas->GetName() << endl;
00082     }
00083 }

void TempModule::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 86 of file TempModule.cxx.

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

00087 {
00088     
00089     for (int ind=0; temp_desc[ind][0]; ++ind) {
00090         const char* name = temp_desc[ind][0];
00091         const char* dev = temp_desc[ind][2];
00092 
00093         const RawBeamData* rbd = block[dev];
00094         if (!rbd) {
00095             MSG("BD",Msg::kWarning)
00096                 << "No " << dev << " in the data\n";
00097             continue;
00098         }
00099         if (! rbd->GetDataLength()) {
00100             MSG("BD",Msg::kWarning)
00101                 << dev << " exists but w/out data\n";
00102             continue;
00103         }
00104         
00105         double val = rbd->GetData()[0];
00106         double dae = 1.0*rbd->GetSeconds() + rbd->GetMsecs()*0.001;
00107         StripHist* sh = fStripHist[name];
00108         assert(sh);
00109         sh->Fill(dae,val);
00110         MSG("BD",Msg::kVerbose)
00111             << "Filled " << name << endl;
00112     }
00113 }


Member Data Documentation

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

Definition at line 23 of file TempModule.h.

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


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1