Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

PlotAllPedsImp Struct Reference

List of all members.

Public Member Functions

 PlotAllPedsImp ()
bool Update ()

Public Attributes

TCanvas canvas
TH1F * swicpeds [15]
map< string, TH1F * > hists
DbiResultPtr< BeamMonSwicPedsdrp

Constructor & Destructor Documentation

PlotAllPedsImp::PlotAllPedsImp  )  [inline]
 

Definition at line 40 of file PlotAllPeds.cxx.

References Form(), and BDDevices::SwicDevices().

00040                      : canvas("canvas","All Peds",1000,600) 
00041     {
00042         canvas.Divide(5,3);
00043         vector<string> swicnames = BDDevices::SwicDevices();
00044         size_t siz = swicnames.size();
00045         for (size_t ind=0;ind<siz;++ind) {
00046             canvas.cd(ind+1);
00047             string name = Form("peds%02d",ind);
00048             string title = Form("Peds for %s",swicnames[ind].c_str());
00049             swicpeds[ind] = new TH1F(name.c_str(),title.c_str(),96,0,96);
00050             hists[swicnames[ind]] = swicpeds[ind];
00051             swicpeds[ind]->Draw();
00052             cerr << ind << ": " << name << ", " << title << endl;
00053         }
00054         swicpeds[14] = 0;
00055     }


Member Function Documentation

bool PlotAllPedsImp::Update  ) 
 

Definition at line 61 of file PlotAllPeds.cxx.

References canvas, drp, BeamMonSwicPeds::GetDeviceName(), BeamMonSwicPeds::GetMeans(), BeamMonSwicPeds::GetNsamples(), DbiResultPtr< T >::GetNumRows(), DbiResultPtr< T >::GetRow(), BeamMonSwicPeds::GetSigmas(), hists, and swicpeds.

Referenced by PlotAllPeds::Next(), PlotAllPeds::Prev(), and PlotAllPeds::Start().

00062 {
00063     for (int ind=0; ind<14; ++ind)
00064         swicpeds[ind]->Reset("ICE");
00065     int nrows = drp.GetNumRows();
00066     for (int ind=0; ind<nrows; ++ind) {
00067         const BeamMonSwicPeds* peds = drp.GetRow(ind);
00068         string name = peds->GetDeviceName();
00069         TH1F* h = hists[name];
00070         if (!h) {
00071             cerr << "Unknown SWIC: " << name << endl;
00072             continue;
00073         }
00074         int cut = 0;
00075         vector<float> means = peds->GetMeans();
00076         vector<float> sigmas = peds->GetSigmas();
00077 
00078         for (int ch=0; ch<96; ++ch) {
00079             h->SetBinContent(ch+1,means[ch]);
00080             h->SetBinError(ch+1,sigmas[ch]);
00081         }
00082         cerr << name << ": cut " << cut << " channels of "
00083              << peds->GetNsamples() << " samples\n";
00084 
00085         canvas.cd(ind+1);
00086         gPad->Modified();
00087     }
00088     canvas.cd();
00089     canvas.Modified();
00090     canvas.Update();
00091     return true;
00092 }


Member Data Documentation

TCanvas PlotAllPedsImp::canvas
 

Definition at line 35 of file PlotAllPeds.cxx.

Referenced by Update().

DbiResultPtr<BeamMonSwicPeds> PlotAllPedsImp::drp
 

Definition at line 38 of file PlotAllPeds.cxx.

Referenced by PlotAllPeds::Next(), PlotAllPeds::Prev(), PlotAllPeds::Start(), and Update().

map<string,TH1F*> PlotAllPedsImp::hists
 

Definition at line 37 of file PlotAllPeds.cxx.

Referenced by Update().

TH1F* PlotAllPedsImp::swicpeds[15]
 

Definition at line 36 of file PlotAllPeds.cxx.

Referenced by Update().


The documentation for this struct was generated from the following file:
Generated on Mon Feb 15 11:10:04 2010 for loon by  doxygen 1.3.9.1