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::zdc;
21
23// Register encoded data in the tree (Fill is not called, will be done by caller)
24void CTFCoder::appendToTree(TTree& tree, CTF& ec)
25{
27}
28
30// extract and decode data from the tree
31void CTFCoder::readFromTree(TTree& tree, int entry, std::vector<BCData>& trigVec, std::vector<ChannelData>& chanVec, std::vector<OrbitData>& eodVec)
32{
33 assert(entry >= 0 && entry < tree.GetEntries());
34 CTF ec;
36 decode(ec, trigVec, chanVec, eodVec);
37}
38
40void CTFCoder::createCoders(const std::vector<char>& bufVec, o2::ctf::CTFCoderBase::OpType op)
41{
42 const auto ctf = CTF::getImage(bufVec.data());
43 // just to get types
44 int16_t bcIncTrig, sclInc;
45 int32_t orbitIncTrig, orbitIncEOD;
46 uint16_t moduleTrig, nchanTrig, chanData, pedData, triggersHL, channelsHL;
47 uint8_t extTriggers, chanID;
48#define MAKECODER(part, slot) createCoder(op, std::get<rans::RenormedDenseHistogram<decltype(part)>>(ctf.getDictionary<decltype(part)>(slot, mANSVersion)), int(slot))
49 // clang-format off
50 MAKECODER(bcIncTrig, CTF::BLC_bcIncTrig);
51 MAKECODER(orbitIncTrig, CTF::BLC_orbitIncTrig);
52 MAKECODER(moduleTrig, CTF::BLC_moduleTrig);
53 MAKECODER(channelsHL, CTF::BLC_channelsHL);
54 MAKECODER(triggersHL, CTF::BLC_triggersHL);
55 MAKECODER(extTriggers, CTF::BLC_extTriggers);
56 MAKECODER(nchanTrig, CTF::BLC_nchanTrig);
57 //
60 //
61 MAKECODER(orbitIncEOD, CTF::BLC_orbitIncEOD);
64 // clang-format on
65}
#define MAKECODER(part, slot)
uint32_t op
class for entropy encoding/decoding of ZDC data
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
static constexpr const char * getName(ID id)
names of defined detectors
Definition DetID.h:145
o2::ctf::CTFIOSize decode(const CTF::base &ec, VTRG &trigVec, VCHAN &chanVec, VPED &pedVec)
entropy decode data from buffer with CTF
Definition CTFCoder.h:157
void createCoders(const std::vector< char > &bufVec, o2::ctf::CTFCoderBase::OpType op) final
Definition CTFCoder.cxx:40
GLuint entry
Definition glcorearb.h:5735
wrapper for the Entropy-encoded triggers and cells of the TF
Definition CTF.h:44
@ BLC_bcIncTrig
Definition CTF.h:47
@ BLC_sclInc
Definition CTF.h:60
@ BLC_moduleTrig
Definition CTF.h:49
@ BLC_orbitIncTrig
Definition CTF.h:48
@ BLC_channelsHL
Definition CTF.h:50
@ BLC_triggersHL
Definition CTF.h:51
@ BLC_chanData
Definition CTF.h:56
@ BLC_pedData
Definition CTF.h:59
@ BLC_extTriggers
Definition CTF.h:52
@ BLC_orbitIncEOD
Definition CTF.h:58
@ BLC_chanID
Definition CTF.h:55
@ BLC_nchanTrig
Definition CTF.h:53
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))