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

BfieldCoilCurrent.h

Go to the documentation of this file.
00001 #ifndef BFIELDCOILCURRENT_H
00002 #define BFIELDCOILCURRENT_H
00003 
00004 #include "DatabaseInterface/DbiTableRow.h"
00005 
00006 class DbiValidityRec;
00007 
00008 class BfieldCoilCurrent;
00009 std::ostream& operator<<(std::ostream& os, const BfieldCoilCurrent& bcc);
00010 
00011 class BfieldCoilCurrent : public DbiTableRow
00012 {
00013 
00014 using TObject::Compare;  // So won't be hidden
00015 
00016 public:
00017 
00018   typedef enum ECoilStatus { 
00019     kDegaussed  =  0,  // explictly degaussed, or never energized
00020     kForward    = +1,
00021     kReverse    = -1,
00022     kForwardOff = +2,  // no power, last powered in Forward mode
00023     kReverseOff = -2   // no power, last powered in Reverse mode
00024   } CoilStatus_t;
00025 
00026   BfieldCoilCurrent()
00027     : sm1stat(0),sm1curr(0),sm2stat(0),sm2curr(0), sm1turns(0),sm2turns(0) { }
00028 
00029   BfieldCoilCurrent(const BfieldCoilCurrent& from) 
00030     : DbiTableRow(from) { *this = from; }
00031 
00032   BfieldCoilCurrent(Int_t  stat1,   Int_t  curr1,
00033                     Int_t  stat2,   Int_t  curr2, 
00034                     Int_t turns1=0, Int_t turns2=0);
00035   virtual ~BfieldCoilCurrent() { };
00036 
00037   Bool_t CanL2Cache() const { return kTRUE; }
00038   Bool_t Compare(const BfieldCoilCurrent& that ) const {
00039     return sm1stat == that.sm1stat
00040       && sm1curr   == that.sm1curr
00041       && sm2stat   == that.sm2stat
00042       && sm2curr   == that.sm2curr; }
00043 
00044   Int_t    GetSm1Status() const    { return sm1stat; }
00045   Int_t    GetSm1Current() const   { return sm1curr; }
00046   Int_t    GetSm2Status() const    { return sm2stat; }
00047   Int_t    GetSm2Current() const   { return sm2curr; }
00048 
00049   Double_t GetSm1AmpTurns() const  { return sm1curr * sm1turns; }
00050   Double_t GetSm2AmpTurns() const  { return sm2curr * sm2turns; }
00051 
00052   virtual void Fill(DbiResultSet& rs, const DbiValidityRec* vrec);
00053   virtual void Store(DbiOutRowStream& ors, const DbiValidityRec* vrec) const;
00054 
00055   virtual void Print(Option_t *option = "") const;
00056   virtual std::ostream& FormatToOStream(std::ostream& os,
00057                                         Option_t *option="") const;
00058 
00059   virtual DbiTableRow* CreateTableRow() const { return new BfieldCoilCurrent; }
00060 
00061 private:
00062 
00063   // Status should be one of the above codes
00064   // Current is the readback current of the supply, it is NOT the
00065   // number of Amp-turns being run through the center of the detector.
00066 
00067   // 2005-02-14: rwh  currently the status 0 doesn't distinguish
00068   //   between degausssed (or never energized) and simply "off".
00069   //   Also the conversion between the supply readback and Amp-turns
00070   //   is hardcoded.
00071 
00072   Int_t sm1stat;
00073   Int_t sm1curr;
00074   Int_t sm2stat;
00075   Int_t sm2curr;
00076 
00077   Int_t sm1turns;
00078   Int_t sm2turns;
00079 
00080   ClassDef(BfieldCoilCurrent,0)
00081 
00082 };
00083 
00084 #endif  // BFIELDCOILCURRENT_H

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