Jpp
Functions
JMuonGandalf.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/JMultipleFileScanner.hh"
#include "JSupport/JParallelFileScanner.hh"
#include "JSupport/JFileRecorder.hh"
#include "JSupport/JSupport.hh"
#include "JSupport/JMeta.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
#include "JFit/JEvt.hh"
#include "JFit/JMuonGandalf.hh"
#include "JFit/JMuonParameters.hh"
#include "JFit/JMuonGandalfParameters_t.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 JFIT::JRegressor<JLine3Z,JGandalf> fit with I/O of JFIT::JEvt data.

Author
gmaggi

Definition in file JMuonGandalf.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 36 of file JMuonGandalf.cc.

37 {
38  using namespace std;
39  using namespace JPP;
40  using namespace KM3NETDAQ;
41 
43  typedef JParallelFileScanner< JTypeList<JDAQEvent, JEvt> > JParallelFileScanner_t;
44 
45  JParallelFileScanner_t inputFile;
47  JLimit_t& numberOfEvents = inputFile.getLimit();
48  string detectorFile;
49  string pdfFile;
50  JMuonParameters muonParams;
51  int debug;
52 
53 
54  try {
55 
56  JParser<> zap("Program to perform PDF fit of muon trajectory to data.");
57 
58  zap['f'] = make_field(inputFile);
59  zap['o'] = make_field(outputFile) = "gandalf.root";
60  zap['a'] = make_field(detectorFile);
61  zap['n'] = make_field(numberOfEvents) = JLimit::max();
62  zap['P'] = make_field(pdfFile);
63  zap['@'] = make_field(muonParams) = JPARSER::initialised();
64  zap['d'] = make_field(debug) = 1;
65 
66  zap(argc, argv);
67  }
68  catch(const exception& error) {
69  FATAL(error.what() << endl);
70  }
71 
72  cout.tie(&cerr);
73 
75 
76  try {
77  load(detectorFile, detector);
78  }
79  catch(const JException& error) {
80  FATAL(error);
81  }
82 
84 
85  outputFile.open();
86  outputFile.put(JMeta(argc, argv));
87 
88  const JMuonGandalf muonGandalf(moduleRouter, muonParams, pdfFile);
89 
90  while (inputFile.hasNext()) {
91 
92  STATUS("event: " << setw(10) << inputFile.getCounter() << '\r'); DEBUG(endl);
93 
94  JParallelFileScanner_t::multi_pointer_type ps = inputFile.next();
95 
96  const JDAQEvent* tev = ps;
97  JEvt* in = ps;
98 
99  const JDAQTimeslice timeSlice(*tev, true);
100 
101  JEvt out;
102 
103  muonGandalf.getJEvt(timeSlice, *in, out);
104 
105  outputFile.put(out);
106  }
107  STATUS(endl);
108 
110 
111  io >> outputFile;
112 
113  outputFile.close();
114 }
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
JFIT::JMuonParameters
Definition: JMuonParameters.hh:20
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::JMuonGandalf
class to handle Muon Gandalf reconstruction first, two other angular reconstructionS should be ran : ...
Definition: JMuonGandalf.hh:47
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
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
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