Belle II Software  release-08-01-10
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 
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
Replacement for event(). Fill you calibration data objects here.
virtual void prepare() override
Replacement for initialize(). Register calibration dataobjects here as well.
ARICHChannelMaskModule()
Constructor: Sets the description, the properties and the parameters of the module.
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
REG_MODULE(arichBtest)
Register the Module.
Abstract base class for different kinds of events.