9#include "pxd/modules/pxdDQM/PXDDQMExpressRecoModule.h"
11#include <pxd/geometry/SensorInfo.h>
12#include <vxd/geometry/GeoCache.h>
13#include <vxd/geometry/SensorInfoBase.h>
14#include <vxd/geometry/GeoTools.h>
15#include <pxd/unpacking/PXDMappingLookup.h>
17#include <boost/format.hpp>
19#include "TDirectory.h"
40 "Recommended Number of events for monitor is 40 kEvents or more to fill all histograms "
45 "cut on pixel charge for accepting good pixel, default >= 12", 12);
47 "cut on cluster seed for accepting good cluster, default >= 12", 12);
49 "cut on cluster size accepting good cluster, default <= 4", 4);
51 "cut on cluster charge for accepting good cluster, default >= 12", 12);
53 std::string(
"PXDER"));
64 if (gTools->getNumberOfLayers() == 0) {
65 B2FATAL(
"Missing geometry for VXD, check steering file.");
67 if (gTools->getNumberOfPXDLayers() == 0) {
68 B2WARNING(
"Missing geometry for PXD, PXD-DQM is skipped.");
73 TDirectory* oldDir = gDirectory;
80 int nPXDSensors = gTools->getNumberOfPXDSensors();
81 int nPXDChips = gTools->getTotalPXDChips();
84 m_hitMapCounts =
new TH1D(
"DQMER_PXD_PixelHitmapCounts",
"PXD Integrated number of fired pixels per sensor",
85 nPXDSensors, 0, nPXDSensors);
89 m_hitMapFilterCounts =
new TH1D(
"DQMER_PXD_PixelHitmapFilterCounts",
"PXD Integrated number of filtered pixels per sensor",
90 nPXDSensors, 0, nPXDSensors);
94 m_hitMapClCounts =
new TH1D(
"DQMER_PXD_ClusterHitmapCounts",
"PXD Integrated number of clusters per sensor",
95 nPXDSensors, 0, nPXDSensors);
99 m_hitMapClFilterCounts =
new TH1D(
"DQMER_PXD_ClusterHitmapFilterCounts",
"PXD Integrated number of filtered clusters per sensor",
100 nPXDSensors, 0, nPXDSensors);
105 m_hitMapCountsChip =
new TH1D(
"DQMER_PXD_PixelHitmapCountsChip",
"PXD Integrated number of fired pixels per chip",
106 nPXDChips, 0, nPXDChips);
109 m_hitMapClCountsChip =
new TH1D(
"DQMER_PXD_ClusterHitmapCountsChip",
"PXD Integrated number of clusters per chip",
110 nPXDChips, 0, nPXDChips);
113 for (
int i = 0; i < nPXDChips; i++) {
114 VxdID id = gTools->getChipIDFromPXDIndex(i);
116 int iLadder =
id.getLadderNumber();
117 int iSensor =
id.getSensorNumber();
118 int iChip = gTools->getPXDChipNumber(
id);
119 int IsU = gTools->isPXDSideU(
id);
120 TString AxisTicks = Form(
"%i_%i_%i_u%iDCD", iLayer, iLadder, iSensor, iChip);
122 AxisTicks = Form(
"%i_%i_%i_v%iSWB", iLayer, iLadder, iSensor, iChip);
127 for (
int i = 0; i < nPXDSensors; i++) {
128 VxdID id = gTools->getSensorIDFromPXDIndex(i);
130 int iLadder =
id.getLadderNumber();
131 int iSensor =
id.getSensorNumber();
132 TString AxisTicks = Form(
"%i_%i_%i", iLayer, iLadder, iSensor);
150 for (
int i = 0; i < nPXDSensors; i++) {
151 VxdID id = gTools->getSensorIDFromPXDIndex(i);
153 int iLadder =
id.getLadderNumber();
154 int iSensor =
id.getSensorNumber();
155 VxdID sensorID(iLayer, iLadder, iSensor);
157 string sensorDescr = str(format(
"%1%_%2%_%3%") % iLayer % iLadder % iSensor);
161 string name = str(format(
"DQMER_PXD_%1%_Fired") % sensorDescr);
162 string title = str(format(
"PXD Sensor %1% Fired pixels") % sensorDescr);
163 m_fired[i] =
new TH1D(name.c_str(), title.c_str(), 200, 0, 200);
164 m_fired[i]->SetCanExtend(TH1::kAllAxes);
165 m_fired[i]->GetXaxis()->SetTitle(
"# of fired pixels");
166 m_fired[i]->GetYaxis()->SetTitle(
"counts");
170 name = str(format(
"DQMER_PXD_%1%_GoodFired") % sensorDescr);
171 title = str(format(
"PXD Sensor %1% Good pixels") % sensorDescr);
172 m_goodfired[i] =
new TH1D(name.c_str(), title.c_str(), 200, 0, 200);
174 m_goodfired[i]->GetXaxis()->SetTitle(
"# of fired pixels");
179 name = str(format(
"DQMER_PXD_%1%_Clusters") % sensorDescr);
180 title = str(format(
"PXD Sensor %1% Clusters") % sensorDescr);
181 m_clusters[i] =
new TH1D(name.c_str(), title.c_str(), 200, 0, 200);
183 m_clusters[i]->GetXaxis()->SetTitle(
"# of clusters");
184 m_clusters[i]->GetYaxis()->SetTitle(
"counts");
188 name = str(format(
"DQMER_PXD_%1%_GoodClusters") % sensorDescr);
189 title = str(format(
"PXD Sensor %1% Good clusters") % sensorDescr);
190 m_goodclusters[i] =
new TH1D(name.c_str(), title.c_str(), 200, 0, 200);
222 name = str(format(
"DQMER_PXD_%1%_ClusterCharge") % sensorDescr);
223 title = str(format(
"PXD Sensor %1% Cluster Charge") % sensorDescr);
224 m_clusterCharge[i] =
new TH1D(name.c_str(), title.c_str(), 256, 0, 256);
230 name = str(format(
"DQMER_PXD_%1%_PixelSignal") % sensorDescr);
231 title = str(format(
"PXD Sensor %1% Pixel Signal") % sensorDescr);
232 m_pixelSignal[i] =
new TH1D(name.c_str(), title.c_str(), 256, 0, 256);
233 m_pixelSignal[i]->GetXaxis()->SetTitle(
"signal of pixels [ADU]");
238 name = str(format(
"DQMER_PXD_%1%_ClusterSizeU") % sensorDescr);
239 title = str(format(
"PXD Sensor %1% Cluster Size U") % sensorDescr);
240 m_clusterSizeU[i] =
new TH1D(name.c_str(), title.c_str(), 10, 0, 10);
246 name = str(format(
"DQMER_PXD_%1%_ClusterSizeV") % sensorDescr);
247 title = str(format(
"PXD Sensor %1% Cluster Size V") % sensorDescr);
248 m_clusterSizeV[i] =
new TH1D(name.c_str(), title.c_str(), 10, 0, 10);
254 name = str(format(
"DQMER_PXD_%1%_ClusterSizeUV") % sensorDescr);
255 title = str(format(
"PXD Sensor %1% Cluster Size U+V") % sensorDescr);
271 if (gTools->getNumberOfPXDLayers() != 0) {
281 if (gTools->getNumberOfPXDLayers() == 0)
return;
290 for (
int i = 0; i < gTools->getNumberOfPXDSensors(); i++) {
312 if (gTools->getNumberOfPXDLayers() == 0)
return;
321 vector< int > Pixels(nPXDSensors);
322 vector< int > GoodPixels(nPXDSensors);
324 int iLayer = digit.getSensorID().getLayerNumber();
325 int iLadder = digit.getSensorID().getLadderNumber();
326 int iSensor = digit.getSensorID().getSensorNumber();
327 VxdID sensorID(iLayer, iLadder, iSensor);
328 int index = gTools->getPXDSensorIndex(sensorID);
332 int indexChip = gTools->getPXDChipIndex(sensorID, kTRUE, iChip);
335 indexChip = gTools->getPXDChipIndex(sensorID, kFALSE, iChip);
340 if (digit.getCharge() >=
m_CutMinCharge && digit.getCharge() < 255) {
345 for (
int i = 0; i < nPXDSensors; i++) {
346 if (
m_fired[i] !=
nullptr && Pixels[i] > 0)
m_fired[i]->Fill(Pixels[i]);
351 vector< int > Clusters(nPXDSensors);
352 vector< int > GoodClusters(nPXDSensors);
354 int iLayer = cluster.getSensorID().getLayerNumber();
355 int iLadder = cluster.getSensorID().getLadderNumber();
356 int iSensor = cluster.getSensorID().getSensorNumber();
357 VxdID sensorID(iLayer, iLadder, iSensor);
358 int index = gTools->getPXDSensorIndex(sensorID);
362 int indexChip = gTools->getPXDChipIndex(sensorID, kTRUE, iChip);
365 indexChip = gTools->getPXDChipIndex(sensorID, kFALSE, iChip);
375 GoodClusters[index]++;
379 for (
int i = 0; i < nPXDSensors; i++) {
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
std::vector< TH1D * > m_goodfired
Filtered fired pixels per event.
TH1D * m_hitMapClFilterCounts
Hitmaps of filtered Clusters.
void initialize() override final
Initialize.
std::vector< TH1D * > m_fired
Fired pixels per event.
int m_CutMinSeedCharge
cut for accepting to filtered hitmap histogram, using cluster seed
std::vector< TH1D * > m_clusterSizeUV
Cluster size.
std::string m_storePXDClustersName
PXDClusters StoreArray name.
TH1D * m_hitMapFilterCounts
Hitmaps of filtered Digits.
void defineHisto() override final
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
int m_CutMinCharge
cut for accepting filtered pixel
void event() override final
Event.
std::vector< TH1D * > m_pixelSignal
Charge of pixels.
std::vector< TH1D * > m_clusterSizeV
v cluster size
TH1D * m_hitMapCounts
Hitmaps of Digits.
TH1D * m_hitMapCountsChip
Hitmaps of digits on chips.
TH1D * m_hitMapClCounts
Hitmaps of Clusters.
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
int m_CutMinClusterCharge
cut for accepting filtered cluster, using cluster charge
std::vector< TH1D * > m_goodclusters
filtered Clusters per event
StoreArray< PXDDigit > m_storePXDDigits
Storearray for Digits
std::vector< TH1D * > m_clusterSizeU
u cluster size
std::vector< TH1D * > m_clusters
Clusters per event.
void beginRun() override final
Begin run.
int m_CutMaxClusterSize
cut for accepting to filtered hitmap histogram, maximum cluster size
StoreArray< PXDCluster > m_storePXDClusters
Storearray for Cluster
TH1D * m_hitMapClCountsChip
Hitmaps of clusters on chips.
std::vector< TH1D * > m_clusterCharge
Start row distribution.
std::string m_storePXDDigitsName
PXDDigits StoreArray name.
PXDDQMExpressRecoModule()
Constructor.
static int getDCDID(const int u, const int v, const VxdID sensorID)
get ID of DCD for giving pixel, range: 1..4.
static int getSWBID(const int v)
get ID of SWB for giving pixel, range: 1..6.
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
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.
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
int getVCellID(double v, bool clamp=false) const
Return the corresponding pixel/strip ID of a given v coordinate.
int getUCellID(double u, double v=0, bool clamp=false) const
Return the corresponding pixel/strip ID of a given u coordinate.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getLayerNumber() const
Get the layer id.
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.
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.