16 #ifndef QUALITYCONTROL_EXAMPLEPRINTERSPEC_H 17 #define QUALITYCONTROL_EXAMPLEPRINTERSPEC_H 23 #include <TObjArray.h> 25 #include <Framework/Task.h> 26 #include <Framework/DataRefUtils.h> 29 #include "QualityControl/QualityObject.h" 43 void run(ProcessingContext& processingContext)
final 45 LOG(INFO) <<
"Received data";
46 std::shared_ptr<TObjArray> moArray{ DataRefUtils::as<TObjArray>(*processingContext.inputs().begin()) };
48 if (moArray->IsEmpty()) {
49 LOG(INFO) <<
"Array is empty";
56 LOG(INFO) <<
"First element is not a MonitorObject";
59 auto* histo =
dynamic_cast<TH1F*
>(mo->getObject());
60 if (histo ==
nullptr) {
61 LOG(INFO) <<
"MonitorObject does not contain a TH1";
65 std::string bins =
"BINS:";
66 for (
int i = 0; i < histo->GetNbinsX(); i++) {
67 bins +=
" " + std::to_string((
int)histo->GetBinContent(i));
82 void run(ProcessingContext& processingContext)
final 84 auto qo = processingContext.inputs().get<
QualityObject*>(
"checked-mo");
86 LOG(INFO) <<
"Received Quality: " << qo->getQuality();
92 #endif //QUALITYCONTROL_EXAMPLEPRINTERSPEC_H Example DPL task to be plugged after a QC check.
Definition: ExamplePrinterSpec.h:79
Encapsulation of a Quality into a TObject that can be streamed and stored.
Definition: QualityObject.h:29
Definition: ExamplePrinterSpec.h:31
Example DPL task to be plugged after a QC task.
Definition: ExamplePrinterSpec.h:40
This class keeps the meta data about one published object.
Definition: MonitorObject.h:41