Skip to content

Commit 9067738

Browse files
Copilotknopers8
andcommitted
Remove CheckInterface::getAcceptedType and isObjectCheckable methods from framework and all user code
Co-authored-by: knopers8 <14327588+knopers8@users.noreply.github.com>
1 parent 26fccb6 commit 9067738

188 files changed

Lines changed: 196 additions & 552 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Framework/include/QualityControl/CheckInterface.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,7 @@ class CheckInterface : public core::UserCodeInterface
6969
/// then this should be reset here.
7070
virtual void reset(); // not fully abstract because we don't want to change all the existing subclasses
7171

72-
/// \brief Returns the name of the class that can be treated by this check.
73-
///
74-
/// The name of the class returned by this method will be checked against the MonitorObject's encapsulated
75-
/// object's class. If it is the same or a parent then the check will be applied. Therefore, this method
76-
/// must return the highest class in the hierarchy that this check can use.
77-
/// If the class does not override it, we return "TObject".
78-
virtual std::string getAcceptedType();
79-
80-
bool isObjectCheckable(const std::shared_ptr<core::MonitorObject> mo);
81-
bool isObjectCheckable(const core::MonitorObject* mo);
72+
8273

8374
virtual void startOfActivity(const core::Activity& activity); // not fully abstract because we don't want to change all the existing subclasses
8475
virtual void endOfActivity(const core::Activity& activity); // not fully abstract because we don't want to change all the existing subclasses

Framework/src/CheckInterface.cxx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,13 @@
1818
#include "QualityControl/ReferenceUtils.h"
1919
#include "QualityControl/MonitorObject.h"
2020

21-
#include <TClass.h>
22-
2321
using namespace std;
2422
using namespace o2::quality_control::core;
2523

2624
namespace o2::quality_control::checker
2725
{
2826

29-
std::string CheckInterface::getAcceptedType() { return "TObject"; }
30-
31-
bool CheckInterface::isObjectCheckable(const std::shared_ptr<MonitorObject> mo)
32-
{
33-
return isObjectCheckable(mo.get());
34-
}
3527

36-
bool CheckInterface::isObjectCheckable(const MonitorObject* mo)
37-
{
38-
TObject* encapsulated = mo->getObject();
39-
40-
return encapsulated->IsA()->InheritsFrom(getAcceptedType().c_str());
41-
}
4228

4329
void CheckInterface::configure()
4430
{

Framework/test/testCheckInterface.cxx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ class TestCheck : public checker::CheckInterface
6262
str->String().Append(" is beautiful now");
6363
}
6464

65-
std::string getAcceptedType() override
66-
{
67-
return "TObjString";
68-
}
65+
6966

7067
string mValidString;
7168
};
@@ -91,5 +88,5 @@ TEST_CASE("test_invoke_all_interface_methods")
9188
testCheck.beautify(mo);
9289
CHECK(reinterpret_cast<TObjString*>(mo->getObject())->String() == "A string is beautiful now");
9390

94-
CHECK(testCheck.getAcceptedType() == "TObjString");
91+
9592
}

Modules/Benchmark/include/Benchmark/AlwaysGoodCheck.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ class AlwaysGoodCheck : public o2::quality_control::checker::CheckInterface
3636
// Override interface
3737
void configure() override;
3838
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-
ClassDefOverride(AlwaysGoodCheck, 2);
39+
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override; ClassDefOverride(AlwaysGoodCheck, 2);
4340
};
4441

4542
} // namespace o2::quality_control_modules::benchmark

Modules/Benchmark/src/AlwaysGoodCheck.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Quality AlwaysGoodCheck::check(std::map<std::string, std::shared_ptr<MonitorObje
3333
return Quality::Good;
3434
}
3535

36-
std::string AlwaysGoodCheck::getAcceptedType() { return ""; }
36+
3737

3838
void AlwaysGoodCheck::beautify(std::shared_ptr<MonitorObject>, Quality)
3939
{

Modules/CPV/include/CPV/PedestalCheck.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ class PedestalCheck : public o2::quality_control::checker::CheckInterface
3636
// Override interface
3737
void configure() override;
3838
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:
39+
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override; private:
4340
int getRunNumberFromMO(std::shared_ptr<MonitorObject> mo);
4441

4542
// configurable parameters and their default values

Modules/CPV/include/CPV/PhysicsCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PhysicsCheck : public o2::quality_control::checker::CheckInterface
3737
void configure() override;
3838
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
3939
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
40-
std::string getAcceptedType() override { return "TH1"; }
40+
4141

4242
private:
4343
int getRunNumberFromMO(std::shared_ptr<MonitorObject> mo);

Modules/CPV/src/PedestalCheck.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ Quality PedestalCheck::check(std::map<std::string, std::shared_ptr<MonitorObject
279279
return result;
280280
}
281281

282-
// std::string PedestalCheck::getAcceptedType() { return "TObject"; }
283-
std::string PedestalCheck::getAcceptedType() { return "TH1"; }
282+
//
283+
284284

285285
void PedestalCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult)
286286
{

Modules/CTP/include/CTP/RawDataReaderCheck.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface
4141
// Override interface
4242
void configure() override;
4343
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
44-
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
45-
std::string getAcceptedType() override;
46-
void startOfActivity(const Activity& activity) override;
44+
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override; void startOfActivity(const Activity& activity) override;
4745
const double_t nofOrbitsPerTF = o2::base::GRPGeomHelper::instance().getNHBFPerTF();
4846
const double_t TimeTF = nofOrbitsPerTF * o2::constants::lhc::LHCOrbitMUS / 1e6; // in seconds
4947

Modules/CTP/src/RawDataReaderCheck.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ float RawDataReaderCheck::setTextPosition(float iPos, std::shared_ptr<TLatex> ms
201201
return MessagePos;
202202
}
203203

204-
std::string RawDataReaderCheck::getAcceptedType() { return "TH1"; }
204+
205205

206206
void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult)
207207
{

0 commit comments

Comments
 (0)