Belle II Software  release-08-01-10
DQMHistAnalysisRootFitExample.h
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 // File : DQMHistAnalysisRooFitExample.h
10 // Description : An example module for DQM histogram analysis
11 //-
12 
13 #pragma once
14 
15 #ifdef _BELLE2_EPICS
16 // EPICS
17 #include "cadef.h"
18 #endif
19 
20 #include <dqm/core/DQMHistAnalysis.h>
21 
22 #include <TCanvas.h>
23 #include <RooWorkspace.h>
24 #include <RooDataHist.h>
25 #include <RooPlot.h>
26 #include <RooFitResult.h>
27 #include <RooAbsPdf.h>
28 
29 namespace Belle2 {
37 
38  // Public functions
39  public:
40 
45 
50 
54  void initialize(void) override final;
55 
59  void beginRun(void) override final;
60 
64  void event(void) override final;
65 
69  void endRun(void) override final;
70 
74  void terminate(void) override final;
75 
76  private:
77 
78  // Data member
80  RooWorkspace* w = nullptr;
82  RooRealVar* x = nullptr;
84  RooDataHist* data = nullptr;
86  RooPlot* plot = nullptr;
88  RooFitResult* r = nullptr;
90  RooAbsPdf* model = nullptr;
91 
92 
94  TCanvas* m_c0 = nullptr;
95 
96 #ifdef _BELLE2_EPICS
97  chid mychid;
98 #endif
99  };
101 } // end namespace Belle2
102 
The base class for the histogram analysis module.
Class definition for the output module of Sequential ROOT I/O.
void terminate(void) override final
This method is called at the end of the event processing.
void initialize(void) override final
Initializer.
RooDataHist * data
The data of histogram for fitting.
void endRun(void) override final
This method is called if the current run ends.
TCanvas * m_c0
The drawing canvas for plotting the fitting result.
RooPlot * plot
The plot of the fitting result.
void beginRun(void) override final
Called when entering a new run.
void event(void) override final
This method is called for each event.
Abstract base class for different kinds of events.