2 #include "spdlog/sinks/stdout_color_sinks.h"
3 #include "spdlog/spdlog.h"
10 int main(
int argc,
char const *argv[]) {
12 chain.
Add(
"test.root");
17 spdlog::info(
"{} entries in the chain", chain.
GetEntries());
19 auto handle1 = chain.
CreateSkimTree(
"skimmed.root",
"RichBase;RichPlus");
21 unsigned long long nEntries = chain.
GetEntries();
24 unsigned long long skimmedEntries = 0;
33 for (
auto &event : chain) {
38 spdlog::info(
"Entry {} - Mask {}", event.header->EventNo, to_string_binary<32>(event.header->Mask()));
82 fmt::print(
"{:<32}: {:>15} {:>15} {:>15} {:>15}\n",
"",
"Rigidity",
"InvRigErr",
"TrChiSqX",
"TrChiSqY");
83 for (
unsigned int ijl = 0; ijl < 9; ijl++) {
84 if (!
KeyExists(ijl, event.trTrackPlus->PartialRigidity))
106 spdlog::info(
"We skimmed {} entries", skimmedEntries);
SkimTreeHandle< SingleTreeChain > CreateSkimTree(const std::string &filename, const std::string &exclBranches)
Create a new SkimTree handle object and setup all internal branches.
int main(int argc, char **argv)
int Add(const std::string &filePath)
Add a file to the chain.
This event is classified as charge >2 according to tracker (Q > 2.5)
std::enable_if< std::is_convertible< T, Key >::value, bool >::type KeyExists(T key, const std::map< Key, Value > &container)
unsigned long int GetEntries()
Get the total number of events.
void SetupBranches(bool isMC=false)
Set all branch addresses for reading operations, or create all branches for writing operation...