90 void compile(
const double Tmax,
91 const unsigned int L1 = 2)
93 std::sort(this->begin(), this->end());
97 for (const_iterator i = this->begin(); i != this->end(); ) {
110 buffer.insert(i->getID());
112 const_iterator
j = i;
114 for (
double t1 = i->getLowerLimit(); ++
j != this->end() &&
j->getLowerLimit() - t1 < Tmax; t1 =
j->getLowerLimit()) {
115 buffer.insert(
j->getID());
118 if (buffer.size() >= L1) {
127 this->erase(out, end());
138 inline bool has(
const JTimeRange& timerange)
const
140 const_iterator i = std::lower_bound(this->begin(), this->end(), timerange.
getLowerLimit());
142 return i != this->end() && i->overlap(timerange);
156 inline bool matchAll(
const JHitL1& first,
const JHitL1& second)
172 JHorizon(
const double ct,
186 bool operator()(
const JHitL1& hit)
const
190 for (JHitL1::const_iterator i = hit.begin(); i != hit.end(); ++i) {
210 int main(
int argc,
char **argv)
217 JLimit_t& numberOfEvents = inputFile.getLimit();
230 JParser<> zap(
"Example program to test performance of various hit filters.");
240 zap[
'c'] =
make_field(cluster) =
'A',
'B',
'C',
'D',
'E',
'F';
246 catch(
const exception &error) {
247 FATAL(error.what() << endl);
277 if (histogram == 1) {
283 for ( ; x < 30.0; x += 1.0)
286 for ( ; x < 50.0; x += 2.0)
289 for ( ; x < 100.0; x += 5.0)
292 for ( ; x < 200.0; x += 10.0)
295 he =
new TProfile(
"he", NULL, X.size() - 1, X.data());
296 hp =
new TProfile(
"hp", NULL, X.size() - 1, X.data());
300 he =
new TProfile(
"he", NULL, 28, 0.0, 7.0);
301 hp =
new TProfile(
"hp", NULL, 28, 0.0, 7.0);
304 TH1D ht1(
"ht1", NULL, 550, -50.0, +500.0);
305 TH1D ht2(
"ht2", NULL, 550, -50.0, +500.0);
306 TH1D hd1(
"hd1", NULL, 100, -1.0, +1.0);
307 TH1D hd2(
"hd2", NULL, 100, -1.0, +1.0);
308 TH1D hx1(
"hx1", NULL, 100, 0.0, +250.0);
309 TH1D hx2(
"hx2", NULL, 100, 0.0, +250.0);
310 TH1D hw1(
"hw1", NULL, 100, -0.5, +99.5);
311 TH1D hw2(
"hw2", NULL, 100, -0.5, +99.5);
323 const JHorizon horizon(0.2, 2);
335 const Evt*
event = ps;
340 const double E = neutrino.
E;
352 if (
is_muon(*track) && track->E > Emax) {
359 if (muon != event->mc_trks.end()) {
385 for (JMap_t::iterator i = zmap.begin(); i != zmap.end(); ) {
387 i->second.compile(Tmax_ns, 2);
389 if (i->second.empty())
395 const int L1mc = zmap.size();
405 for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
409 buildL2(*i, moduleRouter.
getModule(i->getModuleID()), back_inserter(zbuf));
413 sort(zbuf.begin(), zbuf.end(), timeSorter<JHitL1>);
415 dataL1.push_back(*zbuf.begin());
422 JDataL1_t::iterator __end = dataL1.begin();
432 __end =
clusterize(dataL1.begin(), dataL1.end(), weightSorter<JHitL1>, match3D);
436 __end =
clusterize(dataL1.begin(), dataL1.end(), match3B);
445 for (JDataL1_t::iterator i = dataL1.begin(); i != dataL1.end(); ++i)
450 for (JDataL1_t::iterator i = dataL1.begin(); i != dataL1.end(); ++i)
459 for (JDataL1_t::iterator i = dataL1.begin(); i != dataL1.end(); ++i)
462 __end = partition(dataL1.begin(), __end, horizon);
465 for (JDataL1_t::iterator i = dataL1.begin(); i != dataL1.end(); ++i)
471 __end = dataL1.end();
478 JDataL1_t::iterator __q = __end;
487 const double t1 = converter.
getTime(*hit);
497 iter_swap(hit, --__q);
502 if (L1mc != 0 && !L1.empty()) {
504 Double_t x = numeric_limits<Double_t>::max();
511 he->Fill(x, (Double_t) L1ok.size() / (Double_t) L1mc);
512 hp->Fill(x, (Double_t) L1ok.size() / (Double_t) L1.size());
517 for (JDataL1_t::iterator hit = dataL1.begin(); hit != __end; ++hit) {
522 for (JDataL1_t::iterator hit = dataL1.begin(); hit != __end; ++hit) {
528 for (JHitL1::const_iterator i = hit->begin(); i != hit->end(); ++i) {
529 if (i->getDot(
gui) < dot)
530 dot = i->getDot(
gui);
533 const double w = (hit->rbegin()->
getT() - hit->begin()->
getT());
538 hx1.Fill(hit->
getX());
543 hx2.Fill(hit->
getX());