Skip to content

Commit d51876e

Browse files
authored
Update ITCClusterTask: higher granularity plots (#1618)
* Change TH1D to TH1F * Remove unused monitor plots * Add z-phi plots * Add coarse occupancy and size checks * Publish new plots * Fix fine binning * Fix lines in detailed plots * Fix change of coordinates * Implement comments * Change in geometry manager + line drawing * Move OpenMP statement
1 parent 13b1b01 commit d51876e

4 files changed

Lines changed: 446 additions & 228 deletions

File tree

Modules/ITS/include/ITS/ITSClusterTask.h

Lines changed: 61 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include <ITSBase/GeometryTGeo.h>
2929
#include <Framework/TimingInfo.h>
3030

31-
class TH1D;
32-
class TH2D;
31+
class TH1F;
32+
class TH2F;
3333

3434
using namespace o2::quality_control::core;
3535

@@ -51,75 +51,101 @@ class ITSClusterTask : public TaskInterface
5151
void endOfActivity(Activity& activity) override;
5252
void reset() override;
5353

54+
// Fine checks
55+
void setRphiBinningIB(std::vector<float> bins = { -0.75, -0.60, -0.45, -0.30, -0.15, 0, 0.15, 0.30, 0.45, 0.60, 0.76 });
56+
void setZBinningIB(std::vector<float> bins = { -1.5, -1.20, -0.9, -0.6, -0.3, 0, 0.3, 0.6, 0.9, 1.2, 1.51 });
57+
void setRphiBinningOB(std::vector<float> bins = { -0.75, -0.35, 0, 0.35, 0.76 });
58+
void setZBinningOB(std::vector<float> bins = { -1.5, -0.75, 0., 0.75, 1.51 });
59+
5460
private:
5561
void publishHistos();
5662
void formatAxes(TH1* h, const char* xTitle, const char* yTitle, float xOffset = 1., float yOffset = 1.);
5763
void addObject(TObject* aObject);
5864
void getJsonParameters();
5965
void createAllHistos();
60-
void updateOccMonitorPlots();
66+
void addLines();
67+
68+
float getHorizontalBin(float z, int chip, int layer, int lane = 0);
69+
float getVerticalBin(float rphi, int stave, int layer);
6170

6271
static constexpr int NLayer = 7;
6372
static constexpr int NLayerIB = 3;
64-
TH2D* hClusterVsBunchCrossing;
73+
6574
std::vector<TObject*> mPublishedObjects;
66-
TH1D* hClusterSizeSummaryIB[7][48][9];
67-
TH1D* hClusterTopologySummaryIB[7][48][9];
68-
TH1D* hGroupedClusterSizeSummaryIB[7][48][9];
6975

70-
TH1D* hClusterSizeLayerSummary[7];
71-
TH1D* hClusterTopologyLayerSummary[7];
72-
TH1D* hGroupedClusterSizeLayerSummary[7];
76+
// Inner barrel
77+
TH1F* hClusterTopologySummaryIB[NLayer][48][9] = { { { nullptr } } };
78+
TH1F* hGroupedClusterSizeSummaryIB[NLayer][48][9] = { { { nullptr } } };
79+
80+
TH2F* hAverageClusterOccupancySummaryIB[NLayer] = { nullptr };
81+
TH2F* hAverageClusterSizeSummaryIB[NLayer] = { nullptr };
82+
83+
int mClusterOccupancyIB[NLayer][48][9] = { { { 0 } } };
84+
85+
// Outer barrel
86+
TH1F* hGroupedClusterSizeSummaryOB[NLayer][48] = { { nullptr } };
87+
TH1F* hClusterSizeSummaryOB[NLayer][48] = { { nullptr } };
88+
TH1F* hClusterTopologySummaryOB[NLayer][48] = { { nullptr } };
89+
90+
TH2F* hAverageClusterOccupancySummaryOB[NLayer] = { nullptr };
91+
TH2F* hAverageClusterSizeSummaryOB[NLayer] = { nullptr };
92+
93+
int mClusterOccupancyOB[NLayer][48][28] = { { { 0 } } };
94+
95+
// Layer synnary
96+
TH1F* hClusterSizeLayerSummary[NLayer] = { nullptr };
97+
TH1F* hClusterTopologyLayerSummary[NLayer] = { nullptr };
98+
TH1F* hGroupedClusterSizeLayerSummary[NLayer] = { nullptr };
99+
100+
// General
101+
TH2F* hClusterVsBunchCrossing = nullptr;
102+
TH2F* mGeneralOccupancy = nullptr;
73103

74-
TH2D* hAverageClusterOccupancySummaryIB[7];
75-
TH2D* hAverageClusterOccupancyMonitorIB[7]; // will be used in online data monitoring, showing occupation for the last N ROFs
76-
TH2D* hAverageClusterSizeSummaryIB[7];
77-
TH2D* hAverageClusterSizeMonitorIB[7];
104+
// Fine checks
105+
TH2F* hAverageClusterOccupancySummaryFine[NLayer] = { nullptr };
106+
TH2F* hAverageClusterSizeSummaryFine[NLayer] = { nullptr };
78107

79-
Int_t mClusterOccupancyIB[7][48][9];
80-
Int_t mClusterOccupancyIBmonitor[7][48][9];
108+
TH2F* hAverageClusterOccupancySummaryZPhi[NLayer] = { nullptr };
109+
TH2F* hAverageClusterSizeSummaryZPhi[NLayer] = { nullptr };
81110

82-
TH1D* hGroupedClusterSizeSummaryOB[7][48];
83-
TH1D* hClusterSizeSummaryOB[7][48];
84-
TH1D* hClusterTopologySummaryOB[7][48];
111+
int mClusterSize[NLayer][48][28] = { { { 0 } } }; //[#layers][max staves][max lanes / chips]
112+
int nClusters[NLayer][48][28] = { { { 0 } } };
85113

86-
TH2D* hAverageClusterOccupancySummaryOB[7];
87-
TH2D* hAverageClusterOccupancyMonitorOB[7]; // will be used in online data monitoring, showing occupation for the last N ROFs
88-
TH2D* hAverageClusterSizeSummaryOB[7];
89-
TH2D* hAverageClusterSizeMonitorOB[7];
114+
// Edges of space binning within chips (local frame coordinates)
115+
std::vector<float> vRphiBinsIB;
116+
std::vector<float> vZBinsIB;
117+
std::vector<float> vRphiBinsOB;
118+
std::vector<float> vZBinsOB;
90119

91-
// THnSparseD *sClustersSize[7];
92-
TH2D* mGeneralOccupancy;
120+
int nZBinsIB = 1;
121+
int nRphiBinsIB = 1;
122+
int nRphiBinsOB = 1;
123+
int nZBinsOB = 1;
93124

94125
const int mOccUpdateFrequency = 100000;
95126
int mDoPublish1DSummary = 0;
96127
int mNThreads = 1;
97128
int mNRofs = 0;
98-
int mNRofsMonitor = 0;
99129
int nBCbins = 103;
100130
long int mTimestamp = -1;
101131
std::string mGeomPath = "./";
102132
TString xLabel;
103133
std::string mGeoTimestamp = "1640991600000";
104134
int mLocalGeometryFile = 1;
135+
int mDoPublishDetailedSummary = 0;
105136

106-
const int mNStaves[7] = { 12, 16, 20, 24, 30, 42, 48 };
137+
const int mNStaves[NLayer] = { 12, 16, 20, 24, 30, 42, 48 };
107138
const int mNHicPerStave[NLayer] = { 1, 1, 1, 8, 8, 14, 14 };
108139
const int mNChipsPerHic[NLayer] = { 9, 9, 9, 14, 14, 14, 14 };
109140
const int mNLanePerHic[NLayer] = { 3, 3, 3, 2, 2, 2, 2 };
110141
const int ChipBoundary[NLayer + 1] = { 0, 108, 252, 432, 3120, 6480, 14712, 24120 };
111142
const int StaveBoundary[NLayer + 1] = { 0, 12, 28, 48, 72, 102, 144, 192 };
112143
const std::string mYlabels[NLayer * 2] = { "L6B(S24#rightarrow47)", "L5B(S21#rightarrow41)", "L4B(S15#rightarrow29)", "L3B(S12#rightarrow23)", "L2B(S10#rightarrow19)", "L1B(S08#rightarrow15)", "L0B(S06#rightarrow11)", "L0T(S00#rightarrow05)", "L1T(S00#rightarrow07)", "L2T(S00#rightarrow09)", "L3T(S00#rightarrow11)", "L4T(S00#rightarrow14)", "L5T(S00#rightarrow20)", "L6T(S00#rightarrow23)" };
113144

114-
int mEnableLayers[7];
115-
int mClusterSize[7][48][28] = { { { 0 } } }; //[#layers][max staves][max lanes / chips]
116-
double mClusterSizeMonitor[7][48][28] = { { { 0 } } };
117-
int nClusters[7][48][28] = { { { 0 } } };
118-
Int_t mClusterOccupancyOB[7][48][28] = { { { 0 } } };
119-
Int_t mClusterOccupancyOBmonitor[7][48][28] = { { { 0 } } };
145+
int mEnableLayers[NLayer] = { 0 };
120146

121-
o2::itsmft::TopologyDictionary* mDict;
122-
o2::its::GeometryTGeo* mGeom;
147+
o2::itsmft::TopologyDictionary* mDict = nullptr;
148+
o2::its::GeometryTGeo* mGeom = nullptr;
123149

124150
const char* OBLabel34[16] = { "HIC1L_B0_ln7", "HIC1L_A8_ln6", "HIC2L_B0_ln8", "HIC2L_A8_ln5", "HIC3L_B0_ln9", "HIC3L_A8_ln4", "HIC4L_B0_ln10", "HIC4L_A8_ln3", "HIC1U_B0_ln21", "HIC1U_A8_ln20", "HIC2U_B0_ln22", "HIC2U_A8_ln19", "HIC3U_B0_ln23", "HIC3U_A8_ln18", "HIC4U_B0_ln24", "HIC4U_A8_ln17" };
125151
const char* OBLabel56[28] = { "HIC1L_B0_ln7", "HIC1L_A8_ln6", "HIC2L_B0_ln8", "HIC2L_A8_ln5", "HIC3L_B0_ln9", "HIC3L_A8_ln4", "HIC4L_B0_ln10", "HIC4L_A8_ln3", "HIC5L_B0_ln11", "HIC5L_A8_ln2", "HIC6L_B0_ln12", "HIC6L_A8_ln1", "HIC7L_B0_ln13", "HIC7L_A8_ln0", "HIC1U_B0_ln21", "HIC1U_A8_ln20", "HIC2U_B0_ln22", "HIC2U_A8_ln19", "HIC3U_B0_ln23", "HIC3U_A8_ln18", "HIC4U_B0_ln24", "HIC4U_A8_ln17", "HIC5U_B0_ln25", "HIC5U_A8_ln16", "HIC6U_B0_ln26", "HIC6U_A8_ln15", "HIC7U_B0_ln27", "HIC7U_A8_ln14" };

Modules/ITS/itsCluster.json

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
3-
"qc": {
2+
"qc": {
43
"config": {
54
"database": {
65
"implementation": "CCDB",
@@ -23,12 +22,12 @@
2322
"url": "http://alice-ccdb.cern.ch"
2423
}
2524
},
26-
"tasks": {
25+
"tasks": {
2726
"ITSClusterTask": {
2827
"active": "true",
2928
"className": "o2::quality_control_modules::its::ITSClusterTask",
3029
"moduleName": "QcITS",
31-
"detectorName": "ITS",
30+
"detectorName": "ITS",
3231
"cycleDurationSeconds": "180",
3332
"maxNumberCycles": "-1",
3433
"dataSource_comment": "The other type of dataSource is \"direct\", see basic-no-sampling.json.",
@@ -37,18 +36,17 @@
3736
"name": "compclus"
3837
},
3938
"location": "remote",
40-
"taskParameters": {
41-
"layer": "1111111",
42-
"nThreads": "1",
43-
"nBCbins" : "103",
44-
"dicttimestamp" : "0",
45-
"geomPath": "./",
46-
"publishSummary1D": "0",
47-
"isLocalGeometry": "0",
48-
"geomstamp": "1640991600000"
49-
39+
"taskParameters": {
40+
"layer": "1111111",
41+
"nThreads": "1",
42+
"nBCbins": "103",
43+
"dicttimestamp": "0",
44+
"geomPath": "./",
45+
"publishSummary1D": "0",
46+
"publishDetailedSummary": "0",
47+
"isLocalGeometry": "0",
48+
"geomstamp": "1640991600000"
5049
}
51-
5250
}
5351
},
5452
"checks": {
@@ -59,47 +57,49 @@
5957
"policy": "OnEachSeparately",
6058
"detectorName": "ITS",
6159
"checkParameters": {
62-
"maxcluoccL0" : "5",
63-
"maxcluoccL1" : "4",
64-
"maxcluoccL2" : "3",
65-
"maxcluoccL3" : "2",
66-
"maxcluoccL4" : "1",
67-
"maxcluoccL5" : "1",
68-
"maxcluoccL6" : "1",
69-
"skipxbinsoccupancy" : "",
70-
"skipybinsoccupancy" : ""
60+
"maxcluoccL0": "5",
61+
"maxcluoccL1": "4",
62+
"maxcluoccL2": "3",
63+
"maxcluoccL3": "2",
64+
"maxcluoccL4": "1",
65+
"maxcluoccL5": "1",
66+
"maxcluoccL6": "1",
67+
"skipxbinsoccupancy": "",
68+
"skipybinsoccupancy": ""
7169
},
72-
"dataSource": [{
73-
"type": "Task",
74-
"name": "ITSClusterTask",
75-
"MOs": ["Layer0/AverageClusterSize","Layer1/AverageClusterSize","Layer2/AverageClusterSize","Layer3/AverageClusterSize","Layer4/AverageClusterSize","Layer5/AverageClusterSize","Layer6/AverageClusterSize", "General/General_Occupancy"]
76-
77-
}]
78-
}
70+
"dataSource": [
71+
{
72+
"type": "Task",
73+
"name": "ITSClusterTask",
74+
"MOs": [
75+
"Layer0/AverageClusterSize",
76+
"Layer1/AverageClusterSize",
77+
"Layer2/AverageClusterSize",
78+
"Layer3/AverageClusterSize",
79+
"Layer4/AverageClusterSize",
80+
"Layer5/AverageClusterSize",
81+
"Layer6/AverageClusterSize",
82+
"General/General_Occupancy"
83+
]
84+
}
85+
]
86+
}
7987
}
80-
},
81-
88+
},
8289
"dataSamplingPolicies": [
8390
{
84-
"id": "compclus",
85-
"active": "true",
86-
"machines": [],
87-
"query": "compclus:ITS/COMPCLUSTERS/0;clustersrof:ITS/CLUSTERSROF/0;patterns:ITS/PATTERNS/0",
88-
"samplingConditions": [
89-
{
90-
"condition": "random",
91-
"fraction": "1",
92-
"seed": "1441"
93-
}
94-
],
95-
96-
"blocking": "false"
91+
"id": "compclus",
92+
"active": "true",
93+
"machines": [],
94+
"query": "compclus:ITS/COMPCLUSTERS/0;clustersrof:ITS/CLUSTERSROF/0;patterns:ITS/PATTERNS/0",
95+
"samplingConditions": [
96+
{
97+
"condition": "random",
98+
"fraction": "1",
99+
"seed": "1441"
100+
}
101+
],
102+
"blocking": "false"
97103
}
98104
]
99-
100105
}
101-
102-
103-
104-
105-

