File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,18 @@ void PlainTreeFiller::SetFieldsToIgnore(const std::vector<std::string>&& fields_
2525}
2626
2727void 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+ }
2840
2941 if (!branch_name_.empty ()) {
3042 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 {
2929
3030 void SetFieldsToIgnore (const std::vector<std::string>&& fields_to_ignore);
3131
32+ void SetIsIgnoreDefaultFields (bool is = true ) { is_ignore_defual_fields_ = is; }
33+
3234 protected:
3335 TFile* file_{nullptr };
3436 TTree* plain_tree_{nullptr };
@@ -39,6 +41,8 @@ class PlainTreeFiller : public AnalysisTask {
3941
4042 std::vector<float > vars_{};
4143 std::vector<std::string> fields_to_ignore_{};
44+
45+ bool is_ignore_defual_fields_{false };
4246};
4347
4448}// namespace AnalysisTree
You can’t perform that action at this time.
0 commit comments