QualityControl  1.5.1
O2 Data Quality Control Framework
TaskDiagnostics.h
Go to the documentation of this file.
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 
18 
19 #ifndef QC_MODULE_TOF_TASKDIAGNOSTICS_H
20 #define QC_MODULE_TOF_TASKDIAGNOSTICS_H
21 
22 // O2 includes
23 #include "TOFReconstruction/DecoderBase.h"
24 #include "DataFormatsTOF/CompressedDataFormat.h"
25 using namespace o2::tof::compressed;
26 
27 // QC includes
29 #include "Base/Counter.h"
30 
31 class TH1F;
32 class TH2F;
33 
34 using namespace o2::quality_control::core;
35 using namespace o2::tof::diagnostic;
36 
38 {
39 
41 static const char* RDHDiagnosticName[2] = { "RDH_HAS_DATA", "" };
42 
45 class DiagnosticsCounter final
46  : public DecoderBase
47 {
48  public:
50  DiagnosticsCounter() = default;
52  ~DiagnosticsCounter() = default;
53 
55  void decode();
56 
58  static const int ncrates = 72;
59  static const int ntrms = 10;
60  static const int ntrmschains = 2;
61  Counter<2, RDHDiagnosticName> mRDHCounter[ncrates];
65 
66  private:
68  void rdhHandler(const o2::header::RAWDataHeader* /* rdh */) override{};
69  void headerHandler(const CrateHeader_t* crateHeader, const CrateOrbit_t* crateOrbit) override;
70  void frameHandler(const CrateHeader_t* /* crateHeader */, const CrateOrbit_t* /* crateOrbit */,
71  const FrameHeader_t* /* frameHeader */, const PackedHit_t* /* packedHits */) override{};
72  void trailerHandler(const CrateHeader_t* crateHeader, const CrateOrbit_t* crateOrbit,
73  const CrateTrailer_t* crateTrailer, const Diagnostic_t* diagnostics,
74  const Error_t* errors) override;
75 };
76 
79 class TaskDiagnostics /*final*/
80  : public TaskInterface // todo add back the "final" when doxygen is fixed
81 {
82  public:
84  TaskDiagnostics() = default;
86  ~TaskDiagnostics() override = default;
87 
88  // Definition of the methods for the template method pattern
89  void initialize(o2::framework::InitContext& ctx) override;
90  void startOfActivity(Activity& activity) override;
91  void startOfCycle() override;
92  void monitorData(o2::framework::ProcessingContext& ctx) override;
93  void endOfCycle() override;
94  void endOfActivity(Activity& activity) override;
95  void reset() override;
96 
97  private:
98  // Histograms
99  std::shared_ptr<TH2F> mRDHHisto;
100  std::shared_ptr<TH2F> mDRMHisto;
101  std::shared_ptr<TH2F> mLTMHisto;
102  std::shared_ptr<TH2F> mTRMHisto[DiagnosticsCounter::ntrms];
103 
104  DiagnosticsCounter mDecoderCounter;
105 };
106 
107 } // namespace o2::quality_control_modules::tof
108 
109 #endif // QC_MODULE_TOF_TASKDIAGNOSTICS_H
Definition: Counter.h:33
TOF Quality Control class for Decoding Compressed data for TOF Compressed data QC Task...
Definition: TaskDiagnostics.h:45
Skeleton of a QC task.
Definition: TaskInterface.h:53
Utilities to count events and fill histograms at the end of the main processing loops.
TOF Quality Control DPL Task for TOF Compressed data.
Definition: TaskDiagnostics.h:79
Dummy class that should be removed when there is the official one. This corresponds to a Run1/2 "run"...
Definition: Activity.h:25
These methods can be used to build a complex processing topology. It spawns 3 separate dummy processi...
Definition: Activity.h:19