![]() |
Project
|
#include <cassert>#include <boost/test/unit_test.hpp>#include <boost/test/data/test_case.hpp>#include <boost/test/data/dataset.hpp>#include "CommonUtils/NameConf.h"#include "CTPReconstruction/CTFCoder.h"#include "DataFormatsCTP/CTF.h"#include "DataFormatsCTP/Digits.h"#include "Framework/Logger.h"#include <TFile.h>#include <TStopwatch.h>#include <TSystem.h>#include <cstring>#include <random>Go to the source code of this file.
Macros | |
| #define | BOOST_TEST_MODULE Test CTPCTFIO |
| #define | BOOST_TEST_MAIN |
| #define | BOOST_TEST_DYN_LINK |
Functions | |
| sw | Start () |
| std::mt19937_64 | eng (rd()) |
| for (int itrg=0;itrg< 1000;itrg++) | |
| coder | setANSVersion (ansVersion) |
| coder | encode (vec, digits, lumi) |
| sw | Stop () |
| LOG (info)<< "Compressed in "<< sw.CpuTime()<< " s" | |
| TFile | flOut ("test_ctf_ctp.root", "recreate") |
| TTree | ctfTree (std::string(o2::base::NameConf::CTFTREENAME).c_str(), "O2 CTF tree") |
| ctfImage | print () |
| ctfImage | appendToTree (ctfTree, "CTP") |
| ctfTree | Write () |
| vec | clear () |
| TFile | flIn ("test_ctf_ctp.root") |
| std::unique_ptr< TTree > | tree ((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str())) |
| BOOST_CHECK (tree) | |
| coder | decode (ctfImage, digitsD, lumiD) |
| BOOST_TEST (digits==digitsD, boost::test_tools::per_element()) | |
| BOOST_CHECK (lumiD.orbit==lumi.orbit &&lumiD.nHBFCounted==lumi.nHBFCounted &&lumiD.orbit==lumi.orbit) | |
Variables | |
| std::vector< o2::ctf::ANSHeader > | ANSVersions {o2::ctf::ANSVersionCompat, o2::ctf::ANSVersion1} |
| TStopwatch | sw |
| o2::InteractionRecord | ir0 (3, 5) |
| o2::InteractionRecord | ir (ir0) |
| std::random_device | rd |
| std::uniform_int_distribution< unsigned long long > | distr |
| LumiInfo | lumi {digits.front().intRecord.orbit, 30, 12345} |
| std::vector< o2::ctf::BufferType > | vec |
| auto * | ctfImage = o2::ctp::CTF::get(vec.data()) |
| std::vector< CTPDigit > | digitsD |
| LumiInfo | lumiD |
| #define BOOST_TEST_DYN_LINK |
Definition at line 14 of file test_ctf_io_ctp.cxx.
| #define BOOST_TEST_MAIN |
Definition at line 13 of file test_ctf_io_ctp.cxx.
| #define BOOST_TEST_MODULE Test CTPCTFIO |
Definition at line 12 of file test_ctf_io_ctp.cxx.
| BOOST_CHECK | ( | lumiD. | orbit = =lumi.orbit &&lumiD.nHBFCounted==lumi.nHBFCounted &&lumiD.orbit==lumi.orbit | ) |
| BOOST_CHECK | ( | tree | ) |
| vec clear | ( | ) |
| TTree ctfTree | ( | std::string(o2::base::NameConf::CTFTREENAME).c_str() | , |
| "O2 CTF tree" | |||
| ) |
| std::mt19937_64 eng | ( | rd() | ) |
| TFile flIn | ( | "test_ctf_ctp.root" | ) |
| TFile flOut | ( | "test_ctf_ctp.root" | , |
| "recreate" | |||
| ) |
| for | ( | ) |
Definition at line 48 of file test_ctf_io_ctp.cxx.
| LOG | ( | info | ) |
| ctfImage print | ( | ) |
| coder setANSVersion | ( | ansVersion | ) |
| sw Start | ( | ) |
| sw Stop | ( | ) |
| std::unique_ptr< TTree > tree | ( | (TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()) | ) |
| ctfTree Write | ( | ) |
|
inline |
Definition at line 36 of file test_ctf_io_ctp.cxx.
| const auto ctfImage = o2::ctp::CTF::get(vec.data()) |
Definition at line 70 of file test_ctf_io_ctp.cxx.
| std::vector<CTPDigit> digitsD |
Definition at line 92 of file test_ctf_io_ctp.cxx.
Definition at line 47 of file test_ctf_io_ctp.cxx.
| o2::InteractionRecord ir(ir0) | ( | ir0 | ) |
| o2::InteractionRecord ir0(3, 5) | ( | 3 | , |
| 5 | |||
| ) |
| LumiInfo lumi {digits.front().intRecord.orbit, 30, 12345} |
Definition at line 55 of file test_ctf_io_ctp.cxx.
| LumiInfo lumiD |
Definition at line 93 of file test_ctf_io_ctp.cxx.
| std::random_device rd |
Definition at line 45 of file test_ctf_io_ctp.cxx.
| TStopwatch sw |
Definition at line 41 of file test_ctf_io_ctp.cxx.
| std::vector<o2::ctf::BufferType> vec |
Definition at line 58 of file test_ctf_io_ctp.cxx.