#include <Swic.h>
Inheritance diagram for Swic:

Public Member Functions | |
| Swic () | |
| Create a swic with file of pedistals to subtract. | |
| virtual | ~Swic () |
| bool | SetPeds (const std::vector< double > &peds) |
| bool | SetMask (const std::vector< double > &peds) |
| void | SetScale (double scale=1.0) |
| bool | SetAcnetDevice (const AcnetDevice &ad) |
| void | SetMvPerADC (double mvperadc=-0.30518) |
| Set mV/ADC conversion. | |
| double | GetVoltage (int index) const |
| int | GetRawADC (int index) const |
| double | GetIntegralVoltage () const |
| Get total voltage. | |
| int | GetIntegralADC () const |
| Get total raw ADC counts. | |
| double | GetVmeTimestamp () const |
| Access timing info - return 0 if it hasn't been set. | |
| int | GetVmeSeconds () const |
| int | GetVmeNanosecs () const |
Static Public Attributes | |
| const int | WIRE_DATA_START = 104 |
| const int | WIRE_DATA_LENGTH = 96 |
| const int | VME_TIMESTAMP_START = 205 |
| const double | UNSCALE_FACTOR = 3276.7001 |
Protected Member Functions | |
| virtual void | NewData () |
| virtual bool | VisitAcnetDevice (const AcnetDevice &) |
Private Attributes | |
| std::vector< double > | fPeds |
| std::vector< double > | fMask |
| std::vector< int > | fData |
| double | fMvPerADC |
| double | fScale |
| int | fVmeSec |
| int | fVmeNsec |
|
|
Create a swic with file of pedistals to subtract.
Definition at line 12 of file Swic.cxx. References SetMvPerADC(), and SetScale(). 00013 : fPeds(WIRE_DATA_LENGTH,0) 00014 , fMask(WIRE_DATA_LENGTH,1) 00015 , fData(WIRE_DATA_LENGTH,0) 00016 , fVmeSec(0), fVmeNsec(0) 00017 { 00018 this->SetMvPerADC(); 00019 this->SetScale(); 00020 }
|
|
|
Definition at line 21 of file Swic.cxx. 00021 {}
|
|
|
Get total raw ADC counts.
Definition at line 99 of file Swic.cxx. References GetRawADC(). 00100 {
00101 int ret=0;
00102 for (int ind=0; ind<WIRE_DATA_LENGTH; ++ind)
00103 ret += this->GetRawADC(ind);
00104 return ret;
00105 }
|
|
|
Get total voltage.
Definition at line 92 of file Swic.cxx. References GetVoltage(). 00093 {
00094 double ret=0;
00095 for (int ind=0; ind<WIRE_DATA_LENGTH; ++ind)
00096 ret += this->GetVoltage(ind);
00097 return ret;
00098 }
|
|
|
Get the raw unscaled channel dtata by the index into the 96 element data block chunk, count from zero - 95. Definition at line 88 of file Swic.cxx. References fData. Referenced by GetIntegralADC(). 00089 {
00090 return fData[offset];
00091 }
|
|
|
Definition at line 77 of file Swic.h. 00077 { return fVmeNsec; }
|
|
|
Definition at line 76 of file Swic.h. Referenced by ProtonDist::Fill(). 00076 { return fVmeSec; }
|
|
|
Access timing info - return 0 if it hasn't been set.
Definition at line 75 of file Swic.h. Referenced by DeltaT::Fill(), Pedestals::GeneratePeds(), and pedmaker().
|
|
|
Get the mV by index into the 96 element data block chunk, count from zero - 95. Definition at line 84 of file Swic.cxx. References fData, fMask, fMvPerADC, fPeds, and fScale. Referenced by ProtonDist::Fill(), fill_profile(), Pedestals::GeneratePeds(), GetIntegralVoltage(), ProfMon::GetStats(), HadMon::GetStats(), and pedmaker().
|
|
|
Definition at line 24 of file Swic.h. 00024 {}
|
|
|
Set the data by giving an AcnetDevice which is a Swic. Returns false if the AcnetDevice doesn't seem to be a Swic or, if called through a sub class, any of the protected unpackers fail. Definition at line 29 of file Swic.cxx. References AcnetDevice::data, fData, fVmeNsec, fVmeSec, AcnetDevice::name, AcnetDevice::ndata, unscale(), VisitAcnetDevice(), and VME_TIMESTAMP_START. Referenced by book_and_fill(), ProtonDist::Fill(), DeltaT::Fill(), Pedestals::GeneratePeds(), and pedmaker(). 00030 {
00031 if (ad.ndata != 216) {
00032 cerr << "Swic::SetAcnetDevice: warning wrong number of data for "
00033 << ad.name << " 216 != " << ad.ndata << endl;
00034 return false;
00035 }
00036
00037 double tot = 0;
00038 for (int ind=0; ind < WIRE_DATA_LENGTH; ++ind) {
00039 int off = ind + WIRE_DATA_START;
00040 fData[ind] = unscale(ad.data[off]);
00041 tot += fData[ind];
00042 }
00043 if (tot == 0.0) {
00044 //cerr << "Swic::SetAcnetDevice: warning zero total data for "
00045 // << ad.name << endl;
00046 return false;
00047 }
00048
00049 int i1 = unscale(ad.data[VME_TIMESTAMP_START+0]);
00050 int i2 = unscale(ad.data[VME_TIMESTAMP_START+1]);
00051 fVmeSec = (i1<<16)+(i2&0xffff);
00052
00053 int i3 = unscale(ad.data[VME_TIMESTAMP_START+2]);
00054 int i4 = unscale(ad.data[VME_TIMESTAMP_START+3]);
00055 fVmeNsec = (i3<<16)+(i4&0xffff);
00056
00057 return this->VisitAcnetDevice(ad);
00058 }
|
|
|
Set channel mask to be multiplied from wire data. Return false if not given right size vector Definition at line 67 of file Swic.cxx. References fMask. Referenced by ProtonDist::Fill(). 00068 {
00069 int siz = mask.size();
00070 if (siz != WIRE_DATA_LENGTH) return false;
00071 fMask = mask;
00072 return true;
00073 }
|
|
|
Set mV/ADC conversion.
Definition at line 79 of file Swic.cxx. References fMvPerADC. Referenced by pedmaker(), and Swic(). 00080 {
00081 fMvPerADC = mvperadc;
00082 }
|
|
|
Set Pedestals to be subtracted from wire data. Return false if not given right size vector Definition at line 60 of file Swic.cxx. References fPeds. Referenced by book_and_fill(), and ProtonDist::Fill(). 00061 {
00062 int siz = peds.size();
00063 if (siz != WIRE_DATA_LENGTH) return false;
00064 fPeds = peds;
00065 return true;
00066 }
|
|
|
Set overall scale (eg to track a torroid). This is multiplied to the pedestal subtracted data Definition at line 75 of file Swic.cxx. References fScale. Referenced by make_plots(), and Swic(). 00076 {
00077 fScale = scale;
00078 }
|
|
|
Definition at line 26 of file Swic.h. Referenced by SetAcnetDevice(). 00026 { return true; }
|
|
|
Definition at line 16 of file Swic.h. Referenced by GetRawADC(), GetVoltage(), and SetAcnetDevice(). |
|
|
Definition at line 15 of file Swic.h. Referenced by GetVoltage(), and SetMask(). |
|
|
Definition at line 17 of file Swic.h. Referenced by GetVoltage(), and SetMvPerADC(). |
|
|
Definition at line 15 of file Swic.h. Referenced by GetVoltage(), and SetPeds(). |
|
|
Definition at line 17 of file Swic.h. Referenced by GetVoltage(), and SetScale(). |
|
|
Definition at line 18 of file Swic.h. Referenced by SetAcnetDevice(). |
|
|
Definition at line 18 of file Swic.h. Referenced by SetAcnetDevice(). |
|
|
|
|
|
Definition at line 6 of file Swic.cxx. Referenced by SetAcnetDevice(). |
|
|
|
|
|
|
1.3.9.1