Belle II Software development
ARICHChannelMaskModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <arich/modules/arichChannelMask/ARICHChannelMaskModule.h>
10
11#include <TH2F.h>
12
13
14using namespace Belle2;
15
16//-----------------------------------------------------------------
17// Register the Module
18//-----------------------------------------------------------------
20
21//-----------------------------------------------------------------
22// Implementation
23//-----------------------------------------------------------------
24
26{
27 // Set module properties
28 setDescription("Collector for ARICH channel mask production in CAF");
29}
30
32{
33
34 auto hist = new TH2F("ch_occupancy", "HAPD channel occupancy in bits", 420 * 144 + 1, -0.5, 420 * 144 + 0.5, 4, -0.5, 3.5);
35 registerObject<TH2F>("ch_occupancy", hist);
36 m_ARICHDigits.isRequired();
37}
38
39
41{
42 auto hist = getObjectPtr<TH2F>("ch_occupancy");
43 hist->Fill(420 * 144, 0); // evnt count
44
45 for (const auto& digit : m_ARICHDigits) {
46 uint8_t bits = digit.getBitmap();
47 for (int i = 0; i < 4; i++) {
48 if ((bits & (1 << i)) && !(bits & ~(1 << i))) {
49 hist->Fill((digit.getModuleID() - 1) * 144 + digit.getChannelID(), i);
50 }
51 }
52 }
53}
virtual void collect() override
Collection (called for each event).
virtual void prepare() override
Preparation of data collection.
StoreArray< ARICHDigit > m_ARICHDigits
Digits.
The Class for ARICH HAPD channel mask.
Calibration collector module base class.
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.