14#include <dqm/analysis/modules/DQMHistAnalysisSVD.h>
15#include <vxd/geometry/GeoCache.h>
41 B2DEBUG(10,
"DQMHistAnalysisSVD: Constructor done.");
46 "If true you can set the range of the histogram in Z with 'ColzMax' and 'ColzMin' parameters.",
77 m_legNormal =
new TPaveText(x1, y1, x2, y2,
"brNDC");
81 m_legEmpty =
new TPaveText(x1, y1, x2, y2,
"brNDC");
109 m_ly =
new TLine(0, 0, 0, 210);
110 m_ly->SetLineStyle(kDashed);
111 m_ly->SetLineWidth(2);
113 m_lx =
new TLine(0, 0, 210, 0);
114 m_lx->SetLineStyle(kDashed);
115 m_lx->SetLineWidth(2);
117 m_arrowy =
new TArrow(0, 0, 0, 10, 0.01,
"|>");
122 m_arrowx =
new TArrow(0, 0, 10, 0, 0.01,
"|>");
128DQMHistAnalysisSVDModule::~ DQMHistAnalysisSVDModule()
185 B2INFO(
"efficiency status not set properly: " << status);
196 bool isU,
bool online)
202 histo->getHistogram(isU)->Draw(
"text colz");
214 else histo->getPoly(isU)->Draw(
"colz l");
219 canvasRPhi->Modified();
220 canvasRPhi->Update();
229 histo->getHistogram(isU)->Draw(
"text colz");
238 histo->getPoly(isU, 0)->Draw(
"colz l");
242 canvasRPhi->Modified();
243 canvasRPhi->Update();
249 vector<TText*> ladders;
250 vector<TText*> sensors;
252 const double rLayer[4] = {40, 70, 110, 160};
253 const double nLadders[4] = {7, 10, 12, 16};
254 const double nSensors[4] = {2, 3, 4, 5};
255 const double position[4] = {0.8, 1.2, 1., 0.8};
256 const double delta[4] = {9, 8, 8, 8};
257 const double inclination[4] = {-17, -5, -13, -12};
259 double pi = TMath::Pi();
261 for (
int layer = 0; layer < 4; layer ++) {
262 for (
int ladder = 1; ladder <= nLadders[layer]; ladder++) {
263 double deltaText = delta[layer] + position[layer];
264 double r = rLayer[layer] + (deltaText) * nSensors[layer];
265 double phi = 2 * pi / nLadders[layer];
266 double dphiThisPoint = (ladder - 1) * phi - phi / 2 + inclination[layer] * pi / 180.;
267 double dphiNextPoint = dphiThisPoint + phi;
268 double minX = r * TMath::Cos(dphiThisPoint);
269 double maxX = (r + deltaText) * TMath::Cos(dphiNextPoint);
270 double minY = r * TMath::Sin(dphiThisPoint);
271 double maxY = (r + deltaText) * TMath::Sin(dphiNextPoint);
273 double xcen = (minX + maxX) / 2.;
274 double ycen = (minY + maxY) / 2.;
276 double angle = TMath::ATan2(ycen, xcen) * 180. / TMath::Pi() - 90.;
277 if (ycen < 0) angle = TMath::ATan2(ycen, xcen) * 180. / TMath::Pi() + 90;
279 TText* t =
new TText(xcen, ycen, Form(
"%d.%d", layer + 3, ladder));
281 t->SetTextAngle(angle);
282 t->SetTextSize(0.025);
284 ladders.push_back(t);
286 for (
int sensor = 1; sensor <= nSensors[layer]; sensor++) {
287 if ((layer == 0 && ladder == 4) || (layer == 1 && ladder == 5) || (layer == 2 && ladder == 6) || (layer == 3 && ladder == 7)) {
288 double rs = rLayer[layer] + (delta[layer]) * (sensor - 1);
289 double xcens = rs * TMath::Cos(dphiThisPoint);
290 double ycens = rs * TMath::Sin(dphiThisPoint);
292 double angles = TMath::ATan2(ycens, xcens) * 180. / pi - 90.;
293 if (ycen < 0) angles = TMath::ATan2(ycens, xcens) * 180. / pi + 90;
295 TText* ts =
new TText(xcens, ycens, Form(
"%d ", sensor));
296 ts->SetTextAlign(31);
297 ts->SetTextAngle(angles);
298 ts->SetTextSize(0.018);
300 sensors.push_back(ts);
306 return std::make_pair(ladders, sensors);
The base class for the histogram analysis module.
void colorizeCanvas(TCanvas *canvas, EStatus status)
Helper function for Canvas colorization.
@ c_ColorDefault
default for non-coloring
@ c_StatusDefault
default for non-coloring
@ c_StatusTooFew
Not enough entries/event to judge.
@ c_StatusError
Analysis result: Severe issue found.
@ c_StatusWarning
Analysis result: Warning, there may be minor issues.
@ c_StatusGood
Analysis result: Good.
int m_colzMaximum
Maximum of the histogram.
TPaveText * m_legOnlineNormal
onlineOccupancy plot legend, normal
std::pair< std::vector< TText * >, std::vector< TText * > > textModuleNumbers()
create vectors of TText to write on the canvas
TPaveText * m_legEmpty
plot legend, empty
int m_colzMinimum
Minimum of the histogram.
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
TArrow * m_arrowx
x-axis direction
std::vector< TText * > m_sensorsText
list of sensors to write on the cancas
void drawText()
draw text on the RPhi view
float m_valueMinimum
Minimum value of parameter
TPaveText * m_legNormal
plot legend, normal
TArrow * m_arrowy
y-axis direction
std::vector< TText * > m_laddersText
list of ladders to write on the canvas
TPaveText * m_legProblem
plot legend, problem
TPaveText * m_legOnlineProblem
onlineOccupancy plot legend, problem
TPaveText * m_legOnlineWarning
onlineOccupancy plot legend, warning
void updateErrCanvases(SVDSummaryPlots *histo, TCanvas *canvas, TCanvas *canvasRPhi, bool isU)
update error canvases
void updateCanvases(SVDSummaryPlots *histo, TCanvas *canvas, TCanvas *canvasRPhi, svdStatus status, bool isU, bool online=false)
update canvases
bool m_setColzRange
set the range of the histogram in colz
void setDescription(const std::string &description)
Sets the description of the module.
class to summarize SVD quantities per sensor and side
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.