Belle II Software  release-08-01-10
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.
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.
DummyCollectorModule()
Constructor: Sets the description, the properties and the parameters of the module.
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.