Public Member Functions | Private Member Functions | Private Attributes | List of all members
daqdataformats::NanoSliceVersionConvention Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-10-23/DAQDataFormats/cxx/include/NanoSliceVersionConvention.h"

Public Member Functions

 NanoSliceVersionConvention ()
 
 ~NanoSliceVersionConvention ()
 
std::ostream & print (std::ostream &os=std::cout) const
 
Encode_Type getEncodeType (const version_t ver) const
 Get the encoding type. More...
 
uint32_t getNSamples (const version_t ver) const
 Get the number of samples. More...
 
uint32_t getNPretriggeredSamples (const version_t ver) const
 Get number of pretriggered samples. More...
 

Private Member Functions

bool setup ()
 
bool checkVersion (const version_t ver, const bool throw_exception=true) const
 

Private Attributes

std::vector< FEBVersioningRegisters_versionRegisters
 

Detailed Description

Definition at line 102 of file NanoSliceVersionConvention.h.

Constructor & Destructor Documentation

daqdataformats::NanoSliceVersionConvention::NanoSliceVersionConvention ( )
inline
daqdataformats::NanoSliceVersionConvention::~NanoSliceVersionConvention ( )
inline

Definition at line 106 of file NanoSliceVersionConvention.h.

106 {}

Member Function Documentation

bool daqdataformats::NanoSliceVersionConvention::checkVersion ( const version_t  ver,
const bool  throw_exception = true 
) const
inlineprivate

Check the version of nanoslice If it's wrong, throw an exception

See if it's an allowed version

Definition at line 166 of file NanoSliceVersionConvention.h.

References daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, and GENERATE_DATAFORMAT_EXCEPTION.

167  {
168 
169  /// See if it's an allowed version
171  || ver == 1
172  || ver >= (int)_versionRegisters.size()
173  || ver < 0
174  ){
175 
176  if(throw_exception){
177 #ifndef DARWINBUILD
178  // GENERATE_DATAFORMAT_EXCEPTION("NanoSlice Version " + boost::lexical_cast<std::string>(ver) + " is not allowed");
179 #else
180  GENERATE_DATAFORMAT_EXCEPTION("NanoSlice Version is not allowed");
181 #endif
182  }
183  return false;
184  }// end of checking the version
185 
186  return true;
187  }
std::vector< FEBVersioningRegisters > _versionRegisters
#define GENERATE_DATAFORMAT_EXCEPTION(msg)
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
Encode_Type daqdataformats::NanoSliceVersionConvention::getEncodeType ( const version_t  ver) const
inline
uint32_t daqdataformats::NanoSliceVersionConvention::getNPretriggeredSamples ( const version_t  ver) const
inline
uint32_t daqdataformats::NanoSliceVersionConvention::getNSamples ( const version_t  ver) const
inline
std::ostream& daqdataformats::NanoSliceVersionConvention::print ( std::ostream &  os = std::cout) const
inline

Definition at line 108 of file NanoSliceVersionConvention.h.

References MECModelEnuComparisons::i.

109  {
110 
111  const int nversions = _versionRegisters.size();
112  os<<"Total Number of versions="<<nversions<<"\n";
113 
114 
115  for(int i=0; i<nversions; ++i){
116  os<<"Version "<<i<<":";
117  try{
118  if(checkVersion(i, false)){
119  _versionRegisters[i].print(os);
120  }
121  else{os<<"NOT ALLOWED\n";}
122  }
123  catch(...){
124  os<<"NOT ALLOWED\n";
125  }
126 
127  }
128 
129  return os;
130  }
std::vector< FEBVersioningRegisters > _versionRegisters
bool checkVersion(const version_t ver, const bool throw_exception=true) const
bool daqdataformats::NanoSliceVersionConvention::setup ( )
inlineprivate

Definition at line 153 of file NanoSliceVersionConvention.h.

References daqdataformats::DCSENCODE_12_in_16, daqdataformats::FEBVersioningRegisters::FEBVersioningRegisters(), and daqdataformats::RAWENCODE_12_in_16.

154  {
155  _versionRegisters.push_back(FEBVersioningRegisters(DCSENCODE_12_in_16, 1, 0));
156  _versionRegisters.push_back(FEBVersioningRegisters(DCSENCODE_12_in_16, 0, 0));
157  _versionRegisters.push_back(FEBVersioningRegisters(RAWENCODE_12_in_16, 8, 3));
158  _versionRegisters.push_back(FEBVersioningRegisters(RAWENCODE_12_in_16, 4, 3));
159  _versionRegisters.push_back(FEBVersioningRegisters(RAWENCODE_12_in_16, 14, 0));
160  _versionRegisters.push_back(FEBVersioningRegisters(RAWENCODE_12_in_16, 20, 0));
161  return true;
162  }
std::vector< FEBVersioningRegisters > _versionRegisters

Member Data Documentation

std::vector<FEBVersioningRegisters> daqdataformats::NanoSliceVersionConvention::_versionRegisters
private

Definition at line 190 of file NanoSliceVersionConvention.h.


The documentation for this class was generated from the following file: