10#include <FairRunOnline.h>
14#include <THttpServer.h>
15#include <TStopwatch.h>
50 string name =
"hDigiTime" +
ToString(entry.first);
51 string title =
ToString(entry.first) +
" digi time in event";
52 double lower = entry.second.first -
BORDER;
53 double upper = entry.second.second +
BORDER;
90 logOut << setw(15) << left << GetName() <<
" [";
91 logOut << fixed << setw(8) << setprecision(1) << right << timer.RealTime() * 1000. <<
" ms] ";
92 logOut <<
"TS " <<
fNumTs <<
", events " << numEvents;
93 LOG(info) << logOut.str();
105 LOG(info) <<
"=====================================";
106 LOG(info) << GetName() <<
": Run summary";
107 LOG(info) <<
"Timeslices : " <<
fNumTs;
109 LOG(info) <<
"Exec time : " << fixed << setprecision(2) << 1000. *
fExecTime / double(
fNumTs) <<
" ms / TS";
112 TH1D* histo = entry.second;
113 LOG(info) <<
ToString(subsystem) <<
" digi times: entries " << histo->GetEntries() <<
", mean " << histo->GetMean()
114 <<
", stddev " << histo->GetStdDev();
117 LOG(info) <<
"=====================================";
126 FairRootManager* ioman = FairRootManager::Instance();
129 LOG(info) <<
"==================================================";
130 LOG(info) << GetName() <<
": Initialising...";
133 fEvents = ioman->InitObjectAs<
const std::vector<CbmDigiEvent>*>(
"DigiEvent");
135 LOG(error) << GetName() <<
": No input branch DigiEvent!";
138 LOG(info) <<
"--- Found branch DigiEvent";
141 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
143 LOG(info) <<
"--- Http server present; registering histograms";
145 server->Register(
"DigiEvent", entry.second);
148 LOG(info) <<
"--- No Http server present";
151 fAlgo = std::make_unique<cbm::algo::evbuild::DigiEventQa>(
fConfig);
152 LOG(info) <<
fAlgo->ToString();
154 LOG(info) <<
"==================================================";
163 bool add = TH1::AddDirectoryStatus();
164 TH1::AddDirectory(
false);
167 TH1::AddDirectory(add);
168 for (uint32_t bin = 0; bin <= source.
GetNbinsX() + 1; bin++) {
ClassImp(CbmConverterManager)
std::string ToString(ECbmModuleId modId)
QA task class for digi events produced by the event builder.
size_t fNumTs
Input data (events)
CbmTaskDigiEventQa()
Constructor.
std::unique_ptr< cbm::algo::evbuild::DigiEventQa > fAlgo
double fExecTime
Execution time [s].
const std::vector< CbmDigiEvent > * fEvents
std::map< ECbmModuleId, TH1D * > fDigiTimeHistos
cbm::algo::evbuild::DigiEventQaConfig fConfig
TH1D * ToTH1D(const cbm::algo::qa::H1D &source)
Create a ROOT TH1D from a H1D object.
virtual void Exec(Option_t *opt)
Task execution.
virtual ~CbmTaskDigiEventQa()
Destructor.
size_t fNumEvents
Number of analysed events.
virtual InitStatus Init()
Task initialisation.
void Config(const cbm::algo::evbuild::Config &config)
Configuration.
virtual void Finish()
Finish timeslice.
Configuration of digi event building.
EventBuilderConfig fBuilder
Event builder configuration.
std::map< ECbmModuleId, std::pair< double, double > > fWindows
Key: detector; value: [tmin, tmax].
double GetBinContent(uint32_t iBin) const
Gets bin content.
const std::string & GetName() const
Gets name.
double GetMaxX() const
Gets x-axis lower bound.
double GetEntries() const
Gets number of entries.
double GetMinX() const
Gets x-axis lower bound.
uint32_t GetNbinsX() const
Gets number of bins for x axis.
static std::vector< DigiEvent > FromCbmDigiEvents(const std::vector< CbmDigiEvent > &events)
Configuration data for the QA of CbmDigiEvents.
std::map< ECbmModuleId, DigiEventQaDetConfig > fData
QA results for CbmDigiEvent objects.
std::unordered_map< ECbmModuleId, qa::H1D * > fDigiTimeHistos
Configuration data for the QA of CbmDigiEvents for a given detector.