PulserDriftPin Class Reference

#include <PulserDriftPin.h>

Inheritance diagram for PulserDriftPin:
DbiTableRow

List of all members.

Public Member Functions

 PulserDriftPin ()
 PulserDriftPin (Int_t aggNo, PlexPinDiodeId pinid, Float_t mean, Float_t error, Float_t num_entries, Float_t num_triggers)
 PulserDriftPin (Int_t aggNo, const PulserSummary &ps)
virtual ~PulserDriftPin ()
void New (Int_t aggNo, PlexPinDiodeId pinid, const PulserSummary &ps)
Int_t GetAggregateNo () const
UInt_t GetIndex (UInt_t) const
PlexPinDiodeId GetStripEnd () const
PlexPinDiodeId GetPinDiodeId () const
Float_t GetMean () const
Float_t GetError () const
Float_t GetNumEntries () const
Float_t GetNumTriggers () const
Float_t ZCMean () const
Float_t ZCError () 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
PlexPinDiodeId fPlexPinDiodeId
Float_t fMean
Float_t fError
Float_t fNumEntries
Float_t fNumTriggers

Detailed Description

Definition at line 38 of file PulserDriftPin.h.


Constructor & Destructor Documentation

PulserDriftPin::PulserDriftPin (  ) 

Definition at line 47 of file PulserDriftPin.cxx.

References fAggregateNo, fError, fMean, fNumEntries, and fNumTriggers.

00048 {
00049   fAggregateNo = -1;
00050  
00051   fMean = -1;
00052   fError=-1;
00053   fNumEntries=-1;
00054   fNumTriggers=-1;
00055 }

PulserDriftPin::PulserDriftPin ( Int_t  aggNo,
PlexPinDiodeId  pinid,
Float_t  mean,
Float_t  error,
Float_t  num_entries,
Float_t  num_triggers 
)

Definition at line 57 of file PulserDriftPin.cxx.

00059                                                :
00060    fAggregateNo(aggNo) , fPlexPinDiodeId(pinid) , fMean(mean),
00061    fError(error), fNumEntries(num_entries), fNumTriggers(num_triggers)
00062 {
00063    
00064 }

PulserDriftPin::PulserDriftPin ( Int_t  aggNo,
const PulserSummary ps 
)

Definition at line 66 of file PulserDriftPin.cxx.

References PulserSummary::GetPinDiodeId(), and New().

00067 {
00068   PlexPinDiodeId pinid = ps.GetPinDiodeId();
00069   New(aggNo,pinid,ps);
00070 }

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

Definition at line 46 of file PulserDriftPin.h.

00046 {};


Member Function Documentation

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

Implements DbiTableRow.

Definition at line 61 of file PulserDriftPin.h.

00061 { return new PulserDriftPin;}

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

Implements DbiTableRow.

Definition at line 83 of file PulserDriftPin.cxx.

References det, fAggregateNo, fError, fMean, fNumEntries, fNumTriggers, fPlexPinDiodeId, VldRange::GetDetectorMask(), DbiValidityRec::GetVldRange(), ElecType::kUnknown, and Detector::StringToEnum().

00085 {
00086   Detector::Detector_t det =
00087     (Detector::Detector_t) 
00088     ((vrec) ? vrec->GetVldRange().GetDetectorMask() : 0);
00089   
00090   string elecName="Unknown";
00091   char   elecType = ElecType::kUnknown;
00092   char   rackEastWest='?', rackLevel='?';
00093   int    rackBay=0, muxboxInRack=0;
00094   int    diodeinbox=0, gain=0;
00095   
00096   //       SeqNo         int,
00097   //       AggregateNo   int,
00098   //       ElecName      tinytext,
00099   //       RackEastWest  char(1),
00100   //       RackLevel     char(1),
00101   //       RackBay       tinyint,
00102   //       MuxBoxInRack  tinyint,
00103   //       DiodeInBox    tinyint,
00104   //       Gain          tinyint,
00105   //       Mean          float,
00106   //       Error         float,
00107   //       NumEntries    int,
00108   //       NumTriggers   int 
00109   
00110   rs >> fAggregateNo
00111      >> elecName
00112      >> rackEastWest
00113      >> rackLevel
00114      >> rackBay
00115      >> muxboxInRack
00116      >> diodeinbox
00117      >> gain
00118      >> fMean
00119      >> fError
00120      >> fNumEntries
00121      >> fNumTriggers;
00122 
00123   ElecType::Elec_t elec = ElecType::StringToEnum(elecName.c_str(),1);
00124   if (ElecType::kUnknown == elec)  elec = (ElecType::Elec_t) elecType;
00125   
00126   fPlexPinDiodeId = PlexPinDiodeId(det,elec,rackEastWest,rackLevel,
00127                                    rackBay,muxboxInRack,diodeinbox,gain);
00128 } 

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

Reimplemented from DbiTableRow.

Definition at line 50 of file PulserDriftPin.h.

References fAggregateNo.

00050 { return fAggregateNo; }

Float_t PulserDriftPin::GetError (  )  const [inline]

Definition at line 55 of file PulserDriftPin.h.

References fError.

00055 {return fError;}

UInt_t PulserDriftPin::GetIndex ( UInt_t   )  const [inline, virtual]

