Jpp
JMuonSimplex.cc
Go to the documentation of this file.
1 #include <string>
2 
5 
6 #include "JDAQ/JDAQEventIO.hh"
9 
12 
15 #include "JSupport/JSupport.hh"
16 #include "JSupport/JMeta.hh"
17 
18 #include "Jeep/JParser.hh"
19 #include "Jeep/JMessage.hh"
20 
21 #include "JFit/JEvt.hh"
22 #include "JFit/JMuonSimplex.hh"
23 #include "JFit/JMuonParameters.hh"
25 
26 #include "JLang/JSharedPointer.hh"
27 
28 /**
29  * \file
30  *
31  * Program to perform JFIT::JRegressor<JLine3Z,JSimplex> fit with I/O of JFIT::JEvt data.
32  * \author gmaggi
33  */
34 int main(int argc, char **argv)
35 {
36  using namespace std;
37  using namespace JPP;
38  using namespace KM3NETDAQ;
39 
41  typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
42 
43  JParallelFileScanner_t inputFile;
45  JLimit_t& numberOfEvents = inputFile.getLimit();
46  string detectorFile;
47  JMuonParameters muonParams;
48  int debug;
49 
50  try {
51 
52  JParser<> zap("Program to perform intermediate fit of muon trajectory to data.");
53 
54  zap['f'] = make_field(inputFile);
55  zap['o'] = make_field(outputFile) = "simplex.root";
56  zap['a'] = make_field(detectorFile);
57  zap['@'] = make_field(muonParams) = JPARSER::initialised();
58  zap['n'] = make_field(numberOfEvents) = JLimit::max();
59  zap['d'] = make_field(debug) = 1;
60 
61  zap(argc, argv);
62  }
63  catch(const exception& error) {
64  FATAL(error.what() << endl);
65  }
66 
67  cout.tie(&cerr);
68 
70 
71  try {
72  load(detectorFile, detector);
73  }
74  catch(const JException& error) {
75  FATAL(error);
76  }
77 
79 
80  outputFile.open();
81  outputFile.put(JMeta(argc, argv));
82 
83  const JMuonSimplex muonSimplex(moduleRouter, muonParams);
84 
85  while (inputFile.hasNext()) {
86 
87  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
88 
89  JParallelFileScanner_t::multi_pointer_type ps = inputFile.next();
90 
91  const JDAQEvent* tev = ps;
92  JEvt* in = ps;
93 
94  const JDAQTimeslice timeSlice(*tev, true);
95 
96  JEvt out;
97 
98  muonSimplex.getJEvt(timeSlice, *in, out);
99 
100  outputFile.put(out);
101  }
102 
103  STATUS(endl);
104 
106 
107  io >> outputFile;
108 
109  outputFile.close();
110 }
111 
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
JMuonSimplexParameters_t.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:476
JFIT::JMuonParameters
Definition: JMuonParameters.hh:20
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
JSupport.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
main
int main(int argc, char **argv)
Definition: JMuonSimplex.cc:34
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
JSUPPORT::JParallelFileScanner
General purpose class for parallel reading of objects from a single file or multiple files.
Definition: JParallelFileScanner.hh:31
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
JFIT::JMuonSimplex
class to handle the Simplex angular reconstruction.
Definition: JMuonSimplex.hh:50
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
JMuonSimplex.hh
JMuonParameters.hh
JDAQSummarysliceIO.hh
JFIT::JMuonSimplex::getJEvt
void getJEvt(const KM3NETDAQ::JDAQTimeslice &timeSlice, JFIT::JEvt &InPreFits, JFIT::JEvt &OutFits) const
Declaration of Member function that actually performs the reconstruction.
Definition: JMuonSimplex.hh:98
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