Belle II Software  release-06-02-00
DummyCollectorModule.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 <calibration/modules/DummyCollector/DummyCollectorModule.h>
10 
11 #include <TTree.h>
12 #include <TH1I.h>
13 
14 using namespace Belle2;
15 
16 //-----------------------------------------------------------------
17 // Register the Module
18 //-----------------------------------------------------------------
19 REG_MODULE(DummyCollector)
20 
21 //-----------------------------------------------------------------
22 // Implementation
23 //-----------------------------------------------------------------
24 
26 {
27  // Set module properties
28  setDescription("Dummy module for running when you don't really need output.");
29 }
30 
32 {
33  auto hist = new TH1I("histogram", "Number of times hist->Fill() was called.", 1, 0., 1.);
34  registerObject<TH1I>("DummyHist", hist);
35 }
36 
38 {
39  getObjectPtr<TH1I>("DummyHist")->Fill(0.5);
40 }
Calibration collector module base class.
Basically empty Collector, makes only a tiny amount of output 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.
#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.