73{
77
79
81 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
82
83 JTriggeredFileScanner_t inputFile;
89
90 try {
91
92 JParser<> zap(
"Application for writing DST.");
93
97 zap[
'O'] =
make_field(option,
"bit pattern: " << endl << bits_t()) = 0xFF;
100
101 zap(argc, argv);
102 }
103 catch(const exception& error) {
104 FATAL(error.what() << endl);
105 }
106
107
109
111
113
114 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
115
116 multi_pointer_type ps = inputFile.next();
117
121
122 if (option.
has(CLEAR_MC_HITS)) {
123 event->mc_hits.clear();
124 }
125
126 if (option.
has(CLEAR_MC_TRKS)) {
127
128 vector<Trk>::iterator __end = partition(event->mc_trks.begin(), event->mc_trks.end(), [](
const Trk& trk) { return is_initialstate(trk) || is_muonbundle(trk); });
129
131
133
134 __end = partition(__end, event->mc_trks.end(), [
id](
const Trk& trk) { return is_lepton(trk) && trk.mother_id == id; });
135 }
136
137 event->mc_trks.erase(__end, event->mc_trks.end());
138 }
139
140 if (option.
has(CLEAR_DAQ_HITS)) {
142 }
143
144 if (option.
has(CLEAR_INTERMEDIATE_FITS) ||
145 option.
has(CLEAR_ALL_BUT_BEST_FITS)) {
146
148
149 if (option.
has(CLEAR_ALL_BUT_BEST_FITS) && evt->begin() != __end) {
150 __end = next(evt->begin());
151 }
152
153 if (!keep.empty()) {
154 for (JEvt::iterator i = evt->begin(), __q = __end; i != __q; ++i) {
155 __end = partition(__end, evt->end(), [i, keep](
const JFit& fit) { return i->getHistory().match(fit.getHistory()) && keep.count(fit.getHistory().rbegin()->type) != 0; });
156 }
157 }
158
159 evt->erase(__end, evt->end());
160 }
161
162
163
165
169 }
171
173
175
177}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int getStatus() const
Get status of the fit; negative values should refer to a bad fit.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
void setCounter(const JTriggerCounter_t counter)
Set trigger counter.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
unsigned long long int JTriggerCounter_t
Type definition of trigger counter.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Auxiliary class for handling status.
bool has(const int bit) const
Test PMT status.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for defining the range of iterations of objects.
const JLimit & getLimit() const
Get limit.
static counter_type max()
Get maximum counter value.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.