Project
Loading...
Searching...
No Matches
LinkRecord.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
12#include <iostream>
13#include "fairlogger/Logger.h"
16
17namespace o2
18{
19
20namespace trd
21{
22
23uint32_t LinkRecord::getHalfChamberLinkId(uint32_t detector, uint32_t rob)
24{
25 int sector = (detector % (constants::NLAYER * constants::NSTACK));
26 int stack = (detector % constants::NLAYER);
28 int side = rob % 2;
29 LOG(debug) << "sector, stack, layer, side :" << sector << " " << stack << " " << layer << " " << side;
31}
32
33uint32_t LinkRecord::getHalfChamberLinkId(uint32_t sector, uint32_t stack, uint32_t layer, uint32_t side)
34{
36 a.setLinkId(sector, stack, layer, side);
37 return a.mLinkId;
38}
39
40void LinkRecord::setLinkId(const uint32_t sector, const uint32_t stack, const uint32_t layer, const uint32_t side)
41{
42 setSector(sector);
46 setSpare();
47}
48
50{
51 stream << "Data for link from supermodule:" << this->getSector() << " stack:" << this->getStack() << " layer:" << this->getLayer() << "side :" << this->getSide() << ", starting from entry " << this->getFirstEntry() << " with " << this->getNumberOfObjects() << " objects";
52}
53
54std::ostream& operator<<(std::ostream& stream, LinkRecord& trg)
55{
57 return stream;
58}
59
60} // namespace trd
61} // namespace o2
uint16_t rob
Global TRD definitions and constants.
uint32_t side
Definition RawData.h:0
uint32_t stack
Definition RawData.h:1
std::ostringstream debug
Header for data corresponding to the indexing of the links in the raw data output adapted from DataFo...
Definition LinkRecord.h:31
void setSector(const int sector)
Definition LinkRecord.h:47
void setLinkId(const uint32_t linkid)
Definition LinkRecord.h:42
uint32_t getSector() const
Definition LinkRecord.h:55
int getFirstEntry() const
Definition LinkRecord.h:60
uint32_t getLayer() const
Definition LinkRecord.h:57
uint32_t getStack() const
Definition LinkRecord.h:56
void setLayer(const int layer)
Definition LinkRecord.h:49
uint32_t getSide() const
Definition LinkRecord.h:58
int getNumberOfObjects() const
Definition LinkRecord.h:59
static uint32_t getHalfChamberLinkId(uint32_t detector, uint32_t rob)
void setSpare(const int spare=0)
Definition LinkRecord.h:51
void printStream(std::ostream &stream)
void setSide(const int side)
Definition LinkRecord.h:50
void setStack(const int stack)
Definition LinkRecord.h:48
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
GLuint GLuint stream
Definition glcorearb.h:1806
constexpr int NLAYER
the number of layers
Definition Constants.h:27
constexpr int NSTACK
the number of stacks per sector
Definition Constants.h:26
std::ostream & operator<<(std::ostream &stream, const Digit &d)
Definition Digit.cxx:78
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"