Jpp  17.0.0-rc.1
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 76 of file JPrintAAnet.cc.

77 {
78  using namespace std;
79  using namespace JPP;
80 
81  JMultipleFileScanner<Evt> inputFile;
82  JLimit_t& numberOfEvents = inputFile.getLimit();
83  int debug;
84 
85  try {
86 
87  JParser<> zap("Example program to print track fit results from Evt formatted data.");
88 
89  zap['f'] = make_field(inputFile);
90  zap['n'] = make_field(numberOfEvents) = JLimit::max();
91  zap['d'] = make_field(debug) = 2;
92 
93  zap(argc, argv);
94  }
95  catch(const exception& error) {
96  FATAL(error.what() << endl);
97  }
98 
99 
100  while (inputFile.hasNext()) {
101 
102  cout << "event " << setw(10) << inputFile.getCounter() << endl;
103 
104  const Evt* evt = inputFile.next();
105 
106  if (has_reconstructed_jppmuon(*evt)) {
107 
108  const Trk trk = get_best_reconstructed_jppmuon(*evt);
109 
110  print(cout, "", trk);
111  print(cout, "->", *evt, trk.mother_id);
112  }
113  }
114 }
Utility class to parse command line options.
Definition: JParser.hh:1500
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:1961
int debug
debug level
Definition: JSirene.cc:66
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
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:19