PulserGainLog Class Reference

#include <PulserGainLog.h>

Inheritance diagram for PulserGainLog:
DbiTableRow

List of all members.

Public Member Functions

 PulserGainLog ()
 PulserGainLog (Int_t codever)
virtual ~PulserGainLog ()
bool Add (const PulserGainLog &pgl)
bool Add (const PulserSummaryList *psl)
Int_t GetCodeVer () const
Int_t GetAggregateNo () const
Int_t GetIdent () const
Int_t GetFirstPoint () const
Int_t GetLastPoint () const
Int_t GetNumPoints () const
const Float_t * GetHeight () const
const Float_t * GetWidth () const
const Float_t * GetNumPulses () const
const Float_t * GetNumTriggers () const
const VldTimeStampGetTimeEnd () const
const VldTimeStampGetTimeStart () const
bool IsComplete () const
virtual DbiTableRowCreateTableRow () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const

Private Attributes

Int_t fAggregateNo
Int_t fCodeVer
Int_t fIdent
Int_t fNumPoints
Int_t fFirst
Int_t fLast
VldTimeStamp fTimeStart
VldTimeStamp fTimeEnd
Float_t fHeight [40]
Float_t fWidth [40]
Float_t fNum [40]
Float_t fTriggers [40]

Detailed Description

Definition at line 31 of file PulserGainLog.h.


Constructor & Destructor Documentation

PulserGainLog::PulserGainLog (  ) 

Definition at line 43 of file PulserGainLog.cxx.

References fAggregateNo, fCodeVer, fFirst, fHeight, fLast, fNum, fNumPoints, fTriggers, and fWidth.

00043                              : fTimeStart(0,0) , fTimeEnd(0,0) 
00044 {
00045   fCodeVer = 0;
00046   fAggregateNo = 0;
00047   fFirst = fLast = fNumPoints = 0;
00048   for (int i=0;i<40;i++) fHeight[i] = fWidth[i] = fNum[i] = fTriggers[i] = 0;
00049 }

PulserGainLog::PulserGainLog ( Int_t  codever  ) 

Definition at line 51 of file PulserGainLog.cxx.

References fAggregateNo, fFirst, fHeight, fLast, fNum, fNumPoints, fTriggers, and fWidth.

00051                                           : fCodeVer(codever), 
00052   fTimeStart(0,0) , fTimeEnd(0,0) 
00053 {
00054   fFirst = fLast = fNumPoints = fAggregateNo = 0;
00055   for (int i=0;i<40;i++) fHeight[i] = fWidth[i] = fNum[i] = fTriggers[i] = 0;
00056 }

virtual PulserGainLog::~PulserGainLog (  )  [inline, virtual]

Definition at line 36 of file PulserGainLog.h.

00036 {};


Member Function Documentation

bool PulserGainLog::Add ( const PulserSummaryList psl  ) 

Definition at line 137 of file PulserGainLog.cxx.

References fAggregateNo, fFirst, fHeight, fIdent, fLast, fNum, fNumPoints, fTimeEnd, fTimeStart, fTriggers, fWidth, PulserSummaryList::GetAggregateNo(), PulserSummaryList::GetExpectedPoints(), PulserSummaryList::GetHeight(), PulserSummaryList::GetIdent(), PulserSummaryList::GetNumPulses(), PulserSummaryList::GetPointIndex(), VldContext::GetTimeStamp(), PulserSummaryList::GetTriggers(), PulserSummaryList::GetVldContext(), PulserSummaryList::GetWidth(), Msg::kDebug, and MSG.

00138 {
00139 
00140 
00141     MSG("Pulser",Msg::kDebug)<<"In GainLog Add(psl). Aggregate Number: " << fAggregateNo << endl; 
00142     MSG("Pulser",Msg::kDebug)<<"In GainLog Add(psl). fFirst, fLast, fIdent: " << fFirst << ", " << fLast << ", " << fIdent << endl;
00143     MSG("Pulser",Msg::kDebug)<<"In GainLog Add(psl). Trying to add point: " << psl->GetPointIndex()  << ", " << psl->GetIdent() << endl;
00144 
00145   if (fAggregateNo != 0) {
00146     // We already have some data
00147     if (fAggregateNo != psl->GetAggregateNo()) return false;
00148     if (fIdent != psl->GetIdent()) return false;
00149     if (fLast != (psl->GetPointIndex()-1)) return false;
00150   } 
00151   else {
00152     fAggregateNo = psl->GetAggregateNo();
00153     fIdent = psl->GetIdent();
00154     fFirst = psl->GetPointIndex();
00155     fTimeStart = psl->GetVldContext().GetTimeStamp();
00156     fNumPoints = psl->GetExpectedPoints();
00157   }
00158   fLast = psl->GetPointIndex();
00159   fTimeEnd = psl->GetVldContext().GetTimeStamp();
00160   fHeight[fLast-1] = psl->GetHeight();
00161   fWidth[fLast-1] = psl->GetWidth();
00162   fNum[fLast-1] = psl->GetNumPulses();
00163   fTriggers[fLast-1] = psl->GetTriggers();
00164 
00165     MSG("Pulser",Msg::kDebug)<<"In GainLog Add(psl). Aggregate Number: " << fAggregateNo << endl; 
00166     MSG("Pulser",Msg::kDebug)<<"In GainLog Add(psl). fFirst, fLast, fIdent: " << fFirst << ", " << fLast << ", " << fIdent << endl;
00167     MSG("Pulser",Msg::kDebug)<<"In GainLog Add(psl). Trying to add point: " << psl->GetPointIndex()  << ", " << psl->GetIdent() << endl;
00168  
00169     //  ++fNumPoints;
00170   return true;
00171 }

