121 using namespace KM3NETDAQ;
124 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
128 JTriggeredFileScanner_t inputFile;
134 JHistogram_t histogram;
141 JParser<> zap(
"Program to test JMuonStart.");
143 zap[
'f'] =
make_field(inputFile,
"input file (output of JXXXMuonReconstruction.sh)");
145 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
149 zap[
'H'] =
make_field(histogram,
"histogram binning") = JHistogram_t(200, -250.0, +250.0);
154 catch(
const exception& error) {
155 FATAL(error.what() << endl);
193 NOTICE(
"center: " << center << endl);
196 histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit()));
198 histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit(),
199 histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit()));
201 while (inputFile.hasNext()) {
203 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
205 multi_pointer_type ps = inputFile.next();
211 summary.update(*tev);
218 if (muon == event->mc_trks.end() || track->E > muon->E) {
224 if (muon == event->mc_trks.end()) {
228 if (muon->len == 0.0) {
229 muon->len =
gWater(muon->E);
235 JRange_t za(JRange_t::DEFAULT_RANGE);
236 JRange_t zb(JRange_t::DEFAULT_RANGE);
237 JRange_t zd(JRange_t::DEFAULT_RANGE);
247 za.setLowerLimit(ta.
getZ());
248 za.setLength(fabs(muon->len));
254 buildL0(*tev, moduleRouter,
true, back_inserter(dataL0));
261 JEvt::const_iterator track = evt->begin();
276 for (buffer_type::const_iterator i = dataL0.begin(); i != dataL0.end(); ++i) {
283 top[hit.getModuleID()].insert(hit.getPMTAddress());
289 double getZ()
const {
return z; }
290 double getP()
const {
return p; }
298 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
300 if (summary.hasSummaryFrame(module->getID())) {
310 const double z = pos.getZ() - pos.getX() /
getTanThetaC();
311 const double p =
getProbability(*module, frame, rates_Hz.getMultiplesRates(), T_ns.getLength(), top[module->getID()]);
313 data.push_back({ z, p });
325 if (track_start == data. end()) { track_start = data. begin(); }
326 if (track_end == data.rend()) { track_end = data.rbegin(); }
328 zd = JRange_t(track_start->getZ(), track_end->getZ());
335 H1[
"B"]->Fill(zb.getLength() - za.getLength());
336 H1[
"D"]->Fill(zd.getLength() - za.getLength());
338 H2[
"B"]->Fill(zb.getLowerLimit() - za.getLowerLimit(), zb.getUpperLimit() - za.getUpperLimit());
339 H2[
"D"]->Fill(zd.getLowerLimit() - za.getLowerLimit(), zd.getUpperLimit() - za.getUpperLimit());
static const int JMUONSTART
Router for direct addressing of PMT data in detector data structure.
Utility class to parse command line options.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
JTrack3E getTrack(const Trk &track)
Get track.
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)...
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Template specialisation of class JModel to match hit with muon trajectory along z-axis.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
const JK40Rates & getK40Rates()
Get K40 rates.
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
bool qualitySorter(const JFit &first, const JFit &second)
Comparison of fit results.
JTime & add(const JTime &value)
Addition operator.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Auxiliary class for defining the range of iterations of objects.
Data structure for fit parameters.
Type definition of range.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
JAxis3D & rotate(const JRotation3D &R)
Rotate axis.
JDirection3D getDirection(const Vec &dir)
Get direction.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for start or end point evaluation.
Data storage class for rate measurements of all PMTs in one module.
JPosition3D getPosition(const Vec &pos)
Get position.
File router for fast addressing of summary data.
double getP(const double expval, bool hit)
Get Poisson probability to observe a hit or not for given expectation value for the number of hits...
then JCookie sh JDataQuality D $DETECTOR_ID R
static const int JSTART_LENGTH_METRES
distance between first and last hits in metres from JStart.cc
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Data structure for L0 hit.
Auxiliary class to set-up Hit.
double getProbability(const size_t N, const size_t M, const JK40Rates &R_Hz, const double T_ns)
Get probability due to random background.
Data structure for fit of straight line paralel to z-axis.
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.
do set_variable DETECTOR_TXT $WORKDIR detector
JPosition3D & rotate(const JRotation3D &R)
Rotate.
double getZ() const
Get z position.
Auxiliary class for K40 rates.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
#define DEBUG(A)
Message macros.