Jpp
JORCAShowerFit.cc
Go to the documentation of this file.
1 #include <string>
2 
3 #include "evt/Head.hh"
4 #include "evt/Evt.hh"
5 
6 #include "JDAQ/JDAQEvent.hh"
7 #include "JDAQ/JDAQTimeslice.hh"
8 
11 
13 #include "JSupport/JSupport.hh"
15 #include "JSupport/JMeta.hh"
16 #include "JSupport/JTreeScanner.hh"
17 
18 #include "Jeep/JParser.hh"
19 #include "Jeep/JMessage.hh"
20 
21 #include "JFit/JEvt.hh"
24 #include "JFit/JORCAShowerFit.hh"
25 
26 #include "JLang/JSharedPointer.hh"
27 
28 
29 /**
30  * \file
31  *
32  * Program to perform EM Shower Fit for ORCA with I/O of JFIT::JEvt data.
33  * The reconstruction is made at the PMT level.
34  * \author adomi
35  */
36 
37 int main(int argc, char** argv){
38 
39  using namespace std;
40  using namespace JPP;
41  using namespace KM3NETDAQ;
42 
43  typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
45 
46  JParallelFileScanner_t inputFile;
47  JFileRecorder<typelist> outputFile;
48  JShowerParameters showerParams;
49  JLimit_t& numberOfEvents = inputFile.getLimit();
50  string detectorFile;
51  string pdfFile;
52  int debug;
53 
54  try {
55 
56  JParser<> zap;
57 
58  zap['f'] = make_field(inputFile) ;
59  zap['o'] = make_field(outputFile) = "JORCAShowerFit_Output.root";
60  zap['a'] = make_field(detectorFile) ;
61  zap['F'] = make_field(pdfFile) ;
62  zap['@'] = make_field(showerParams) = JPARSER::initialised();
63  zap['n'] = make_field(numberOfEvents) = JLimit::max();
64  zap['d'] = make_field(debug) = 2;
65 
66  zap(argc, argv);
67  }
68  catch(const exception& error) {
69  FATAL(error.what() << endl);
70  }
71 
72  using namespace JTRIGGER;
73  using namespace JDETECTOR;
74  using namespace JGEOMETRY3D;
75  using namespace JTOOLS;
76 
77  JDetector detector;
78 
79  try {
80  load(detectorFile, detector);
81  }
82  catch(const JException& error) {
83  FATAL(error);
84  }
85 
86  outputFile.open();
87  outputFile.put(JMeta(argc, argv));
88 
89  const JSharedPointer<const JModuleRouter> moduleRouter(new JModuleRouter(detector));
90 
91  const JORCAShowerFit ShowerFit(moduleRouter, showerParams, pdfFile);
92 
93  while (inputFile.hasNext()) {
94 
95  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
96 
97  JParallelFileScanner_t::multi_pointer_type ps = inputFile.next();
98 
99  JDAQEvent* tev = ps;
100  JEvt* in = ps;
101 
102  JEvt out;
103 
104  const JDAQTimeslice timeSliceBuildL0(*tev, true);
105 
106  ShowerFit.getJEvt(timeSliceBuildL0, *in, out);
107 
108  outputFile.put(out);
109  }
110  STATUS(endl);
111 
112  JMultipleFileScanner<JRemove<typelist, JEvt>::typelist> io(inputFile);
113 
114  io >> outputFile;
115 
116  outputFile.close();
117 }
JMeta.hh
KM3NETDAQ::JDAQEvent
DAQ Event.
Definition: JDAQEvent.hh:34
JFileRecorder.hh
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:456
JSharedPointer.hh
JSUPPORT::JLimit_t
JLimit JLimit_t
Type definition of limit.
Definition: JLimit.hh:215
KM3NETDAQ::JDAQTimeslice
Data time slice.
Definition: JDAQTimeslice.hh:36
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JDAQTimeslice.hh
JTreeScanner.hh
JSupport.hh
JShowerParameters.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JEvt.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
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
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
JDAQEvent.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
JDETECTOR
Auxiliary classes and methods for detector calibration.
Definition: JAnchor.hh:12
main
int main(int argc, char **argv)
Definition: JORCAShowerFit.cc:37