61 int main(
int argc,
char **argv)
65 using namespace KM3NETDAQ;
75 JCalibration_t calibrationFile;
84 JParser<> zap(
"Auxiliary program to convert fit results to AAnet format.\
85 \nThe option -L corresponds to the name of a shared library \
86 \nand function so to rearrange the order of fit results.");
90 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
101 catch(
const exception& error) {
102 FATAL(error.what() << endl);
107 typedef JParallelFileScanner_t::multi_pointer_type multi_pointer_type;
112 if (detectorFile !=
"") {
125 dynamics.
load(calibrationFile);
137 }
catch(
const exception& error) {}
144 copy(buffer, header);
157 STATUS(
"Processing: " << *i << endl);
159 JParallelFileScanner_t
in(*i);
162 in.setLimit(inputFile.getLimit());
172 center = get<Vec>(head);
175 }
catch(
const exception& error) {}
178 while (in.hasNext()) {
180 STATUS(
"event: " << setw(10) << in.getCounter() <<
'\r');
DEBUG(endl);
182 multi_pointer_type ps = in.next();
189 JFIT::JEvt::iterator __end = evt->end();
191 if (numberOfFits > 0) {
192 advance(__end = evt->begin(), min(numberOfFits, evt->size()));
196 partial_sort(evt->begin(), __end, evt->end(),
qualitySorter);
201 if (mc.getEntries() != 0) {
221 if (!pmt_router->empty()) {
225 if (pmt_router.
hasPMT(i->pmt_id)) {
231 i->dom_id =
id.
getID();
232 i->channel_id =
id.getPMTAddress();
238 FATAL(
"Missing PMT" << i->pmt_id << endl);
243 if (!mod_router->empty()) {
256 i->pmt_id = pmt.getID();
261 i->a = cpu.getNPE(i->tot);
265 FATAL(
"Missing module " << i->dom_id << endl);
270 for (JFIT::JEvt::const_iterator fit = evt->begin(); fit != __end; ++fit) {
274 trk.
id = out.
trks.size() + 1;
275 trk.
pos =
Vec(fit->getX(), fit->getY(), fit->getZ());
276 trk.
dir =
Vec(fit->getDX(), fit->getDY(), fit->getDZ());
279 trk.
lik = fit->getQ();
282 for (JHistory::const_iterator i = fit->getHistory().begin(); i != fit->getHistory().end(); ++i) {
286 for (
int i = 0; i != fit->getN(); ++i) {
287 trk.
fitinf.push_back(fit->getW(i));
290 out.
trks.push_back(trk);
293 out.
id = ++number_of_events;
Router for direct addressing of PMT data in detector data structure.
double getT() const
Get calibrated time of hit.
Utility class to parse command line options.
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
double t
track time [ns] (when the particle is at pos )
static JDetectorMechanics getMechanics
Function object to get string mechanics.
JPMTIdentifier getIdentifier(const JPMTAddress &address) const
Get identifier of PMT.
ROOT TTree parameter settings.
bool read(Vec &v, std::istream &is)
Read a Vec(tor) from a stream.
Recording of objects on file according a format that follows from the file name extension.
Router for direct addressing of module data in detector data structure.
General purpose sorter of fit results.
General purpose class for parallel reading of objects from a single file or multiple files...
bool hasPMT(const JObjectID &id) const
Has PMT.
const JPMT & getPMT(const JPMTAddress &address) const
Get PMT.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Long64_t counter_type
Type definition for counter.
double livetime_s
Live time [s].
double getTime(const Hit &hit)
Get true time of hit.
Basic data structure for time and time over threshold information of hit.
double E
Energy [GeV] (either MC truth or reconstructed)
const JDetector & update(const double t1_s)
Get detector calibrated at given time.
Data structure for detector geometry and calibration.
ROOT TTree parameter settings.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
void load(JObjectIterator_t &input)
Load calibration data.
double getToT() const
Get calibrated time over threshold of hit.
Auxiliary class for defining the range of iterations of objects.
The Vec class is a straightforward 3-d vector, which also works in pyroot.
void push(T JHead::*pd)
Push given data member to Head.
JDirection3D getDirection(const Vec &dir)
Get direction.
int mc_run_id
MC run identifier.
Auxiliary class for recursive type list generation.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int getID() const
Get identifier.
JAANET::start_run start_run
Parallel scanning of objects from a single file or multiple files according a format that follows fro...
Data structure for PMT geometry and calibration.
JPosition3D getPosition(const Vec &pos)
Get position.
std::vector< double > fitinf
place to store additional fit info, for jgandalf, see JFitParameters.hh
Auxiliary class for map of PMT parameters.
Dynamic detector calibration.
void load(const std::string &file_name)
Load mechanical model parameters from file.
Direct access to PMT in detector data structure.
const JPMT & getPMT(const int index) const
Get PMT.
General purpose messaging.
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Direct access to module in detector data structure.
PMT analogue signal processor.
Dynamic detector calibration.
Vec pos
postion of the track at time t [m]
Address of PMT in detector data structure.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
Data structure for set of track fit results.
std::vector< Trk > trks
list of reconstructed tracks (can be several because of prefits,showers, etc).
double getLivetime(const std::string &file_name)
Get data taking live time.
std::vector< int > rec_stages
list of identifyers of succesfull fitting stages resulting in this track
General purpose class for object reading from a list of file names.
double lik
likelihood or lambda value (for aafit, lambda)
Utility class to parse command line options.
std::vector< Hit > mc_hits
MC: list of MC truth hits.
static const int JPP_RECONSTRUCTION_TYPE
KM3NeT Data Definitions v2.0.0-14-gbeccebb https://git.km3net.de/common/km3net-dataformat.
bool hasModule(const JObjectID &id) const
Has module.
void copy(const Head &from, JHead &to)
Copy header from from to to.
PMT analogue signal processor.
int id
offline event identifier
const JLimit & getLimit() const
Get limit.
Compass event data types.
std::vector< Hit > hits
list of hits
do set_variable DETECTOR_TXT $WORKDIR detector
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
JTriggerCounter_t getCounter() const
Get trigger counter.
std::vector< Trk > mc_trks
MC: list of MC truth tracks.
const JPMTAddress & getAddress(const JObjectID &id) const
Get address of PMT.
bool qualitySorter(const JRECONSTRUCTION::JFit &first, const JRECONSTRUCTION::JFit &second)
Comparison of fit results.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
#define DEBUG(A)
Message macros.
int rec_type
identifyer for the overall fitting algorithm/chain/strategy