BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnPadGenerator.h
Go to the documentation of this file.
1
#ifndef BMNPADGENERATOR_H
2
#define BMNPADGENERATOR_H
3
4
#include <cstdio>
5
#include <exception>
6
#include <stdio.h>
7
#include <stdlib.h>
8
#include <vector>
9
// Boost
10
#include <boost/foreach.hpp>
11
#include <boost/property_tree/json_parser.hpp>
12
#include <boost/property_tree/ptree.hpp>
13
// ROOT
14
#include <
TCanvas.h
>
15
#include <
TClass.h
>
16
#include <
TDirectory.h
>
17
#include <
TH2F.h
>
18
#include <
TH3S.h
>
19
// BmnRoot
20
#include "
BmnPadBranch.h
"
21
22
#include <BmnHistManager.h>
23
24
using
std::string;
25
namespace
pt = boost::property_tree;
26
27
/**
28
* \class BmnPadGenerator
29
* \brief Generates pad tree from the scheme
30
*/
31
class
BmnPadGenerator
32
{
33
public
:
34
BmnPadGenerator
()
35
:
_HM
(
std
::make_unique<
BmnHistManager
>())
36
,
_pad
(nullptr)
37
{}
38
39
virtual
~BmnPadGenerator
()
40
{
41
if
(
_pad
)
42
delete
_pad
;
43
}
44
/**
45
* @brief Load pad tree from json config
46
* @param FileName path to json config
47
* */
48
void
LoadPTFrom
(
string
FileName);
49
/**
50
* @brief Generate pad branch tree from the boost property tree
51
* @param PropTree boost property tree
52
* @return pointer to the BmnPadBranch instance - start of the branch tree
53
*/
54
BmnPadBranch
*
GeneratePadBranch
(pt::ptree& PropTree);
55
PadInfo
*
GeneratePadNode
(pt::ptree& PropTree);
56
/**
57
* @brief Create pad structure in the canvas from the pad tree
58
* and associate pad branch instances with the pad pointers
59
* @param br pad tree
60
* @param pad canvas or any other TVirtualPad instance
61
*/
62
static
void
PadTree2Canvas
(
BmnPadBranch
* br,
TVirtualPad
* pad);
63
64
BmnPadBranch
*
GetPadBranch
() {
return
_pad
; }
65
66
private
:
67
std::unique_ptr<BmnHistManager>
_HM
;
//!
68
BmnPadBranch
*
_pad
;
//!
69
pt::ptree
_TreeScheme
;
//!
70
};
71
72
#endif
/* BMNPADGENERATOR_H */
BmnPadBranch.h
TCanvas.h
TClass.h
TDirectory.h
TH2F.h
TH3S.h
BmnHistManager
Histogram manager.
Definition
BmnHistManager.h:42
BmnPadBranch
Node of pad tree.
Definition
BmnPadBranch.h:15
BmnPadGenerator
Generates pad tree from the scheme.
Definition
BmnPadGenerator.h:32
BmnPadGenerator::_pad
BmnPadBranch * _pad
Definition
BmnPadGenerator.h:68
BmnPadGenerator::GeneratePadBranch
BmnPadBranch * GeneratePadBranch(pt::ptree &PropTree)
Generate pad branch tree from the boost property tree.
BmnPadGenerator::BmnPadGenerator
BmnPadGenerator()
Definition
BmnPadGenerator.h:34
BmnPadGenerator::_TreeScheme
pt::ptree _TreeScheme
Definition
BmnPadGenerator.h:69
BmnPadGenerator::GetPadBranch
BmnPadBranch * GetPadBranch()
Definition
BmnPadGenerator.h:64
BmnPadGenerator::~BmnPadGenerator
virtual ~BmnPadGenerator()
Definition
BmnPadGenerator.h:39
BmnPadGenerator::GeneratePadNode
PadInfo * GeneratePadNode(pt::ptree &PropTree)
BmnPadGenerator::PadTree2Canvas
static void PadTree2Canvas(BmnPadBranch *br, TVirtualPad *pad)
Create pad structure in the canvas from the pad tree and associate pad branch instances with the pad ...
BmnPadGenerator::LoadPTFrom
void LoadPTFrom(string FileName)
Load pad tree from json config.
BmnPadGenerator::_HM
std::unique_ptr< BmnHistManager > _HM
Definition
BmnPadGenerator.h:67
PadInfo
Storage for pad content and it's options.
Definition
PadInfo.h:20
TVirtualPad
std
Definition
json.hpp:4446
QA
BmnPadGenerator.h
Generated on
for BmnRoot by
1.17.0