1 #ifndef _ots_ROCStream_h_
2 #define _ots_ROCStream_h_
4 #include "otsdaq-components/DetectorConfiguration/ROCDACs.h"
5 #include "otsdaq-core/Macros/CoutMacros.h"
27 void setDetectorID (
const std::string& rocName ){theDetectorID_ = rocName;}
28 void setROCType (
const std::string& rocType ){theROCType_ = rocType;}
29 void setROCStatus (
bool rocStatus ){theROCStatus_ = rocStatus;}
30 void setFEWROCAddress(
unsigned int fecROCAddress ){theFEWROCAddress_ = fecROCAddress;}
31 void setROCDACs (
const ROCDACs& rocDACs ){theROCDACs_ = rocDACs;}
32 void addDAC (std::string name,
unsigned int address,
unsigned int value){theROCDACs_.setDAC(name,address,value);}
33 void setROCMask (
const std::string& rocMask );
34 void setROCTrimBits (
const std::string& rocTrimBits){theROCTrimBits_ = rocTrimBits;}
37 const std::string& getDetectorID (
void)
const {
return theDetectorID_;}
38 const std::string& getROCType (
void)
const {
return theROCType_;}
39 bool getROCStatus (
void)
const {
return theROCStatus_;}
40 unsigned int getFEWROCAddress(
void)
const {
return theFEWROCAddress_;}
41 const ROCDACs& getROCDACs (
void)
const {
return theROCDACs_;}
42 const std::string& getROCMask (
void)
const {
return theROCMask_;}
43 const std::string& getROCTrimBits (
void)
const {
return theROCTrimBits_;}
48 std::string theDetectorID_;
49 std::string theROCType_;
51 unsigned int theFEWROCAddress_;
53 std::string theROCMask_;
54 std::string theROCTrimBits_;
60 inline void ots::ROCStream::setROCMask(
const std::string& rocMask)
68 for(
unsigned int i=0; i<rocMask.length(); i++)
82 __SS__ <<
"Too many [ in bit mask configuration" << std::endl;
83 __COUT_ERR__ <<
"\n" << ss.str();
86 else if(rocMask[i] ==
']')
99 __SS__ <<
"Too many ] in bit mask configuration" << std::endl;
100 __COUT_ERR__ <<
"\n" << ss.str();
103 else if(rocMask[i] ==
'0' || rocMask[i] ==
'1')
104 theROCMask_ += rocMask[i];
108 #endif //ots_ROCStream_h