Jpp
JORCAShowerPositionFit.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"
26 
27 #include "JLang/JSharedPointer.hh"
28 
29 int main(int argc, char **argv){
30 
31  using namespace std;
32  using namespace JPP;
33  using namespace KM3NETDAQ;
34 
35  typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
37 
38  JParallelFileScanner_t inputFile;
40  JLimit_t& numberOfEvents = inputFile.getLimit();
41  string detectorFile;
42  string pdfFile;
43  JShowerParameters showerParams;
44  int debug;
45 
46  try{
47  JParser<> zap;
48 
49  zap['f'] = make_field(inputFile);
50  zap['o'] = make_field(outputFile) = "PositionFit.root";
51  zap['a'] = make_field(detectorFile);
52  zap['F'] = make_field(pdfFile) = "PDF_ShowerPositionFit.root";
53  zap['n'] = make_field(numberOfEvents) = JLimit::max();
54  zap['@'] = make_field(showerParams) = JPARSER::initialised();
55  zap['d'] = make_field(debug) = 2;
56 
57  if (zap.read(argc, argv) != 0) return 1;
58  }
59  catch(const exception& error){
60  FATAL(error.what() << endl);
61  }
62 
63  using namespace JTRIGGER;
64  using namespace JDETECTOR;
65  using namespace JGEOMETRY3D;
66  using namespace JTOOLS;
67 
69 
70  try {
71  load(detectorFile, detector);
72  }
73  catch(const JException& error) {
74  FATAL(error);
75  }
76 
77  outputFile.open();
78  outputFile.put(JMeta(argc, argv));
79 
81 
82  const JORCAShowerPositionFit ShowerPosFit(moduleRouter, showerParams, pdfFile);
83 
84  while (inputFile.hasNext()) {
85 
86  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
87 
88  JParallelFileScanner_t::multi_pointer_type ps = inputFile.next();
89 
90  JDAQEvent* tev = ps;
91  JEvt* in = ps;
92 
93  JEvt out;
94 
95  const JDAQTimeslice timeSliceBuildL0(*tev, true);
96  const JDAQTimeslice timeSliceBuildL2(*tev, false);
97 
98  ShowerPosFit.getJEvt(timeSliceBuildL0, timeSliceBuildL2, *in, out);
99 
100  outputFile.put(out);
101  }
102  STATUS(endl);
103 
105 
106  io >> outputFile;
107 
108  outputFile.close();
109 }
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
JFIT::JORCAShowerPositionFit
class to handle the second step of the shower reconstruction, mainly dedicated for ORCA
Definition: JORCAShowerPositionFit.hh:58
JMessage.hh
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e.
Definition: JParser.hh:63
JShowerPositionFitParameters_t.hh
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
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
JFIT::JORCAShowerPositionFit::getJEvt
void getJEvt(const KM3NETDAQ::JDAQTimeslice &timeSliceBuildL0, const KM3NETDAQ::JDAQTimeslice &timeSliceBuildL2, JFIT::JEvt &InPreFits, JFIT::JEvt &OutFits) const
Declaration of Member function that actually performs the reconstruction.
Definition: JORCAShowerPositionFit.hh:135
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
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
JORCAShowerPositionFit.hh
JDAQSummarysliceIO.hh
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
main
int main(int argc, char **argv)
Definition: JORCAShowerPositionFit.cc:29
JPARSER::JParser::read
int read(const int argc, const char *const argv[])
Parse the program's command line options.
Definition: JParser.hh:1791