QualityControl  1.5.1
O2 Data Quality Control Framework
TrendingTaskITSFhr.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_TRENDINGTASKITSFHR_H
17 #define QUALITYCONTROL_TRENDINGTASKITSFHR_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 <vector>
31 #include <unordered_map>
32 
34 {
35 class DatabaseInterface;
36 }
37 
39 {
40 
55 {
56  public:
57  TrendingTaskITSFhr() = default;
58  ~TrendingTaskITSFhr() override = default;
59 
60  void configure(std::string name,
61  const boost::property_tree::ptree& config) override;
62  void initialize(Trigger, framework::ServiceRegistry&) override;
63  void update(Trigger, framework::ServiceRegistry&) override;
64  void finalize(Trigger, framework::ServiceRegistry&) override;
65 
66  private:
67  // other functions (mainly style)
68  void SetLegendStyle(TLegend* leg);
69  void SetGraphStyle(TGraph* g, int col, int mkr);
70  void SetGraphNameAndAxes(TGraph* g, std::string name, std::string title,
71  std::string xtitle, std::string ytitle, double ymin,
72  double ymax, std::vector<std::string> runlist);
73  void PrepareLegend(TLegend* leg, int layer);
74 
75  struct MetaData {
76  Int_t runNumber = 0;
77  };
78 
79  void trendValues(repository::DatabaseInterface& qcdb);
80  void storePlots(repository::DatabaseInterface& qcdb);
81  void storeTrend(repository::DatabaseInterface& qcdb);
82 
83  TrendingTaskConfigITS mConfig;
84  MetaData mMetaData;
85  Int_t ntreeentries = 0;
86  UInt_t mTime;
87  std::vector<std::string> runlist;
88  std::unique_ptr<TTree> mTrend;
89  std::unordered_map<std::string, std::unique_ptr<Reductor>> mReductors;
90 
91  const int col[7] = { 1, 2, 3, 4, 5, 6, 7 };
92  const int mkr[3] = { 8, 29, 34 };
93  static constexpr int NLAYERS = 3;
94  static constexpr int NTRENDSFHR = 4;
95  const int nStaves[NLAYERS] = { 12, 16, 20 };
96  const std::string trendtitles[NTRENDSFHR] = { "Fake-hit rate",
97  "Stddev Fake-hit rate", "Number of Active chips", "Occupancy" };
98  const std::string trendnames[NTRENDSFHR] = { "mean", "rms", "activechips", "occupancy" };
99  const std::string ytitles[NTRENDSFHR] = {
100  "Fake-hit rate (/event/pixel)", "Stddev Fake-hit rate (/event/pixel)", "# Active chips", "Occupancy (/event)"
101  };
102 };
103 
104 } // namespace o2::quality_control::postprocessing
105 
106 #endif // QUALITYCONTROL_TRENDINGTASKITSFHR_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
A post-processing task which trends values, stores them in a TTree and produces plots.
Definition: TrendingTaskITSFhr.h:54
Definition: PostProcessingConfig.h:23