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

CalLinearity.h

Go to the documentation of this file.
00001 // $Id: CalLinearity.h,v 1.3 2005/09/08 20:14:45 tagg Exp $
00002 
00003 #ifndef CALLINEARITY_H
00004 #define CALLINEARITY_H
00005 
00010 
00011 #include "Rtypes.h"
00012 #include "DatabaseInterface/DbiTableRow.h"
00013 #include "LeakChecker/Lea.h"
00014 #include <vector>
00015 #include "Plex/PlexStripEndId.h"
00016 using std::vector;
00017 
00018 class DbiValidityRec;
00019 
00020 class CalLinearity : public DbiTableRow
00021 {
00022 
00023 public:
00024    
00025    // Constructors and destructors.
00026   CalLinearity() {
00027       LEA_CTOR; }
00028   virtual ~CalLinearity(){ LEA_DTOR; };
00029   CalLinearity(int aggno, PlexStripEndId &seid, int task); // Create the 1:1 mapping object
00030   CalLinearity(int aggno, PlexStripEndId &seid, 
00031                vector<float> &x, vector<float> &y, 
00032                vector<float> &ex, vector<float> &ey, 
00033                CalLinearity &lin, bool horizontal);
00034   CalLinearity(int aggno, PlexStripEndId &seid,
00035                vector<float> &x, vector<float> &y);
00036 
00037   Int_t GetAggregateNo() const { return fAggregateNo; }
00038   UInt_t GetIndex(UInt_t /* defIndex */) const { return fStripEndKey; }
00039   Int_t GetStripEnd() const {return fStripEndId;}
00040   Int_t GetTask() const { return fTask; }
00041   Int_t GetNumXPoints() {return fNumXPoints;}  
00042   Float_t GetLimit() const {
00043     if (fNsplines==1) {
00044       return fSplines[fNsplines-1].endy;
00045     }
00046     else {
00047       // Don't use the extrapolation spline for the limit
00048       return fSplines[fNsplines-2].endy;
00049     }
00050   };
00051 
00052  virtual DbiTableRow* CreateTableRow() const { 
00053       return new CalLinearity; }  
00054 
00055 // State changing member functions
00056    virtual void Fill(DbiResultSet& rs,
00057                     const DbiValidityRec* vrec);
00058    virtual void Store(DbiOutRowStream& ors,
00059                      const DbiValidityRec* vrec) const;
00060 
00061    Float_t ADCtoLin(const Float_t charge) const ;
00062    Float_t LintoADC(const Float_t charge) const ;
00063 
00064  private:
00065  CalLinearity(const CalLinearity& from)
00066     : DbiTableRow(from) { LEA_CTOR; *this = from; }
00067 
00068  struct spline {
00069    float startx;
00070    float starty;
00071    float slope;
00072    float alpha;
00073    float endx;
00074    float endy;
00075  };
00076 
00077    // Data members
00078  Int_t fAggregateNo;
00079  Int_t fStripEndKey;
00080  Int_t fStripEndId;
00081  Int_t fTask;
00082  mutable Int_t fNumber;         // mutable so we can pack data into here
00083  mutable Float_t fParam[40];    // in Store()
00084 
00085  spline fSplines[8];
00086  int fNsplines;
00087  int fNumXPoints;
00088 
00089  ClassDef(CalLinearity,0)    
00090 };
00091 
00092 #endif //CALLINEARITY_H

Generated on Mon Feb 15 11:06:27 2010 for loon by  doxygen 1.3.9.1