9 #include <pxd/modules/pxdDQM/PXDGatedDHCDQMModule.h>
10 #include "TDirectory.h"
28 setDescription(
"Monitor Gating after Injection");
29 setPropertyFlags(c_ParallelProcessingCertified);
30 addParam(
"histogramDirectoryName", m_histogramDirectoryName,
"Name of the directory where histograms will be placed",
31 std::string(
"PXDINJ"));
34 void PXDGatedDHCDQMModule::defineHisto()
36 TDirectory* oldDir = gDirectory;
37 oldDir->mkdir(m_histogramDirectoryName.c_str());
38 oldDir->cd(m_histogramDirectoryName.c_str());
40 hGateAfterInjLER =
new TH2F(
"PXDGateingInjLER",
"PXDGateingInjLER/Time;Time in #mus;Flags", 100000, 0, 50000, 64, 0, 64);
41 hGateAfterInjHER =
new TH2F(
"PXDGateingInjHER",
"PXDGateingInjHER/Time;Time in #mus;Flags", 100000, 0, 50000, 64, 0, 64);
46 void PXDGatedDHCDQMModule::initialize()
49 m_storeDAQEvtStats.isRequired();
50 m_rawTTD.isRequired();
53 void PXDGatedDHCDQMModule::beginRun()
56 hGateAfterInjLER->Reset();
57 hGateAfterInjHER->Reset();
60 void PXDGatedDHCDQMModule::event()
63 for (
auto& it : m_rawTTD) {
64 B2DEBUG(29,
"TTD FTSW : " << hex << it.GetTTUtime(0) <<
" " << it.GetTTCtime(0) <<
" EvtNr " << it.GetEveNo(0) <<
" Type " <<
65 (it.GetTTCtimeTRGType(0) & 0xF) <<
" TimeSincePrev " << it.GetTimeSincePrevTrigger(0) <<
" TimeSinceInj " <<
66 it.GetTimeSinceLastInjection(0) <<
" IsHER " << it.GetIsHER(0) <<
" Bunch " << it.GetBunchNumber(0));
69 auto difference = it.GetTimeSinceLastInjection(0);
71 if (difference != 0x7FFFFFFF) {
72 float diff2 = difference / 127.;
73 bool isher = it.GetIsHER(0);
74 for (
auto& pkt : *m_storeDAQEvtStats) {
75 for (
auto& dhc : pkt) {
76 int value = dhc.getDHCID() * 4 + dhc.getGatedFlag() * 2 + dhc.getGatedHER();
78 hGateAfterInjHER->Fill(diff2, value);
80 hGateAfterInjLER->Fill(diff2, value);
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
The PXD Gatint after Injection DQM 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.