|
LCIO
02.17
|
#include <signal.h>#include <string>#include <cstring>#include <cstdlib>#include <sstream>#include <fstream>#include <iomanip>#include "lcio.h"#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include "EVENT/LCCollection.h"#include "EVENT/SimTrackerHit.h"#include "EVENT/SimCalorimeterHit.h"#include "IO/LCReader.h"#include "UTIL/LCTOOLS.h"#include "EVENT/LCRunHeader.h"#include "UTIL/LCTime.h"#include <readline/readline.h>#include <readline/history.h>
Include dependency graph for lsh.cc:Go to the source code of this file.
Classes | |
| struct | pagerInfo |
Typedefs | |
| typedef pair< int, string > | level |
Functions | |
| const char * | print_prompt () |
| PROMPT. More... | |
| void | leave (int ret) |
| END PROMPT. More... | |
| void | int_handler (int sig) |
| END EXIT. More... | |
| void | term_handler (int sig) |
| void | begin_paging (pagerInfo *file) |
| END SIGNAL HANDLERS. More... | |
| bool | end_paging (pagerInfo *file) |
| void | simplePrintCol (LCCollection *col) |
| END PAGER HANDLING. More... | |
| void | normalPrintCol (LCCollection *col) |
| void | printTop () |
| void | fun_print (string colNr, string flag) |
| void | lsRuns () |
| END PRINT FUNCTIONS. More... | |
| void | lsEvents () |
| void | lsCollections () |
| void | fun_ls () |
| END LS FUNCTIONS. More... | |
| void | fun_cd (string str) |
| void | fun_dump (string arg) |
| void | fun_egg () |
| void | fun_open (string filename) |
| void | fun_help () |
| int | main (int argc, char **argv) |
| END COMMAND FUNCTIONS. More... | |
Variables | |
| const int | TOP = 0 |
| const int | RUN = 1 |
| const int | EVT = 2 |
| const int | COL = 3 |
| vector< level > | position |
| map< int, string > | mapRuns |
| map< int, int > | mapEventsInRun |
| int | numEvents = 0 |
| bool | withEvents = true |
| bool | interrupt = false |
| bool | pageOutput = false |
| string | pager = "less" |
| string | egg = "egg" |
| string | prompt = "" |
| LCReader * | lcReader |
| LCRunHeader * | runHdr |
| LCEvent * | event |
| LCCollection * | gCol |
| void begin_paging | ( | pagerInfo * | file | ) |
END SIGNAL HANDLERS.
PAGER HANDLING
Definition at line 146 of file lsh.cc.
References pagerInfo::fd_old, pagerInfo::fd_temp, pagerInfo::filename, and pagerInfo::save.
Referenced by main().
Definition at line 161 of file lsh.cc.
References std::string::append(), std::string::c_str(), pagerInfo::fd_old, pagerInfo::fd_temp, pagerInfo::filename, pager, pagerInfo::save, and std::system().
Referenced by main().
| void fun_cd | ( | string | str | ) |
Definition at line 445 of file lsh.cc.
References std::string::c_str(), std::endl(), event, EVT, lcReader, leave(), std::next(), position, RUN, std::string::size(), std::size(), std::strcpy(), std::strtok(), and TOP.
Referenced by main().
| void fun_dump | ( | string | arg | ) |
| void fun_egg | ( | ) |
| void fun_help | ( | ) |
| void fun_ls | ( | ) |
END LS FUNCTIONS.
COMMAND FUNCTIONS
Definition at line 420 of file lsh.cc.
References COL, EVT, fun_print(), lsCollections(), lsEvents(), lsRuns(), position, printTop(), RUN, and TOP.
Referenced by main().
| void fun_open | ( | string | filename | ) |
Definition at line 552 of file lsh.cc.
References std::string::c_str(), egg, std::endl(), event, std::fclose(), std::fopen(), std::fseek(), std::ftell(), interrupt, lcReader, mapEventsInRun, mapRuns, numEvents, std::perror(), position, std::string::replace(), runHdr, std::size(), TOP, and withEvents.
Referenced by main().
Definition at line 324 of file lsh.cc.
References std::endl(), event, EVT, gCol, lcReader, normalPrintCol(), position, RUN, simplePrintCol(), std::size(), and TOP.
Referenced by fun_dump(), fun_ls(), and main().
| void int_handler | ( | int | sig | ) |
END EXIT.
SIGNAL HANDLERS
Definition at line 129 of file lsh.cc.
References std::endl(), and interrupt.
Referenced by main().
| void leave | ( | int | ret | ) |
END PROMPT.
EXIT
Definition at line 110 of file lsh.cc.
References std::endl(), std::exit(), and lcReader.
Referenced by fun_cd(), main(), and term_handler().
| void lsCollections | ( | ) |
Definition at line 393 of file lsh.cc.
References std::vector< T >::begin(), std::vector< T >::end(), std::endl(), event, EVT, gCol, lcReader, std::left(), position, std::right(), RUN, std::setw(), and TOP.
Referenced by fun_ls().
| void lsEvents | ( | ) |
Definition at line 379 of file lsh.cc.
References std::endl(), event, interrupt, lcReader, position, RUN, std::setw(), std::size(), and TOP.
Referenced by fun_ls().
| void lsRuns | ( | ) |
END PRINT FUNCTIONS.
LS FUNCTIONS
Definition at line 361 of file lsh.cc.
References std::endl(), std::left(), mapEventsInRun, mapRuns, std::right(), std::setw(), std::stringstream::str(), and withEvents.
Referenced by fun_ls().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
END COMMAND FUNCTIONS.
MAIN
MAIN SHELL LOOP
read input
ohne readline
process input
Definition at line 638 of file lsh.cc.
References std::vector< T >::begin(), begin_paging(), std::data(), IO::LCReader::directAccess, egg, end_paging(), std::endl(), std::string::erase(), std::exit(), pagerInfo::filename, std::fixed(), std::free(), fun_cd(), fun_dump(), fun_egg(), fun_help(), fun_ls(), fun_open(), fun_print(), std::vector< T >::insert(), std::string::insert(), int_handler(), lcReader, leave(), pageOutput, pager, std::vector< T >::pop_back(), print_prompt(), printTop(), std::vector< T >::push_back(), std::string::push_back(), std::vector< T >::reserve(), pagerInfo::save, std::setprecision(), std::signal(), std::vector< T >::size(), std::strcmp(), and term_handler().
| void normalPrintCol | ( | LCCollection * | col | ) |
Definition at line 217 of file lsh.cc.
Referenced by fun_print().
| const char* print_prompt | ( | ) |
PROMPT.
Definition at line 87 of file lsh.cc.
References std::string::c_str(), std::string::clear(), position, and prompt.
Referenced by main().
| void printTop | ( | ) |
Definition at line 313 of file lsh.cc.
References std::endl(), mapRuns, numEvents, and withEvents.
| void simplePrintCol | ( | LCCollection * | col | ) |
END PAGER HANDLING.
PRINT FUNCITONS
Definition at line 190 of file lsh.cc.
References std::endl(), and std::setw().
Referenced by fun_print().
| void term_handler | ( | int | sig | ) |
| const int COL = 3 |
Definition at line 63 of file lsh.cc.
Referenced by fun_dump(), and fun_ls().
| string egg = "egg" |
Definition at line 74 of file lsh.cc.
Referenced by fun_open(), and main().
| LCEvent* event |
Definition at line 80 of file lsh.cc.
Referenced by fun_cd(), fun_dump(), fun_open(), fun_print(), lcdumpevent(), lcdumpeventdetailed(), lcevtaddcollection(), lcevtcreate(), lcevtdelete(), lcevtgetcollection(), lcevtgetcollectionnames(), lcevtgetdetectorname(), lcevtgeteventnumber(), lcevtgetrunnumber(), lcevtgettimestamp(), lcevtremovecollection(), lcevtsetdetectorname(), lcevtseteventnumber(), lcevtsetrunnumber(), lcevtsettimestamp(), lcgeteventheader(), lcio2hepevt(), lcseteventheader(), lcwrtwriteevent(), lsCollections(), lsEvents(), main(), MT::LCReader::readEvent(), MT::LCReader::readNextEvent(), MT::LCReader::readStream(), SIO::LCIORandomAccessMgr::recreateEventMap(), and Scheduler::startTask().
| const int EVT = 2 |
Definition at line 62 of file lsh.cc.
Referenced by fun_cd(), fun_dump(), fun_ls(), fun_print(), and lsCollections().
| LCCollection* gCol |
Definition at line 81 of file lsh.cc.
Referenced by fun_print(), and lsCollections().
| bool interrupt = false |
Definition at line 70 of file lsh.cc.
Referenced by fun_dump(), fun_open(), int_handler(), and lsEvents().
| LCReader* lcReader |
Definition at line 78 of file lsh.cc.
Referenced by fun_cd(), fun_dump(), fun_open(), fun_print(), lcrdrclose(), lcrdrcreate(), lcrdrdelete(), lcrdreventprocessor(), lcrdropen(), lcrdropenchain(), lcrdrreadstream(), lcreadnextrunheader(), leave(), lsCollections(), lsEvents(), and main().
| map<int, int> mapEventsInRun |
Definition at line 67 of file lsh.cc.
Referenced by fun_open(), and lsRuns().
Definition at line 66 of file lsh.cc.
Referenced by fun_open(), lsRuns(), and printTop().
| int numEvents = 0 |
Definition at line 68 of file lsh.cc.
Referenced by fun_open(), and printTop().
| string pager = "less" |
Definition at line 73 of file lsh.cc.
Referenced by end_paging(), and main().
Definition at line 64 of file lsh.cc.
Referenced by fun_cd(), fun_dump(), fun_ls(), fun_open(), fun_print(), lsCollections(), lsEvents(), and print_prompt().
| string prompt = "" |
Definition at line 75 of file lsh.cc.
Referenced by print_prompt().
| const int RUN = 1 |
Definition at line 61 of file lsh.cc.
Referenced by fun_cd(), fun_dump(), fun_ls(), fun_print(), lsCollections(), and lsEvents().
| LCRunHeader* runHdr |
Definition at line 79 of file lsh.cc.
Referenced by fun_dump(), fun_open(), lcreadnextrunheader(), lcwriterunheader(), and main().
| const int TOP = 0 |
Definition at line 60 of file lsh.cc.
Referenced by fun_cd(), fun_dump(), fun_ls(), fun_open(), fun_print(), lsCollections(), and lsEvents().
| bool withEvents = true |
Definition at line 69 of file lsh.cc.
Referenced by fun_open(), lsRuns(), and printTop().
1.8.5