Skip to content

Commit d1af35d

Browse files
JianLIUhepBarthelemy
authored andcommitted
ITS: diagnostic info inspection and adding QC check for ITSFeeTask (#572)
* ITS: diagnostic info inspection and adding QC check for ITSFeeTask * minor amendment * rename DDW variable, add warnings in case the ITS run number not found
1 parent 59f5261 commit d1af35d

9 files changed

Lines changed: 305 additions & 92 deletions

File tree

Modules/ITS/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ add_library(QcITS
1313
src/ITSFhrCheck.cxx
1414
src/ITSClusterCheck.cxx
1515
src/ITSTrackCheck.cxx
16+
src/ITSFeeCheck.cxx
1617
)
1718

1819
target_sources(QcITS PRIVATE src/TH2XlineReductor.cxx)
@@ -46,6 +47,7 @@ add_root_dictionary(QcITS
4647
include/ITS/ITSFhrCheck.h
4748
include/ITS/ITSClusterCheck.h
4849
include/ITS/ITSTrackCheck.h
50+
include/ITS/ITSFeeCheck.h
4951
LINKDEF include/ITS/LinkDef.h
5052
BASENAME QcITS)
5153

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
11+
///
12+
/// \file ITSFeeCheck.h
13+
/// \auhtor Liang Zhang
14+
/// \author Jian Liu
15+
///
16+
17+
#ifndef QC_MODULE_ITS_ITSFEECHECK_H
18+
#define QC_MODULE_ITS_ITSFEECHECK_H
19+
20+
#include "QualityControl/CheckInterface.h"
21+
22+
namespace o2::quality_control_modules::its
23+
{
24+
25+
/// \brief Check the FAULT flag for the lanes
26+
27+
class ITSFeeCheck : public o2::quality_control::checker::CheckInterface
28+
{
29+
30+
public:
31+
/// Default constructor
32+
ITSFeeCheck() = default;
33+
/// Destructor
34+
~ITSFeeCheck() override = default;
35+
36+
// Override interface
37+
void configure(std::string name) override;
38+
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
39+
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
40+
std::string getAcceptedType() override;
41+
42+
private:
43+
ClassDefOverride(ITSFeeCheck, 1);
44+
};
45+
46+
} // namespace o2::quality_control_modules::its
47+
48+
#endif // QC_MODULE_ITS_ITSFeeCheck_H

Modules/ITS/include/ITS/ITSFeeTask.h

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,23 @@ namespace o2::quality_control_modules::its
3333
/// \brief ITS FEE task aiming at 100% online data integrity checking
3434
class ITSFeeTask final : public TaskInterface
3535
{
36-
37-
struct GBTDdw { //GBT diagnostic word
38-
39-
union GBTBits {
40-
struct payloadBits {
41-
uint64_t flags2 : 36; /// 0:35 not defined yet
42-
uint64_t flags1 : 36; /// 36:71 not defined yet
43-
uint64_t id : 8; /// 72:79 0xe0; Header Status Word (HSW) identifier
44-
} payload;
45-
46-
uint8_t data8[16]; // 80 bits GBT word + padding to 128 bits
47-
} ddwBits;
36+
struct GBTDiagnosticWord { //GBT diagnostic word
37+
union {
38+
uint64_t word0 = 0x0;
39+
struct {
40+
uint64_t laneStatus : 56;
41+
uint16_t zero0 : 8;
42+
} laneBits;
43+
};
44+
union {
45+
uint64_t word1 = 0x0;
46+
struct {
47+
uint8_t flag1 : 4;
48+
uint8_t index : 4;
49+
uint8_t id : 8;
50+
uint64_t padding : 48;
51+
} indexBits;
52+
};
4853
};
4954

5055
public:
@@ -63,23 +68,30 @@ class ITSFeeTask final : public TaskInterface
6368

6469
private:
6570
void setAxisTitle(TH1* object, const char* xTitle, const char* yTitle);
66-
void createErrorTFPlots(int barrel);
71+
void createFeePlots();
6772
void setPlotsFormat();
68-
void getEnableLayers();
6973
void getRunNumber(); //for ITS commissioning only
7074
void resetGeneralPlots();
7175
static constexpr int NLayer = 7;
7276
static constexpr int NLayerIB = 3;
77+
static constexpr int NLanes = 28;
78+
static constexpr int NFees = 48 * 3 + 144 * 2;
79+
static constexpr int NFlags = 4;
7380
const int StaveBoundary[NLayer + 1] = { 0, 12, 28, 48, 72, 102, 144, 192 };
74-
std::array<bool, NLayer> mEnableLayers = { false };
7581
int mTimeFrameId = 0;
76-
int mNTrigger = 13;
77-
static constexpr int NError = 13;
78-
TString mErrorType[NError] = { "ORBIT", "HB", "HBr", "HC", "PHYSICS", "PP", "CAL", "SOT", "EOT", "SOC", "EOC", "TF", "INT" }; //TODO: replace by defined error flags
82+
static constexpr int mNTrigger = 13;
83+
TString mTriggerType[mNTrigger] = { "ORBIT", "HB", "HBr", "HC", "PHYSICS", "PP", "CAL", "SOT", "EOT", "SOC", "EOC", "TF", "INT" };
84+
std::string mLaneStatusFlag[NFlags] = { "OK", "WARNING", "ERROR", "FAULT" }; //b00 OK, b01 WARNING, b10 ERROR, b11 FAULT
7985

8086
TH1I* mTFInfo; //count vs TF ID
81-
TH2I* mErrorFlagVsFeeId;
82-
TH1I* mErrorFlag;
87+
TH2I* mTriggerVsFeeId;
88+
TH1I* mTrigger;
89+
TH2I* mLaneInfo;
90+
TH2I* mFlag1Check; //include transmission_timeout, packet_overflow, lane_starts_violation
91+
TH2I* mIndexCheck; //should be zero
92+
TH2I* mIdCheck; //should be 0x : e4
93+
TH2I* mLaneStatus[NFlags]; //4 flags for each lane. 3/8/14 lane for each link. 3/2/2 link for each RU. TODO: remove the OK flag in these 4 flag plots, OK flag plot just used to debug.
94+
TH1I* mProcessingTime;
8395
//TH1D* mInfoCanvas;//TODO: default, not implemented yet
8496
std::string mRunNumberPath;
8597
std::string mRunNumber = "000000";

Modules/ITS/include/ITS/LinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
#pragma link C++ class o2::quality_control_modules::its::ITSFhrCheck + ;
1515
#pragma link C++ class o2::quality_control_modules::its::ITSClusterCheck + ;
1616
#pragma link C++ class o2::quality_control_modules::its::ITSTrackCheck + ;
17+
#pragma link C++ class o2::quality_control_modules::its::ITSFeeCheck + ;
1718

1819
#endif

Modules/ITS/itsFee.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
},
2525
"tasks": {
26-
"FEE": {
26+
"ITSFEE": {
2727
"active": "true",
2828
"className": "o2::quality_control_modules::its::ITSFeeTask",
2929
"moduleName": "QcITS",
@@ -36,7 +36,22 @@
3636
},
3737
"location": "remote"
3838
}
39+
},
40+
"checks": {
41+
"ITSFeeCheck": {
42+
"active": "true",
43+
"className": "o2::quality_control_modules::its::ITSFeeCheck",
44+
"moduleName": "QcITS",
45+
"policy": "OnAny",
46+
"detectorName": "ITS",
47+
"dataSource": [{
48+
"type": "Task",
49+
"name": "ITSFEE",
50+
"MOs": ["LaneStatus/laneStatusFlagFAULT"]
51+
}]
52+
}
3953
}
54+
4055
},
4156
"dataSamplingPolicies": [
4257
{

Modules/ITS/src/ITSClusterCheck.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void ITSClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkR
5858
tInfo = new TText(0.1, 0.8, "Quality::GOOD");
5959
tInfo->SetTextColor(kGreen);
6060
} else if (checkResult == Quality::Bad) {
61-
tInfo = new TText(0.1, 0.8, "Quality::GOOD");
61+
tInfo = new TText(0.1, 0.8, "Quality::BAD");
6262
tInfo->SetTextColor(kRed);
6363
}
6464
tInfo->SetTextSize(17);

Modules/ITS/src/ITSFeeCheck.cxx

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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+
11+
///
12+
/// \file ITSFeeCheck.cxx
13+
/// \author LiAng Zhang
14+
/// \author Jian Liu
15+
///
16+
17+
#include "ITS/ITSFeeCheck.h"
18+
#include "QualityControl/MonitorObject.h"
19+
#include "QualityControl/Quality.h"
20+
21+
#include <fairlogger/Logger.h>
22+
#include <TList.h>
23+
#include <TH2.h>
24+
#include <TText.h>
25+
26+
namespace o2::quality_control_modules::its
27+
{
28+
29+
void ITSFeeCheck::configure(std::string) {}
30+
31+
Quality ITSFeeCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap)
32+
{
33+
auto mo = moMap->begin()->second;
34+
Quality result = Quality::Null;
35+
std::map<std::string, std::shared_ptr<MonitorObject>>::iterator iter;
36+
for (iter = moMap->begin(); iter != moMap->end(); iter++) {
37+
if (iter->second->getName() == "LaneStatus/laneStatusFlagFAULT") {
38+
auto* h = dynamic_cast<TH2I*>(iter->second->getObject());
39+
if (h->GetMaximum() > 0) {
40+
result = Quality::Bad;
41+
} else {
42+
result = Quality::Good;
43+
}
44+
}
45+
}
46+
return result;
47+
}
48+
49+
std::string ITSFeeCheck::getAcceptedType() { return "TH2I"; }
50+
51+
void ITSFeeCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult)
52+
{
53+
auto* h = dynamic_cast<TH2I*>(mo->getObject());
54+
TText* tInfo;
55+
56+
if (checkResult == Quality::Good) {
57+
tInfo = new TText(0.1, 0.8, "Quality::GOOD");
58+
tInfo->SetTextColor(kGreen);
59+
} else if (checkResult == Quality::Bad) {
60+
tInfo = new TText(0.1, 0.8, "Quality::BAD");
61+
tInfo->SetTextColor(kRed);
62+
}
63+
tInfo->SetTextSize(17);
64+
tInfo->SetNDC();
65+
h->GetListOfFunctions()->Add(tInfo);
66+
}
67+
68+
} // namespace o2::quality_control_modules::its

0 commit comments

Comments
 (0)