10 #include <cdc/modules/cdcDQM/CDCDQMModule.h>
15 #include <framework/database/DBObjPtr.h>
19 #include <TDirectory.h>
24 #include <cdc/dataobjects/WireID.h>
25 #include <cdc/geometry/CDCGeometryPar.h>
40 setDescription(
"Make summary of data quality.");
41 addParam(
"MinHits", m_minHits,
"Include only events with more than MinHits hits in ARICH", 0);
42 setPropertyFlags(c_ParallelProcessingCertified);
45 CDCDQMModule::~CDCDQMModule()
49 void CDCDQMModule::defineHisto()
52 TDirectory* oldDir = gDirectory;
56 m_hNEvents =
new TH1F(
"hNEvents",
"hNEvents", 10, 0, 10);
57 m_hNEvents->GetXaxis()->SetBinLabel(1,
"number of events");
58 m_hOcc =
new TH1F(
"hOcc",
"hOccupancy", 150, 0, 1.5);
59 m_hADC =
new TH2F(
"hADC",
"hADC", 300, 0, 300, 200, 0, 1000);
60 m_hTDC =
new TH2F(
"hTDC",
"hTDC", 300, 0, 300, 1000, 4200, 5200);
61 m_hHit =
new TH2F(
"hHit",
"hHit", 56, 0, 56, 400, 0, 400);
65 void CDCDQMModule::initialize()
68 m_cdcHits.isOptional();
69 m_cdcRawHits.isOptional();
70 m_trgSummary.isOptional();
72 if (!m_Tracks.isOptional()) {
73 B2WARNING(
"Missing Tracks array");
78 void CDCDQMModule::beginRun()
80 if (!m_RecoTracks.isOptional()) {
81 B2DEBUG(22,
"Missing recoTracks array in beginRun() ");
92 void CDCDQMModule::event()
95 const int nWires = 14336;
102 if (m_cdcHits.getEntries() < m_minHits) {
104 setReturnValue(0);
return;
107 m_hOcc->Fill(
static_cast<float>(m_cdcHits.getEntries()) / nWires);
109 for (
const auto& hit : m_cdcHits) {
110 int lay = hit.getICLayer();
111 int wire = hit.getIWire();
112 m_hHit->Fill(lay, wire);
116 for (
const auto& b2track : m_Tracks) {
119 B2WARNING(
"No track fit result found.");
125 B2WARNING(
"Can not access RecoTrack of this Belle2::Track");
131 if (ndf < 20)
continue;
135 const genfit::TrackPoint* tp = track->getCreatedTrackPoint(track->getRecoHitInformation(hit));
137 UChar_t lay = hit->getICLayer();
138 UShort_t IWire = hit->getIWire();
139 UShort_t adc = hit->getADCCount();
140 unsigned short tdc = hit->getTDCCount();
141 unsigned short tot = hit->getTOT();
142 WireID wireid(lay, IWire);
143 unsigned short bid = cdcgeo.
getBoardID(wireid);
145 m_hADC->Fill(bid, adc);
147 if (adc > 50 && tot > 1) {
148 m_hTDC->Fill(bid, tdc);
154 void CDCDQMModule::endRun()
156 m_hNEvents->SetBinContent(1, m_nEvents);
159 void CDCDQMModule::terminate()
Make summary of data quality from reconstruction.
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
The Class for CDC Geometry Parameters.
unsigned short getBoardID(const WireID &wID) const
Returns frontend board id. corresponding to the wire id.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
This is the Reconstruction Event-Data Model Track.
@ TTYP_RAND
random trigger events
Values of the result of a track fit with a given particle hypothesis.
Class to identify a wire inside the CDC.
Class where important numbers and properties of a fit can be stored.
double getNdf() const
Get the degrees of freedom of the fit.
Object containing AbsMeasurement and AbsFitterInfo objects.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.