Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 32 additions & 20 deletions Modules/EMCAL/include/EMCAL/DigitsQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "QualityControl/TaskInterface.h"
#include <array>
#include <unordered_map>
#include <string_view>
#include <gsl/span>
#include <CCDB/TObjectWrapper.h>
#include <TProfile2D.h>
Expand All @@ -40,6 +41,7 @@ namespace emcal
class Geometry;
class BadChannelMap;
class TimeCalibrationParams;
class Cell;
} // namespace emcal

namespace quality_control_modules
Expand All @@ -58,27 +60,36 @@ class DigitsQcTask final : public TaskInterface
{
public:
struct DigitsHistograms {
std::string mTriggerClass;
o2::emcal::Geometry* mGeometry;
double mCellThreshold = 0; //
//std::array<TH2*, 2> mDigitAmplitude; ///< Digit amplitude
TH2* mDigitAmplitude; ///< Digit amplitude
// std::array<TH2*, 2> mDigitTime; ///< Digit time
TH2* mDigitTime; ///< Digit time
TH2* mDigitAmplitude = nullptr; ///< Digit amplitude
// std::array<TH2*, 2> mDigitTime; ///< Digit time
TH2* mDigitTime = nullptr; ///< Digit time
//std::array<TH2*, 2> mDigitAmplitudeCalib; ///< Digit amplitude calibrated
TH2* mDigitAmplitudeCalib; ///< Digit amplitude calibrated
// std::array<TH2*, 2> mDigitTimeCalib; ///< Digit time calibrated
TH2* mDigitTimeCalib; ///< Digit time calibrated

TH2* mDigitOccupancy = nullptr; ///< Digit occupancy EMCAL and DCAL
TH2* mDigitOccupancyThr = nullptr; ///< Digit occupancy EMCAL and DCAL with Energy trheshold
TProfile2D* mIntegratedOccupancy = nullptr; ///< Digit integrated occupancy
TH1* mDigitAmplitudeEMCAL = nullptr; ///< Digit amplitude in EMCAL
TH1* mDigitAmplitudeDCAL = nullptr; ///< Digit amplitude in DCAL
TH1* mnumberEvents = nullptr; ///< Number of Events for normalization

void initForTrigger(const char* trigger);
void startPublishing();
TH2* mDigitAmplitudeCalib = nullptr; ///< Digit amplitude calibrated
// std::array<TH2*, 2> mDigitTimeCalib; ///< Digit time calibrated
TH2* mDigitTimeCalib = nullptr; ///< Digit time calibrated

TH2* mDigitAmpSupermodule = nullptr;
TH2* mDigitAmpSupermoduleCalib = nullptr;
TH2* mDigitTimeSupermodule = nullptr;
TH2* mDigitTimeSupermoduleCalib = nullptr;

TH2* mDigitOccupancy = nullptr; ///< Digit occupancy EMCAL and DCAL
TH2* mDigitOccupancyThr = nullptr; ///< Digit occupancy EMCAL and DCAL with Energy trheshold
TH2* mIntegratedOccupancy = nullptr; ///< Digit integrated occupancy
TH1* mDigitAmplitudeEMCAL = nullptr; ///< Digit amplitude in EMCAL
TH1* mDigitAmplitudeDCAL = nullptr; ///< Digit amplitude in DCAL
TH1* mnumberEvents = nullptr; ///< Number of Events for normalization

void initForTrigger(const std::string trigger, bool hasAmpVsCellID, bool hasTimeVsCellID, bool hasHistosCalib2D);
void startPublishing(o2::quality_control::core::ObjectsManager& manager);
void reset();
void clean();

void fillHistograms(const o2::emcal::Cell& cell, bool isGood, double timeoffset);
void countEvent();
};

/// \brief Constructor
Expand All @@ -95,9 +106,12 @@ class DigitsQcTask final : public TaskInterface
void endOfActivity(Activity& activity) override;
void reset() override;

void setThreshold(Double_t threshold) { mCellThreshold = threshold; }
void setEndOfPayloadCheck(Bool_t doCheck) { mDoEndOfPayloadCheck = doCheck; }

bool hasConfigValue(const std::string_view key);
std::string getConfigValue(const std::string_view key);
std::string getConfigValueLower(const std::string_view key);
Comment on lines +112 to +113
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knopers8 @Barthelemy Could those functions be pushed upwards to the TaskInterface?

Actually I am thinking about something similar to what is done for the Options by the framework having variant data types for int, float, bool and string, and a template function casting to the required type. (Would remove the need for the lambdas I am using to extract bool and float from the string myself)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


private:
struct SubEvent {
header::DataHeader::SubSpecificationType mSpecification;
Expand All @@ -124,8 +138,6 @@ class DigitsQcTask final : public TaskInterface
};
};
std::vector<CombinedEvent> buildCombinedEvents(const std::unordered_map<header::DataHeader::SubSpecificationType, gsl::span<const o2::emcal::TriggerRecord>>& triggerrecords) const;
void startPublishing(DigitsHistograms& histos);
Double_t mCellThreshold = 0.5; ///< energy cell threshold
Bool_t mDoEndOfPayloadCheck = false; ///< Do old style end-of-payload check
std::map<std::string, DigitsHistograms> mHistogramContainer; ///< Container with histograms per trigger class
o2::emcal::Geometry* mGeometry = nullptr; ///< EMCAL geometry
Expand Down
Loading