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(
"refMCTP",
m_refMeanP,
"Mean of the signal time peak from Physics reference run",
float(0.0));
50 addParam(
"refMCTC",
m_refMeanC,
"Mean of the signal time peak from Cosmic reference run",
float(0.0));
51 addParam(
"samples3",
m_3Samples,
"if True 3 samples histograms analysis is performed",
bool(
false));
59 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: initialized.");
74 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: beginRun called.");
82 double timeWarnUp = 0.;
83 double timeErrorLo = 0.;
84 double timeWarnLo = 0.;
86 B2DEBUG(10,
" SVD cluster time on track threshold taken from EPICS configuration file:");
96 m_legTiNormal =
new TPaveText(0.15, 0.65, 0.35, 0.80,
"brNDC");
102 m_legTiEmpty =
new TPaveText(0.15, 0.65, 0.35, 0.80,
"brNDC");
118 m_legTi3Empty =
new TPaveText(0.15, 0.65, 0.35, 0.80,
"brNDC");
126 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: event called.");
129 TH1* hnEvnts =
findHist(
"SVDExpReco/SVDDQM_nEvents",
true);
130 if (hnEvnts == NULL) {
131 B2INFO(
"no events, nothing to do here");
134 B2DEBUG(10,
"SVDExpReco/SVDDQM_nEvents found");
137 TH1* rtype =
findHist(
"DQMInfo/rtype");
139 B2DEBUG(10,
"DQMInfo/rtype found");
141 m_runtype = rtype ? rtype->GetTitle() :
"physics";
143 TString tmp = hnEvnts->GetTitle();
144 Int_t pos = tmp.Last(
'~');
145 if (pos == -1) pos = 0;
147 TString runID = tmp(pos, tmp.Length() - pos);
148 B2INFO(
"DQMHistAnalysisSVDClustersOnTrackModule::runID = " << runID);
149 Float_t nEvents = hnEvnts->GetEntries();
152 double ratio3_6 = 0.;
153 TH1* m_h =
findHist(
"SVDClsTrk/SVDTRK_ClusterTimeV456");
156 bool hasError =
false;
157 bool lowStat =
false;
169 Float_t difference_physics = fabs(mean_PeakInCenter -
m_refMeanP);
174 Float_t difference_cosmic = fabs(mean_PeakInCenter -
m_refMeanC);
179 B2WARNING(
"Run type:" <<
m_runtype <<
"taken cosmics criteria");
180 Float_t difference_cosmic = fabs(mean_PeakInCenter -
m_refMeanC);
208 B2INFO(
"Histogram SVDClsTrk/c_SVDTRK_ClusterTimeV456 from SVDDQMClustersOnTrack module not found!");
223 m_h =
findHist(
"SVDClsTrk/SVDTRK_Cluster3TimeV456");
226 bool hasError3 =
false;
227 bool lowStat3 =
false;
238 Float_t difference_physics = fabs(mean_PeakInCenter -
m_refMeanP);
243 Float_t difference_cosmic = fabs(mean_PeakInCenter -
m_refMeanC);
273 B2INFO(
"Histogram SVDClsTrk/c_SVDTRK_Cluster3TimeV456 from SVDDQMClustersOnTrack module not found!");
293 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: endRun called");
299 B2DEBUG(10,
"DQMHistAnalysisSVDClustersOnTrack: terminate called");
The base class for the histogram analysis module.
void colorizeCanvas(TCanvas *canvas, EStatus status)
Helper function for Canvas colorization.
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
@ c_ColorDefault
default for non-coloring
void setEpicsPV(std::string keyname, double value)
Write value to a EPICS PV.
@ c_StatusDefault
default for non-coloring
@ c_StatusTooFew
Not enough entries/event to judge.
@ c_StatusError
Analysis result: Severe issue found.
@ c_StatusGood
Analysis result: Good.
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.
TPaveText * m_legTiEmpty
cluster time on tracks plot legend, empty
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
TPaveText * m_legTi3Normal
cluster time on tracks for 3 samples plot legend, normal
TString m_runtype
string with runtype: physics or cosmic
DQMHistAnalysisSVDClustersOnTrackModule()
Constructor.
TPaveText * m_legTiProblem
cluster time on tracks plot legend, problem
float m_refMeanC
mean of the signal time peak from Cosmic reference run
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.
bool m_3Samples
if true enable 3 samples histograms analysis
TH1F m_hClusterOnTrackTime_L456V
time for clusters on Track for L456V histo
TPaveText * m_legTi3Empty
cluster time on tracks for 3 samples plot legend, empty
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.
TPaveText * m_legTiNormal
cluster time on tracks plot legend, normal
float m_refMeanP
mean of the signal time peak from Physics reference run
TH1F m_hClusterOnTrackTimeL456V3Samples
time for clusters on Track for L456V histo for 3 samples
TPaveText * m_legTi3Problem
cluster time on tracks for 3 samples plot legend, problem
~DQMHistAnalysisSVDClustersOnTrackModule()
Destructor.
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.