14#include <dqm/analysis/modules/DQMHistAnalysisSVDClustersOnTrack.h>
15#include <vxd/geometry/GeoCache.h>
41 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: Constructor done.");
43 setDescription(
"DQM Analysis Module that produces colored canvas for a straightforward interpretation of the SVD Data Quality.");
47 addParam(
"timeThreshold",
m_timeThreshold,
"Acceptable difference between mean of central peak for present and reference run",
49 addParam(
"samples3",
m_3Samples,
"if True 3 samples histograms analysis is performed",
bool(
false));
57 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: initialized.");
72 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: beginRun called.");
80 double timeWarnUp = 0.;
81 double timeErrorLo = 0.;
82 double timeWarnLo = 0.;
84 B2DEBUG(10,
" SVD cluster time on track threshold taken from EPICS configuration file:");
111 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: event called.");
114 TH1* hnEvnts =
findHist(
"SVDExpReco/SVDDQM_nEvents",
true);
115 if (hnEvnts == NULL) {
116 B2INFO(
"no events, nothing to do here");
119 B2DEBUG(10,
"SVDExpReco/SVDDQM_nEvents found");
123 m_runtype = !rtype.empty() ? rtype.c_str() :
"physics";
126 B2INFO(
"no run type found, put defaultwise physics");
128 TString tmp = hnEvnts->GetTitle();
129 Int_t pos = tmp.Last(
'~');
130 if (pos == -1) pos = 0;
132 TString runID = tmp(pos, tmp.Length() - pos);
133 B2INFO(
"DQMHistAnalysisSVDClustersOnTrackModule::runID = " << runID);
134 Float_t nEvents = hnEvnts->GetEntries();
137 double ratio3_6 = 0.;
138 TH1* m_h =
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeV456");
163 B2INFO(
"Histogram SVDClsTrk/c_SVDTRK_ClusterTimeV456 from SVDDQMClustersOnTrack module not found!");
175 m_h =
findHist(
"SVDClsTrk/SVDTRK_Cluster3TimeV456");
198 B2INFO(
"Histogram SVDClsTrk/c_SVDTRK_Cluster3TimeV456 from SVDDQMClustersOnTrack module not found!");
215 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: endRun called");
221 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: terminate called");
234 text->SetText(text->GetX(), text->GetY(), Form(
"Mode: %3.1f ns", mode));
238 text->SetText(text->GetX(), text->GetY(), Form(
"Mode: %3.1f ns", mode));
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
static const std::string & getRunType(void)
Get the list of the reference histograms.
void setEpicsPV(std::string keyname, double value)
Write value to a EPICS PV.
int registerEpicsPV(std::string pvname, std::string keyname="")
EPICS related Functions.
bool requestLimitsFromEpicsPVs(chid id, double &lowerAlarm, double &lowerWarn, double &upperWarn, double &upperAlarm)
Get Alarm Limits from EPICS PV.
TCanvas * m_cClusterOnTrackTimeL456V3Samples
time for clusters on Track for L456V canvas for 3 sampples
void initialize() override final
Initializer.
double m_statThreshold
minimal number of events to compare histograms
double m_timeThreshold
difference between mean of cluster time for present and reference run
TString m_runtype
string with runtype: physics or cosmic
DQMHistAnalysisSVDClustersOnTrackModule()
Constructor.
std::string m_pvPrefix
string prefix for EPICS PVs
void terminate() override final
This method is called at the end of the event processing.
void event() override final
This method is called for each event.
bool m_printCanvas
Parameters accesible from basf2 scripts.
int getCanvasStatus(double mode)
get canvas status
bool m_3Samples
if true enable 3 samples histograms analysis
TH1F m_hClusterOnTrackTime_L456V
time for clusters on Track for L456V histo
void endRun() override final
This method is called if the current run ends.
TCanvas * m_cClusterOnTrackTime_L456V
time for clusters on Track for L456V canvas
void beginRun() override final
Called when entering a new run.
TH1F m_hClusterOnTrackTimeL456V3Samples
time for clusters on Track for L456V histo for 3 samples
~DQMHistAnalysisSVDClustersOnTrackModule()
Destructor.
TString getHistoNameFromCanvas(TString cName, TString view="", TString cPrefix="c_", TString hPrefix="")
get histogram name from Canvas name
TPaveText * m_legEmpty
plot legend, empty
TPaveText * m_legLowStat
plot legend, low stats
DQMHistAnalysisSVDModule(bool panelTop=false, bool online=false)
Constructor.
TPaveText * m_legWarning
plot legend, warning
void setStatusOfCanvas(int status, TCanvas *canvas, bool plotLeg=true, bool online=false)
set status of Canvas
TPaveText * m_legNormal
plot legend, normal
TPaveText * m_legProblem
plot legend, problem
void setDescription(const std::string &description)
Sets the description of the module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.