Project
Loading...
Searching...
No Matches
CTFCoder.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
18#include <TTree.h>
19
20using namespace o2::ctp;
22// Register encoded data in the tree (Fill is not called, will be done by caller)
23void CTFCoder::appendToTree(TTree& tree, CTF& ec)
24{
26}
27
29// extract and decode data from the tree
30void CTFCoder::readFromTree(TTree& tree, int entry, std::vector<CTPDigit>& data, LumiInfo& lumi)
31{
32 assert(entry >= 0 && entry < tree.GetEntries());
33 CTF ec;
35 decode(ec, data, lumi);
36}
37
39void CTFCoder::createCoders(const std::vector<char>& bufVec, o2::ctf::CTFCoderBase::OpType op)
40{
41 const auto ctf = CTF::getImage(bufVec.data());
42 // just to get types
43 int16_t bcInc = 0;
44 int32_t orbitInc = 0;
45 uint8_t bytesInput = 0, bytesClass = 0;
46#define MAKECODER(part, slot) createCoder(op, std::get<rans::RenormedDenseHistogram<decltype(part)>>(ctf.getDictionary<decltype(part)>(slot, mANSVersion)), int(slot))
47 // clang-format off
50 MAKECODER(bytesInput, CTF::BLC_bytesInput);
51 MAKECODER(bytesClass, CTF::BLC_bytesClass);
52 // clang-format on
53}
#define MAKECODER(part, slot)
class for entropy encoding/decoding of CTP data
uint32_t op
void readFromTree(TTree &tree, const std::string &name, int ev=0)
read from tree to non-flat object
static auto getImage(const void *newHead)
get const image of the container wrapper, with pointers in the image relocated to new head
size_t appendToTree(TTree &tree, const std::string &name) const
attach to tree
void createCoders(const std::vector< char > &bufVec, o2::ctf::CTFCoderBase::OpType op) final
Definition CTFCoder.cxx:39
o2::ctf::CTFIOSize decode(const CTF::base &ec, VTRG &data, LumiInfo &lumi)
entropy decode data from buffer with CTF
Definition CTFCoder.h:131
static constexpr const char * getName(ID id)
names of defined detectors
Definition DetID.h:145
GLuint entry
Definition glcorearb.h:5735
GLboolean * data
Definition glcorearb.h:298
wrapper for the Entropy-encoded trigger inputs and classes of the TF
Definition CTF.h:45
@ BLC_bytesInput
Definition CTF.h:50
@ BLC_bytesClass
Definition CTF.h:51
@ BLC_bcIncTrig
Definition CTF.h:48
@ BLC_orbitIncTrig
Definition CTF.h:49
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))
LumiInfo lumi