getEntry.cc
Go to the documentation of this file.
3 // vim: set sw=2 expandtab :
4 
6 #include "hep_concurrency/tsan.h"
7 
8 #include "TBranch.h"
9 #include "TTree.h"
10 
11 #include <iostream>
12 
13 using namespace std;
14 using namespace hep::concurrency;
15 
16 namespace art {
17  namespace input {
18 
19  Int_t
20  getEntry(TBranch* branch, EntryNumber entryNumber)
21  {
23  try {
24  return branch->GetEntry(entryNumber);
25  }
26  catch (cet::exception& e) {
28  << e.explain_self() << "\n";
29  }
30  }
31 
32  Int_t
33  getEntry(TBranch* branch,
34  EntryNumber entryNumber,
35  unsigned long long& ticks[[gnu::unused]])
36  {
38  try {
39  // unsigned tsc_begin_cpuidx = 0;
40  // auto tsc_begin = getTSCP(tsc_begin_cpuidx);
41  // unsigned tsc_end_cpuidx = tsc_begin_cpuidx;
42  // auto tsc_end = tsc_begin;
43  auto ret = branch->GetEntry(entryNumber);
44  // tsc_end = getTSCP(tsc_end_cpuidx);
45  // ticks = tsc_end - tsc_begin;
46  // Show the amount of time spent doing the I/O.
47  // cerr << "-----> " << __func__ << ": ticks: " << ticks << "\n";
48  return ret;
49  }
50  catch (cet::exception& e) {
52  << e.explain_self() << "\n";
53  }
54  }
55 
56  Int_t
57  getEntry(TTree* tree, EntryNumber entryNumber)
58  {
60  try {
61  return tree->GetEntry(entryNumber);
62  }
63  catch (cet::exception& e) {
65  << e.explain_self() << "\n";
66  }
67  }
68 
69  Int_t
70  getEntry(TTree* tree,
71  EntryNumber entryNumber,
72  unsigned long long& ticks[[gnu::unused]])
73  {
75  try {
76  // unsigned tsc_begin_cpuidx = 0;
77  // auto tsc_begin = getTSCP(tsc_begin_cpuidx);
78  // unsigned tsc_end_cpuidx = tsc_begin_cpuidx;
79  // auto tsc_end = tsc_begin;
80  auto ret = tree->GetEntry(entryNumber);
81  // tsc_end = getTSCP(tsc_end_cpuidx);
82  // ticks = tsc_end - tsc_begin;
83  // Show the amount of time spent doing the I/O.
84  // cerr << "-----> " << __func__ << ": ticks: " << ticks << "\n";
85  return ret;
86  }
87  catch (cet::exception& e) {
89  << e.explain_self() << "\n";
90  }
91  }
92 
93  } // namespace input
94 } // namespace art
STL namespace.
const double e
Int_t getEntry(TTree *tree, EntryNumber entryNumber, unsigned long long &ticks[[gnu::unused]])
Definition: getEntry.cc:70
Long64_t EntryNumber
Definition: Inputfwd.h:41
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33