Jpp
Functions
JORCAShowerPrefit.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 "JTools/JRange.hh"
#include "JFit/JORCAShowerPrefit.hh"
#include "JFit/JShowerParameters.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

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

Definition at line 29 of file JORCAShowerPrefit.cc.

30 {
31  using namespace std;
32  using namespace JPP;
33  using namespace KM3NETDAQ;
34 
36 
39  JLimit_t& numberOfEvents = inputFile.getLimit();
40  string detectorFile;
41  JShowerParameters showerParams;
42  int debug;
43 
44  try {
45 
46  JParser<> zap("Program to perform position pre-fit of shower to data.");
47 
48  zap['f'] = make_field(inputFile);
49  zap['o'] = make_field(outputFile) = "ShowerPrefit.root";
50  zap['a'] = make_field(detectorFile);
51  zap['@'] = make_field(showerParams) = JPARSER::initialised();
52  zap['n'] = make_field(numberOfEvents) = JLimit::max();
53  zap['d'] = make_field(debug) = 1;
54 
55  zap(argc, argv);
56  }
57  catch(const exception& error) {
58  FATAL(error.what() << endl);
59  }
60 
61  cout.tie(&cerr);
62 
64 
65  try {
66  load(detectorFile, detector);
67  }
68  catch(const JException& error) {
69  FATAL(error);
70  }
71 
73 
74  outputFile.open();
75  outputFile.put(JMeta(argc, argv));
76 
77  const JORCAShowerPrefit ShowerPrefit(moduleRouter, showerParams);
78 
79  while (inputFile.hasNext()) {
80 
81  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
82 
83  const JDAQEvent* tev = inputFile.next();
84 
85  const JDAQTimeslice timeSliceBuildL0(*tev, true);
86  const JDAQTimeslice timeSliceBuildL2(*tev, !showerParams.prefit.useL0);
87 
88  JEvt out;
89 
90  ShowerPrefit.getJEvt(timeSliceBuildL0, timeSliceBuildL2, out);
91 
92  outputFile.put(out);
93  }
94 
95  STATUS(endl);
96 
98 
99  io >> outputFile;
100 
101  outputFile.close();
102 }
JFIT::JShowerPrefitParameters_t::useL0
bool useL0
Definition: JShowerPrefitParameters_t.hh:22
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition: JDAQEvent.hh:30
JSUPPORT::JSingleFileScanner::getCounter
counter_type getCounter() const
Get counter.
Definition: JSingleFileScanner.hh:208
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e.
Definition: JParser.hh:63
JDETECTOR::load
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Definition: JDetectorToolkit.hh:476
JSUPPORT::JSingleFileScanner::next
virtual const pointer_type & next()
Get next element.
Definition: JSingleFileScanner.hh:280
JLANG::JTYPELIST
Auxiliary class for recursive type list generation.
Definition: JTypeList.hh:377
KM3NETDAQ::JDAQTimeslice
Data time slice.
Definition: JDAQTimeslice.hh:30
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JFIT::JORCAShowerPrefit
class to handle first step of the shower reconstruction, mainly dedicated for ORCA
Definition: JORCAShowerPrefit.hh:55
JFIT::JEvt
Data structure for set of track fit results.
Definition: JEvt.hh:293
JSUPPORT::JSingleFileScanner::hasNext
virtual bool hasNext()
Check availability of next element.
Definition: JSingleFileScanner.hh:234
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
debug
int debug
debug level
Definition: JSirene.cc:59
STATUS
#define STATUS(A)
Definition: JMessage.hh:63
JFIT::JShowerParameters::prefit
JShowerPrefitParameters_t prefit
Definition: JShowerParameters.hh:23
JFIT::JShowerParameters
Definition: JShowerParameters.hh:20
JDETECTOR::JModuleRouter
Router for direct addressing of module data in detector data structure.
Definition: JModuleRouter.hh:34
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
JDETECTOR::JDetector
Detector data structure.
Definition: JDetector.hh:80
JAANET::detector
Detector file.
Definition: JHead.hh:130
JSUPPORT::JMeta
Auxiliary class for ROOT I/O of application specific meta data.
Definition: JMeta.hh:71
DEBUG
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
std
Definition: jaanetDictionary.h:36
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
FATAL
#define FATAL(A)
Definition: JMessage.hh:67
outputFile
string outputFile
Definition: JDAQTimesliceSelector.cc:37
JSUPPORT::JFileRecorder
Object writing to file.
Definition: JFileRecorder.hh:41
JLANG::JException
General exception.
Definition: JException.hh:23
JSUPPORT::JSingleFileScanner
Object reading from a list of files.
Definition: JSingleFileScanner.hh:75
JLANG::JSharedPointer
The template JSharedPointer class can be used to share a pointer to an object.
Definition: JSharedPointer.hh:28