Belle II Software  release-06-02-00
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 
14 using namespace Belle2;
15 using namespace std;
16 
17 //-----------------------------------------------------------------
18 // Register the Module
19 //-----------------------------------------------------------------
21 
22 //-----------------------------------------------------------------
23 // Implementation
24 //-----------------------------------------------------------------
25 
27 {
28  // Set module properties
29  setDescription("Collector for ARICH channel mask production in CAF");
30 }
31 
33 {
34 
35  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);
36  registerObject<TH2F>("ch_occupancy", hist);
37  m_ARICHDigits.isRequired();
38 }
39 
40 
42 {
43  auto hist = getObjectPtr<TH2F>("ch_occupancy");
44  hist->Fill(420 * 144, 0); // evnt count
45 
46  for (const auto& digit : m_ARICHDigits) {
47  uint8_t bits = digit.getBitmap();
48  for (int i = 0; i < 4; i++) {
49  if ((bits & (1 << i)) && !(bits & ~(1 << i))) {
50  hist->Fill((digit.getModuleID() - 1) * 144 + digit.getChannelID(), i);
51  }
52  }
53  }
54 }
Testing module for collection of calibration data.
virtual void collect() override
Replacement for event(). Fill you calibration data objects here.
virtual void prepare() override
Replacement for initialize(). Register calibration dataobjects here as well.
The Class for ARICH HAPD channel mask.
Calibration collector module base class.
#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.