forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EMCAL-527] Adding RawCheck (AliceO2Group#320)
* [EMCAL-527] Adding RawCheck Implemented Checks: - checker for ErrorType histogram * Remove extra empty line. * trigger build Co-authored-by: Giulio Eulisse <[email protected]> Co-authored-by: Barthélémy von Haller <[email protected]>
- Loading branch information
1 parent
f7125f2
commit 263e5c1
Showing
4 changed files
with
140 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright CERN and copyright holders of ALICE O2. This software is | ||
// distributed under the terms of the GNU General Public License v3 (GPL | ||
// Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// See http://alice-o2.web.cern.ch/license for full licensing information. | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// | ||
/// \file RawCheck.h | ||
/// \author Cristina Terrevoli | ||
/// | ||
|
||
#ifndef QC_MODULE_EMCAL_EMCALRAWCHECK_H | ||
#define QC_MODULE_EMCAL_EMCALRAWCHECK_H | ||
|
||
#include "QualityControl/CheckInterface.h" | ||
|
||
class TH1F; | ||
|
||
using namespace o2::quality_control::core; | ||
|
||
namespace o2::quality_control_modules::emcal | ||
{ | ||
|
||
/// \brief Example Quality Control DPL Task | ||
/// It is final because there is no reason to derive from it. Just remove it if needed. | ||
/// \author Barthelemy von Haller | ||
class RawCheck /*final*/ : public o2::quality_control::checker::CheckInterface // todo add back the "final" when doxygen is fixed | ||
{ | ||
public: | ||
/// Default constructor | ||
RawCheck() = default; | ||
/// Destructor | ||
~RawCheck() override = default; | ||
|
||
// Override interface | ||
void configure(std::string name) override; | ||
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override; | ||
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override; | ||
std::string getAcceptedType() override; | ||
|
||
ClassDefOverride(RawCheck, 1); | ||
}; | ||
|
||
} // namespace o2::quality_control_modules::emcal | ||
|
||
#endif // QC_MODULE_EMCAL_EMCALRAWCHECK_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// Copyright CERN and copyright holders of ALICE O2. This software is | ||
// distributed under the terms of the GNU General Public License v3 (GPL | ||
// Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// See http://alice-o2.web.cern.ch/license for full licensing information. | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// | ||
/// \file RawCheck.cxx | ||
/// \author Cristina Terrevoli | ||
/// | ||
|
||
#include <TCanvas.h> | ||
#include <TH1.h> | ||
#include <TH2.h> | ||
#include <TPaveText.h> | ||
#include <TList.h> | ||
|
||
#include "QualityControl/QcInfoLogger.h" | ||
#include "QualityControl/MonitorObject.h" | ||
#include "QualityControl/Quality.h" | ||
#include <fairlogger/Logger.h> | ||
#include "EMCAL/RawCheck.h" | ||
|
||
using namespace std; | ||
|
||
namespace o2::quality_control_modules::emcal | ||
{ | ||
|
||
void RawCheck::configure(std::string) {} | ||
|
||
Quality RawCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) | ||
{ | ||
auto mo = moMap->begin()->second; | ||
Quality result = Quality::Good; | ||
|
||
if (mo->getName() == "ErrorTypePerSM") { | ||
auto* h = dynamic_cast<TH2*>(mo->getObject()); | ||
if (h->GetEntries() != 0) { | ||
result = Quality::Bad; | ||
} // checker for the error type per SM | ||
} | ||
std::cout << " result " << result << std::endl; | ||
|
||
return result; | ||
} | ||
|
||
std::string RawCheck::getAcceptedType() { return "TH1"; } | ||
|
||
void RawCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult) | ||
{ | ||
if (mo->getName().find("Error") != std::string::npos) { | ||
auto* h = dynamic_cast<TH1*>(mo->getObject()); | ||
TPaveText* msg = new TPaveText(0.5, 0.5, 0.9, 0.75, "NDC"); | ||
h->GetListOfFunctions()->Add(msg); | ||
msg->SetName(Form("%s_msg", mo->GetName())); | ||
|
||
if (checkResult == Quality::Good) { | ||
//check the error type, loop on X entries to find the SM and on Y to find the Error Number | ||
// | ||
msg->Clear(); | ||
msg->AddText("No Error: OK!!!"); | ||
msg->SetFillColor(kGreen); | ||
// | ||
h->SetFillColor(kGreen); | ||
} else if (checkResult == Quality::Bad) { | ||
LOG(INFO) << "Quality::Bad, setting to red"; | ||
msg->Clear(); | ||
msg->AddText("Presence of Error Code"); //Type of the Error, in SM XX | ||
msg->AddText("If NOT a technical run,"); | ||
msg->AddText("call EMCAL on-call."); | ||
h->SetFillColor(kRed); | ||
} else if (checkResult == Quality::Medium) { | ||
LOG(INFO) << "Quality::medium, setting to orange"; | ||
h->SetFillColor(kOrange); | ||
} | ||
h->SetLineColor(kBlack); | ||
} | ||
} | ||
|
||
} // namespace o2::quality_control_modules::emcal |