bool PulserGainLog::Add ( const PulserGainLog pgl  ) 

Definition at line 98 of file PulserGainLog.cxx.

References fFirst, fHeight, fIdent, fLast, fNum, fTimeEnd, fTimeStart, fTriggers, fWidth, GetFirstPoint(), GetHeight(), GetIdent(), GetLastPoint(), GetNumPulses(), GetNumTriggers(), GetTimeEnd(), GetTimeStart(), and GetWidth().

Referenced by PulserDBModule::AddToGC(), PulserDBModule::MergeBack(), and PulserDBModule::MergeForward().

00099 {
00100   if (fIdent!=pgl.GetIdent()) return false; 
00101 // Don't add if our current gc has different (led, num points etc.) from pgl. 
00102 
00103 
00104   const Float_t *height = pgl.GetHeight();
00105   const Float_t *width = pgl.GetWidth();
00106   const Float_t *numpulses = pgl.GetNumPulses();
00107   const Float_t *numtriggers = pgl.GetNumTriggers();
00108 
00109 
00110   // Allow Add() to add to either end of the curve.
00111   if (pgl.GetFirstPoint()==1+fLast) {
00112     // add to end
00113     fLast = pgl.GetLastPoint();
00114     fTimeEnd = pgl.GetTimeEnd();
00115   }
00116   else if(pgl.GetLastPoint()==fFirst-1) {
00117     // add to start
00118     fFirst = pgl.GetFirstPoint();
00119     fTimeStart = pgl.GetTimeStart();
00120   }
00121   else {
00122     // Fragments don't join up
00123     return false;
00124   }
00125 
00126   for (int i = pgl.GetFirstPoint();i<=pgl.GetLastPoint();i++) {
00127     fHeight[i-1] = height[i-1];
00128     fWidth[i-1] = width[i-1];
00129     fNum[i-1] = numpulses[i-1];
00130     fTriggers[i-1] = numtriggers[i-1];
00131     //    ++fNumPoints;
00132   }
00133 
00134   return true;
00135 }

virtual DbiTableRow* PulserGainLog::CreateTableRow (  )  const [inline, virtual]

Implements DbiTableRow.

Definition at line 67 of file PulserGainLog.h.

00067 { return new PulserGainLog;}

void PulserGainLog::Fill ( DbiResultSet rs,
const DbiValidityRec vrec 
) [virtual]

Implements DbiTableRow.

Definition at line 59 of file PulserGainLog.cxx.

References fAggregateNo, fCodeVer, fFirst, fHeight, fIdent, fLast, fNum, fNumPoints, fTimeEnd, fTimeStart, fTriggers, and fWidth.

00061 {
00062   rs >> fAggregateNo;
00063   rs >> fCodeVer;
00064   rs >> fIdent;
00065   rs >> fNumPoints;
00066   rs >> fFirst >> fLast;
00067   rs >> fTimeStart >> fTimeEnd;
00068   for (int i=0;i<40;i++) rs >> fHeight[i];
00069   for (int i=0;i<40;i++) rs >> fWidth[i];
00070   for (int i=0;i<40;i++) rs >> fNum[i];
00071   for (int i=0;i<40;i++) rs >> fTriggers[i];
00072 } 

Int_t PulserGainLog::GetAggregateNo (  )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 45 of file PulserGainLog.h.

References fAggregateNo.

Referenced by PulserDBModule::AddToGC(), and PulserDBModule::DoWriteGC().

00045 {return fAggregateNo;} // Note - this table is 

Int_t PulserGainLog::GetCodeVer (  )  const [inline]

Definition at line 44 of file PulserGainLog.h.

References fCodeVer.

00044 {return fCodeVer;}

Int_t PulserGainLog::GetFirstPoint (  )  const [inline]

Definition at line 49 of file PulserGainLog.h.

References fFirst.

Referenced by Add(), PulserDBModule::GetCurrentFromDB(), and PulserDBModule::MergeBack().

00049 {return fFirst;}

const Float_t* PulserGainLog::GetHeight (  )  const [inline]

Definition at line 53 of file PulserGainLog.h.

References fHeight.

Referenced by Add().

00053 {return fHeight;}

Int_t PulserGainLog::GetIdent (  )  const [inline]

