DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
conversions-impl.hh File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 DEFINE_CONVERSION_CLASS (pass,(public:void init(unordered_map< std::string, std::string > params) {(void) params;data_size=sizeof(uint32_t);data_description="i";} void Convert(uint32_t src, void *dest) { uint32_t *val=(uint32_t *) dest;*val=src;})) DEFINE_CONVERSION_CLASS(linear
 
void init (unordered_map< std::string, std::string > params)
 
void Convert (uint32_t src, void *dest)
 

Variables

double scale
 
double offset
 

Function Documentation

◆ Convert()

void Convert ( uint32_t src,
void * dest )

Definition at line 38 of file conversions-impl.hh.

38 {
39 double *val = (double *)dest;
40 *val = ((double)src) * scale + offset;
41 }
double offset
double scale

◆ DEFINE_CONVERSION_CLASS()

DEFINE_CONVERSION_CLASS ( pass ,
(public: void init(unordered_map< std::string, std::string > params) {(void) params; data_size=sizeof(uint32_t); data_description="i"; } void Convert(uint32_t src, void *dest) { uint32_t *val=(uint32_t *) dest; *val=src; })  )

◆ init()

void init ( unordered_map< std::string, std::string > params)

Definition at line 30 of file conversions-impl.hh.

30 {
31 data_size = sizeof(double);
32 data_description = "d";
33 std::string scale_str = params["scale"];
34 std::string offset_str = params["offset"];
35 sscanf(scale_str.c_str(), "%le", &scale);
36 sscanf(offset_str.c_str(), "%le", &offset);
37 };

Variable Documentation

◆ offset

double offset

Definition at line 28 of file conversions-impl.hh.

◆ scale

double scale

Definition at line 27 of file conversions-impl.hh.