Project
Loading...
Searching...
No Matches
testClosureCoDec.cxx File Reference
#include "MCHRawElecMap/Mapper.h"
#include "MCHRawEncoderPayload/DataBlock.h"
#include <boost/test/unit_test.hpp>
#include <boost/property_tree/ptree.hpp>
#include "DetectorsRaw/HBFUtils.h"
#include "DetectorsRaw/RawFileWriter.h"
#include "Framework/Logger.h"
#include "MCHRawCommon/DataFormats.h"
#include "MCHRawDecoder/PageDecoder.h"
#include "MCHRawEncoderPayload/PayloadEncoder.h"
#include "MCHRawEncoderPayload/PayloadPaginator.h"
#include <boost/mpl/list.hpp>
#include <fmt/format.h>
#include <iostream>

Go to the source code of this file.

Classes

struct  BareGen
 
struct  UserLogicGen
 
struct  UserLogicGen1
 
struct  BareDummy
 
struct  UserLogicDummy
 
struct  UserLogicDummy1
 

Macros

#define BOOST_TEST_MODULE   Test MCHRaw Closure
 
#define BOOST_TEST_MAIN
 
#define BOOST_TEST_DYN_LINK
 

Typedefs

typedef boost::mpl::list< BareGen, UserLogicGen, UserLogicGen1, BareDummy, UserLogicDummy, UserLogicDummy1testTypes
 

Functions

template<typename ELECMAP , typename FORMAT , typename CHARGESUM , int VERSION>
std::vector< std::byte > paginate (gsl::span< const std::byte > buffer, const std::string &tmpbasename)
 
std::vector< SampaClustergetSampaClusters (const std::string &d)
 
std::set< DsElecIdgetDs (gsl::span< std::string > data)
 
template<typename ELECMAP , typename FORMAT , typename CHARGESUM , int VERSION>
std::vector< std::byte > createBuffer (gsl::span< std::string > data, uint32_t orbit=12345, uint16_t bc=678)
 
SampaChannelHandler handlePacketStoreAsVec (std::vector< std::string > &result)
 
template<typename ELECMAP >
bool testDecode (gsl::span< const std::byte > testBuffer, gsl::span< std::string > expected)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (ClosureChargeSum, T, testTypes)
 
 BOOST_AUTO_TEST_CASE_TEMPLATE (ClosureSample, T, testTypes)
 

Variables

std::vector< std::stringchargeSumInput
 
std::vector< std::stringsampleInput
 
constexpr const charsampaClusterFormat = "{}-CH{}-{}"
 

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 16 of file testClosureCoDec.cxx.

◆ BOOST_TEST_MAIN

#define BOOST_TEST_MAIN

Definition at line 15 of file testClosureCoDec.cxx.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Test MCHRaw Closure

Definition at line 14 of file testClosureCoDec.cxx.

Typedef Documentation

◆ testTypes

Definition at line 283 of file testClosureCoDec.cxx.

Function Documentation

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [1/2]

BOOST_AUTO_TEST_CASE_TEMPLATE ( ClosureChargeSum  ,
,
testTypes   
)

Definition at line 285 of file testClosureCoDec.cxx.

◆ BOOST_AUTO_TEST_CASE_TEMPLATE() [2/2]

BOOST_AUTO_TEST_CASE_TEMPLATE ( ClosureSample  ,
,
testTypes   
)

Definition at line 294 of file testClosureCoDec.cxx.

◆ createBuffer()

template<typename ELECMAP , typename FORMAT , typename CHARGESUM , int VERSION>
std::vector< std::byte > createBuffer ( gsl::span< std::string data,
uint32_t  orbit = 12345,
uint16_t  bc = 678 
)

Definition at line 168 of file testClosureCoDec.cxx.

◆ getDs()

std::set< DsElecId > getDs ( gsl::span< std::string data)

Definition at line 144 of file testClosureCoDec.cxx.

◆ getSampaClusters()

std::vector< SampaCluster > getSampaClusters ( const std::string d)

Definition at line 115 of file testClosureCoDec.cxx.

◆ handlePacketStoreAsVec()

SampaChannelHandler handlePacketStoreAsVec ( std::vector< std::string > &  result)

Definition at line 207 of file testClosureCoDec.cxx.

◆ paginate()

template<typename ELECMAP , typename FORMAT , typename CHARGESUM , int VERSION>
std::vector< std::byte > paginate ( gsl::span< const std::byte >  buffer,
const std::string tmpbasename 
)

Definition at line 68 of file testClosureCoDec.cxx.

◆ testDecode()

template<typename ELECMAP >
bool testDecode ( gsl::span< const std::byte >  testBuffer,
gsl::span< std::string expected 
)

Definition at line 216 of file testClosureCoDec.cxx.

Variable Documentation

◆ chargeSumInput

std::vector<std::string> chargeSumInput
Initial value:
= {
"S728-J1-DS0-CH3-ts-24-bc-0-cs-14-q-13",
"S728-J1-DS0-CH13-ts-24-bc-0-cs-134-q-133",
"S728-J1-DS0-CH23-ts-24-bc-0-cs-164-q-163",
"S361-J0-DS4-CH0-ts-24-bc-0-cs-11-q-10",
"S361-J0-DS4-CH1-ts-24-bc-0-cs-21-q-20",
"S361-J0-DS4-CH2-ts-24-bc-0-cs-31-q-30",
"S361-J0-DS4-CH3-ts-24-bc-0-cs-41-q-40",
"S448-J6-DS2-CH22-ts-24-bc-0-cs-421-q-420",
"S448-J6-DS2-CH23-ts-24-bc-0-cs-431-q-430",
"S448-J6-DS2-CH24-ts-24-bc-0-cs-441-q-440",
"S448-J6-DS2-CH25-ts-24-bc-0-cs-451-q-450",
"S448-J6-DS2-CH26-ts-24-bc-0-cs-461-q-460",
"S448-J6-DS2-CH42-ts-24-bc-0-cs-421-q-420"}

Definition at line 33 of file testClosureCoDec.cxx.

◆ sampaClusterFormat

constexpr const char* sampaClusterFormat = "{}-CH{}-{}"
constexpr

Definition at line 108 of file testClosureCoDec.cxx.

◆ sampleInput

std::vector<std::string> sampleInput
Initial value:
= {
"S728-J1-DS0-CH3-ts-24-bc-0-cs-3-q-13-15-17",
"S728-J1-DS0-CH13-ts-24-bc-0-cs-3-q-133-135-137",
"S728-J1-DS0-CH23-ts-24-bc-0-cs-2-q-163-165",
"S361-J0-DS4-CH0-ts-24-bc-0-cs-3-q-10-12-14",
"S361-J0-DS4-CH1-ts-24-bc-0-cs-3-q-20-22-24",
"S361-J0-DS4-CH2-ts-24-bc-0-cs-3-q-30-32-34",
"S361-J0-DS4-CH3-ts-24-bc-0-cs-3-q-40-42-44",
"S448-J6-DS2-CH22-ts-24-bc-0-cs-3-q-420-422-424",
"S448-J6-DS2-CH23-ts-24-bc-0-cs-3-q-430-432-434",
"S448-J6-DS2-CH24-ts-24-bc-0-cs-3-q-440-442-444",
"S448-J6-DS2-CH25-ts-24-bc-0-cs-3-q-450-452-454",
"S448-J6-DS2-CH26-ts-24-bc-0-cs-3-q-460-462-464",
"S448-J6-DS2-CH42-ts-24-bc-0-cs-5-q-420-422-424-426-428"}

Definition at line 50 of file testClosureCoDec.cxx.