Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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 
46  typedef JRange<double> JRange_t;
47 
49 
50  typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
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
103  }
104  STATUS(endl);
105 
106  {
108 
109  io >> outputFile;
110  }
111 
112  outputFile.close();
113 
114  return 0;
115 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:70
Object writing to file.
Utility class to parse command line options.
Definition: JParser.hh:1514
#define STATUS(A)
Definition: JMessage.hh:63
General purpose class for parallel reading of objects from a single file or multiple files...
string outputFile
Acoustic single fit.
const JFit & get_best_reconstructed_muon(const JEvt &evt)
Get best reconstructed muon.
Type definition of range.
Definition: JHead.hh:41
Acoustic event fit.
Auxiliary class for recursive type list generation.
Definition: JTypeList.hh:351
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
Data structure for set of track fit results.
bool has_reconstructed_muon(const JEvt &evt)
Test whether given event has a track with muon reconstruction.
General purpose class for object reading from a list of file names.
const JDAQEventHeader & getDAQEventHeader() const
Get DAQ event header.
int debug
debug level