Project
Loading...
Searching...
No Matches
test_ctf_io_tof.cxx File Reference
#include <cassert>
#include <boost/test/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/dataset.hpp>
#include "DataFormatsTOF/CTF.h"
#include "TOFBase/Geo.h"
#include "TOFBase/Digit.h"
#include "CommonUtils/NameConf.h"
#include "TOFReconstruction/CTFCoder.h"
#include "Framework/Logger.h"
#include <TFile.h>
#include <TRandom.h>
#include <TStopwatch.h>
#include <cstring>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   Test TOFCTFIO
 
#define BOOST_TEST_MAIN
 
#define BOOST_TEST_DYN_LINK
 

Functions

sw Start ()
 
 for (int irof=0;irof< 100;irof++)
 
sw Stop ()
 
 LOG (info)<< "Generated "<< digits.size()<< " in "<< rows.size()<< " ROFs in "<< sw.CpuTime()<< " s"
 
coder setANSVersion (ansVersion)
 
coder encode (vec, rows, digits, pattVec)
 
TFile flOut ("test_ctf_tof.root", "recreate")
 
TTree ctfTree (std::string(o2::base::NameConf::CTFTREENAME).c_str(), "O2 CTF tree")
 
ctfImage print ()
 
ctfImage appendToTree (ctfTree, "TOF")
 
ctfTree Write ()
 
vec clear ()
 
TFile flIn ("test_ctf_tof.root")
 
std::unique_ptr< TTree > tree ((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))
 
 BOOST_CHECK (tree)
 
coder decode (ctfImage, rowsD, digitsD, pattVecD)
 
 BOOST_CHECK (rows.size()==rowsD.size())
 
 BOOST_CHECK (digits.size()==digitsD.size())
 
 BOOST_CHECK (pattVec.size()==pattVecD.size())
 

Variables

std::vector< o2::ctf::ANSHeaderANSVersions {o2::ctf::ANSVersionCompat, o2::ctf::ANSVersion1}
 
std::vector< ReadoutWindowDatarows
 
std::vector< uint8_t > pattVec
 
TStopwatch sw
 
std::vector< introw
 
std::vector< intcol
 
std::vector< o2::ctf::BufferTypevec
 
auto * ctfImage = CTF::get(vec.data())
 
std::vector< DigitdigitsD
 
std::vector< ReadoutWindowDatarowsD
 
std::vector< uint8_t > pattVecD
 
int npatt = ctfImage.getHeader().nPatternBytes
 

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 14 of file test_ctf_io_tof.cxx.

◆ BOOST_TEST_MAIN

#define BOOST_TEST_MAIN

Definition at line 13 of file test_ctf_io_tof.cxx.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Test TOFCTFIO

Definition at line 12 of file test_ctf_io_tof.cxx.

Function Documentation

◆ appendToTree()

ctfImage appendToTree ( ctfTree  ,
"TOF"   
)

◆ BOOST_CHECK() [1/4]

BOOST_CHECK ( digits.  size() = =digitsD.size())

◆ BOOST_CHECK() [2/4]

BOOST_CHECK ( pattVec.  size() = =pattVecD.size())

◆ BOOST_CHECK() [3/4]

BOOST_CHECK ( rows.  size() = =rowsD.size())

◆ BOOST_CHECK() [4/4]

BOOST_CHECK ( tree  )

◆ clear()

vec clear ( )

◆ ctfTree()

TTree ctfTree ( std::string(o2::base::NameConf::CTFTREENAME).c_str()  ,
"O2 CTF tree"   
)

◆ decode()

coder decode ( ctfImage  ,
rowsD  ,
digitsD  ,
pattVecD   
)

◆ encode()

coder encode ( vec  ,
rows  ,
digits  ,
pattVec   
)

◆ flIn()

TFile flIn ( "test_ctf_tof.root"  )

◆ flOut()

TFile flOut ( "test_ctf_tof.root"  ,
"recreate"   
)

◆ for()

for ( )

Definition at line 48 of file test_ctf_io_tof.cxx.

◆ LOG()

LOG ( info  )

◆ print()

ctfImage print ( )

◆ setANSVersion()

coder setANSVersion ( ansVersion  )

◆ Start()

sw Start ( )

◆ Stop()

sw Stop ( )

◆ tree()

std::unique_ptr< TTree > tree ( (TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str())  )

◆ Write()

ctfTree Write ( )

Variable Documentation

◆ ANSVersions

Definition at line 36 of file test_ctf_io_tof.cxx.

◆ col

std::vector<int> col

Definition at line 47 of file test_ctf_io_tof.cxx.

◆ ctfImage

const auto ctfImage = CTF::get(vec.data())

Definition at line 109 of file test_ctf_io_tof.cxx.

◆ digitsD

std::vector<Digit> digitsD

Definition at line 129 of file test_ctf_io_tof.cxx.

◆ npatt

int npatt = ctfImage.getHeader().nPatternBytes

Definition at line 150 of file test_ctf_io_tof.cxx.

◆ pattVec

std::vector<uint8_t> pattVec

Definition at line 43 of file test_ctf_io_tof.cxx.

◆ pattVecD

std::vector<uint8_t> pattVecD

Definition at line 131 of file test_ctf_io_tof.cxx.

◆ row

std::vector<int> row

Definition at line 47 of file test_ctf_io_tof.cxx.

◆ rows

std::vector<ReadoutWindowData> rows
Initial value:
{
std::vector<Digit> digits
std::vector< Digit > digits

Definition at line 42 of file test_ctf_io_tof.cxx.

◆ rowsD

std::vector<ReadoutWindowData> rowsD

Definition at line 130 of file test_ctf_io_tof.cxx.

◆ sw

TStopwatch sw

Definition at line 45 of file test_ctf_io_tof.cxx.

◆ vec

std::vector<o2::ctf::BufferType> vec

Definition at line 95 of file test_ctf_io_tof.cxx.