Modules/ITS/src/ITSClusterCheck.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Quality ITSClusterCheck::check(std::map<std::string, std::shared_ptr<MonitorObje
4040
result = Quality::Good;
4141

4242
if (iter->second->getName().find("AverageClusterSize") != std::string::npos) {
43-
auto* h = dynamic_cast<TH2D*>(iter->second->getObject());
43+
auto* h = dynamic_cast<TH2F*>(iter->second->getObject());
4444
for (int ilayer = 0; ilayer < NLayer; ilayer++) {
4545
result.addMetadata(Form("Layer%d", ilayer), "good");
4646
if (iter->second->getName().find(Form("Layer%d", ilayer)) != std::string::npos && h->GetMaximum() > averageClusterSizeLimit[ilayer]) {
@@ -51,7 +51,7 @@ Quality ITSClusterCheck::check(std::map<std::string, std::shared_ptr<MonitorObje
5151
}
5252

5353
if (iter->second->getName().find("General_Occupancy") != std::string::npos) {
54-
auto* hp = dynamic_cast<TH2D*>(iter->second->getObject());
54+
auto* hp = dynamic_cast<TH2F*>(iter->second->getObject());
5555
std::vector<int> skipxbins = convertToIntArray(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "skipxbinsoccupancy", ""));
5656
std::vector<int> skipybins = convertToIntArray(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "skipybinsoccupancy", ""));
5757
std::vector<std::pair<int, int>> xypairs;
@@ -102,7 +102,7 @@ Quality ITSClusterCheck::check(std::map<std::string, std::shared_ptr<MonitorObje
102102
return result;
103103
} // end check
104104

105-
std::string ITSClusterCheck::getAcceptedType() { return "TH2D"; }
105+
std::string ITSClusterCheck::getAcceptedType() { return "TH2F"; }
106106

107107
void ITSClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult)
108108
{
@@ -112,7 +112,7 @@ void ITSClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkR
112112
Double_t positionX, positionY;
113113

114114
if (mo->getName().find("AverageClusterSize") != std::string::npos) {
115-
auto* h = dynamic_cast<TH2D*>(mo->getObject());
115+
auto* h = dynamic_cast<TH2F*>(mo->getObject());
116116
std::string histoName = mo->getName();
117117
int iLayer = histoName[histoName.find("Layer") + 5] - 48; // Searching for position of "Layer" in the name of the file, then +5 is the NUMBER of the layer, -48 is conversion to int
118118

@@ -137,7 +137,7 @@ void ITSClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkR
137137
}
138138

139139
if (mo->getName().find("General_Occupancy") != std::string::npos) {
140-
auto* h = dynamic_cast<TH2D*>(mo->getObject());
140+
auto* h = dynamic_cast<TH2F*>(mo->getObject());
141141
if (checkResult == Quality::Good) {
142142
status = "Quality::GOOD";
143143
textColor = kGreen;

0 commit comments

Comments
 (0)