Go to the documentation of this file.
2 #include "fmt/ranges.h"
3 #include "spdlog/sinks/stdout_color_sinks.h"
4 #include "spdlog/spdlog.h"
11 int main(
int argc,
char const *argv[]) {
13 chain.
Add(
"test.root");
18 spdlog::info(
"{} entries in the chain", chain.
GetEntries());
20 auto handle1 = chain.
CreateSkimTree(
"skimmed.root",
"RichBase;RichPlus");
22 unsigned long long nEntries = chain.
GetEntries();
25 unsigned long long skimmedEntries = 0;
34 for (
auto &event : chain) {
39 spdlog::info(
"Entry {} - Mask {}", event.header->EventNo, to_string_binary<32>(event.header->Mask()));
52 auto pattern =
event.trTrackBase->GetTrackPattern();
53 for (
auto hit_type : pattern) {
54 switch (hit_type.second) {
56 fmt::print(
"{} None\n", hit_type.first);
59 fmt::print(
"{} Y-only\n", hit_type.first);
62 fmt::print(
"{} XY\n", hit_type.first);
67 event.trTrackPlus->Dump();
114 spdlog::info(
"We skimmed {} entries", skimmedEntries);
NAIAChain class description.
int main(int argc, char const *argv[])
unsigned long int GetEntries()
Get the total number of events.
int Add(const std::string &filePath)
Add a file to the chain.
SkimTreeHandle< NAIAChain > CreateSkimTree(const std::string &filename, const std::string &exclBranches)
Create a new SkimTree handle object and setup all internal branches.
void SetupBranches(bool create_MC_branches=false)
Set all branch addresses for reading operations, or create all branches for writing operation.