Skip to content

Commit 748fc64

Browse files
bazinskisawenzel
authored andcommitted
fix trapsimulator output for raw, add 64 bit tracklets, add linkrecord.
1 parent 299c914 commit 748fc64

23 files changed

+824
-338
lines changed

DataFormats/Detectors/TRD/CMakeLists.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010

1111
o2_add_library(DataFormatsTRD
1212
SOURCES src/TriggerRecord.cxx
13-
src/RawData.cxx
13+
src/LinkRecord.cxx
1414
src/Tracklet64.cxx
15-
PUBLIC_LINK_LIBRARIES O2::CommonDataFormat
16-
O2::SimulationDataFormat
17-
O2::TRDBase
18-
)
15+
src/RawData.cxx
16+
PUBLIC_LINK_LIBRARIES O2::CommonDataFormat O2::SimulationDataFormat)
1917

20-
o2_target_root_dictionary(DataFormatsTRD
21-
HEADERS include/DataFormatsTRD/TriggerRecord.h
22-
include/DataFormatsTRD/RawData.h
23-
include/DataFormatsTRD/Tracklet64.h)
18+
o2_target_root_dictionary(DataFormatsTRD
19+
HEADERS include/DataFormatsTRD/TriggerRecord.h
20+
include/DataFormatsTRD/LinkRecord.h
21+
include/DataFormatsTRD/Tracklet64.h
22+
include/DataFormatsTRD/RawData.h)
2423

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#ifndef ALICEO2_TRD_LINKRECORD_H
12+
#define ALICEO2_TRD_LINKRECORD_H
13+
14+
#include <iosfwd>
15+
#include "Rtypes.h"
16+
#include "CommonDataFormat/InteractionRecord.h"
17+
#include "CommonDataFormat/RangeReference.h"
18+
#include "DataFormatsTRD/RawData.h"
19+
20+
namespace o2
21+
{
22+
23+
namespace trd
24+
{
25+
26+
/// \class LinkRecord
27+
/// \brief Header for data corresponding to the indexing of the links in the raw data output
28+
/// adapted from DataFormatsTRD/TriggerRecord
29+
class LinkRecord
30+
{
31+
using DataRange = o2::dataformats::RangeReference<int>;
32+
33+
public:
34+
LinkRecord() = default;
35+
LinkRecord(const uint32_t hcid, int firstentry, int nentries) : mLinkId(hcid), mDataRange(firstentry, nentries) {}
36+
~LinkRecord() = default;
37+
38+
void setLinkId(const uint32_t linkid) { mLinkId = linkid; }
39+
void setDataRange(int firstentry, int nentries) { mDataRange.set(firstentry, nentries); }
40+
void setIndexFirstObject(int firstentry) { mDataRange.setFirstEntry(firstentry); }
41+
void setNumberOfObjects(int nentries) { mDataRange.setEntries(nentries); }
42+
43+
uint32_t getLinkId() { return mLinkId; }
44+
int getNumberOfObjects() const { return mDataRange.getEntries(); }
45+
int getFirstEntry() const { return mDataRange.getFirstEntry(); }
46+
47+
void printStream(std::ostream& stream) const;
48+
49+
private:
50+
uint32_t mLinkId; /// The link ID for this set of data, hcid as well
51+
DataRange mDataRange; /// Index of the triggering event (event index and first entry in the container)
52+
53+
ClassDefNV(LinkRecord, 1);
54+
};
55+
56+
std::ostream& operator<<(std::ostream& stream, const LinkRecord& trg);
57+
58+
} // namespace trd
59+
60+
} // namespace o2
61+
62+
#endif

0 commit comments

Comments
 (0)