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

BfieldCoilCurrent Class Reference

#include <BfieldCoilCurrent.h>

Inheritance diagram for BfieldCoilCurrent:

DbiTableRow List of all members.

Public Types

typedef enum BfieldCoilCurrent::ECoilStatus CoilStatus_t
enum  ECoilStatus {
  kDegaussed = 0, kForward = +1, kReverse = -1, kForwardOff = +2,
  kReverseOff = -2
}

Public Member Functions

 BfieldCoilCurrent ()
 BfieldCoilCurrent (const BfieldCoilCurrent &from)
 BfieldCoilCurrent (Int_t stat1, Int_t curr1, Int_t stat2, Int_t curr2, Int_t turns1=0, Int_t turns2=0)
virtual ~BfieldCoilCurrent ()
Bool_t CanL2Cache () const
Bool_t Compare (const BfieldCoilCurrent &that) const
Int_t GetSm1Status () const
Int_t GetSm1Current () const
Int_t GetSm2Status () const
Int_t GetSm2Current () const
Double_t GetSm1AmpTurns () const
Double_t GetSm2AmpTurns () const
virtual void Fill (DbiResultSet &rs, const DbiValidityRec *vrec)
virtual void Store (DbiOutRowStream &ors, const DbiValidityRec *vrec) const
virtual void Print (Option_t *option="") const
virtual std::ostream & FormatToOStream (std::ostream &os, Option_t *option="") const
virtual DbiTableRowCreateTableRow () const

Private Attributes

Int_t sm1stat
Int_t sm1curr
Int_t sm2stat
Int_t sm2curr
Int_t sm1turns
Int_t sm2turns

Member Typedef Documentation

typedef enum BfieldCoilCurrent::ECoilStatus BfieldCoilCurrent::CoilStatus_t
 


Member Enumeration Documentation

enum BfieldCoilCurrent::ECoilStatus
 

Enumeration values:
kDegaussed 
kForward 
kReverse 
kForwardOff 
kReverseOff 

Definition at line 18 of file BfieldCoilCurrent.h.

00018                            { 
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;


Constructor & Destructor Documentation

BfieldCoilCurrent::BfieldCoilCurrent  )  [inline]
 

Definition at line 26 of file BfieldCoilCurrent.h.

References sm1curr, sm1stat, sm1turns, sm2curr, sm2stat, and sm2turns.

00027     : sm1stat(0),sm1curr(0),sm2stat(0),sm2curr(0), sm1turns(0),sm2turns(0) { }

BfieldCoilCurrent::BfieldCoilCurrent const BfieldCoilCurrent from  )  [inline]
 

Definition at line 29 of file BfieldCoilCurrent.h.

00030     : DbiTableRow(from) { *this = from; }

BfieldCoilCurrent::BfieldCoilCurrent Int_t  stat1,
Int_t  curr1,
Int_t  stat2,
Int_t  curr2,
Int_t  turns1 = 0,
Int_t  turns2 = 0
 

Definition at line 20 of file BfieldCoilCurrent.cxx.

00023   : sm1stat(stat1), sm1curr(curr1), sm2stat(stat2), sm2curr(curr2),
00024     sm1turns(turns1), sm2turns(turns2)
00025 {
00026   // we have no context so if turns==0 we don't know what to set
00027 }

virtual BfieldCoilCurrent::~BfieldCoilCurrent  )  [inline, virtual]
 

Definition at line 35 of file BfieldCoilCurrent.h.

00035 { };


Member Function Documentation

Bool_t BfieldCoilCurrent::CanL2Cache  )  const [inline, virtual]
 

Reimplemented from DbiTableRow.

Definition at line 37 of file BfieldCoilCurrent.h.

00037 { return kTRUE; }

Bool_t BfieldCoilCurrent::Compare const BfieldCoilCurrent that  )  const [inline]
 

Definition at line 38 of file BfieldCoilCurrent.h.

References sm1curr, sm1stat, sm2curr, and sm2stat.

00038                                                        {
00039     return sm1stat == that.sm1stat
00040       && sm1curr   == that.sm1curr
00041       && sm2stat   == that.sm2stat
00042       && sm2curr   == that.sm2curr; }

virtual DbiTableRow* BfieldCoilCurrent::CreateTableRow  )  const [inline, virtual]
 

Implements DbiTableRow.

Definition at line 59 of file BfieldCoilCurrent.h.

00059 { return new BfieldCoilCurrent; }

void BfieldCoilCurrent::Fill DbiResultSet rs,
const DbiValidityRec vrec
[virtual]
 

Implements DbiTableRow.

Definition at line 31 of file BfieldCoilCurrent.cxx.

References DbiRowStream::CurColName(), det, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), DbiRowStream::HasRowCounter(), DbiRowStream::IncrementCurCol(), MSG, DbiRowStream::NumCols(), sm1curr, sm1stat, sm1turns, sm2stat, sm2turns, and DbiRowStream::TableName().

