Project
Loading...
Searching...
No Matches
test_ctf_io_hmpid.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 "HMPIDReconstruction/CTFCoder.h"
#include "DataFormatsHMP/CTF.h"
#include "Framework/Logger.h"
#include <TFile.h>
#include <TRandom.h>
#include <TStopwatch.h>
#include <TSystem.h>
#include <cstring>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   Test HMPIDCTFIO
 
#define BOOST_TEST_MAIN
 
#define BOOST_TEST_DYN_LINK
 

Functions

sw Start ()
 
 for (int irof=0;irof< 1000;irof++)
 
coder setANSVersion (ansVersion)
 
coder encode (vec, triggers, digits)
 
sw Stop ()
 
 LOG (info)<< "Compressed in "<< sw.CpuTime()<< " s"
 
TFile flOut ("test_ctf_hmpid.root", "recreate")
 
TTree ctfTree (std::string(o2::base::NameConf::CTFTREENAME).c_str(), "O2 CTF tree")
 
ctfImage print ()
 
ctfImage appendToTree (ctfTree, "HMP")
 
ctfTree Write ()
 
vec clear ()
 
TFile flIn ("test_ctf_hmpid.root")
 
std::unique_ptr< TTree > tree ((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))
 
 BOOST_CHECK (tree)
 
coder decode (ctfImage, triggersD, digitsD)
 
 BOOST_CHECK (triggersD.size()==triggers.size())
 
 BOOST_CHECK (digitsD.size()==digits.size())
 
 BOOST_TEST (triggersD==triggers, boost::test_tools::per_element())
 
 BOOST_TEST (digitsD==digits, boost::test_tools::per_element())
 

Variables

std::vector< o2::ctf::ANSHeaderANSVersions {o2::ctf::ANSVersionCompat, o2::ctf::ANSVersion1}
 
std::vector< Digitdigits
 
TStopwatch sw
 
o2::InteractionRecord ir (0, 0)
 
Digit clu
 
std::vector< o2::ctf::BufferTypevec
 
auto * ctfImage = o2::hmpid::CTF::get(vec.data())
 
std::vector< TriggertriggersD
 
std::vector< DigitdigitsD
 

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 14 of file test_ctf_io_hmpid.cxx.

◆ BOOST_TEST_MAIN

#define BOOST_TEST_MAIN

Definition at line 13 of file test_ctf_io_hmpid.cxx.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Test HMPIDCTFIO

Definition at line 12 of file test_ctf_io_hmpid.cxx.

Function Documentation

◆ appendToTree()

ctfImage appendToTree ( ctfTree  ,
"HMP"   
)

◆ BOOST_CHECK() [1/3]

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

◆ BOOST_CHECK() [2/3]

BOOST_CHECK ( tree  )

◆ BOOST_CHECK() [3/3]

BOOST_CHECK ( triggersD.  size() = =triggers.size())

◆ BOOST_TEST() [1/2]

BOOST_TEST ( digitsD  = =digits,
boost::test_tools::per_element()   
)

◆ BOOST_TEST() [2/2]

BOOST_TEST ( triggersD  = =triggers,
boost::test_tools::per_element()   
)

◆ clear()

vec clear ( )

◆ ctfTree()

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

◆ decode()

coder decode ( ctfImage  ,
triggersD  ,
digitsD   
)

◆ encode()

coder encode ( vec  ,
triggers  ,
digits   
)

◆ flIn()

TFile flIn ( "test_ctf_hmpid.root"  )

◆ flOut()

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

◆ for()

for ( )

Definition at line 45 of file test_ctf_io_hmpid.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 35 of file test_ctf_io_hmpid.cxx.

◆ clu

Digit clu

Definition at line 44 of file test_ctf_io_hmpid.cxx.

◆ ctfImage

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

Definition at line 74 of file test_ctf_io_hmpid.cxx.

◆ digits

std::vector<Digit> digits
Initial value:
{
std::vector<Trigger> triggers
Examples
/home/runner/work/AliceO2/AliceO2/Detectors/MUON/MCH/Calibration/include/MCHCalibration/PedestalData.h.

Definition at line 40 of file test_ctf_io_hmpid.cxx.

◆ digitsD

std::vector<Digit> digitsD

Definition at line 98 of file test_ctf_io_hmpid.cxx.

◆ ir

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

◆ sw

TStopwatch sw

Definition at line 41 of file test_ctf_io_hmpid.cxx.

◆ triggersD

std::vector<Trigger> triggersD

Definition at line 97 of file test_ctf_io_hmpid.cxx.

◆ vec

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

Definition at line 62 of file test_ctf_io_hmpid.cxx.