12 #include <klm/modules/KLMChannelStatusCollector/KLMChannelStatusCollectorModule.h>
15 #include <klm/dataobjects/KLMChannelIndex.h>
16 #include <klm/dataobjects/KLMChannelMapValue.h>
31 m_HitMap("KLMChannelMapHits",
DataStore::c_Persistent)
33 setDescription(
"Module for KLM channel status calibration (data collection).");
34 setPropertyFlags(c_ParallelProcessingCertified);
47 TTree* calibrationData =
new TTree(
"calibration_data",
"");
48 registerObject<TTree>(
"calibration_data", calibrationData);
55 if (digit.isMultiStrip())
59 digit.getSubdetector(), digit.getSection(), digit.getSector(),
60 digit.getLayer(), digit.getPlane(), digit.getStrip());
69 TTree* calibrationData = getObjectPtr<TTree>(
"calibration_data");
70 calibrationData->Branch(
"channel", &channel,
"channel/s");
71 calibrationData->Branch(
"hits", &hits,
"hits/i");
74 channel = klmChannel.getKLMChannelNumber();
75 hits =
m_HitMap->getChannelData(channel);
76 calibrationData->Fill();
85 std::string histogramName;
86 TFile* f =
new TFile(dqmFile);
94 for (
int j = 0; j < nHistograms; ++j) {
95 histogramName =
"KLM/strip_hits_subdetector_" +
96 std::to_string(klmSector.getSubdetector()) +
97 "_section_" + std::to_string(klmSector.getSection()) +
98 "_sector_" + std::to_string(klmSector.getSector()) +
99 "_" + std::to_string(j);
100 TH1* histogram = (TH1*)f->Get(histogramName.c_str());
101 if (histogram ==
nullptr) {
102 B2ERROR(
"KLM DQM histogram " << histogramName <<
" is not found.");
105 int n = histogram->GetXaxis()->GetNbins();
106 for (
int i = 1; i <= n; ++i) {
107 uint16_t channelIndex = std::round(histogram->GetBinCenter(i));
109 m_HitMap->setChannelData(channelNumber, histogram->GetBinContent(i));