9 #include "dqm/modules/DelayDQMModule.h"
11 #include "TDirectory.h"
29 setDescription(
"Processing Delay DQM module");
30 setPropertyFlags(c_ParallelProcessingCertified);
31 addParam(
"histogramDirectoryName", m_histogramDirectoryName,
"Name of the directory where histograms will be placed",
33 addParam(
"title", m_title,
"Prefix for Title (ERECO, HLT, ...)", std::string(
"Processing "));
34 addParam(
"useMeta", m_useMeta,
"Use time from EvtMetadata or FTSW",
false);
41 TAxis* axis = h->GetXaxis();
42 Int_t bins = axis->GetNbins();
44 Axis_t from = axis->GetXmin();
45 Axis_t to = axis->GetXmax();
46 Axis_t width = (to - from) / bins;
47 Axis_t* new_bins =
new Axis_t[bins + 1];
49 for (Int_t i = 0; i <= bins; i++) {
50 new_bins[i] = TMath::Power(10, from + i * width);
52 axis->Set(bins, new_bins);
63 TDirectory* oldDir = gDirectory;
70 m_DelayS =
new TH1D(
"DelayS", (
m_title +
"Delay;time /s").c_str(), 600, 0, 600);
71 m_DelayMs =
new TH1D(
"DelayMs", (
m_title +
"Delay;time /ms").c_str(), 200, 0, 2000);
72 m_DelayLog =
new TH1D(
"DelayLog", (
m_title +
"Delay; time /s").c_str(), 200, -3, 6);
107 using namespace std::chrono;
108 nanoseconds ns = duration_cast<nanoseconds> (system_clock::now().time_since_epoch());
109 nanoseconds event_time{};
119 it.GetPCTimeVal(0, &tv);
120 event_time = (
static_cast<seconds
>(tv.tv_sec)) + (
static_cast<microseconds
>(tv.tv_usec));
124 auto deltaT = (duration_cast<milliseconds> (ns - event_time)).count();
Processing Delay DQM Module.
void initialize() override final
Module functions.
void defineHisto() override final
Function to define histograms.
StoreArray< RawFTSW > m_rawFTSW
Input for FTSW.
StoreObjPtr< EventMetaData > m_eventMetaData
Input ptr for EventMetaData.
bool m_useMeta
use time from Meta or FTSW
void event() override final
Function to process event record.
void BinLogX(TH1 *h)
helper function to replace X axis by a log scaled axis
std::string m_title
Prefix for title (NOT histo name)
TH1D * m_DelayS
Delay between trigger and end of processing in s.
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
TH1D * m_DelayLog
Delay between trigger and end of processing log scale.
TH1D * m_DelayMs
Delay between trigger and end of processing in ms.
void beginRun() override final
Function to process begin_run record.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.