ROOT logo
//*-- AUTHOR   : Ilse Koenig
//*-- Created  : 09/09/2004 by Ilse Koenig
//*-- Modified : 21/03/2005 by Ilse Koenig

//_HADES_CLASS_DESCRIPTION 
//////////////////////////////////////////////////////////////////////////////
//
// HOraSlowChanRaw
//
// Class for the raw data for a non-waveform slowcontrol channel
//
//////////////////////////////////////////////////////////////////////////////

#include "horaslowchanraw.h"
#include "TDatime.h"

ClassImp(HOraSlowChanRaw)

HOraSlowChanRaw::HOraSlowChanRaw() {
  // Default constructor
  nanoSeconds=0;
  value=0.;
  status=0;
}

void HOraSlowChanRaw::fill(const Char_t* t,Int_t nano,Double_t val,Int_t stat) {
  // Fills the timestamp, the nanoseconds, the value and the status
  // (channel data type float)
  timestamp=t;
  nanoSeconds=nano;
  value=val;
  status=stat;
}

void HOraSlowChanRaw::fill(const Char_t* t,Int_t nano,Int_t val,Int_t stat) {
  // Fills the timestamp, the nanoseconds, the value and the status 
  // (channel data type int)
  timestamp=t;
  nanoSeconds=nano;
  value=(Double_t)val;
  status=stat;
}

Int_t HOraSlowChanRaw::getTimeDiff(const Char_t* t) {
  // Returns the time difference (in seconds) relative to time t
  TDatime t1(t);
  TDatime t2(timestamp);
  return (t2.Convert()-t1.Convert());  
}

void HOraSlowChanRaw::print(Int_t valPrec) {
  // Prints the data to stdout with data precision valPrec
  cout.setf(ios::fixed,ios::floatfield);
  cout.setf(ios::right,ios::adjustfield);
  cout<<timestamp<<"  "<<nanoSeconds<<"  "
      <<setprecision(valPrec)<<setw(valPrec+10)<<value
      <<"  "<<status<<'\n';
}

void HOraSlowChanRaw::write(fstream& fout,Int_t valPrec) {
  // Streams the data with data precision valPrec
  fout.setf(ios::fixed,ios::floatfield);
  fout.setf(ios::right,ios::adjustfield);
  fout<<timestamp<<"  "<<nanoSeconds<<"  "
      <<setprecision(valPrec)<<setw(valPrec+10)<<value
      <<setw(3)<<status<<'\n';
}

 horaslowchanraw.cc:1
 horaslowchanraw.cc:2
 horaslowchanraw.cc:3
 horaslowchanraw.cc:4
 horaslowchanraw.cc:5
 horaslowchanraw.cc:6
 horaslowchanraw.cc:7
 horaslowchanraw.cc:8
 horaslowchanraw.cc:9
 horaslowchanraw.cc:10
 horaslowchanraw.cc:11
 horaslowchanraw.cc:12
 horaslowchanraw.cc:13
 horaslowchanraw.cc:14
 horaslowchanraw.cc:15
 horaslowchanraw.cc:16
 horaslowchanraw.cc:17
 horaslowchanraw.cc:18
 horaslowchanraw.cc:19
 horaslowchanraw.cc:20
 horaslowchanraw.cc:21
 horaslowchanraw.cc:22
 horaslowchanraw.cc:23
 horaslowchanraw.cc:24
 horaslowchanraw.cc:25
 horaslowchanraw.cc:26
 horaslowchanraw.cc:27
 horaslowchanraw.cc:28
 horaslowchanraw.cc:29
 horaslowchanraw.cc:30
 horaslowchanraw.cc:31
 horaslowchanraw.cc:32
 horaslowchanraw.cc:33
 horaslowchanraw.cc:34
 horaslowchanraw.cc:35
 horaslowchanraw.cc:36
 horaslowchanraw.cc:37
 horaslowchanraw.cc:38
 horaslowchanraw.cc:39
 horaslowchanraw.cc:40
 horaslowchanraw.cc:41
 horaslowchanraw.cc:42
 horaslowchanraw.cc:43
 horaslowchanraw.cc:44
 horaslowchanraw.cc:45
 horaslowchanraw.cc:46
 horaslowchanraw.cc:47
 horaslowchanraw.cc:48
 horaslowchanraw.cc:49
 horaslowchanraw.cc:50
 horaslowchanraw.cc:51
 horaslowchanraw.cc:52
 horaslowchanraw.cc:53
 horaslowchanraw.cc:54
 horaslowchanraw.cc:55
 horaslowchanraw.cc:56
 horaslowchanraw.cc:57
 horaslowchanraw.cc:58
 horaslowchanraw.cc:59
 horaslowchanraw.cc:60
 horaslowchanraw.cc:61
 horaslowchanraw.cc:62
 horaslowchanraw.cc:63
 horaslowchanraw.cc:64
 horaslowchanraw.cc:65
 horaslowchanraw.cc:66
 horaslowchanraw.cc:67
 horaslowchanraw.cc:68