File indexing completed on 2025-08-06 08:13:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #define SCORRELATORUTILITIES_TREEINTERFACES_CC
0011
0012
0013 #include "TreeInterfaces.h"
0014
0015
0016 using namespace std;
0017
0018
0019
0020
0021
0022 namespace SColdQcdCorrelatorAnalysis {
0023
0024
0025
0026
0027 template <typename T> int64_t Interfaces::GetEntry(
0028 T* tree,
0029 const uint64_t entry
0030 ) {
0031
0032 int64_t status = numeric_limits<int64_t>::min();
0033 if (!tree) {
0034 status = 0;
0035 } else {
0036 status = tree -> GetEntry(entry);
0037 }
0038 return status;
0039
0040 }
0041
0042
0043 template int64_t Interfaces::GetEntry(TTree* tree, const uint64_t entry);
0044 template int64_t Interfaces::GetEntry(TChain* tree, const uint64_t entry);
0045 template int64_t Interfaces::GetEntry(TNtuple* tree, const uint64_t entry);
0046
0047
0048
0049
0050
0051
0052 template <typename T> int64_t Interfaces::LoadTree(
0053 T* tree,
0054 const uint64_t entry,
0055 int& current
0056 ) {
0057
0058
0059 int number = numeric_limits<int>::min();
0060 int64_t status = numeric_limits<int64_t>::min();
0061 if (!tree) {
0062 status = -5;
0063 } else {
0064 number = tree -> GetTreeNumber();
0065 status = tree -> LoadTree(entry);
0066 }
0067
0068
0069 const bool isStatusGood = (status >= 0);
0070 const bool isNotCurrent = (number != current);
0071 if (isStatusGood && isNotCurrent) {
0072 current = tree -> GetTreeNumber();
0073 }
0074 return status;
0075
0076 }
0077
0078
0079 template int64_t Interfaces::LoadTree(TTree* tree, const uint64_t entry, int& current);
0080 template int64_t Interfaces::LoadTree(TChain* tree, const uint64_t entry, int& current);
0081 template int64_t Interfaces::LoadTree(TNtuple* tree, const uint64_t entry, int& current);
0082
0083 }
0084
0085