Definition at line 48 of file PulserGainLog.h.

References fIdent.

Referenced by Add().

00048 {return fIdent;}

Int_t PulserGainLog::GetLastPoint (  )  const [inline]

Definition at line 50 of file PulserGainLog.h.

References fLast.

Referenced by Add(), and PulserDBModule::MergeForward().

00050 {return fLast;}

Int_t PulserGainLog::GetNumPoints (  )  const [inline]

Definition at line 51 of file PulserGainLog.h.

References fNumPoints.

Referenced by PulserDBModule::MergeForward().

00051 {return fNumPoints;} 

const Float_t* PulserGainLog::GetNumPulses (  )  const [inline]

Definition at line 55 of file PulserGainLog.h.

References fNum.

Referenced by Add().

00055 {return fNum;}

const Float_t* PulserGainLog::GetNumTriggers (  )  const [inline]

Definition at line 56 of file PulserGainLog.h.

References fTriggers.

Referenced by Add().

00056 {return fTriggers;}

const VldTimeStamp& PulserGainLog::GetTimeEnd (  )  const [inline]

Definition at line 58 of file PulserGainLog.h.

References fTimeEnd.

Referenced by Add(), and PulserDBModule::MergeForward().

00058 {return fTimeEnd;}

const VldTimeStamp& PulserGainLog::GetTimeStart (  )  const [inline]

Definition at line 59 of file PulserGainLog.h.

References fTimeStart.

Referenced by Add(), PulserDBModule::DoWriteGC(), PulserDBModule::MergeBack(), and PulserDBModule::WriteTempGC().

00059 {return fTimeStart;}

const Float_t* PulserGainLog::GetWidth (  )  const [inline]

Definition at line 54 of file PulserGainLog.h.

References fWidth.

Referenced by Add().

00054 {return fWidth;}

bool PulserGainLog::IsComplete (  )  const

Definition at line 90 of file PulserGainLog.cxx.

References fFirst, fLast, fNumPoints, Msg::kDebug, and MSG.

Referenced by PulserDBModule::EndRun(), and PulserDBModule::GainCurve().

00091 {
00092   MSG("Pulser",Msg::kDebug)<<"fFirst, fNumPoints "<< fFirst << ", " << fNumPoints <<endl;
00093     return ((fFirst==1)&&(fLast==fNumPoints));
00094   //  return ((fFirst==1)&&(fLast==20));
00095 }

void PulserGainLog::Store ( DbiOutRowStream ors,
const DbiValidityRec vrec 
) const [virtual]

Reimplemented from DbiTableRow.

Definition at line 74 of file PulserGainLog.cxx.

References fAggregateNo, fCodeVer, fFirst, fHeight, fIdent, fLast, fNum, fNumPoints, fTimeEnd, fTimeStart, fTriggers, and fWidth.

00076 {
00077   ors << fAggregateNo;
00078   ors << fCodeVer;
00079   ors << fIdent;
00080   ors << fNumPoints;
00081   ors << fFirst << fLast;
00082   ors << fTimeStart << fTimeEnd;
00083   for (int i=0;i<40;i++) ors << fHeight[i];
00084   for (int i=0;i<40;i++) ors << fWidth[i];
00085   for (int i=0;i<40;i++) ors << fNum[i];
00086   for (int i=0;i<40;i++) ors << fTriggers[i];
00087 }


Member Data Documentation

Int_t PulserGainLog::fAggregateNo [private]

Definition at line 76 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetAggregateNo(), PulserGainLog(), and Store().

Int_t PulserGainLog::fCodeVer [private]

Definition at line 77 of file PulserGainLog.h.

Referenced by Fill(), GetCodeVer(), PulserGainLog(), and Store().

Int_t PulserGainLog::fFirst [private]

Definition at line 80 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetFirstPoint(), IsComplete(), PulserGainLog(), and Store().

Float_t PulserGainLog::fHeight[40] [private]

Definition at line 84 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetHeight(), PulserGainLog(), and Store().

Int_t PulserGainLog::fIdent [private]

Definition at line 78 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetIdent(), and Store().

Int_t PulserGainLog::fLast [private]

Definition at line 81 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetLastPoint(), IsComplete(), PulserGainLog(), and Store().

Float_t PulserGainLog::fNum[40] [private]

Definition at line 86 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetNumPulses(), PulserGainLog(), and Store().

Int_t PulserGainLog::fNumPoints [private]

Definition at line 79 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetNumPoints(), IsComplete(), PulserGainLog(), and Store().

Definition at line 83 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetTimeEnd(), and Store().

Definition at line 82 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetTimeStart(), and Store().

Float_t PulserGainLog::fTriggers[40] [private]

Definition at line 87 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetNumTriggers(), PulserGainLog(), and Store().

Float_t PulserGainLog::fWidth[40] [private]

Definition at line 85 of file PulserGainLog.h.

Referenced by Add(), Fill(), GetWidth(), PulserGainLog(), and Store().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1