46class GenericContainerFiller {
48 GenericContainerFiller() =
delete;
49 explicit GenericContainerFiller(std::string fileInName, std::string treeInName =
"pTree");
50 virtual ~GenericContainerFiller() =
default;
52 void SetOutputFileName(
const std::string& name) { file_out_name_ = name; }
53 void SetOutputTreeName(
const std::string& name) { tree_out_name_ = name; }
54 void SetOutputBranchName(
const std::string& name) { branch_out_name_ = name; }
56 void SetFieldsToIgnore(
const std::vector<std::string>& fields) { fields_to_ignore_ = fields; }
57 void SetFieldsToPreserve(
const std::vector<std::string>& fields) { fields_to_preserve_ = fields; }
59 void SetEntrySwitchTriggerVarName(
const std::string& name) { entry_switch_trigger_var_name_ = name; }
61 void SetNChannelsPerEntry(
int n) { n_channels_per_entry_ = n; }
63 void Run(
int nEntries = -1);
67 int Exec(
int iEntry,
int previousTriggerVar);
70 static int DetermineFieldIdByName(
const std::vector<IndexMap>& iMap,
const std::string& name);
71 void SetLeafAddress(
const std::string& branchName,
const IndexMap& imap,
LeafBuffer& buffer);
72 static void SetFieldsFromLeaves(
const std::vector<IndexMap>& imap,
AnalysisTree::Container& container,
const std::vector<LeafBuffer>& buffers);
74 std::string file_in_name_;
75 std::string tree_in_name_;
77 std::string file_out_name_{
"AnalysisTree.root"};
78 std::string tree_out_name_{
"aTree"};
79 std::string branch_out_name_{
"PlainBranch"};
81 TChain* tree_in_{
nullptr};
82 TFile* file_out_{
nullptr};
83 TTree* tree_out_{
nullptr};
86 AnalysisTree::GenericDetector* generic_detector_{
nullptr};
87 std::vector<IndexMap> branch_map_;
88 std::vector<LeafBuffer> branch_values_;
91 std::string entry_switch_trigger_var_name_;
93 int entry_switch_trigger_id_{-1};
98 int n_channels_per_entry_{-1};
100 std::vector<std::string> fields_to_ignore_{};
101 std::vector<std::string> fields_to_preserve_{};