00032                                                          {
00033 
00034   if (    rs.TableName() != "BfieldCoilCurrent"
00035        && rs.TableName() != "BFIELDCOILCURRENT" ) {
00036     rs >> sm1stat >> sm1curr >> sm2stat >> sm2curr;
00037   }
00038   else {
00039     Int_t numCol = rs.NumCols();
00040     // seqno already processed
00041     for (Int_t curCol = rs.HasRowCounter() ? 3 : 2; curCol <= numCol; ++curCol) {
00042       string colName = rs.CurColName();
00043       if (      colName == "SM1_CURRENT" )   rs >> sm1curr;
00044       else if ( colName == "SM1_STATUS" )    rs >> sm1stat;
00045       else if ( colName == "SM2_CURRENT" )   rs >> sm2curr;
00046       else if ( colName == "SM2_STATUS" )    rs >> sm2stat;
00047       else {
00048         MSG("Dbi",Msg::kDebug) << "Ignoring column " << curCol
00049           << "(" << colName << ")"
00050           << "; not part of BfieldCoilCurrent" << endl;
00051         rs.IncrementCurCol();
00052       }
00053     }
00054   }
00055 
00056 
00057   Detector::Detector_t det = 
00058     (Detector::Detector_t)
00059     ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00060 
00061   switch ( det ) {
00062   case Detector::kNear:
00063     sm1turns = 8;  // 8 turns (planks, each with 6 parallel conductors)
00064     sm2turns = 0;
00065     break;
00066   case Detector::kFar:
00067     sm1turns = 190;
00068     sm2turns = 190;
00069     break;
00070   default:
00071     sm1turns = 0;
00072     sm2turns = 0;
00073     break;
00074   }
00075 
00076 }

std::ostream & BfieldCoilCurrent::FormatToOStream std::ostream &  os,
Option_t *  option = ""
const [virtual]
 

Definition at line 95 of file BfieldCoilCurrent.cxx.

References Nav::GetName(), sm1curr, sm1stat, sm1turns, sm2curr, sm2stat, and sm2turns.

Referenced by operator<<(), and Print().

00097 {
00098   os << GetName();
00099   os << " SM1 status=" << sm1stat 
00100      << " @ " << sm1curr << "A*" << sm1turns << "turns";
00101   if ( sm2stat != 0 || sm2curr != 0 || sm2turns != 0 ) 
00102     os << ", SM2 status=" << sm2stat 
00103        << " @ " << sm2curr << "A*" << sm2turns << "turns";
00104   os << endl;
00105  
00106   return os;
00107 }

Double_t BfieldCoilCurrent::GetSm1AmpTurns  )  const [inline]
 

Definition at line 49 of file BfieldCoilCurrent.h.

References sm1curr.

00049 { return sm1curr * sm1turns; }

Int_t BfieldCoilCurrent::GetSm1Current  )  const [inline]
 

Definition at line 45 of file BfieldCoilCurrent.h.

00045 { return sm1curr; }

Int_t BfieldCoilCurrent::GetSm1Status  )  const [inline]
 

Definition at line 44 of file BfieldCoilCurrent.h.

00044 { return sm1stat; }

Double_t BfieldCoilCurrent::GetSm2AmpTurns  )  const [inline]
 

Definition at line 50 of file BfieldCoilCurrent.h.

References sm2curr.

00050 { return sm2curr * sm2turns; }

Int_t BfieldCoilCurrent::GetSm2Current  )  const [inline]
 

Definition at line 47 of file BfieldCoilCurrent.h.

00047 { return sm2curr; }

Int_t BfieldCoilCurrent::GetSm2Status  )  const [inline]
 

Definition at line 46 of file BfieldCoilCurrent.h.

00046 { return sm2stat; }

void BfieldCoilCurrent::Print Option_t *  option = ""  )  const [virtual]
 

Definition at line 91 of file BfieldCoilCurrent.cxx.

References FormatToOStream(), and option.

00092 { FormatToOStream(cout,option); }

void BfieldCoilCurrent::Store DbiOutRowStream ors,
const DbiValidityRec vrec
const [virtual]
 

Reimplemented from DbiTableRow.

Definition at line 80 of file BfieldCoilCurrent.cxx.

References sm1curr, sm1stat, and sm2stat.

00081                                                                       {
00082   ors << sm1stat << sm1curr << sm2stat << sm2curr;
00083 }


Member Data Documentation

Int_t BfieldCoilCurrent::sm1curr [private]
 

Definition at line 73 of file BfieldCoilCurrent.h.

Referenced by BfieldCoilCurrent(), Compare(), Fill(), FormatToOStream(), GetSm1AmpTurns(), and Store().

Int_t BfieldCoilCurrent::sm1stat [private]
 

Definition at line 72 of file BfieldCoilCurrent.h.

Referenced by BfieldCoilCurrent(), Compare(), Fill(), FormatToOStream(), and Store().

Int_t BfieldCoilCurrent::sm1turns [private]
 

Definition at line 77 of file BfieldCoilCurrent.h.

Referenced by BfieldCoilCurrent(), Fill(), and FormatToOStream().

Int_t BfieldCoilCurrent::sm2curr [private]
 

Definition at line 75 of file BfieldCoilCurrent.h.

Referenced by BfieldCoilCurrent(), Compare(), FormatToOStream(), and GetSm2AmpTurns().

Int_t BfieldCoilCurrent::sm2stat [private]
 

Definition at line 74 of file BfieldCoilCurrent.h.

Referenced by BfieldCoilCurrent(), Compare(), Fill(), FormatToOStream(), and Store().

Int_t BfieldCoilCurrent::sm2turns [private]
 

Definition at line 78 of file BfieldCoilCurrent.h.

Referenced by BfieldCoilCurrent(), Fill(), and FormatToOStream().


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