216 using namespace KM3NETDAQ;
232 JParser<> zap(
"Example program to test performance of various hit filters.");
237 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
242 zap[
'c'] =
make_field(cluster) =
'A',
'B',
'C',
'D',
'E',
'F';
248 catch(
const exception &error) {
249 FATAL(error.what() << endl);
253 using namespace KM3NETDAQ;
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);
322 const JHorizon horizon(0.2, 2);
327 while (inputFile.hasNext()) {
329 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
334 const Evt*
event = ps;
339 const double E = neutrino.
E;
351 if (
is_muon(*track) && track->E > Emax) {
358 if (muon != event->mc_trks.end()) {
377 zmap[pmtRouter.getParentModuleID(
i->pmt_id)].push_back(*
i);
384 for (JMap_t::iterator
i = zmap.begin();
i != zmap.end(); ) {
386 i->second.compile(Tmax_ns, 2);
388 if (
i->second.empty())
394 const int L1mc = zmap.size();
404 for (JDAQTimeslice::const_iterator
i = timeslice.begin();
i != timeslice.end(); ++
i) {
408 buildL2(*
i, moduleRouter.getModule(
i->getModuleID()), back_inserter(zbuf));
412 sort(zbuf.begin(), zbuf.end(), timeSorter<JHitL1>);
414 dataL1.push_back(*zbuf.begin());
421 JDataL1_t::iterator __end = dataL1.begin();
431 __end =
clusterize(dataL1.begin(), dataL1.end(), weightSorter<JHitL1>, match3D);
435 __end =
clusterize(dataL1.begin(), dataL1.end(), match3B);
444 for (JDataL1_t::iterator
i = dataL1.begin();
i != dataL1.end(); ++
i)
449 for (JDataL1_t::iterator
i = dataL1.begin();
i != dataL1.end(); ++
i)
458 for (JDataL1_t::iterator
i = dataL1.begin();
i != dataL1.end(); ++
i)
461 __end = partition(dataL1.begin(), __end, horizon);
464 for (JDataL1_t::iterator
i = dataL1.begin();
i != dataL1.end(); ++
i)
470 __end = dataL1.end();
477 JDataL1_t::iterator __q = __end;
484 L1.insert(hit->getModuleID());
486 const double t1 = converter.getTime(hit->getT());
488 if (zmap[hit->getModuleID()].has(
JTimeRange(t1 - 0.5*Tmax_ns, t1 + 0.5*Tmax_ns))) {
490 L1ok.insert(hit->getModuleID());
496 iter_swap(hit, --__q);
501 if (L1mc != 0 && !L1.empty()) {
503 Double_t x = numeric_limits<Double_t>::max();
510 he->Fill(x, (Double_t) L1ok.size() / (Double_t) L1mc);
511 hp->Fill(x, (Double_t) L1ok.size() / (Double_t) L1.size());
516 for (JDataL1_t::iterator hit = dataL1.begin(); hit != __end; ++hit) {
517 hit->transform(
R, pos);
521 for (JDataL1_t::iterator hit = dataL1.begin(); hit != __end; ++hit) {
527 for (JHitL1::const_iterator
i = hit->begin();
i != hit->end(); ++
i) {
528 if (
i->getDot(gui) < dot)
529 dot =
i->getDot(gui);
532 const double w = (hit->rbegin()->getT() - hit->begin()->getT());
535 ht1.Fill(converter.getTime(hit->getT()) - t1);
537 hx1.Fill(hit->getX());
540 ht2.Fill(converter.getTime(hit->getT()) - t1);
542 hx2.Fill(hit->getX());
Router for direct addressing of PMT data in detector data structure.
Utility class to parse command line options.
static struct JTRIGGER::clusterizeWeight clusterizeWeight
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Router for direct addressing of module data in detector data structure.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
JMatchHelper< JHit_t > make_match(bool(*match)(const JHit_t &, const JHit_t &))
Auxiliary method to make JMatch object based on pointer to match function.
Auxiliary class to convert DAQ hit time to/from Monte Carlo hit time.
double E
Energy [GeV] (either MC truth or reconstructed)
bool is_noise(const Hit &hit)
Verify hit origin.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
double getCosThetaC()
Get average cosine of Cherenkov angle of water corresponding to group velocity.
Auxiliary class for defining the range of iterations of objects.
JDirection3D getDirection(const Vec &dir)
Get direction.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
set_variable E_E log10(E_{fit}/E_{#mu})"
JPosition3D getPosition(const Vec &pos)
Get position.
Data structure for L2 parameters.
then JCookie sh JDataQuality D $DETECTOR_ID R
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
const double getInverseSpeedOfLight()
Get inverse speed of light.
no fit printf nominal n $STRING awk v X
double getTanThetaC()
Get average tangent of Cherenkov angle of water corresponding to group velocity.
Data structure for position in three dimensions.
const JLimit & getLimit() const
Get limit.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
do set_variable DETECTOR_TXT $WORKDIR detector
Data structure for normalised vector in three dimensions.
General purpose class for multiple pointers.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
static struct JTRIGGER::clusterize clusterize
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).
double getSinThetaC()
Get average sine of Cherenkov angle of water corresponding to group velocity.
3D match criterion with road width.
#define DEBUG(A)
Message macros.