Reimplemented from DbiTableRow.

Definition at line 51 of file PulserDriftPin.h.

References fPlexPinDiodeId, and PlexPinDiodeId::GetEncoded().

00051 { return fPlexPinDiodeId.GetEncoded(); }

Float_t PulserDriftPin::GetMean (  )  const [inline]

Definition at line 54 of file PulserDriftPin.h.

References fMean.

00054 {return fMean;}

Float_t PulserDriftPin::GetNumEntries (  )  const [inline]

Definition at line 56 of file PulserDriftPin.h.

References fNumEntries.

Referenced by PulserDriftCalScheme::GetDriftPinDiodeValue().

00056 {return fNumEntries;}

Float_t PulserDriftPin::GetNumTriggers (  )  const [inline]

Definition at line 57 of file PulserDriftPin.h.

References fNumTriggers.

00057 {return fNumTriggers;}

PlexPinDiodeId PulserDriftPin::GetPinDiodeId (  )  const [inline]

Definition at line 53 of file PulserDriftPin.h.

References fPlexPinDiodeId.

00053 {return fPlexPinDiodeId;}

PlexPinDiodeId PulserDriftPin::GetStripEnd (  )  const [inline]

Definition at line 52 of file PulserDriftPin.h.

References fPlexPinDiodeId.

00052 {return fPlexPinDiodeId;}

void PulserDriftPin::New ( Int_t  aggNo,
PlexPinDiodeId  pinid,
const PulserSummary ps 
)
void PulserDriftPin::Store ( DbiOutRowStream ors,
const DbiValidityRec vrec 
) const [virtual]

Reimplemented from DbiTableRow.

Definition at line 130 of file PulserDriftPin.cxx.

References bfld::AsString(), fAggregateNo, fError, fMean, fNumEntries, fNumTriggers, fPlexPinDiodeId, PlexMuxBoxId::GetEastWest(), PlexMuxBoxId::GetElecType(), PlexPinDiodeId::GetGain(), PlexPinDiodeId::GetInBox(), PlexMuxBoxId::GetInRack(), PlexMuxBoxId::GetRackBay(), and PlexMuxBoxId::GetRackLevel().

00132 {
00133   ElecType::Elec_t elec = fPlexPinDiodeId.GetElecType();
00134   char rackEastWest = fPlexPinDiodeId.GetEastWest();
00135   char rackLevel    = fPlexPinDiodeId.GetRackLevel();
00136   int  rackBay      = fPlexPinDiodeId.GetRackBay();
00137   int  muxInRack    = fPlexPinDiodeId.GetInRack();
00138   ors << fAggregateNo
00139       << ElecType::AsString(elec)
00140       << rackEastWest
00141       << rackLevel
00142       << rackBay
00143       << muxInRack
00144       << fPlexPinDiodeId.GetInBox()
00145       << fPlexPinDiodeId.GetGain()
00146       << fMean
00147       << fError
00148       << fNumEntries
00149       << fNumTriggers;
00150 }

Float_t PulserDriftPin::ZCError (  )  const

Definition at line 158 of file PulserDriftPin.cxx.

References fError, fMean, fNumEntries, and fNumTriggers.

Referenced by PulserDriftCalScheme::GetDriftPinDiodeValue().

00158                                       {
00159   // Return zero-corrected error
00160   Float_t zcerr = fNumEntries * fError * fError;
00161   zcerr+= (1.-fNumEntries/fNumTriggers) * fMean * fMean;
00162   zcerr = sqrt(fNumEntries*zcerr)/fNumTriggers;
00163   return zcerr;
00164 }

Float_t PulserDriftPin::ZCMean (  )  const

Definition at line 152 of file PulserDriftPin.cxx.

References fMean, fNumEntries, and fNumTriggers.

Referenced by PulserDriftCalScheme::GetDriftPinDiodeValue().

00152                                      {
00153   // Return zero-corrected mean
00154   Float_t zcmean = fMean * fNumEntries / fNumTriggers;
00155   return zcmean;
00156 }


Member Data Documentation

Definition at line 70 of file PulserDriftPin.h.

Referenced by Fill(), GetAggregateNo(), New(), PulserDriftPin(), and Store().

Float_t PulserDriftPin::fError [private]

Definition at line 73 of file PulserDriftPin.h.

Referenced by Fill(), GetError(), New(), PulserDriftPin(), Store(), and ZCError().

Float_t PulserDriftPin::fMean [private]

Definition at line 72 of file PulserDriftPin.h.

Referenced by Fill(), GetMean(), New(), PulserDriftPin(), Store(), ZCError(), and ZCMean().

Float_t PulserDriftPin::fNumEntries [private]

Definition at line 74 of file PulserDriftPin.h.

Referenced by Fill(), GetNumEntries(), New(), PulserDriftPin(), Store(), ZCError(), and ZCMean().

Float_t PulserDriftPin::fNumTriggers [private]

Definition at line 75 of file PulserDriftPin.h.

Referenced by Fill(), GetNumTriggers(), New(), PulserDriftPin(), Store(), ZCError(), and ZCMean().

Definition at line 71 of file PulserDriftPin.h.

Referenced by Fill(), GetIndex(), GetPinDiodeId(), GetStripEnd(), New(), 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