Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JShowerPrefit.cc File Reference
#include "km3net-dataformat/offline/Head.hh"
#include "km3net-dataformat/offline/Evt.hh"
#include "JDAQ/JDAQEventIO.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "JDAQ/JDAQSummarysliceIO.hh"
#include "JDetector/JModuleRouter.hh"
#include "JDetector/JDetectorToolkit.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JSingleFileScanner.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "JTools/JPermutation.hh"
#include "JReconstruction/JEvt.hh"
#include "JReconstruction/JShowerPrefit.hh"
#include "JReconstruction/JShowerPrefitParameters_t.hh"
#include "JLang/JSharedPointer.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)
Author
adomi

Definition at line 31 of file JShowerPrefit.cc.

32 {
33  using namespace std;
34  using namespace JPP;
35 
37 
40  JLimit_t& numberOfEvents = inputFile.getLimit();
41  string detectorFile;
43  int debug;
44 
45  try {
46 
47  JParser<> zap("Program to perform position pre-fit of shower to data.");
48 
49  zap['f'] = make_field(inputFile);
50  zap['o'] = make_field(outputFile) = "ShowerPrefit.root";
51  zap['a'] = make_field(detectorFile);
53  zap['n'] = make_field(numberOfEvents) = JLimit::max();
54  zap['d'] = make_field(debug) = 2;
55 
56  zap(argc, argv);
57  }
58  catch(const exception& error) {
59  FATAL(error.what() << endl);
60  }
61 
62  cout.tie(&cerr);
63 
65 
66  try {
67  load(detectorFile, detector);
68  }
69  catch(const JException& error) {
70  FATAL(error);
71  }
72 
73  const JModuleRouter router(detector);
74 
75  JShowerPrefit fit(parameters, router, debug);
76 
77  outputFile.open();
78  outputFile.put(JMeta(argc, argv));
79 
80  while (inputFile.hasNext()) {
81 
82  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
83 
84  const JDAQEvent* tev = inputFile.next();
85 
86  JEvt out = fit(*tev);
87 
88  // apply default sorter
89 
90  JEvt::iterator __end = out.end();
91 
92  sort(out.begin(), __end, qualitySorter);
93 
94  outputFile.put(out);
95 
96  }
97 
98  STATUS(endl);
99 
101 
102  io >> outputFile;
103 
104  outputFile.close();
105 }
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:71
Object writing to file.
Utility class to parse command line options.
Definition: JParser.hh:1493
General exception.
Definition: JException.hh:23
#define STATUS(A)
Definition: JMessage.hh:63
Detector data structure.
Definition: JDetector.hh:80
Router for direct addressing of module data in detector data structure.
*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
Definition: diff-Tuna.sh:38
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition: JParser.hh:63
class to handle first step of the shower reconstruction in ORCA: it reconstructs the shower vertex...
string outputFile
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
Detector file.
Definition: JHead.hh:130
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:1954
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
int debug
debug level
Definition: JSirene.cc:61
#define FATAL(A)
Definition: JMessage.hh:67
Data structure for set of track fit results.
Definition: JEvt.hh:294
Object reading from a list of files.
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:73
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results.
JTriggerCounter_t next()
Increment trigger counter.
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62