QualityControl  1.5.1
O2 Data Quality Control Framework
TrendingTaskITSThr.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 
15 
16 #ifndef QUALITYCONTROL_TRENDINGTASKITSTHR_H
17 #define QUALITYCONTROL_TRENDINGTASKITSTHR_H
18 
19 #include "ITS/TrendingTaskConfigITS.h"
22 
23 #include <TAxis.h>
24 #include <TColor.h>
25 #include <TGraph.h>
26 #include <TLegend.h>
27 #include <TTree.h>
28 #include <memory>
29 #include <string>
30 #include <unordered_map>
31 
33 {
34 class DatabaseInterface;
35 }
36 
38 {
39 
54 {
55  public:
56  TrendingTaskITSThr() = default;
57  ~TrendingTaskITSThr() override = default;
58 
59  void configure(std::string name,
60  const boost::property_tree::ptree& config) override;
61  void initialize(Trigger, framework::ServiceRegistry&) override;
62  void update(Trigger, framework::ServiceRegistry&) override;
63  void finalize(Trigger, framework::ServiceRegistry&) override;
64 
65  // other functions (mainly style)
66  void SetLegendStyle(TLegend* leg);
67  void SetGraphStyle(TGraph* g, int col, int mkr);
68  void SetGraphNameAndAxes(TGraph* g, std::string name, std::string title,
69  std::string xtitle, std::string ytitle, double ymin,
70  double ymax, std::vector<std::string> runlist);
71  void PrepareLegend(TLegend* leg, int layer);
72 
73  private:
74  struct MetaData {
75  Int_t runNumber = 0;
76  };
77 
78  void trendValues(repository::DatabaseInterface& qcdb);
79  void storePlots(repository::DatabaseInterface& qcdb);
80  void storeTrend(repository::DatabaseInterface& qcdb);
81 
82  TrendingTaskConfigITS mConfig;
83  MetaData mMetaData;
84  UInt_t mTime;
85  std::unique_ptr<TTree> mTrend;
86  std::vector<std::string> runlist;
87  Int_t ntreeentries = 0;
88  std::unordered_map<std::string, std::unique_ptr<Reductor>> mReductors;
89 
90  const int col[7] = { 1, 2, 3, 4, 5, 6, 7 };
91  const int mkr[3] = { 8, 29, 34 };
92  static constexpr int NLAYERS = 3;
93  static constexpr int NTRENDSTHR = 3;
94  const int nStaves[NLAYERS] = { 12, 16, 20 };
95  const std::string trendtitles[NTRENDSTHR] = { "Threshold mean",
96  "Threshold rms", "Dead pixel" };
97  const std::string trendnames[NTRENDSTHR] = { "mean", "rms", "deadpix" };
98  const std::string ytitles[NTRENDSTHR] = {
99  "Threshold mean (DAC)", "Threshold rms (DAC)", "# Dead Pixels"
100  };
101 };
102 
103 } // namespace o2::quality_control::postprocessing
104 
105 #endif // QUALITYCONTROL_TRENDINGTASKITSTHR_H
Definition: AggregatorRunner.h:59
Skeleton of a post-processing task.
Definition: PostProcessingInterface.h:35
The interface to the MonitorObject&#39;s repository.
Definition: DatabaseInterface.h:35
TrendingTask configuration structure.
Definition: TrendingTaskConfigITS.h:28
Definition: PostProcessingConfig.h:23
A post-processing task which trends values, stores them in a TTree and produces plots.
Definition: TrendingTaskITSThr.h:53