Jpp  17.3.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JPrintAAnet.cc File Reference

Example program to print track fit results from Evt formatted data. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "JAAnet/JAAnetToolkit.hh"
#include "JSupport/JMultipleFileScanner.hh"
#include "JSupport/JSupport.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

Example program to print track fit results from Evt formatted data.

Author
mdejong

Definition in file JPrintAAnet.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 77 of file JPrintAAnet.cc.

78 {
79  using namespace std;
80  using namespace JPP;
81 
82  JMultipleFileScanner<Evt> inputFile;
83  JLimit_t& numberOfEvents = inputFile.getLimit();
84  int debug;
85 
86  try {
87 
88  JParser<> zap("Example program to print track fit results from Evt formatted data.");
89 
90  zap['f'] = make_field(inputFile);
91  zap['n'] = make_field(numberOfEvents) = JLimit::max();
92  zap['d'] = make_field(debug) = 2;
93 
94  zap(argc, argv);
95  }
96  catch(const exception& error) {
97  FATAL(error.what() << endl);
98  }
99 
100 
101  while (inputFile.hasNext()) {
102 
103  cout << "event " << setw(10) << inputFile.getCounter() << endl;
104 
105  const Evt* evt = inputFile.next();
106 
107  if (has_reconstructed_jppmuon(*evt)) {
108 
109  const Trk trk = get_best_reconstructed_jppmuon(*evt);
110 
111  print(cout, "", trk);
112  print(cout, "->", *evt, trk.mother_id);
113  }
114  }
115 }
Utility class to parse command line options.
Definition: JParser.hh:1517
bool has_reconstructed_jppmuon(const Evt &evt)
Test whether given event has a track with muon reconstruction.
int mother_id
MC id of the parent particle.
Definition: Trk.hh:29
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
const Trk & get_best_reconstructed_jppmuon(const Evt &evt)
Get best reconstructed muon.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
print
Definition: JConvertDusj.sh:44
#define FATAL(A)
Definition: JMessage.hh:67
General purpose class for object reading from a list of file names.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:73
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Definition: Trk.hh:14
int debug
debug level
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:20