FACT++  1.0
int StateMachineSmartFACT::HandleBiasVoltage ( const EventImp d)
inlineprivate

Definition at line 1394 of file smartfact.cc.

References StateMachineSmartFACT::Statistics::avg, EventImp::GetJavaDate(), PixelMapEntry::group(), PixelMap::hv(), PixelMapEntry::hw(), i, BIAS::State::kRamping, BIAS::State::kVoltageOn, HTML::kWhite, StateMachineSmartFACT::Statistics::max, StateMachineSmartFACT::Statistics::med, StateMachineSmartFACT::Statistics::min, EventImp::Ptr(), and DimState::state().

Referenced by StateMachineSmartFACT().

1395  {
1396  if (!CheckDataSize(d, "BiasControl:Voltage", 1664))
1397  {
1398  fBiasControlVoltageVec.clear();
1399  return GetCurrentState();
1400  }
1401 
1402  fBiasControlVoltageVec.assign(d.Ptr<float>(), d.Ptr<float>()+320);
1403 
1404  const Statistics stat(fBiasControlVoltageVec);
1405 
1406  fBiasControlVoltageMed = stat.med;
1407 
1408  vector<float> val(320, 0);
1409  for (int i=0; i<320; i++)
1410  {
1411  const int idx = (fPixelMap.hv(i).hw()/9)*2+fPixelMap.hv(i).group();
1412  val[idx] = fBiasControlVoltageVec[i];
1413  }
1414 
1416  WriteCam(d, "cam-biascontrol-voltage", val, 10, 65);
1417  else
1418  WriteCam(d, "cam-biascontrol-voltage", val, 75);
1419 
1420  ostringstream out;
1421  out << setprecision(3);
1422  out << d.GetJavaDate() << '\n';
1423  out << HTML::kWhite << '\t' << stat.min << '\n';
1424  out << HTML::kWhite << '\t' << stat.med << '\n';
1425  out << HTML::kWhite << '\t' << stat.avg << '\n';
1426  out << HTML::kWhite << '\t' << stat.max << '\n';
1427  ofstream(fPath+"/voltage.data") << out.str();
1428 
1429  return GetCurrentState();
1430  }
int GetCurrentState() const
return the current state of the machine
bool CheckDataSize(const EventImp &d, const char *name, size_t size, bool min=false)
Definition: smartfact.cc:669
int i
Definition: db_dim_client.c:21
int group() const
Definition: PixelMap.h:40
const int32_t & state() const
Definition: DimState.h:80
vector< float > fBiasControlVoltageVec
Definition: smartfact.cc:545
static const string kWhite
Definition: smartfact.cc:74
uint64_t GetJavaDate() const
Definition: EventImp.cc:303
DimDescribedState fDimBiasControl
Definition: smartfact.cc:634
int hw() const
Definition: PixelMap.h:39
void WriteCam(const EventImp &d, const string &fname, const T &t, double scale, double offset=0)
Definition: smartfact.cc:758
const T * Ptr(size_t offset=0) const
Definition: EventImp.h:74
const PixelMapEntry & hv(int board, int channel) const
Definition: PixelMap.h:139

+ Here is the call graph for this function:

+ Here is the caller graph for this function: