Skip to content

Commit ee01a94

Browse files
authored
ITS: QCReview2023 comments (#2051)
* ITS: QCReview2023 comments * Second portion of fixes * Ivan's comments
1 parent d2d098d commit ee01a94

34 files changed

Lines changed: 245 additions & 310 deletions

Modules/ITS/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ add_root_dictionary(O2QcITS
7979
include/ITS/ITSTrackSimTask.h
8080
include/ITS/ITSThresholdCalibrationCheck.h
8181
include/ITS/ITSDecodingErrorTask.h
82-
include/ITS/ITSDecodingErrorCheck.h
82+
include/ITS/ITSDecodingErrorCheck.h
83+
include/ITS/ITSHelpers.h
8384
LINKDEF include/ITS/LinkDef.h)
8485

8586
# ---- Test(s) ----

Modules/ITS/include/ITS/ITSClusterCheck.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
#include <TLatex.h>
2424
#include <TLine.h>
2525
#include <TH2Poly.h>
26-
#include <vector>
27-
#include <string>
28-
#include <sstream>
26+
#include "ITS/ITSHelpers.h"
2927

3028
namespace o2::quality_control_modules::its
3129
{
@@ -45,25 +43,6 @@ class ITSClusterCheck : public o2::quality_control::checker::CheckInterface
4543
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
4644
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
4745
std::string getAcceptedType() override;
48-
template <typename T>
49-
std::vector<T> convertToArray(std::string input)
50-
{
51-
52-
std::istringstream ss{ input };
53-
54-
std::vector<T> result;
55-
std::string token;
56-
57-
while (std::getline(ss, token, ',')) {
58-
59-
if constexpr (std::is_same_v<T, int>) {
60-
result.push_back(std::stoi(token));
61-
} else if constexpr (std::is_same_v<T, std::string>) {
62-
result.push_back(token);
63-
}
64-
}
65-
return result;
66-
}
6746

6847
private:
6948
ClassDefOverride(ITSClusterCheck, 2);

Modules/ITS/include/ITS/ITSClusterTask.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,14 @@
1818
#define QC_MODULE_ITS_ITSCLUSTERTASK_H
1919

2020
#include "QualityControl/TaskInterface.h"
21-
#include <TH1.h>
22-
#include <TH2.h>
23-
#include <TString.h>
24-
#include <THnSparse.h>
25-
#include <string>
2621
#include "Common/TH2Ratio.h"
2722

2823
#include <DataFormatsITSMFT/TopologyDictionary.h>
2924
#include <ITSBase/GeometryTGeo.h>
3025
#include <Framework/TimingInfo.h>
3126

32-
#include <TLine.h>
33-
#include <TLatex.h>
34-
35-
class TH1F;
36-
class TH2F;
27+
class TH1;
28+
class TH2;
3729

3830
using namespace o2::quality_control::core;
3931
using namespace o2::quality_control_modules::common;

Modules/ITS/include/ITS/ITSDecodingErrorCheck.h

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919

2020
#include "QualityControl/CheckInterface.h"
2121
#include <TLatex.h>
22-
#include <string>
23-
#include <vector>
24-
#include <sstream>
2522
#include "ITSMFTReconstruction/DecodingStat.h"
23+
#include "ITS/ITSHelpers.h"
24+
25+
class TH1;
26+
class TH2;
2627

2728
namespace o2::quality_control_modules::its
2829
{
@@ -45,28 +46,6 @@ class ITSDecodingErrorCheck : public o2::quality_control::checker::CheckInterfac
4546
bool doFlatCheck = false;
4647
o2::itsmft::GBTLinkDecodingStat statistics;
4748

48-
template <typename T>
49-
std::vector<T> convertToArray(std::string input)
50-
{
51-
52-
std::istringstream ss{ input };
53-
54-
std::vector<T> result;
55-
std::string token;
56-
57-
while (std::getline(ss, token, ',')) {
58-
59-
if constexpr (std::is_same_v<T, int>) {
60-
result.push_back(std::stoi(token));
61-
} else if constexpr (std::is_same_v<T, float>) {
62-
result.push_back(std::stof(token));
63-
} else if constexpr (std::is_same_v<T, std::string>) {
64-
result.push_back(token);
65-
}
66-
}
67-
return result;
68-
}
69-
7049
private:
7150
int nCycle = 0;
7251
// set timer

Modules/ITS/include/ITS/ITSDecodingErrorTask.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#include "QualityControl/TaskInterface.h"
2121
#include "Common/TH1Ratio.h"
2222

23-
#include <TH1.h>
24-
#include <TH2.h>
23+
#include <TH1D.h>
24+
#include <TH2D.h>
2525

26-
class TH2D;
27-
class TH1D;
26+
// class TH2D;
27+
// class TH1D;
2828

2929
using namespace o2::quality_control::core;
3030
using namespace o2::quality_control_modules::common;

Modules/ITS/include/ITS/ITSFeeCheck.h

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
#include "QualityControl/CheckInterface.h"
2323
#include <TH2Poly.h>
2424
#include <TLatex.h>
25-
#include <string>
26-
#include <vector>
27-
#include <sstream>
28-
25+
#include "ITS/ITSHelpers.h"
2926
namespace o2::quality_control_modules::its
3027
{
3128

@@ -44,26 +41,7 @@ class ITSFeeCheck : public o2::quality_control::checker::CheckInterface
4441
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
4542
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
4643
std::string getAcceptedType() override;
47-
template <typename T>
48-
std::vector<T> convertToArray(std::string input)
49-
{
50-
51-
std::istringstream ss{ input };
52-
53-
std::vector<T> result;
54-
std::string token;
55-
56-
while (std::getline(ss, token, ',')) {
57-
58-
if constexpr (std::is_same_v<T, int>) {
59-
result.push_back(std::stoi(token));
60-
} else if constexpr (std::is_same_v<T, std::string>) {
61-
result.push_back(token);
62-
}
63-
}
6444

65-
return result;
66-
}
6745
bool checkReason(Quality checkResult, TString text);
6846

6947
private:

Modules/ITS/include/ITS/ITSFeeTask.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,13 @@
2525
#include "Headers/RDHAny.h"
2626
#include "DetectorsRaw/RDHUtils.h"
2727

28-
#include <TH1.h>
29-
#include <TH2.h>
3028
#include <TH2Poly.h>
31-
#include "TMath.h"
29+
#include <TMath.h>
3230
#include <TLine.h>
33-
#include <TText.h>
3431
#include <TLatex.h>
35-
#include <TLine.h>
36-
#include <TLegend.h>
3732

38-
class TH2I;
39-
class TH1I;
40-
class TH2F;
33+
class TH1;
34+
class TH2;
4135

4236
using namespace o2::quality_control::core;
4337

@@ -173,7 +167,6 @@ class ITSFeeTask final : public TaskInterface
173167
TH1I* mTFInfo; // count vs TF ID
174168
TH2I* mTriggerVsFeeId;
175169
TH1I* mTrigger;
176-
TH2I* mLaneInfo;
177170
TH2I* mFlag1Check; // include transmission_timeout, packet_overflow, lane_starts_violation
178171
TH2I* mDecodingCheck; // summary of errors during custom decoding of specific bytes (see plot description)
179172
TH2I* mRDHSummary;
@@ -192,8 +185,6 @@ class ITSFeeTask final : public TaskInterface
192185
TH1D* mProcessingTime2;
193186
TH2F* mPayloadSize; // average payload size vs linkID
194187
// TH1D* mInfoCanvas;//TODO: default, not implemented yet
195-
std::string mRunNumberPath;
196-
std::string mRunNumber = "000000";
197188
};
198189

199190
} // namespace o2::quality_control_modules::its

Modules/ITS/include/ITS/ITSFhrCheck.h

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
#define QC_MODULE_ITS_ITSFHRCHECK_H
2020

2121
#include "QualityControl/CheckInterface.h"
22-
#include <string>
23-
#include <vector>
24-
#include <sstream>
2522
#include <TLatex.h>
23+
#include "ITS/ITSHelpers.h"
2624

2725
namespace o2::quality_control_modules::its
2826
{
@@ -42,26 +40,6 @@ class ITSFhrCheck : public o2::quality_control::checker::CheckInterface
4240
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
4341
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
4442
std::string getAcceptedType() override;
45-
template <typename T>
46-
std::vector<T> convertToArray(std::string input)
47-
{
48-
49-
std::istringstream ss{ input };
50-
51-
std::vector<T> result;
52-
std::string token;
53-
54-
while (std::getline(ss, token, ',')) {
55-
56-
if constexpr (std::is_same_v<T, int>) {
57-
result.push_back(std::stoi(token));
58-
} else if constexpr (std::is_same_v<T, std::string>) {
59-
result.push_back(token);
60-
}
61-
}
62-
63-
return result;
64-
}
6543
bool checkReason(Quality checkResult, TString text);
6644

6745
private:

Modules/ITS/include/ITS/ITSFhrTask.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525
#include <ITSMFTReconstruction/RawPixelDecoder.h>
2626

2727
#include <TText.h>
28-
#include <TH1.h>
29-
#include <TH2.h>
3028
#include <THnSparse.h>
3129
#include <TH2Poly.h>
3230

33-
class TH1F;
31+
class TH1;
3432
class TH2;
3533

3634
using namespace o2::quality_control::core;
@@ -61,7 +59,6 @@ class ITSFhrTask final : public TaskInterface
6159
void reset() override;
6260

6361
private:
64-
int mAverageProcessTime = 0;
6562
int mTFCount = 0;
6663
void setAxisTitle(TH1* object, const char* xTitle, const char* yTitle);
6764
void createGeneralPlots(); // create General Plots depend mLayer which define by json file
@@ -99,12 +96,8 @@ class ITSFhrTask final : public TaskInterface
9996
o2::itsmft::RawPixelDecoder<o2::itsmft::ChipMappingITS>* mDecoder;
10097
ChipPixelData* mChipDataBuffer = nullptr;
10198
std::vector<ChipPixelData> mChipsBuffer;
102-
int mHitNumberOfChip[7][48][2][14][14] = { { { { { 0 } } } } }; // layer, stave, substave, hic, chip
10399

104-
int mNTrigger = 13;
105-
unsigned int mErrors[19] = { 0 };
106100
static constexpr int NTrigger = 13;
107-
int16_t partID = 0;
108101
int mLayer = 0;
109102
int mHitCutForCheck = 100; // Hit number cut for fired pixel check in a trigger
110103
int mGetTFFromBinding = 0;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef QC_MODULE_ITS_ITSHELPERS_H
2+
#define QC_MODULE_ITS_ITSHELPERS_H
3+
4+
#include "QualityControl/DatabaseInterface.h"
5+
#include "QualityControl/Quality.h"
6+
#include <TCanvas.h>
7+
#include <TH1F.h>
8+
#include <TH2F.h>
9+
#include <TGraph.h>
10+
#include <TLegend.h>
11+
#include <TText.h>
12+
13+
namespace o2::quality_control_modules::its
14+
{
15+
template <typename T>
16+
std::vector<T> convertToArray(std::string input)
17+
{
18+
19+
std::istringstream ss{ input };
20+
21+
std::vector<T> result;
22+
std::string token;
23+
while (std::getline(ss, token, ',')) {
24+
25+
if constexpr (std::is_same_v<T, int>) {
26+
result.push_back(std::stoi(token));
27+
} else if constexpr (std::is_same_v<T, std::string>) {
28+
result.push_back(token);
29+
}
30+
}
31+
32+
return result;
33+
}
34+
35+
} // namespace o2::quality_control_modules::its
36+
#endif

0 commit comments

Comments
 (0)