Jpp
JORCAShowerFit.cc
Go to the documentation of this file.
1 #include <string>
2 
5 
6 #include "JDAQ/JDAQEventIO.hh"
9 
12 
14 #include "JSupport/JSupport.hh"
16 #include "JSupport/JMeta.hh"
17 #include "JSupport/JTreeScanner.hh"
18 
19 #include "Jeep/JParser.hh"
20 #include "Jeep/JMessage.hh"
21 
22 #include "JFit/JEvt.hh"
25 #include "JFit/JORCAShowerFit.hh"
26 
27 #include "JLang/JSharedPointer.hh"
28 
29 
30 /**
31  * \file
32  *
33  * Program to perform EM Shower Fit for ORCA with I/O of JFIT::JEvt data.
34  * The reconstruction is made at the PMT level.
35  * \author adomi
36  */
37 
38 int main(int argc, char** argv){
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 }
JMeta.hh
Head.hh
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition: JDAQEvent.hh:30
JFileRecorder.hh
JSUPPORT::JLimit
Auxiliary class for defining the range of iterations of objects.
Definition: JLimit.hh:41
JMessage.hh
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
JSharedPointer.hh
Evt.hh
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
JTreeScanner.hh
JFIT::JORCAShowerFit::getJEvt
void getJEvt(const KM3NETDAQ::JDAQTimeslice &timeSliceBuildL0, JFIT::JEvt &InPreFits, JFIT::JEvt &OutFits) const
Declaration of the member function that actually performs the reconstruction.
Definition: JORCAShowerFit.hh:164
JSupport.hh
JShowerParameters.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JEvt.hh
JDAQEventIO.hh
JDAQTimesliceIO.hh
debug
int debug
debug level
Definition: JSirene.cc:59
JSUPPORT::JLimit::getLimit
const JLimit & getLimit() const
Get limit.
Definition: JLimit.hh:73
JModuleRouter.hh
JParallelFileScanner.hh
JLANG::JTypeList
Type list.
Definition: JTypeList.hh:22
STATUS
#define STATUS(A)
Definition: JMessage.hh:63
JParser.hh
JDetectorToolkit.hh
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
JORCAShowerFit.hh
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
JFIT::JORCAShowerFit
Definition: JORCAShowerFit.hh:63
JDAQSummarysliceIO.hh
JGEOMETRY3D
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition: JAngle3D.hh:18
JShowerFitParameters_t.hh
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
main
int main(int argc, char **argv)
Definition: JORCAShowerFit.cc:38