11 #include <pxd/modules/pxdDQM/PXDGatedDHCDQMModule.h>
12 #include "TDirectory.h"
30 setDescription(
"Monitor Gating after Injection");
31 setPropertyFlags(c_ParallelProcessingCertified);
32 addParam(
"histogramDirectoryName", m_histogramDirectoryName,
"Name of the directory where histograms will be placed",
33 std::string(
"PXDINJ"));
36 void PXDGatedDHCDQMModule::defineHisto()
38 TDirectory* oldDir = gDirectory;
39 oldDir->mkdir(m_histogramDirectoryName.c_str());
40 oldDir->cd(m_histogramDirectoryName.c_str());
42 hGateAfterInjLER =
new TH2F(
"PXDGateingInjLER",
"PXDGateingInjLER/Time;Time in #mus;Flags", 100000, 0, 50000, 64, 0, 64);
43 hGateAfterInjHER =
new TH2F(
"PXDGateingInjHER",
"PXDGateingInjHER/Time;Time in #mus;Flags", 100000, 0, 50000, 64, 0, 64);
48 void PXDGatedDHCDQMModule::initialize()
51 m_storeDAQEvtStats.isRequired();
52 m_rawTTD.isRequired();
55 void PXDGatedDHCDQMModule::beginRun()
58 hGateAfterInjLER->Reset();
59 hGateAfterInjHER->Reset();
62 void PXDGatedDHCDQMModule::event()
65 for (
auto& it : m_rawTTD) {
66 B2DEBUG(29,
"TTD FTSW : " << hex << it.GetTTUtime(0) <<
" " << it.GetTTCtime(0) <<
" EvtNr " << it.GetEveNo(0) <<
" Type " <<
67 (it.GetTTCtimeTRGType(0) & 0xF) <<
" TimeSincePrev " << it.GetTimeSincePrevTrigger(0) <<
" TimeSinceInj " <<
68 it.GetTimeSinceLastInjection(0) <<
" IsHER " << it.GetIsHER(0) <<
" Bunch " << it.GetBunchNumber(0));
71 auto difference = it.GetTimeSinceLastInjection(0);
73 if (difference != 0x7FFFFFFF) {
74 float diff2 = difference / 127.;
75 bool isher = it.GetIsHER(0);
76 for (
auto& pkt : *m_storeDAQEvtStats) {
77 for (
auto& dhc : pkt) {
78 int value = dhc.getDHCID() * 4 + dhc.getGatedFlag() * 2 + dhc.getGatedHER();
80 hGateAfterInjHER->Fill(diff2, value);
82 hGateAfterInjLER->Fill(diff2, value);