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

PulserTimePlotter Class Reference

#include <PulserTimePlotter.h>

List of all members.

Public Member Functions

 PulserTimePlotter (VldContext vc)
virtual ~PulserTimePlotter ()
TGraphErrors * CreateGraph (PlexLedId &led, int gain)

Private Attributes

VldContext fStartVC
VldContext fVC
PlexHandle fPlex


Constructor & Destructor Documentation

PulserTimePlotter::PulserTimePlotter VldContext  vc  ) 
 

Definition at line 39 of file PulserTimePlotter.cxx.

00040   : fStartVC(vc), fVC(vc), fPlex(vc)
00041 {
00042 
00043 }

PulserTimePlotter::~PulserTimePlotter  )  [virtual]
 

Definition at line 45 of file PulserTimePlotter.cxx.

00046 {
00047 
00048 }


Member Function Documentation

TGraphErrors * PulserTimePlotter::CreateGraph PlexLedId led,
int  gain
 

Definition at line 50 of file PulserTimePlotter.cxx.

References fPlex, fStartVC, VldRange::GetDetectorMask(), PulserRawDriftPin::GetError(), PulserRawDriftPin::GetMean(), DbiResultPtr< T >::GetNumRows(), PlexHandle::GetPinDiodeIds(), DbiResultPtr< T >::GetRowByIndex(), VldTimeStamp::GetSec(), VldRange::GetSimMask(), DbiValidityRec::GetTask(), VldRange::GetTimeEnd(), VldRange::GetTimeStart(), DbiResultPtr< T >::GetValidityRec(), DbiValidityRec::GetVldRange(), DbiResultPtr< T >::NewQuery(), and SimFlag::SimFlag_t.

00051 {
00052   vector<float> mean;
00053   vector<float> error;
00054   vector<float> secs;
00055   int sec;
00056   // Find the correct PIN diode, pull it from the DB.
00057   std::pair<PlexPinDiodeId,PlexPinDiodeId> pinids =
00058     fPlex.GetPinDiodeIds(led);
00059   const PulserRawDriftPin *pin;
00060   DbiResultPtr<PulserRawDriftPin> pinRP(fStartVC);
00061   for (;;) {
00062     cout<<"In loop "<<*(pinRP.GetValidityRec())<<endl;
00063     if (pinRP.GetNumRows()>0) {
00064       switch (gain) {
00065       case 0:
00066         pin = pinRP.GetRowByIndex(pinids.second.GetEncoded());
00067         break;
00068       case 1:
00069         pin = pinRP.GetRowByIndex(pinids.first.GetEncoded());
00070         break;
00071       default:
00072         cout<<"You asked for non-existent gain "<<gain<<endl;
00073         return 0;
00074       }
00075       if (!pin) {
00076         cout<<"Couldn't get PIN data for gain "<<gain<<" of led "<<led<<endl;
00077         return 0;
00078       }
00079       cout<<pin->GetMean()<<" "<<pin->GetError()<<endl;
00080       mean.push_back(pin->GetMean());
00081       error.push_back(pin->GetError());
00082       sec = pinRP.GetValidityRec()->GetVldRange().GetTimeStart().GetSec();
00083       secs.push_back(sec);
00084     }
00085     // if (pinRP.NextQuery()==0) break;
00086     int ntime = pinRP.GetValidityRec()->GetVldRange().GetTimeEnd().GetSec() + 1;
00087     VldContext v(Detector::Detector_t(pinRP.GetValidityRec()->GetVldRange().GetDetectorMask()),
00088                  SimFlag::SimFlag_t(pinRP.GetValidityRec()->GetVldRange().GetSimMask()),
00089                  VldTimeStamp(ntime,0));
00090     cout<<v<<endl;
00091     if (pinRP.NewQuery(v,pinRP.GetValidityRec()->GetTask())==0) break;
00092   }
00093   TGraphErrors *g = new TGraphErrors(mean.size(),&(secs[0]),0,&(mean[0]),&(error[0]));
00094   return g;
00095 }


Member Data Documentation

PlexHandle PulserTimePlotter::fPlex [private]
 

Definition at line 40 of file PulserTimePlotter.h.

Referenced by CreateGraph().

VldContext PulserTimePlotter::fStartVC [private]
 

Definition at line 38 of file PulserTimePlotter.h.

Referenced by CreateGraph().

VldContext PulserTimePlotter::fVC [private]
 

Definition at line 39 of file PulserTimePlotter.h.


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:10:07 2010 for loon by  doxygen 1.3.9.1