62 unsigned int hits, moduleHits, maxHits;
68 std::shared_ptr<TTree> calibrationData;
70 calibrationData->SetBranchAddress(
"channel", &channel);
71 calibrationData->SetBranchAddress(
"hits", &hits);
72 int n = calibrationData->GetEntries();
73 m_Results.m_HitMapChannel.setDataAllChannels(0);
77 for (
int i = 0; i < n; ++i) {
78 calibrationData->GetEntry(i);
80 channel,
m_Results.m_HitMapChannel.getChannelData(channel) + hits);
99 channel = klmChannel.getKLMChannelNumber();
108 m_Results.m_HitMapModule.setChannelData(klmModule.getKLMModuleNumber(), 0);
111 m_Results.m_HitMapSector.setChannelData(klmSector.getKLMSectorNumber(), 0);
113 channel = klmChannel.getKLMChannelNumber();
114 module = klmChannel.getKLMModuleNumber();
115 sector = klmChannel.getKLMSectorNumber();
116 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
118 module,
m_Results.m_HitMapModule.getChannelData(module) + hits);
120 sector,
m_Results.m_HitMapSector.getChannelData(sector) + hits);
127 module = klmModule.getKLMModuleNumber();
128 moduleHits =
m_Results.m_HitMapModule.getChannelData(module);
133 if (moduleHits == 0) {
134 for (; klmChannel != klmNextModule; ++klmChannel) {
138 m_Results.m_ModuleActiveChannelMap.setChannelData(module, 0);
141 unsigned int activeChannels = 0;
142 for (; klmChannel != klmNextModule; ++klmChannel) {
144 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
148 m_Results.m_ModuleActiveChannelMap.setChannelData(module, activeChannels);
151 klmChannel = klmModule;
154 for (; klmChannel != klmNextModule; ++klmChannel) {
156 if (
m_Results.m_ChannelStatus->getChannelStatus(channel) ==
159 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
160 if (hits > maxHits) {
161 klmChannelMaxHits = klmChannel;
168 moduleHits, activeChannels))
170 moduleHits -= maxHits;
176 m_Results.m_HitMapModuleNoHot.setChannelData(klmModule.getKLMModuleNumber(), 0);
178 m_Results.m_HitMapSectorNoHot.setChannelData(klmSector.getKLMSectorNumber(), 0);
182 channel = klmChannel.getKLMChannelNumber();
185 module = klmChannel.getKLMModuleNumber();
186 sector = klmChannel.getKLMSectorNumber();
187 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
188 m_Results.m_HitMapModuleNoHot.setChannelData(
189 module,
m_Results.m_HitMapModuleNoHot.getChannelData(module) + hits);
190 m_Results.m_HitMapSectorNoHot.setChannelData(
191 sector,
m_Results.m_HitMapSectorNoHot.getChannelData(sector) + hits);
198 int activeSectorsBKLM = 0;
199 int activeSectorsEKLM = 0;
201 sector = klmSector.getKLMSectorNumber();
202 hits =
m_Results.m_HitMapSectorNoHot.getChannelData(sector);
210 double averageHitsActiveSector = 0;
211 if (activeSectorsBKLM > 0) {
212 averageHitsActiveSector = double(
m_Results.m_HitNumberBKLMNoHot) /
216 bklmSector != klmSectors.
endBKLM(); ++bklmSector) {
217 sector = bklmSector.getKLMSectorNumber();
220 if (activeSectorsEKLM > 0) {
221 averageHitsActiveSector = double(
m_Results.m_HitNumberEKLMNoHot) /
225 eklmSector != klmSectors.
endEKLM(); ++eklmSector) {
226 sector = eklmSector.getKLMSectorNumber();
235 bool notEnoughData =
false;
237 module = klmModule.getKLMModuleNumber();
238 moduleHits =
m_Results.m_HitMapModuleNoHot.getChannelData(module);
245 unsigned int activeChannels = 0;
246 for (; klmChannel != klmNextModule; ++klmChannel) {
250 hits =
m_Results.m_HitMapChannel.getChannelData(channel);
254 double averageHits = double(moduleHits) / activeChannels;
256 if (!notEnoughData) {
257 B2INFO(
"KLM module " << klmModule.getKLMModuleNumber() <<
258 " (subdetector " << klmModule.getSubdetector() <<
259 ", section " << klmModule.getSection() <<
260 ", sector " << klmModule.getSector() <<
261 ", layer " << klmModule.getLayer() <<
262 "): " << moduleHits <<
" hits, average: " << averageHits <<
".");
264 notEnoughData =
true;
267 klmChannel = klmModule;
269 for (; klmChannel != klmNextModule; ++klmChannel)