Jpp 20.0.0-27-g39925593c-D
the software that should make you happy
Loading...
Searching...
No Matches
Functions
JMuonSelect.cc File Reference

Program to extract events based on muon reconstruction. More...

#include <string>
#include <iostream>
#include <iomanip>
#include "km3net-dataformat/definitions/reconstruction.hh"
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JSupport/JMeta.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JParallelFileScanner.hh"
#include "JSupport/JMonteCarloFileSupportkit.hh"
#include "JTrigger/JTriggerParameters.hh"
#include "JTools/JRange.hh"
#include "JReconstruction/JEvt.hh"
#include "JReconstruction/JEvtToolkit.hh"
#include "JReconstruction/JEventSelector.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Program to extract events based on muon reconstruction.


Events outside the accepted range of cosine zenith angle will have no hits.

Author
mdejong

Definition in file JMuonSelect.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 40 of file JMuonSelect.cc.

41{
42 using namespace std;
43 using namespace JPP;
44 using namespace KM3NETDAQ;
45
47
49
51 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
52
53 JParallelFileScanner_t inputFile;
54 size_t numberOfEvents;
56 JRange_t ct;
57 int debug;
58
59
60 try {
61
62 JParser<> zap("Program to extract events based on muon reconstruction."\
63 "\nEvents outside the accepted range of cosine zenith angle will have no hits.");
64
65 zap['f'] = make_field(inputFile, "input file (output of JXXXMuonReconstruction.sh)");
66 zap['n'] = make_field(numberOfEvents) = std::numeric_limits<size_t>::max();
67 zap['o'] = make_field(outputFile, "output file name") = "extract.root";
68 zap['c'] = make_field(ct, "accepted range of cosine zenith angle") = JRange_t();
69 zap['d'] = make_field(debug) = 2;
70
71 zap(argc, argv);
72 }
73 catch(const exception& error) {
74 FATAL(error.what() << endl);
75 }
76
77
78 outputFile.open();
79 outputFile.put(JMeta(argc, argv));
80
81 while (inputFile.hasNext()) {
82
83 STATUS("event: " << setw(8) << inputFile.getCounter() << '\r' << flush);
84
85 multi_pointer_type ps = inputFile.next();
86
87 JDAQEvent* tev = ps;
88 JEvt* evt = ps;
89
90 bool status = true;
91
92 if (has_reconstructed_muon(*evt)) {
93
94 const JFit& fit = get_best_reconstructed_muon(*evt);
95
96 status = ct(fit.getDZ());
97 }
98
99 if (status)
100 outputFile.put(*tev);
101 else
102 outputFile.put(JDAQEvent(tev->getDAQEventHeader()));
103 }
104 STATUS(endl);
105
106 {
108
109 io >> outputFile;
110 }
111
112 outputFile.close();
113
114 return 0;
115}
string outputFile
#define STATUS(A)
Definition JMessage.hh:63
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Data structure for set of track fit results.
Template definition of a multi-dimensional oscillation probability interpolation table.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const JFit & get_best_reconstructed_muon(const JEvt &evt)
Get best reconstructed muon.
bool has_reconstructed_muon(const JEvt &evt)
Test whether given event has a track with muon reconstruction.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
Type definition of range.
Definition JHead.hh:43
Acoustic event fit.
Acoustic single fit.
Auxiliary class for ROOT I/O of application specific meta data.
Definition JMeta.hh:72