14#include <dqm/analysis/modules/DQMHistAnalysisPXDCharge.h>
17#include <vxd/geometry/GeoCache.h>
42 B2DEBUG(99,
"DQMHistAnalysisPXDCharge: Constructor done.");
51 B2DEBUG(99,
"DQMHistAnalysisPXDCharge: initialized.");
58 for (
VxdID& aVxdID : sensors) {
68 m_hCharge =
new TH1F(
"hPXDClusterCharge",
"PXD Cluster Charge; Module; Track Cluster Charge",
m_PXDModules.size(), 0,
74 m_hCharge->GetXaxis()->SetBinLabel(i + 1, ModuleName);
119 B2DEBUG(99,
"DQMHistAnalysisPXDCharge: beginRun called.");
131 for (
unsigned int i = 0; i <
m_PXDModules.size(); i++) {
132 std::string name =
"DQMER_PXD_" + (std::string)
m_PXDModules[i] +
"_ClusterCharge";
133 std::replace(name.begin(), name.end(),
'.',
'_');
147 if (hh1->GetEntries() > 100) {
161 if (hh1->GetEntries() > 100)
m_fLandau->Draw(
"same");
164 if (hh1->GetEntries() > 1000) enough =
true;
172 double currentMin, currentMax;
178 data =
m_fMean->GetParameter(0);
179 m_hCharge->GetMinimumAndMaximum(currentMin, currentMax);
180 diff = fabs(data - currentMin) > fabs(currentMax - data) ? fabs(data - currentMin) : fabs(currentMax - data);
181 if (0) B2INFO(
"Mean: " << data <<
" Max Diff: " << diff);
195 if (fabs(data - 50.) > 20. || diff > 30) {
198 }
else if (fabs(data - 50) > 15. || diff > 10) {
213 static std::map <int, TLatex*> ltmap;
216 tt =
new TLatex(it + 0.5, 0, (
" " + std::string(
m_PXDModules[it]) +
" Module is excluded, please ignore").c_str());
217 tt->SetTextSize(0.035);
218 tt->SetTextAngle(90);
219 tt->SetTextAlign(12);
232 B2DEBUG(99,
"DQMHistAnalysisPXDCharge : endRun called");
238 B2DEBUG(99,
"DQMHistAnalysisPXDCharge: terminate called");
The base class for the histogram analysis module.
static MonitoringObject * getMonitoringObject(const std::string &name)
Get MonitoringObject with given name (new object is created if non-existing)
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
void setEpicsPV(std::string keyname, double value)
Write value to a EPICS PV.
int registerEpicsPV(std::string pvname, std::string keyname="")
EPICS related Functions.
void UpdateCanvas(std::string name, bool updated=true)
Mark canvas as updated (or not)
void terminate(void) override final
This method is called at the end of the event processing.
TCanvas * m_cCharge
Final Canvas.
double m_rangeLow
fit range lo edge for landau
~DQMHistAnalysisPXDChargeModule()
Destructor.
DQMHistAnalysisPXDChargeModule()
Constructor.
void initialize(void) override final
Initializer.
TH1F * m_hCharge
Histogram covering all modules.
void endRun(void) override final
This method is called if the current run ends.
MonitoringObject * m_monObj
Monitoring Object.
TF1 * m_fMean
Fit the Mean for all modules.
std::vector< VxdID > m_PXDModules
IDs of all PXD Modules to iterate over.
std::string m_histogramDirectoryName
name of histogram directory
double m_rangeHigh
fit range hi edge for landau
std::vector< int > m_excluded
Indizes of excluded PXD Modules.
TF1 * m_fLandau
only one fit function for all Landaus
void beginRun(void) override final
Called when entering a new run.
void event(void) override final
This method is called for each event.
void setDescription(const std::string &description)
Sets the description of the module.
void addCanvas(TCanvas *canv)
Add Canvas to monitoring object.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
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.