Npot Class Reference

#include <Npot.h>

Inheritance diagram for Npot:
Plotter

List of all members.

Public Member Functions

 Npot ()
 ~Npot ()
void Book (PlotterManager &pm)
 Implement this to book histograms or o.w. one time setup.
bool Fill (PlotterManager &pm)

Private Attributes

int fNpotNeg
float fNpotNegSum

Detailed Description

Definition at line 7 of file Npot.h.


Constructor & Destructor Documentation

Npot::Npot (  ) 

Definition at line 14 of file Npot.cxx.

00015     :fNpotNeg(0), fNpotNegSum(0.0)
00016 {
00017 }

Npot::~Npot (  ) 

Definition at line 19 of file Npot.cxx.

References fNpotNeg, and fNpotNegSum.

00020 {
00021     if (fNpotNeg)
00022         cerr << fNpotNeg << " negative toroids, average = " << fNpotNegSum/fNpotNeg << endl;
00023 }


Member Function Documentation

void Npot::Book ( PlotterManager  )  [virtual]

Implement this to book histograms or o.w. one time setup.

Reimplemented from Plotter.

Definition at line 25 of file Npot.cxx.

References HistMan::Adopt().

00026 {
00027     HistMan hm("npot");
00028 
00029     TGraph* inst = new TGraph;
00030     inst->SetName("instantaneous");
00031     hm.Adopt("",inst);
00032 
00033     TGraph* accum = new TGraph;
00034     accum->SetName("accumulated");
00035     hm.Adopt("",accum);
00036 }

bool Npot::Fill ( PlotterManager  )  [virtual]

Implement this to get notified each time a new event is read in. Return true to stop analyzing this event.

Reimplemented from Plotter.

Definition at line 38 of file Npot.cxx.

References AcnetDevice::data, AcnetDevice::event, fNpotNeg, fNpotNegSum, HistMan::Get(), Knot::GetDevice(), PlotterManager::GetKnot(), AcnetDevice::ndata, and AcnetDevice::timestamp.

00039 {
00040     const AcnetDevice* tortgt = pm.GetKnot().GetDevice("E:TORTGT");
00041     if (!tortgt->ndata) return false;
00042     if (tortgt->event != 0xA9) return false;
00043 
00044     double npot = tortgt->data[0];
00045     if (npot < 0) {
00046         if (npot < -0.1)
00047             cerr << "Npot: Forcing non-negative PoT (" << npot << ")\n";
00048         ++fNpotNeg;
00049         fNpotNegSum += npot;
00050         if (fNpotNeg % 100 == 1) 
00051             cerr << fNpotNeg << " negative tortgt's, avg = " << fNpotNegSum/fNpotNeg << endl;
00052         npot = 0;
00053     }
00054 
00055     HistMan hm("npot");
00056     TGraph* inst = hm.Get<TGraph>("instantaneous");
00057     TGraph* accum = hm.Get<TGraph>("accumulated");
00058 
00059     inst->SetPoint(inst->GetN(),tortgt->timestamp,npot);
00060 
00061     double lastx=0,lasty=0;
00062     accum->GetPoint(accum->GetN()-1,lastx,lasty);
00063     accum->SetPoint(accum->GetN(),tortgt->timestamp,npot+lasty);
00064 
00065     return true;
00066 }


Member Data Documentation

int Npot::fNpotNeg [private]

Definition at line 8 of file Npot.h.

Referenced by Fill(), and ~Npot().

float Npot::fNpotNegSum [private]

Definition at line 9 of file Npot.h.

Referenced by Fill(), and ~Npot().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1