9#include <pxd/modules/pxdDQM/PXDRawDQMModule.h>
10#include <vxd/geometry/GeoCache.h>
12#include <TDirectory.h>
13#include <boost/format.hpp>
38 std::string(
"pxdraw"));
48 TDirectory* oldDir = gDirectory;
54 hrawPxdPackets =
new TH1F(
"hrawPxdPackets",
"Pxd Raw Packet Nr;Nr per Event", 16, 0, 16);
55 hrawPxdPacketSize =
new TH1F(
"hrawPxdPacketSize",
"Pxd Raw Packetsize;Words per packet", 1024, 0, 1024);
57 "Pxd Raw Hit Map Overview;column+(ladder-1)*300+100;row+850*((layer-1)*2+(sensor-1))", 3700 / 50, 0, 3700, 3500 / 50, 0, 3500);
62 hrawPxdHitsCount =
new TH1F(
"hrawPxdCount",
"Pxd Raw Count ;Nr per Event", 8192, 0, 8192);
63 for (
auto i = 0; i < 64; i++) {
64 auto layer = (((i >> 5) & 0x1) + 1);
65 auto ladder = ((i >> 1) & 0xF);
66 auto sensor = ((i & 0x1) + 1);
70 string s = str(format(
"Sensor %d:%d:%d (DHH ID %02Xh)") % layer % ladder % sensor % i);
71 string s2 = str(format(
"_%d.%d.%d") % layer % ladder % sensor);
74 (
"Pxd Raw Hit Map, " + s +
";column;row").c_str(), 250,
77 (
"Pxd Raw Charge Map, " + s +
";column;row").c_str(), 250, 0, 250, 768, 0, 768);
79 (
"Pxd Raw Hit Charge, " + s +
";Charge").c_str(), 256, 0, 256);
81 (
"Pxd Raw Hit Time Window (framenr*192-gate_of_hit), " + s +
";Time [a.u.]").c_str(), 2048, -256, 2048 - 256);
83 (
"Pxd Raw Gate Time Window (framenr*192-triggergate_of_hit), " + s +
";Time [a.u.]").c_str(), 2048, -256, 2048 - 256);
114 for (
int i = 0; i < 64; i++) {
135 VxdID currentVxdId = it.getSensorID();
141 const PXDDAQDHEStatus* dhe = (*m_storeDAQEvtStats).findDHE(currentVxdId);
142 if (dhe ==
nullptr) {
143 B2ERROR(
"No DHE found for SensorId: " << currentVxdId);
150 if (dhh_id == 0 || dhh_id >= 64) {
151 B2ERROR(
"SensorId (DHH ID) out of range: " << dhh_id);
156 100 + it.getRow() + 850 * (layer + layer + sensor - 3));
169 unsigned int layer, ladder, sensor;
171 currentVxdId = it.getSensorID();
176 dhh_id = ((layer - 1) << 5) | ((ladder) << 1) | (sensor - 1);
177 if (dhh_id <= 0 || dhh_id >= 64) {
178 B2ERROR(
"SensorId (DHH ID) out of range: " << dhh_id);
182 unsigned int chip_offset;
183 chip_offset = it.getChip() * 64;
184 const unsigned char* data = &it.getData()[0];
185 for (
int row = 0; row < 768; row++) {
186 for (
int col = 0; col < 64; col++) {
187 hrawPxdAdcMapAll->Fill(col + chip_offset + ladder * 300 - 200, 100 + row + 850 * (layer + layer + sensor - 3), *(data++));
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 DAQ DHE Status class.
unsigned short getTriggerGate(void) const
get Trigger Gate
unsigned short getDHEID(void) const
Get DHE ID of sensor.
TH2F * hrawPxdAdcMapAll
Histogram Adc 2d hitmap (full frames only) (all pxd)
void initialize() override final
Initialize.
std::string m_storeRawAdcsName
RawAdcs StoreArray name.
TH1F * hrawPxdGateTimeWindow[64]
Histogram raw pixel trigger gate window.
TH1F * hrawPxdPacketSize
Histogram raw packet size.
StoreObjPtr< PXDDAQStatus > m_storeDAQEvtStats
Input array for DAQ Status.
StoreArray< RawPXD > m_storeRawPxdrarray
Storearray for raw data packets
TH1F * hrawPxdHitsCharge[64]
Histogram raw pixel charge.
void defineHisto() override final
Define histograms.
std::string m_storeRawHitsName
PXDRawHits StoreArray name.
std::string m_storeRawPxdrarrayName
RawPXD StoreArray name.
void event() override final
Event.
TH1F * hrawPxdHitsCount
Histogram pixelcount/???
TH2F * hrawPxdHitMapAll
Histogram 2d hitmap (all)
PXDRawDQMModule()
Constructor defining the parameters.
StoreArray< PXDRawAdc > m_storeRawAdcs
Storearray for ADC from full frames
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
TH1F * hrawPxdPackets
Histogram number of raw packets.
TH2F * hrawPxdHitMap[64]
Histogram 2d hitmap.
void beginRun() override final
Begin run.
TH1F * hrawPxdHitTimeWindow[64]
Histogram raw pixel hit "time" window.
StoreArray< PXDRawHit > m_storeRawHits
Storearray for raw pixels
TH2F * hrawPxdChargeMap[64]
Histogram 2d chargemap.
static GeoCache & getInstance()
Return a reference to the singleton instance.
bool validSensorID(Belle2::VxdID id) const
Check that id is a valid sensor number.
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.
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.
Namespace to provide code needed by both Vertex Detectors, PXD and SVD, and also testbeam telescopes.
Abstract base class for different kinds of events.