BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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
24using std::string;
25namespace pt = boost::property_tree;
26
27/**
28 * \class BmnPadGenerator
29 * \brief Generates pad tree from the scheme
30 */
32{
33 public:
35 : _HM(std::make_unique<BmnHistManager>())
36 , _pad(nullptr)
37 {}
38
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
65
66 private:
67 std::unique_ptr<BmnHistManager> _HM; //!
68 BmnPadBranch* _pad; //!
69 pt::ptree _TreeScheme; //!
70};
71
72#endif /* BMNPADGENERATOR_H */
Histogram manager.
Node of pad tree.
Generates pad tree from the scheme.
BmnPadBranch * _pad
BmnPadBranch * GeneratePadBranch(pt::ptree &PropTree)
Generate pad branch tree from the boost property tree.
pt::ptree _TreeScheme
BmnPadBranch * GetPadBranch()
virtual ~BmnPadGenerator()
PadInfo * GeneratePadNode(pt::ptree &PropTree)
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 ...
void LoadPTFrom(string FileName)
Load pad tree from json config.
std::unique_ptr< BmnHistManager > _HM
Storage for pad content and it's options.
Definition PadInfo.h:20
Definition json.hpp:4446