Skip to content

Commit 1486e32

Browse files
selindraJianLIUhep
andauthored
New trending plot of GTB Links decoding errors (#1918)
* Creating new trending graph with GTBLinks decoding errors * Clang correction * 22 to const int correction * some corrections from Artem * testing line removed * more changes from Artem --------- Co-authored-by: JianLIUhep <jian.liu@cern.ch>
1 parent 9da6c0d commit 1486e32

7 files changed

Lines changed: 745 additions & 9 deletions

File tree

Modules/ITS/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
# ---- Library ----
1+
# ---- Library ----
32

43
add_library(O2QcITS
54
src/ITSRawTask.cxx
@@ -9,6 +8,7 @@ add_library(O2QcITS
98
src/TrendingTaskITSCluster.cxx
109
src/TrendingTaskITSTracks.cxx
1110
src/TrendingTaskConfigITS.cxx
11+
src/TrendingTaskITSError.cxx
1212
src/TH2XlineReductor.cxx
1313
src/ReductorBinContent.cxx
1414
src/ITSFhrTask.cxx
@@ -63,6 +63,7 @@ add_root_dictionary(O2QcITS
6363
include/ITS/TrendingTaskITSFEE.h
6464
include/ITS/TrendingTaskITSCluster.h
6565
include/ITS/TrendingTaskITSTracks.h
66+
include/ITS/TrendingTaskITSError.h
6667
include/ITS/TH2XlineReductor.h
6768
include/ITS/ReductorBinContent.h
6869
include/ITS/ITSFhrTask.h

Modules/ITS/include/ITS/LinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
#pragma link C++ class o2::quality_control_modules::its::ITSThresholdCalibrationCheck + ;
2626
#pragma link C++ class o2::quality_control_modules::its::ITSDecodingErrorTask + ;
2727
#pragma link C++ class o2::quality_control_modules::its::ITSDecodingErrorCheck + ;
28+
#pragma link C++ class o2::quality_control::postprocessing::TrendingTaskITSError + ;
2829
#endif

Modules/ITS/include/ITS/ReductorBinContent.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,20 @@ class ReductorBinContent : public quality_control::postprocessing::Reductor
3232
const char* getBranchLeafList() override;
3333
void update(TObject* obj) override;
3434

35+
void setParams(Int_t Flags, Int_t Triggers)
36+
{
37+
nFlags = Flags;
38+
nTriggers = Triggers;
39+
}
40+
3541
private:
36-
static constexpr int nFlags = 3;
37-
static constexpr int nTriggers = 13;
42+
int nFlags = 3;
43+
int nTriggers = 13;
3844

3945
struct mystat {
40-
Double_t binContent[nFlags]; // Bin content in a specified slice
41-
Double_t integral[nTriggers]; // Integral over all Fee ID
46+
// std::vector<Double_t> binContent; // Bin content in a specified slice
47+
Double_t binContent[100];
48+
Double_t integral[100]; // Integral over all Fee I
4249
};
4350

4451
mystat mStats;
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
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+
12+
///
13+
/// \file TrendingTaskITSError.h
14+
/// \author Mariia Selina on the structure from Piotr Konopka
15+
///
16+
17+
#ifndef QUALITYCONTROL_TRENDINGTASKITSError_H
18+
#define QUALITYCONTROL_TRENDINGTASKITSError_H
19+
20+
#include "ITS/TrendingTaskConfigITS.h"
21+
#include "QualityControl/PostProcessingInterface.h"
22+
#include "QualityControl/Reductor.h"
23+
#include "ITSMFTReconstruction/DecodingStat.h"
24+
25+
#include <TAxis.h>
26+
#include <TColor.h>
27+
#include <TGraph.h>
28+
#include <TMultiGraph.h>
29+
#include <TLegend.h>
30+
#include <TCanvas.h>
31+
#include <TTree.h>
32+
#include <memory>
33+
#include <string>
34+
#include <vector>
35+
#include <unordered_map>
36+
37+
namespace o2::quality_control::repository
38+
{
39+
class DatabaseInterface;
40+
}
41+
42+
namespace o2::quality_control::postprocessing
43+
{
44+
45+
/// \brief A post-processing task which trends values, stores them in a TTree
46+
/// and produces plots.
47+
///
48+
/// A post-processing task which trends objects inside QC database (QCDB). It
49+
/// extracts some values of one or multiple
50+
/// objects using the Reductor classes, then stores them inside a TTree. One can
51+
/// generate plots out the TTree - the
52+
/// class exposes the TTree::Draw interface to the user. The TTree and plots are
53+
/// stored in the QCDB. The class is
54+
/// configured with configuration files, see Framework/postprocessing.json as an
55+
/// example.
56+
///
57+
58+
class TrendingTaskITSError : public PostProcessingInterface
59+
{
60+
public:
61+
TrendingTaskITSError() = default;
62+
~TrendingTaskITSError() override = default;
63+
64+
void configure(const boost::property_tree::ptree& config) override;
65+
void initialize(Trigger, framework::ServiceRegistryRef) override;
66+
void update(Trigger, framework::ServiceRegistryRef) override;
67+
void finalize(Trigger, framework::ServiceRegistryRef) override;
68+
69+
private:
70+
// other functions; mainly style of plots
71+
void SetLegendStyle(TLegend* legend, const std::string& name, bool isRun);
72+
void SetCanvasSettings(TCanvas* canvas);
73+
void SetGraphStyle(TGraph* graph, const std::string& name, const std::string& title, int col, int mkr);
74+
void SetGraphName(TMultiGraph* graph, const std::string& name, const std::string& title);
75+
void SetGraphAxes(TMultiGraph* graph, const std::string& xtitle,
76+
const std::string& ytitle, bool isTime);
77+
void SetHistoAxes(TH1* hist, const std::vector<std::string>& runlist,
78+
const double& Ymin, const double& Ymax);
79+
80+
struct MetaData {
81+
Int_t runNumber = 0;
82+
};
83+
84+
void trendValues(const Trigger& t, repository::DatabaseInterface& qcdb);
85+
void storePlots(repository::DatabaseInterface& qcdb);
86+
void storeTrend(repository::DatabaseInterface& qcdb);
87+
88+
TrendingTaskConfigITS mConfig;
89+
MetaData mMetaData;
90+
UInt_t mTime;
91+
Int_t nEntries = 0;
92+
93+
std::vector<std::string> runlist;
94+
std::unique_ptr<TTree> mTrend;
95+
std::unordered_map<std::string, std::unique_ptr<Reductor>> mReductors;
96+
97+
const int colors[30] = { 1, 46, kAzure + 3, 807, 797, 827, 417, 841, 868, 867, 860, 602, 921, 874, 600, 820, 400, 840, 920, 616, 632, 432, 880, 416, 29, 900, kMagenta - 9, kOrange + 4, kGreen - 5, kPink - 9 };
98+
const int markers[30] = { 8, 20, 21, 22, 23, 25, 26, 27, 29, 30, 32, 33, 34, 39, 41, 43, 45, 47, 48, 49, 105, 107, 112, 114, 116, 117, 118, 119, 120, 121 };
99+
100+
// const std::string trend_titles[o2::itsmft::GBTLinkDecodingStat::NErrorsDefined] = { "NoRDHAtStart", "PageNotStopped", "StopPageNotEmpty", "PageCounterDiscontinuity", "RDHvsGBTHPageCnt", "MissingGBTTrigger", "MissingGBTHeader", "MissingGBTTrailer", "NonZeroPageAfterStop", "DataForStoppedLane", "NoDataForActiveLane", "IBChipLaneMismatch", "CableDataHeadWrong", "InvalidActiveLanes", "PacketCounterJump", "PacketDoneMissing", "MissingDiagnosticWord", "GBTWordNotRecognized", "WrongeCableID", "WrongAlignmentWord", "MissingROF", "OldROF" };
101+
};
102+
} // namespace o2::quality_control::postprocessing
103+
#endif // QUALITYCONTROL_TRENDINGTASKITSError_H

0 commit comments

Comments
 (0)