Skip to content

Commit d0fea5e

Browse files
authored
Add ITS cluster and track checks (#569)
* Add ITS cluster and track QC checks * minor modifications * switching to use ip address for the cluster task * fix a typo in TrackCheck
1 parent c8240b4 commit d0fea5e

8 files changed

Lines changed: 273 additions & 5 deletions

File tree

Modules/ITS/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ add_library(QcITS
1111
src/ITSClusterTask.cxx
1212
src/ITSTrackTask.cxx
1313
src/ITSFhrCheck.cxx
14+
src/ITSClusterCheck.cxx
15+
src/ITSTrackCheck.cxx
1416
)
1517

1618
target_sources(QcITS PRIVATE src/TH2XlineReductor.cxx)
@@ -42,6 +44,8 @@ add_root_dictionary(QcITS
4244
include/ITS/ITSClusterTask.h
4345
include/ITS/ITSTrackTask.h
4446
include/ITS/ITSFhrCheck.h
47+
include/ITS/ITSClusterCheck.h
48+
include/ITS/ITSTrackCheck.h
4549
LINKDEF include/ITS/LinkDef.h
4650
BASENAME QcITS)
4751

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

Modules/ITS/include/ITS/LinkDef.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
#pragma link C++ class o2::quality_control_modules::its::ITSClusterTask + ;
1313
#pragma link C++ class o2::quality_control_modules::its::ITSTrackTask + ;
1414
#pragma link C++ class o2::quality_control_modules::its::ITSFhrCheck + ;
15+
#pragma link C++ class o2::quality_control_modules::its::ITSClusterCheck + ;
16+
#pragma link C++ class o2::quality_control_modules::its::ITSTrackCheck + ;
1517

1618
#endif

Modules/ITS/itsCluster.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"config": {
44
"database": {
55
"implementation": "CCDB",
6-
"host": "ccdb-test.cern.ch:8080",
6+
"host": "188.184.2.39:8080",
77
"username": "not_applicable",
88
"password": "not_applicable",
99
"name": "not_applicable"
@@ -18,8 +18,8 @@
1818
"consul": {
1919
"url": "http://consul-test.cern.ch:8500"
2020
},
21-
"conditionDB": {
22-
"url": "ccdb-test.cern.ch:8080"
21+
"conditionDB": {
22+
"url": "188.184.2.39:8080"
2323
}
2424
},
2525
"tasks": {
@@ -28,7 +28,7 @@
2828
"className": "o2::quality_control_modules::its::ITSClusterTask",
2929
"moduleName": "QcITS",
3030
"detectorName": "ITS",
31-
"cycleDurationSeconds": "60",
31+
"cycleDurationSeconds": "180",
3232
"maxNumberCycles": "-1",
3333
"dataSource_comment": "The other type of dataSource is \"direct\", see basic-no-sampling.json.",
3434
"dataSource": {
@@ -37,6 +37,20 @@
3737
},
3838
"location": "remote"
3939
}
40+
},
41+
"checks": {
42+
"ITSClusterCheck": {
43+
"active": "true",
44+
"className": "o2::quality_control_modules::its::ITSClusterCheck",
45+
"moduleName": "QcITS",
46+
"policy": "OnAny",
47+
"detectorName": "ITS",
48+
"dataSource": [{
49+
"type": "Task",
50+
"name": "ITSClusterTask",
51+
"MOs": ["Layer0/AverageClusterSize"]
52+
}]
53+
}
4054
}
4155
},
4256

Modules/ITS/itsTrack.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"className": "o2::quality_control_modules::its::ITSTrackTask",
2929
"moduleName": "QcITS",
3030
"detectorName": "ITS",
31-
"cycleDurationSeconds": "120",
31+
"cycleDurationSeconds": "30",
3232
"maxNumberCycles": "-1",
3333
"dataSource_comment": "The other type of dataSource is \"direct\", see basic-no-sampling.json.",
3434
"dataSource": {
@@ -37,6 +37,20 @@
3737
},
3838
"location": "remote"
3939
}
40+
},
41+
"checks": {
42+
"ITSTrackCheck": {
43+
"active": "true",
44+
"className": "o2::quality_control_modules::its::ITSTrackCheck",
45+
"moduleName": "QcITS",
46+
"policy": "OnAny",
47+
"detectorName": "ITS",
48+
"dataSource": [{
49+
"type": "Task",
50+
"name": "ITSTrackTask",
51+
"MOs": ["NClusters"]
52+
}]
53+
}
4054
}
4155
},
4256

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

Modules/ITS/src/ITSTrackCheck.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 ITSTrackCheck.cxx
13+
/// \author Artem Isakov
14+
/// \author Jian Liu
15+
///
16+
17+
#include "ITS/ITSTrackCheck.h"
18+
#include "QualityControl/MonitorObject.h"
19+
#include "QualityControl/Quality.h"
20+
21+
#include <fairlogger/Logger.h>
22+
#include <TList.h>
23+
#include <TH1.h>
24+
#include <TText.h>
25+
26+
namespace o2::quality_control_modules::its
27+
{
28+
29+
void ITSTrackCheck::configure(std::string) {}
30+
31+
Quality ITSTrackCheck::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() == "NClusters") {
38+
auto* h = dynamic_cast<TH1D*>(iter->second->getObject());
39+
if (h->GetMean() > 8) {
40+
result = Quality::Bad;
41+
} else {
42+
result = Quality::Good;
43+
}
44+
}
45+
}
46+
return result;
47+
}
48+
49+
std::string ITSTrackCheck::getAcceptedType() { return "TH1D"; }
50+
51+
void ITSTrackCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult)
52+
{
53+
auto* h = dynamic_cast<TH1D*>(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::GOOD");
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)