Commit 519e6df 1 parent 33be63b commit 519e6df Copy full SHA for 519e6df
File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,18 @@ void PlainTreeFiller::SetFieldsToIgnore(const std::vector<std::string>&& fields_
25
25
}
26
26
27
27
void PlainTreeFiller::Init () {
28
+ if (is_ignore_defual_fields_) {
29
+ std::vector<std::string> defaultFieldsNames;
30
+ auto mapF = config_->GetBranchConfig (branch_name_).GetMap <float >();
31
+ auto mapI = config_->GetBranchConfig (branch_name_).GetMap <int >();
32
+ auto mapB = config_->GetBranchConfig (branch_name_).GetMap <bool >();
33
+ for (auto & m : {mapF, mapI, mapB}) {
34
+ for (auto & me : m) {
35
+ if (me.second .id_ < 0 ) defaultFieldsNames.emplace_back (me.first );
36
+ }
37
+ }
38
+ SetFieldsToIgnore (std::move (defaultFieldsNames));
39
+ }
28
40
29
41
if (!branch_name_.empty ()) {
30
42
const auto & branch_config = config_->GetBranchConfig (branch_name_);
Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ class PlainTreeFiller : public AnalysisTask {
29
29
30
30
void SetFieldsToIgnore (const std::vector<std::string>&& fields_to_ignore);
31
31
32
+ void SetIsIgnoreDefaultFields (bool is = true ) { is_ignore_defual_fields_ = is; }
33
+
32
34
protected:
33
35
TFile* file_{nullptr };
34
36
TTree* plain_tree_{nullptr };
@@ -39,6 +41,8 @@ class PlainTreeFiller : public AnalysisTask {
39
41
40
42
std::vector<float > vars_{};
41
43
std::vector<std::string> fields_to_ignore_{};
44
+
45
+ bool is_ignore_defual_fields_{false };
42
46
};
43
47
44
48
}// namespace AnalysisTree
You can’t perform that action at this time.
0 commit comments