Jpp
Functions
JORCAShowerFit.cc File Reference
#include <string>
#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/JParallelFileScanner.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JMeta.hh"
#include "JSupport/JTreeScanner.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "JFit/JEvt.hh"
#include "JFit/JShowerParameters.hh"
#include "JFit/JShowerFitParameters_t.hh"
#include "JFit/JORCAShowerFit.hh"
#include "JLang/JSharedPointer.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Program to perform EM Shower Fit for ORCA with I/O of JFIT::JEvt data. The reconstruction is made at the PMT level.

Author
adomi

Definition in file JORCAShowerFit.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 38 of file JORCAShowerFit.cc.

38  {
39 
40  using namespace std;
41  using namespace JPP;
42  using namespace KM3NETDAQ;
43 
44  typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
46 
47  JParallelFileScanner_t inputFile;
49  JShowerParameters showerParams;
50  JLimit_t& numberOfEvents = inputFile.getLimit();
51  string detectorFile;
52  string pdfFile;
53  int debug;
54 
55  try {
56 
57  JParser<> zap;
58 
59  zap['f'] = make_field(inputFile) ;
60  zap['o'] = make_field(outputFile) = "JORCAShowerFit_Output.root";
61  zap['a'] = make_field(detectorFile) ;
62  zap['F'] = make_field(pdfFile) ;
63  zap['@'] = make_field(showerParams) = JPARSER::initialised();
64  zap['n'] = make_field(numberOfEvents) = JLimit::max();
65  zap['d'] = make_field(debug) = 2;
66 
67  zap(argc, argv);
68  }
69  catch(const exception& error) {
70  FATAL(error.what() << endl);
71  }
72 
73  using namespace JTRIGGER;
74  using namespace JDETECTOR;
75  using namespace JGEOMETRY3D;
76  using namespace JTOOLS;
77 
79 
80  try {
81  load(detectorFile, detector);
82  }
83  catch(const JException& error) {
84  FATAL(error);
85  }
86 
87  outputFile.open();
88  outputFile.put(JMeta(argc, argv));
89 
91 
92  const JORCAShowerFit ShowerFit(moduleRouter, showerParams, pdfFile);
93 
94  while (inputFile.hasNext()) {
95 
96  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
97 
98  JParallelFileScanner_t::multi_pointer_type ps = inputFile.next();
99 
100  JDAQEvent* tev = ps;
101  JEvt* in = ps;
102 
103  JEvt out;
104 
105  const JDAQTimeslice timeSliceBuildL0(*tev, true);
106 
107  ShowerFit.getJEvt(timeSliceBuildL0, *in, out);
108 
109  outputFile.put(out);
110  }
111  STATUS(endl);
112 
114 
115  io >> outputFile;
116 
117  outputFile.close();
118 }
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition: JDAQEvent.hh:30
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
KM3NETDAQ::JDAQTimeslice
Data time slice.
Definition: JDAQTimeslice.hh:30
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JFIT::JEvt
Data structure for set of track fit results.
Definition: JEvt.hh:293
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
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:73
JLANG::JTypeList
Type list.
Definition: JTypeList.hh:22
STATUS
#define STATUS(A)
Definition: JMessage.hh:63
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
JSUPPORT::JParallelFileScanner
General purpose class for parallel reading of objects from a single file or multiple files.
Definition: JParallelFileScanner.hh:31
JSUPPORT::JMultipleFileScanner
General purpose class for object reading from a list of file names.
Definition: JMultipleFileScanner.hh:167
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
JFIT::JORCAShowerFit
Definition: JORCAShowerFit.hh:63
JGEOMETRY3D
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition: JAngle3D.hh:18
JTRIGGER
Checksum.
Definition: JSupport/JSupport.hh:35
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
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
JDETECTOR
Auxiliary classes and methods for detector calibration.
Definition: JAnchor.hh:12
JLANG::JException
General exception.
Definition: JException.hh:23
JLANG::JSharedPointer
The template JSharedPointer class can be used to share a pointer to an object.
Definition: JSharedPointer.hh:28