Belle II Software  release-05-02-19
ARICHChannelMaskModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Luka Santelj *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <arich/modules/arichChannelMask/ARICHChannelMaskModule.h>
12 
13 #include <TH2F.h>
14 
15 
16 using namespace Belle2;
17 using namespace std;
18 
19 //-----------------------------------------------------------------
20 // Register the Module
21 //-----------------------------------------------------------------
23 
24 //-----------------------------------------------------------------
25 // Implementation
26 //-----------------------------------------------------------------
27 
29 {
30  // Set module properties
31  setDescription("Collector for ARICH channel mask production in CAF");
32 }
33 
35 {
36 
37  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);
38  registerObject<TH2F>("ch_occupancy", hist);
39  m_ARICHDigits.isRequired();
40 }
41 
42 
44 {
45  auto hist = getObjectPtr<TH2F>("ch_occupancy");
46  hist->Fill(420 * 144, 0); // evnt count
47 
48  for (const auto& digit : m_ARICHDigits) {
49  uint8_t bits = digit.getBitmap();
50  for (int i = 0; i < 4; i++) {
51  if ((bits & (1 << i)) && !(bits & ~(1 << i))) {
52  hist->Fill((digit.getModuleID() - 1) * 144 + digit.getChannelID(), i);
53  }
54  }
55  }
56 }
Belle2::CalibrationCollectorModule
Calibration collector module base class.
Definition: CalibrationCollectorModule.h:44
Belle2::ARICHChannelMask
The Class for ARICH HAPD channel mask.
Definition: ARICHChannelMask.h:35
Belle2::ARICHChannelMaskModule
Testing module for collection of calibration data.
Definition: ARICHChannelMaskModule.h:35
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ARICHChannelMaskModule::prepare
virtual void prepare() override
Replacement for initialize(). Register calibration dataobjects here as well.
Definition: ARICHChannelMaskModule.cc:34
Belle2::ARICHChannelMaskModule::collect
virtual void collect() override
Replacement for event(). Fill you calibration data objects here.
Definition: ARICHChannelMaskModule.cc:43