10#include <vxd/dataobjects/VxdID.h>
43 for (
int view = VIndex ; view < UIndex + 1; view++) {
44 std::string hname = name.Data();
45 bool isU = (view == UIndex);
47 m_histos[view] =
new TH2F(hname.c_str(), title.Data(),
61 enum E_side { VIndex = 0, UIndex = 1 };
72 B2WARNING(
"Unexpected view: " << view);
87 return getValue(layer, ladder, sensor, view);
96 float getValue(
int layer,
int ladder,
int sensor,
int view)
109 void fill(
int layer,
int ladder,
int sensor,
int view,
float value)
123 fill(layer, ladder, sensor, view, value);
131 for (
int view = VIndex ; view < UIndex + 1; view++) {
133 if (!
m_Title[view].EndsWith(
" "))
144 for (
int view = VIndex ; view < UIndex + 1; view++)
153 for (
int view = VIndex ; view < UIndex + 1; view++)
160 int view = isU ? UIndex : VIndex;
166 fill(layer, ladder, sensor, view, value);
172 std::string view = isU ?
"U" :
"V" ;
173 base = std::regex_replace(base, std::regex(
"[@]view"), view);
174 std::string side = isU ?
"P" :
"N" ;
175 base = std::regex_replace(base, std::regex(
"[@]side"), side);
183 for (
int view = VIndex ; view < UIndex + 1; view++)
192 for (
int view = VIndex ; view < UIndex + 1; view++)
198 TH2Poly*
getPoly(
int view,
int min = -1111,
int max = -1111)
201 TString name = histogram->GetName();
202 TString title = histogram->GetTitle();
210 m_polyHistos[view] =
new TH2Poly(name +
"_poly", title, xLow, xHigh, yLow, yHigh);
229 const double nLadders[4] = {7, 10, 12, 16};
230 const double nSensors[4] = {2, 3, 4, 5};
232 for (
int layer = 0; layer < 4; layer++) {
233 for (
int ladder = 1; ladder < nLadders[layer] + 1; ladder++) {
234 for (
int sensor = 1; sensor < nSensors[layer] + 1; sensor++) {
235 double value =
getValue(layer + 3, ladder, sensor, view);
262 return 2 + 1 + sensor;
264 return 6 + 1 + sensor;
266 return 11 + 1 + sensor;
284 TString Ylabels[nY] = {
"",
"L3.x.1",
"L3.x.2",
285 " ",
"L4.x.1",
"L4.x.2",
"L4.x.3",
286 " ",
"L5.x.1",
"L5.x.2",
"L5.x.3",
"L5.x.4",
287 " ",
"L6.x.1",
"L6.x.2",
"L6.x.3",
"L6.x.4",
"L6.x.5",
" "
290 histogram.SetMarkerSize(1.1);
291 histogram.GetXaxis()->SetTitle(
"ladder number");
292 histogram.GetXaxis()->SetLabelSize(0.04);
293 for (
unsigned short i = 0; i < nY; i++)
294 histogram.GetYaxis()->SetBinLabel(i + 1, Ylabels[i].Data());
296 bool isU = view == UIndex;
297 std::string title = histogram.GetTitle();
299 histogram.SetTitle(title.c_str());
301 std::string xAxis = histogram.GetXaxis()->GetTitle();
303 histogram.SetXTitle(xAxis.c_str());
305 std::string yAxis = histogram.GetYaxis()->GetTitle();
307 histogram.SetYTitle(yAxis.c_str());
309 std::string zAxis = histogram.GetZaxis()->GetTitle();
311 histogram.SetZTitle(zAxis.c_str());
319 const double rLayer[4] = {40, 70, 110, 160};
320 const double nLadders[4] = {7, 10, 12, 16};
321 const double nSensors[4] = {2, 3, 4, 5};
322 const double inclination[4] = {-17, -5, -13, -12};
323 const double delta[4] = {9, 8, 8, 8};
325 double pi = TMath::Pi();
327 for (
int layer = 0; layer < 4; layer ++) {
328 for (
int ladder = 1; ladder <= nLadders[layer]; ladder++) {
329 for (
int sensor = 1; sensor <= nSensors[layer]; sensor++) {
330 double r = rLayer[layer] + (delta[layer]) * (sensor - 1);
331 double phi = 2 * pi / nLadders[layer];
332 double dphiThisPoint = (ladder - 1) * phi - phi / 2 + inclination[layer] * pi /
334 double dphiNextPoint = dphiThisPoint + phi;
336 double xr0 = r * TMath::Cos(dphiThisPoint);
337 double xr1 = (r + delta[layer]) * TMath::Cos(dphiThisPoint);
338 double xr2 = (r + delta[layer]) * TMath::Cos(dphiNextPoint);
339 double xr3 = r * TMath::Cos(dphiNextPoint);
340 double yr0 = r * TMath::Sin(dphiThisPoint);
341 double yr1 = (r + delta[layer]) * TMath::Sin(dphiThisPoint);
342 double yr2 = (r + delta[layer]) * TMath::Sin(dphiNextPoint);
343 double yr3 = r * TMath::Sin(dphiNextPoint);
345 double xbin[4] = {xr0, xr1, xr2, xr3};
346 double ybin[4] = {yr0, yr1, yr2, yr3};
347 histogram->AddBin(4, xbin, ybin);
349 for (
int k = 0; k < 4; k++) {
361 const int initBinPerLayer[4] = {1, 15, 45, 93};
363 const double nLadders[4] = {7, 10, 12, 16};
364 const double nSensors[4] = {2, 3, 4, 5};
366 int bin = initBinPerLayer[layer - 3];
368 for (
int ld = 1; ld <= nLadders[layer - 3]; ld++) {
369 bool binFound =
false;
370 for (
int s = 1; s <= nSensors[layer - 3]; s++) {
371 if (ld == ladder && s == sensor) binFound =
true;
class to summarize SVD quantities per sensor and side
ClassDef(SVDSummaryPlots, 3)
needed by root
TH2F * m_histos[2]
vector containing the U and V histograms
void fill(const VxdID &vxdID, int view, float value)
fill the histogram for
~SVDSummaryPlots()
clean everything in the destructor
void clean()
delete pointers
Int_t findBinY(Int_t layer, Int_t sensor)
find the Y bin given the layer and sensor number
TH2Poly * m_polyHistos[2]
vector containing the U and V poly-histograms
void generateHistogramBins(TH2Poly *histogram)
generate histogram bins
void setStats(bool stats=true)
set histograms stat
void customizeString(std::string &base, bool isU)
replaces layer ladder sensor view and apv with the current numbers
SVDSummaryPlots(TString name, TString title)
this is the default constructor
TH2Poly * getPoly(int view, int min=-1111, int max=-1111)
Create the TH2Poly version of the plot.
float getValue(const VxdID &vxdID, int view)
get the value contained in the corresponding bin, given VxdID and view
void fill(int layer, int ladder, int sensor, int view, float value)
fill the histogram for
TH2F * getHistogram(int view)
get a reference to the histogram for
void setMinimum(Int_t value=0)
set histogram minimum
void fill(const VxdID &vxdID, bool isU, float value)
fill the histogram for
TString m_Title[2]
Base title.
SVDSummaryPlots()
Default constructor.
float getValue(int layer, int ladder, int sensor, int view)
get the value contained in the corresponding bin, given
Int_t findBinPoly(Int_t layer, Int_t ladder, Int_t sensor)
find the poly-bin given the layer, ladder and sensor number
void customize(TH2F &histogram, int view)
customize the histogram with the sensor, view
TH2F * m_defaultHistogram
default histograms
void setRunID(const TString &runID)
set run ids in title
void reset()
Reset histograms.
E_side
This enumeration assure the same semantic of the isU methods defined by Peter Kv.
void setMaximum(Int_t value=0)
set histogram maximum
Class to uniquely identify a any structure of the PXD and SVD.
baseType getSensorNumber() const
Get the sensor id.
baseType getLadderNumber() const
Get the ladder id.
baseType getLayerNumber() const
Get the layer id.
Abstract base class for different kinds of events.