9#include <top/modules/collectors/TOPChannelMaskCollectorModule.h>
34 setDescription(
"A collector for preparing masks of dead and hot channels");
44 auto nhits =
new TH1F(
"nhits",
"Number of good hits per event; hits per event; entries per bin", 200, 0, 2000);
45 registerObject<TH1F>(
"nhits", nhits);
47 for (
int slot = 1; slot <= 16; slot++) {
48 string name =
"hits_" + to_string(slot);
49 string title =
"Channel occupancies for slot " + to_string(slot);
50 auto h =
new TH1F(name.c_str(), title.c_str(), 512, 0, 512);
51 h->SetXTitle(
"channel number");
52 h->SetYTitle(
"number of hits per channel");
53 registerObject<TH1F>(name, h);
57 for (
int slot = 1; slot <= 16; slot++) {
58 string name =
"window_vs_asic_" + to_string(slot);
59 string title =
"Window vs. asic for slot " + to_string(slot);
60 auto h =
new TH2F(name.c_str(), title.c_str(), 64, 0, 64, 512, 0, 512);
61 h->SetXTitle(
"ASIC number");
62 h->SetYTitle(
"window number w.r.t reference window");
63 registerObject<TH2F>(name, h);
73 std::vector<TH1F*> slots;
74 for (
const auto& name :
m_names) {
75 auto h = getObjectPtr<TH1F>(name);
79 std::vector<TH2F*> asics;
81 auto h = getObjectPtr<TH2F>(name);
87 if (digit.getHitQuality() == TOPDigit::c_Junk)
continue;
89 unsigned m = digit.getModuleID() - 1;
90 if (m < slots.size()) slots[m]->Fill(digit.getChannel());
91 if (m < asics.size()) asics[m]->Fill(digit.getChannel() / 8, digit.getRawTime() / 64 + 220);
94 auto h = getObjectPtr<TH1F>(
"nhits");
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
std::vector< std::string > m_asicNames
histogram names: window vs.
std::vector< std::string > m_names
histogram names: channel occupancies
StoreArray< TOPDigit > m_digits
collection of TOP digits
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
virtual void collect() final
Replacement for event().
virtual void prepare() final
Replacement for initialize().
TOPChannelMaskCollectorModule()
Constructor.
Abstract base class for different kinds of events.