121 using namespace KM3NETDAQ;
124 typedef JTriggeredFileScanner_t::multi_pointer_type multi_pointer_type;
128 JTriggeredFileScanner_t inputFile;
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();
154 catch(
const exception& error) {
155 FATAL(error.what() << endl);
199 while (inputFile.hasNext()) {
201 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
203 multi_pointer_type ps = inputFile.next();
209 summary.update(*tev);
216 if (muon == event->mc_trks.end() || track->E > muon->E) {
222 if (muon == event->mc_trks.end()) {
226 if (muon->len == 0.0) {
227 muon->len =
gWater(muon->E);
233 JRange_t za(JRange_t::DEFAULT_RANGE());
234 JRange_t zb(JRange_t::DEFAULT_RANGE());
235 JRange_t zd(JRange_t::DEFAULT_RANGE());
245 za.setLowerLimit(ta.
getZ());
246 za.setLength(fabs(muon->len));
252 buildL0(*tev, moduleRouter,
true, back_inserter(dataL0));
259 JEvt::const_iterator track = evt->begin();
274 for (buffer_type::const_iterator
i = dataL0.begin();
i != dataL0.end(); ++
i) {
281 top[hit.getModuleID()].insert(hit.getPMTAddress());
287 double getZ()
const {
return z; }
288 double getP()
const {
return p; }
296 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
298 if (summary.hasSummaryFrame(module->getID())) {
309 const double p =
getProbability(*module, frame, rates_Hz.getMultiplesRates(), T_ns.getLength(), top[module->getID()]);
311 data.push_back({
z, p });
323 if (track_start == data. end()) { track_start = data. begin(); }
324 if (track_end == data.rend()) { track_end = data.rbegin(); }
326 zd = JRange_t(track_start->getZ(), track_end->getZ());
333 H1[
"B"]->Fill(zb.getLength() - za.getLength());
334 H1[
"D"]->Fill(zd.getLength() - za.getLength());
336 H2[
"B"]->Fill(zb.getLowerLimit() - za.getLowerLimit(), zb.getUpperLimit() - za.getUpperLimit());
337 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.
Vec getOffset(const JHead &header)
Get offset.
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.
then warning Cannot perform comparison test for histogram
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
std::vector< JHitW0 > buffer_type
hits
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.
The Vec class is a straightforward 3-d vector, which also works in pyroot.
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
then usage $script[energy[distance[z of PMT]]] fi case set_variable z
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.
JAbstractHistogram< double > JHistogram_t
Type definition for scan along axis.
#define DEBUG(A)
Message macros.