AnalysisTree
Toggle main menu visibility
Loading...
Searching...
No Matches
infra
PlainTreeFiller.hpp
1
/* Copyright (C) 2019-2021 GSI, Universität Tübingen
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Viktor Klochkov, Ilya Selyuzhenkov */
4
#ifndef ANALYSISTREE_PLAINTREEFILLER_H_
5
#define ANALYSISTREE_PLAINTREEFILLER_H_
6
7
#include <utility>
8
9
#include "AnalysisTask.hpp"
10
#include "Detector.hpp"
11
#include "Variable.hpp"
12
13
namespace
AnalysisTree
{
14
15
struct
FIB
{
16
double
double_{-299.};
17
float
float_{-299.f};
18
int
int_{-299};
19
bool
bool_{
false
};
20
Types type_{Types::kNumberOfTypes};
21
};
22
23
class
PlainTreeFiller :
public
AnalysisTask {
24
public
:
25
PlainTreeFiller() =
default
;
26
27
void
AddBranch(
const
std::string& branch_name);
28
29
void
Init()
override
;
30
void
Exec()
override
;
31
void
Finish()
override
;
32
33
void
SetOutputName(std::string file, std::string tree) {
34
file_name_ = std::move(file);
35
tree_name_ = std::move(tree);
36
}
37
38
void
SetFieldsToIgnore(
const
std::vector<std::string>& fields_to_ignore);
39
void
SetFieldsToPreserve(
const
std::vector<std::string>& fields_to_preserve);
40
void
SetFieldsToRename(
const
std::vector<std::pair<std::string, std::string>>& fields_to_rename);
41
42
void
SetIsIgnoreDefaultFields(
bool
is =
true
) { is_ignore_defual_fields_ = is; }
43
void
SetIsPrependLeavesWithBranchName(
bool
is =
true
) { is_prepend_leaves_with_branchname_ = is; }
44
45
protected
:
46
void
CheckIgnorePreserveRenameFields(
const
std::vector<std::string>& leafNames)
const
;
47
48
TFile* file_{
nullptr
};
49
TTree* plain_tree_{
nullptr
};
50
51
std::string file_name_{
"PlainTree.root"
};
52
std::string tree_name_{
"PlainTree"
};
53
std::string branch_name_;
54
55
std::vector<FIB> vars_;
56
std::vector<std::string> fields_to_ignore_{};
57
std::vector<std::string> fields_to_preserve_{};
58
std::map<std::string, std::string> fields_to_rename_{};
59
60
bool
is_ignore_defual_fields_{
false
};
61
bool
is_prepend_leaves_with_branchname_{
true
};
62
};
63
64
}
// namespace AnalysisTree
65
66
#endif
//ANALYSISTREE_PLAINTREEFILLER_H_
AnalysisTree
Cuts keep list of SimpleCuts. Logical AND is applied for all SimpleCut in the Cuts object.
Definition
BranchConfig.cpp:10
AnalysisTree::FIB
Definition
PlainTreeFiller.hpp:15
Generated by
1.18.0