5#ifndef ALGO_QA_DIGIEVENTQA_H
6#define ALGO_QA_DIGIEVENTQA_H 1
14#include <unordered_map>
57 std::map<ECbmModuleId, DigiEventQaDetConfig>
fData;
61 for (
const auto& entry :
fData)
62 ss <<
"\n Subsystem " <<
::ToString(entry.first) <<
" " << entry.second.ToString();
68 for (
const auto& entry : evbuildConfig.
fWindows) {
69 auto detector = entry.first;
70 double tmin = entry.second.first - borderSize;
71 double tmax = entry.second.second + borderSize;
72 fData[detector] = {numBins, tmin, tmax};
81 std::vector<std::pair<std::string, std::string>> cfg{};
82 for (
const auto& entry :
fData) {
83 cfg.push_back(std::pair<std::string, std::string>(
GetDigiTimeHistoName(entry.first),
"DigiEvtQa"));
95 std::pair<std::string, std::string> cfgDigiTimeAll{
"digiEvtTimeQaCanv",
"digiEvtTimeQaCanv;"};
96 cfgDigiTimeAll.second +=
"Digi time in Events per subsystem;";
97 cfgDigiTimeAll.second += std::to_string(
fData.size() / 2 +
fData.size() % 2) +
";2;";
98 for (
const auto& entry :
fData) {
99 cfgDigiTimeAll.second += std::string(
"1,1,0,1,0,(") +
GetDigiTimeHistoName(entry.first) +
",hist);";
101 if (
fData.size() % 2) {
102 cfgDigiTimeAll.second += std::string(
"1,1,0,1,0,;");
104 return std::vector<std::pair<std::string, std::string>>{cfgDigiTimeAll};
146 for (
const Digi& digi : digis)
147 histo->
Fill(digi.GetTime() - eventTime);
A histogram container for the histogram server (header)
QA for CbmDigiEvent objects.
DigiEventQaConfig fConfig
DigiEventQaData operator()(const std::vector< DigiEvent > &events) const
Execution.
DigiEventQa(const DigiEventQaConfig &config)
Constructor.
std::string ToString() const
Info to string.
virtual ~DigiEventQa()=default
Destructor.
const DigiEventQaConfig & GetConfig() const
Const access to Qa config.
void QaDigiTimeInEvent(const DigiEvent &event, ECbmModuleId system, qa::H1D *histo) const
Fill histogram with digi time within event.
void FillDeltaT(gsl::span< const Digi > digis, double eventTime, qa::H1D *histo) const
Fill histogram with digi time within event.
Configuration of the EventBuilder class.
std::map< ECbmModuleId, std::pair< double, double > > fWindows
Key: detector; value: [tmin, tmax].
int Fill(double x, double w=1.)
Fills histogram.
Event data with event number and trigger time.
Configuration data for the QA of CbmDigiEvents.
std::map< ECbmModuleId, DigiEventQaDetConfig > fData
std::vector< std::pair< std::string, std::string > > GetHistosConfigs() const
std::string ToString() const
DigiEventQaConfig(const EventBuilderConfig &evbuildConfig, double borderSize, uint32_t numBins)
DigiEventQaConfig()=default
static std::string GetDigiTimeHistoName(const ECbmModuleId &subsystem)
std::vector< std::pair< std::string, std::string > > GetCanvasConfigs() const
QA results for CbmDigiEvent objects.
qa::HistogramContainer fHistContainer
std::unordered_map< ECbmModuleId, qa::H1D * > fDigiTimeHistos
Configuration data for the QA of CbmDigiEvents for a given detector.
std::string ToString() const
Structure to keep the histograms for sending them on the histogram server.