14#include <dqm/analysis/modules/DQMHistAnalysisPXDFits.h>
17#include <boost/format.hpp>
41 std::string(
"PXDRAW"));
43 for (
auto i = 0, j = 0; i < 64; i++) {
44 auto layer = (((i >> 5) & 0x1) + 1);
45 auto ladder = ((i >> 1) & 0xF);
46 if (ladder == 0)
continue;
47 if (layer == 1 && ladder > 8)
continue;
48 if (layer == 2 && ladder > 12)
continue;
52 if (j == NUM_MODULES)
break;
54 for (
auto i = 0; i < NUM_MODULES; i++) {
62 B2DEBUG(1,
"DQMHistAnalysisPXDFits: Constructor done.");
67 B2DEBUG(1,
"DQMHistAnalysisPXDFits: initialized.");
73 a =
"pxdraw/hSignalAll";
74 a.ReplaceAll(
"/",
"_");
76 m_hSignalAll =
new TH1F(a, a, NUM_MODULES, 0, NUM_MODULES);
80 a =
"pxdraw/hCommonAll";
81 a.ReplaceAll(
"/",
"_");
83 m_hCommonAll =
new TH1F(a, a, NUM_MODULES, 0, NUM_MODULES);
87 a =
"pxdraw/hCountsAll";
88 a.ReplaceAll(
"/",
"_");
90 m_hCountsAll =
new TH1F(a, a, NUM_MODULES, 0, NUM_MODULES);
94 a =
"pxdraw/hOccupancyAll";
95 a.ReplaceAll(
"/",
"_");
101 for (
auto i = 0; i < NUM_MODULES; i++) {
103 auto layer = (((
id >> 5) & 0x1) + 1);
104 auto ladder = ((
id >> 1) & 0xF);
105 auto sensor = ((
id & 0x1) + 1);
106 string s2 = str(format(
"_%d.%d.%d") % layer % ladder % sensor);
108 m_hSignalAll->GetXaxis()->SetBinLabel(i + 1, TString(s2));
109 m_hCommonAll->GetXaxis()->SetBinLabel(i + 1, TString(s2));
110 m_hCountsAll->GetXaxis()->SetBinLabel(i + 1, TString(s2));
113 a =
"pxdraw/hSignal";
114 a.ReplaceAll(
"/",
"_");
118 m_hSignal[i] =
new TH2F(a, a, 6, 0, 6, 4, 0, 4);
124 a =
"pxdraw/hCommon";
125 a.ReplaceAll(
"/",
"_");
128 m_hCommon[i] =
new TH2F(a, a, 6, 0, 6, 4, 0, 4);
134 a =
"pxdraw/hCounts";
135 a.ReplaceAll(
"/",
"_");
138 m_hCounts[i] =
new TH2F(a, a, 6, 0, 6, 4, 0, 4);
143 m_fLandau =
new TF1(
"f_Landau",
"landau", 0, 256);
151 m_fGaus =
new TF1(
"f_Gaus",
"gaus", 0, 8096);
152 m_fGaus->SetParameter(0, 1000);
157 m_fGaus->SetNumberFitPoints(256);
163 B2DEBUG(1,
"DQMHistAnalysisPXDFits: beginRun called.");
166 for (
auto i = 0; i < NUM_MODULES; i++) {
183 for (
auto i = 0; i < NUM_MODULES; i++) {
185 auto layer = (((
id >> 5) & 0x1) + 1);
186 auto ladder = ((
id >> 1) & 0xF);
187 auto sensor = ((
id & 0x1) + 1);
193 for (
auto j = 0; j < 6; j++) {
194 for (
auto k = 0; k < 4; k++) {
196 string s2 = str(format(
"_%d.%d.%d_%d_%d") % layer % ladder % sensor % j % k);
198 std::string name =
"hrawPxdHitsCharge" + s2;
212 m_hSignal[i]->Fill(j, k, hh1->GetMean());
215 B2INFO(
"Histo " << name <<
" not found");
218 name =
"hrawPxdHitsCommonMode" + s2;
232 m_hCommon[i]->Fill(j, k, hh1->GetMean());
235 B2INFO(
"Histo " << name <<
" not found");
238 name =
"hrawPxdCount" + s2;
252 m_hCounts[i]->Fill(j, k, hh1->GetMean());
256 B2INFO(
"Histo " << name <<
" not found");
320 B2DEBUG(1,
"DQMHistAnalysisPXDFits : endRun called");
326 B2DEBUG(1,
"DQMHistAnalysisPXDFits: terminate called");
The base class for the histogram analysis module.
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
TH2F * m_hSignal[NUM_MODULES]
2D Signal Histograms
TH2F * m_hCommon[NUM_MODULES]
2D Common Histograms
void initialize() override final
Initializer.
DQMHistAnalysisPXDFitsModule()
Constructor.
TCanvas * m_cSignal[NUM_MODULES]
2D Signal Canvases
TCanvas * m_cOccupancyAll
All Occupancy Canvas.
TCanvas * m_cCommonAll
All Common Canvas.
TF1 * m_fGaus
Gauss Fit functions.
TCanvas * m_cCommon[NUM_MODULES]
2D Common Canvases
TH1F * m_hOccupancyAll
All Occupancy Histogram.
std::map< int, int > m_inx_to_id
maps from index to VXDid
TCanvas * m_cSignalAll
All Signal Canvas.
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.
TH1F * m_hSignalAll
All Signal Histogram.
std::string m_histogramDirectoryName
Histogram doirectory.
void endRun() override final
This method is called if the current run ends.
TH1F * m_hCountsAll
All Counts Histogram.
std::map< int, int > m_id_to_inx
maps from VXDid to index
void beginRun() override final
Called when entering a new run.
TH1F * m_hCommonAll
All Common Histogram.
TH2F * m_hCounts[NUM_MODULES]
2D Counts Histograms
TCanvas * m_cCounts[NUM_MODULES]
2D Counts Canvases
TCanvas * m_cCountsAll
All Counts Canvas.
TF1 * m_fLandau
Landau Fit functions.
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.