52 std::unique_ptr<KLMChannelStatus> moduleStatus;
53 std::unique_ptr<KLMChannelStatus> channelStatus;
54 if (results.m_ModuleStatus !=
nullptr)
55 moduleStatus = std::make_unique<KLMChannelStatus>(*results.m_ModuleStatus);
56 if (results.m_ChannelStatus !=
nullptr)
57 channelStatus = std::make_unique<KLMChannelStatus>(*results.m_ChannelStatus);
97 unsigned int hits, moduleHits, maxHits;
103 std::shared_ptr<TTree> calibrationData;
105 calibrationData->SetBranchAddress(
"channel", &channel);
106 calibrationData->SetBranchAddress(
"hits", &hits);
107 int n = calibrationData->GetEntries();
108 m_Results.m_HitMapChannel.setDataAllChannels(0);
112 for (
int i = 0; i < n; ++i) {
113 calibrationData->GetEntry(i);
114 m_Results.m_HitMapChannel.setChannelData(
115 channel,
m_Results.m_HitMapChannel.getChannelData(channel) + hits);
134 channel = klmChannel.getKLMChannelNumber();
143 m_Results.m_HitMapModule.setChannelData(klmModule.getKLMModuleNumber(), 0);
146 m_Results.m_HitMapSector.setChannelData(klmSector.getKLMSectorNumber(), 0);
148 channel = klmChannel.getKLMChannelNumber();
149 module = klmChannel.getKLMModuleNumber();
150 sector = klmChannel.getKLMSectorNumber();
151 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
153 module,
m_Results.m_HitMapModule.getChannelData(module) + hits);
155 sector,
m_Results.m_HitMapSector.getChannelData(sector) + hits);
162 module = klmModule.getKLMModuleNumber();
163 moduleHits =
m_Results.m_HitMapModule.getChannelData(module);
168 if (moduleHits == 0) {
169 for (; klmChannel != klmNextModule; ++klmChannel) {
173 m_Results.m_ModuleActiveChannelMap.setChannelData(module, 0);
176 unsigned int activeChannels = 0;
177 for (; klmChannel != klmNextModule; ++klmChannel) {
179 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
183 m_Results.m_ModuleActiveChannelMap.setChannelData(module, activeChannels);
186 klmChannel = klmModule;
189 for (; klmChannel != klmNextModule; ++klmChannel) {
191 if (
m_Results.m_ChannelStatus->getChannelStatus(channel) ==
194 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
195 if (hits > maxHits) {
196 klmChannelMaxHits = klmChannel;
203 moduleHits, activeChannels))
205 moduleHits -= maxHits;
211 m_Results.m_HitMapModuleNoHot.setChannelData(klmModule.getKLMModuleNumber(), 0);
213 m_Results.m_HitMapSectorNoHot.setChannelData(klmSector.getKLMSectorNumber(), 0);
217 channel = klmChannel.getKLMChannelNumber();
220 module = klmChannel.getKLMModuleNumber();
221 sector = klmChannel.getKLMSectorNumber();
222 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
223 m_Results.m_HitMapModuleNoHot.setChannelData(
224 module,
m_Results.m_HitMapModuleNoHot.getChannelData(module) + hits);
225 m_Results.m_HitMapSectorNoHot.setChannelData(
226 sector,
m_Results.m_HitMapSectorNoHot.getChannelData(sector) + hits);
233 int activeSectorsBKLM = 0;
234 int activeSectorsEKLM = 0;
236 sector = klmSector.getKLMSectorNumber();
237 hits =
m_Results.m_HitMapSectorNoHot.getChannelData(sector);
245 double averageHitsActiveSector = 0;
246 if (activeSectorsBKLM > 0) {
247 averageHitsActiveSector = double(
m_Results.m_HitNumberBKLMNoHot) /
251 bklmSector != klmSectors.
endBKLM(); ++bklmSector) {
252 sector = bklmSector.getKLMSectorNumber();
255 if (activeSectorsEKLM > 0) {
256 averageHitsActiveSector = double(
m_Results.m_HitNumberEKLMNoHot) /
260 eklmSector != klmSectors.
endEKLM(); ++eklmSector) {
261 sector = eklmSector.getKLMSectorNumber();
270 bool notEnoughData =
false;
272 module = klmModule.getKLMModuleNumber();
273 moduleHits =
m_Results.m_HitMapModuleNoHot.getChannelData(module);
280 unsigned int activeChannels = 0;
281 for (; klmChannel != klmNextModule; ++klmChannel) {
285 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
289 double averageHits = double(moduleHits) / activeChannels;
291 if (!notEnoughData) {
292 B2INFO(
"KLM module " << klmModule.getKLMModuleNumber() <<
293 " (subdetector " << klmModule.getSubdetector() <<
294 ", section " << klmModule.getSection() <<
295 ", sector " << klmModule.getSector() <<
296 ", layer " << klmModule.getLayer() <<
297 "): " << moduleHits <<
" hits, average: " << averageHits <<
".");
299 notEnoughData =
true;
302 klmChannel = klmModule;
304 for (; klmChannel != klmNextModule; ++klmChannel)