48 const int frame_index,
51 frame_index(frame_index),
62 friend inline std::istream&
operator>>(std::istream& in, JTag& tag)
76 friend inline std::ostream&
operator<<(std::ostream& out,
const JTag& tag)
80 return out << setw(8) << tag.run <<
' '
81 << setw(6) << tag.frame_index <<
' '
82 << setw(6) << tag.counter;
92 friend inline bool operator<(
const JTag& first,
const JTag& second)
94 if (first.run == second.run) {
96 if (first.frame_index == second.frame_index)
97 return first.counter < second.counter;
99 return first.frame_index < second.frame_index;
103 return first.run < second.run;
133 JParser<> zap(
"Example program to select events from DST files.");
138 "<run> <frame index> <trigger counter>"\
139 " (one header line)") =
"";
145 catch(
const exception &error) {
151 inputFile = getFilenames(inputFile);
161 for (JTag tag; in >> tag; ) {
162 selection.insert(tag);
170 if (out ==
NULL || ! out->IsOpen()) {
179 TFile* in = TFile::Open(file_name->c_str(),
"EXISTS");
181 if (in !=
NULL && in->IsOpen()) {
187 TKey* p =
dynamic_cast<TKey*
>(in->GetListOfKeys()->Before(key));
189 if (p ==
NULL ||
strcmp(key->GetName(), p->GetName()) != 0) {
191 TTree* t1 =
dynamic_cast<TTree*
>(key->ReadObj());
199 if (
strcmp((*i)->GetName(), t1->GetName()) == 0) {
208 input.push_back(q =
new TChain(t1->GetName()));
211 q->Add(file_name->c_str());
244 if (
tm->GetEntries() == (*i)->GetEntries())
253 output.push_back((*i)->GetTree()->CloneTree(0));
264 DEBUG(
"tag " << tag <<
' ' << (selection.empty() || selection.count(tag)) <<
endl);
266 if (selection.empty() || selection.count(tag)) {
268 for (
size_t m = 0; m != input.size(); ++m) {
269 input [m]->GetEntry(i);
bool operator<(const Status_Item &first, const Status_Item &second)
comparator for Status item; earliest hit first
int main(int argc, char **argv)
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
Auxiliaries for defining the range of iterations of objects.
General purpose messaging.
#define DEBUG(A)
Message macros.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const char *const TTREE_OFFLINE_EVENT
ROOT TTree name.
static const char *const TBRANCH_OFFLINE_EVENT
ROOT TBranch name.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
int frame_index
from the raw data
int run_id
DAQ run identifier.
ULong64_t trigger_counter
trigger counter
Auxiliary class for defining the range of iterations of objects.