Project
Loading...
Searching...
No Matches
test_ctf_io_fdd.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 "CommonUtils/NameConf.h"
#include "FDDReconstruction/CTFCoder.h"
#include "FDDBase/Constants.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 FDDCTFIO
 
#define BOOST_TEST_MAIN
 
#define BOOST_TEST_DYN_LINK
 

Functions

sw Start ()
 
 for (int idig=0;idig< 1000;idig++)
 
 LOG (info)<< "Generated "<< channels.size()<< " channels in "<< digits.size()<< " digits "<< sw.CpuTime()<< " s"
 
coder setANSVersion (ansVersion)
 
coder encode (vec, digits, channels)
 
sw Stop ()
 
TFile flOut ("test_ctf_fdd.root", "recreate")
 
TTree ctfTree (std::string(o2::base::NameConf::CTFTREENAME).c_str(), "O2 CTF tree")
 
ctfImage print ()
 
ctfImage appendToTree (ctfTree, "FDD")
 
ctfTree Write ()
 
vec clear ()
 
TFile flIn ("test_ctf_fdd.root")
 
std::unique_ptr< TTree > tree ((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))
 
 BOOST_CHECK (tree)
 
coder decode (ctfImage, digitsD, channelsD)
 
 BOOST_CHECK (digitsD.size()==digits.size())
 
 BOOST_CHECK (channelsD.size()==channels.size())
 
 for (int i=digits.size();i--;)
 

Variables

std::vector< o2::ctf::ANSHeaderANSVersions {o2::ctf::ANSVersionCompat, o2::ctf::ANSVersion1}
 
std::vector< ChannelDatachannels
 
TStopwatch sw
 
o2::InteractionRecord ir (0, 0)
 
std::vector< o2::ctf::BufferTypevec
 
auto * ctfImage = o2::fdd::CTF::get(vec.data())
 
std::vector< DigitdigitsD
 
std::vector< ChannelDatachannelsD
 

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 14 of file test_ctf_io_fdd.cxx.

◆ BOOST_TEST_MAIN

#define BOOST_TEST_MAIN

Definition at line 13 of file test_ctf_io_fdd.cxx.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Test FDDCTFIO

Definition at line 12 of file test_ctf_io_fdd.cxx.

Function Documentation

◆ appendToTree()

ctfImage appendToTree ( ctfTree  ,
"FDD"   
)

◆ BOOST_CHECK() [1/3]

BOOST_CHECK ( channelsD.  size() = =channels.size())

◆ BOOST_CHECK() [2/3]

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

◆ BOOST_CHECK() [3/3]

BOOST_CHECK ( tree  )

◆ clear()

vec clear ( )

◆ ctfTree()

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

◆ decode()

coder decode ( ctfImage  ,
digitsD  ,
channelsD   
)

◆ encode()

coder encode ( vec  ,
digits  ,
channels   
)

◆ flIn()

TFile flIn ( "test_ctf_fdd.root"  )

◆ flOut()

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

◆ for() [1/2]

for ( int  i = digits.size(); i--;)

Definition at line 140 of file test_ctf_io_fdd.cxx.

◆ for() [2/2]

for ( )

Definition at line 44 of file test_ctf_io_fdd.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 34 of file test_ctf_io_fdd.cxx.

◆ channels

std::vector<ChannelData> channels
Initial value:
{
std::vector<Digit> digits
std::vector< Digit > digits

Definition at line 39 of file test_ctf_io_fdd.cxx.

◆ channelsD

std::vector<ChannelData> channelsD

Definition at line 125 of file test_ctf_io_fdd.cxx.

◆ ctfImage

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

Definition at line 104 of file test_ctf_io_fdd.cxx.

◆ digitsD

std::vector<Digit> digitsD

Definition at line 124 of file test_ctf_io_fdd.cxx.

◆ ir

o2::InteractionRecord ir(0, 0) ( ,
 
)

◆ sw

TStopwatch sw

Definition at line 40 of file test_ctf_io_fdd.cxx.

◆ vec

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

Definition at line 90 of file test_ctf_io_fdd.cxx.