Project
Loading...
Searching...
No Matches
CompressedDecodingTask.h
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
16
17#ifndef O2_TOF_COMPRESSEDDECODINGTASK
18#define O2_TOF_COMPRESSEDDECODINGTASK
19
20#include "Framework/Task.h"
22#include <fstream>
25#include "TOFBase/Digit.h"
26#include "TStopwatch.h"
28
29using namespace o2::framework;
30
31namespace o2
32{
33namespace tof
34{
35
36using namespace compressed;
37
39{
40 public:
41 CompressedDecodingTask(bool conet, o2::header::DataDescription dataDesc, std::shared_ptr<o2::base::GRPGeomRequest> gr, int norbitPerTF = -1, bool localCmp = false) : mGGCCDBRequest(gr), mNorbitsPerTF(norbitPerTF), mLocalCmp(localCmp)
42 {
43 mConetMode = conet;
44 mDataDesc = dataDesc;
45 setDecoderCONET(conet);
46 }
47
48 ~CompressedDecodingTask() override = default;
49 void init(InitContext& ic) final;
50 void run(ProcessingContext& pc) final;
52 void endOfStream(EndOfStreamContext& ec) final;
54 void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj) final
55 {
56 if (mNorbitsPerTF == -1) {
58 }
59 }
60
61 private:
63 void rdhHandler(const o2::header::RAWDataHeader* rdh) override;
64 void headerHandler(const CrateHeader_t* crateHeader, const CrateOrbit_t* crateOrbit) override;
65 void frameHandler(const CrateHeader_t* crateHeader, const CrateOrbit_t* crateOrbit,
66 const FrameHeader_t* frameHeader, const PackedHit_t* packedHits) override;
67 void trailerHandler(const CrateHeader_t* crateHeader, const CrateOrbit_t* crateOrbit,
68 const CrateTrailer_t* crateTrailer, const Diagnostic_t* diagnostics,
69 const Error_t* errors) override;
70
71 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
72
74 std::vector<std::vector<o2::tof::Digit>> mDigits;
76 int mNTF = 0;
77 int mNCrateOpenTF = 0;
78 int mNCrateCloseTF = 0;
79 bool mHasToBePosted = false;
80 bool mConetMode = false;
81 uint32_t mInitOrbit = 0;
82 uint32_t mCurrentOrbit = 0;
83 bool mRowFilter = false;
84 bool mMaskNoise = false;
85 bool mLocalCmp = false;
86 int mNoiseRate = 1000;
87 unsigned long mCreationTime = 0;
88 int mNorbitsPerTF = -1;
89 TStopwatch mTimer;
90};
91
92framework::DataProcessorSpec getCompressedDecodingSpec(const std::string& inputDesc, bool conet = false, bool askDISTSTF = true, int norbitPerTF = -1, bool localCmp = false);
93
94} // namespace tof
95} // namespace o2
96
97#endif /* O2_TOF_COMPRESSEDDECODINGTASK */
Definition of the TOF encoder.
Helper for geometry and GRP related CCDB requests.
bool finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj)
static GRPGeomHelper & instance()
~CompressedDecodingTask() override=default
CompressedDecodingTask(bool conet, o2::header::DataDescription dataDesc, std::shared_ptr< o2::base::GRPGeomRequest > gr, int norbitPerTF=-1, bool localCmp=false)
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
void postData(ProcessingContext &pc)
void endOfStream(EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
Decoder class for TOF.
Definition Decoder.h:39
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
framework::DataProcessorSpec getCompressedDecodingSpec(const std::string &inputDesc, bool conet=false, bool askDISTSTF=true, int norbitPerTF=-1, bool localCmp=false)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...