10 #include "evt/Head.hh"
12 #include "evt/io_ascii.hh"
13 #include "evt/io_jpp.hh"
43 int main(
int argc,
char **argv)
49 JFileRecorder<JTYPELIST<Head, Evt, JMeta>::typelist>
outputFile;
57 JParser<> zap(
"Auxiliary program to convert fit results to AAnet format.\
58 \nThe option -L corresponds to the names of a shared library \
59 \nand function so to rearrange the order of fit results.");
63 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
70 catch(
const exception& error) {
71 FATAL(error.what() << endl);
74 using namespace KM3NETDAQ;
76 typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
77 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
85 }
catch(
const exception& error) {}
91 push(buffer, &JHead::DAQ);
103 for (JMultipleFileScanner<>::const_iterator i = inputFile.begin(); i != inputFile.end(); ++i) {
105 STATUS(
"Processing: " << *i << endl);
107 JParallelFileScanner_t in(*i);
108 JTreeScanner<Evt> mc(*i);
118 center = get<Vec>(head);
121 }
catch(
const exception& error) {}
124 while (in.hasNext()) {
126 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
128 multi_pointer_type ps = in.next();
133 JEvt::iterator __end = evt->
end();
135 if (numberOfFits > 0) {
136 advance(__end = evt->begin(), min(numberOfFits, evt->size()));
140 partial_sort(evt->begin(), __end, evt->end(),
qualitySorter);
145 if (mc.getEntries() != 0) {
153 if (out.mc_run_id == 0) {
154 out.mc_run_id = mc_run_id;
165 for (JEvt::const_iterator fit = evt->begin(); fit != __end; ++fit) {
169 tr.id = out.trks.size() + 1;
170 tr.pos = Vec(fit->getX(), fit->getY(), fit->getZ());
171 tr.dir = Vec(fit->getDX(), fit->getDY(), fit->getDZ());
174 tr.lik = fit->getQ();
178 for (JHistory::const_iterator i = fit->getHistory().begin(); i != fit->getHistory().end(); ++i) {
179 tr.rec_stages.push_back(i->type);
182 for (
int i = 0; i != fit->getN(); ++i) {
183 tr.fitinf.push_back(fit->getW(i));
186 out.trks.push_back(tr);
189 out.id = ++number_of_events;
197 JMultipleFileScanner<JMeta> io(inputFile);
Utility class to parse command line options.
Recording of objects on file according a format that follows from the file name extension.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
void push(JHead &header, T JHead::*p)
Push data of JHead for subsequent copy to Head.
Empty structure for specification of parser element that is initialised (i.e.
Long64_t counter_type
Type definition for counter.
double livetime_s
Live time [s].
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
JLimit JLimit_t
Type definition of limit.
std::istream & read(std::istream &in, JContainer_t< TString, JAllocator_t > &object, const JBool< false > &option)
Auxiliary method for reading if TString does not exist.
const_iterator< T > end() const
Get end of data.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
JAANET::start_run start_run
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
General purpose messaging.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
double getLivetime(const std::string &file_name)
Get data taking live time.
Utility class to parse command line options.
ROOT TTree parameter settings.
bool qualitySorter(const JFIT::JFit &first, const JFIT::JFit &second)
Comparison of fit results.
void copy(const Head &from, JHead &to)
Copy header from from to to.
const JLimit & getLimit() const
Get limit.
JTriggerCounter_t getCounter() const
Get trigger counter.
#define DEBUG(A)
Message macros.
static const int JPP_RECONSTRUCTION_TYPE
Jpp reconstruction type for AAnet.
int main(int argc, char *argv[])