30int main(
int argc,
char** argv)
33 std::cout <<
"Usage: " << argv[0] <<
" <root file name>" << std::endl;
37 std::cout <<
"Running on " << argc - 1 <<
" file(s)" << std::endl;
39 for(
int i = 1; i < argc; ++i) {
42 std::cout <<
"Failed to open " << argv[i] << std::endl;
46 auto* tree =
dynamic_cast<TTree*
>(f.Get(
"FragmentTree"));
48 std::cout << argv[i] <<
" - FragmentTree: " << tree->GetEntries() << std::endl;
52 tree =
dynamic_cast<TTree*
>(f.Get(
"AnalysisTree"));
54 std::cout << argv[i] <<
" - AnalysisTree: " << tree->GetEntries() << std::endl;
66 bool gotGriffin = (tree->FindBranch(
"TGriffin") !=
nullptr);
69 tree->SetBranchAddress(
"TGriffin", &grif);
71 int64_t numGriffin = 0;
73 bool gotDescant = (tree->FindBranch(
"TDescant") !=
nullptr);
76 tree->SetBranchAddress(
"TDescant", &desc);
78 int64_t numDescant = 0;
80 bool gotLaBr = (tree->FindBranch(
"TLaBr") !=
nullptr);
81 TLaBr* laBr =
nullptr;
83 tree->SetBranchAddress(
"TLaBr", &laBr);
87 bool gotZeroDegree = (tree->FindBranch(
"TZeroDegree") !=
nullptr);
90 tree->SetBranchAddress(
"TZeroDegree", &zd);
92 int64_t numZeroDegree = 0;
94 bool gotSceptar = (tree->FindBranch(
"TSceptar") !=
nullptr);
97 tree->SetBranchAddress(
"TSceptar", &scep);
99 int64_t numSceptar = 0;
101 bool gotPaces = (tree->FindBranch(
"TPaces") !=
nullptr);
104 tree->SetBranchAddress(
"TPaces", &pace);
106 int64_t numPaces = 0;
110 for(int64_t e = 0; e < tree->GetEntries(); ++e) {
134 std::cout << numGriffin <<
" GRIFFIN, ";
137 std::cout << numDescant <<
" DESCANT, ";
140 std::cout << numLaBr <<
" LABR, ";
143 std::cout << numZeroDegree <<
" ZERO-DEGREE, ";
146 std::cout << numSceptar <<
" SCEPTAR, ";
149 std::cout << numPaces <<
" PACES, ";
151 std::cout <<
" " << numGriffin + numDescant + numLaBr + numZeroDegree + numSceptar + numPaces <<
" total hits"
157 std::cout <<
"Failed to find 'FragmentTree' or 'AnalysisTree' in " << argv[i] << std::endl;