41 typedef std::pair<UInt_t,UInt_t> RunEvent;
44 typedef std::set<RunEvent> RunEventList;
51 const std::set<std::string>& runNames ()
53 static const std::set<std::string>
result =
54 {
"RunNumber",
"runNumber" };
63 const std::set<std::string>& eventNames ()
65 static const std::set<std::string>
result =
66 {
"EventNumber",
"eventNumber" };
77 findBranch (
const TTree&
tree,
const std::set<std::string>&
names)
80 TObjArray *
branches = tree_nc.GetListOfBranches();
82 for (std::set<std::string>::const_iterator
name =
names.begin(),
89 return std::string ();
103 RCU_THROW_MSG (
"failed to read number of events from n-tuple");
107 const std::string runName = findBranch (
tree, runNames());
108 const std::string eventName = findBranch (
tree, eventNames());
110 tree.SetBranchStatus (
"*", 0);
112 tree.SetBranchStatus (runName.c_str(), 1);
113 tree.SetBranchAddress (runName.c_str(),
static_cast<void*
>(&
run));
115 tree.SetBranchStatus (eventName.c_str(), 1);
116 tree.SetBranchAddress (eventName.c_str(),
static_cast<void*
>(&
event));
118 tree.SetCacheSize (10 * 1024 * 1024);
119 for (Long64_t
entry = 0;
125 if (
list.find (runEvent) ==
list.end())
127 list.insert (runEvent);
131 message <<
"duplicate event run=" <<
run <<
" event=" <<
event
132 <<
" file=" <<
tree.GetCurrentFile()->GetName();
145 std::unique_ptr<TChain>
chain (
sample.makeTChain ());
168 std::unique_ptr<TChain>
chain ((*sample)->makeTChain ());