LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions | Variables
lsh.cc File Reference
#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, stringlevel
 

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< levelposition
 
map< int, stringmapRuns
 
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
 

Typedef Documentation

typedef pair<int, string> level

Definition at line 50 of file lsh.cc.

Function Documentation

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().

bool end_paging ( pagerInfo file)
void fun_cd ( string  str)
void fun_dump ( string  arg)

Definition at line 504 of file lsh.cc.

References COL, dumpEvent(), event, EVT, fun_print(), interrupt, lcReader, position, RUN, runHdr, and TOP.

Referenced by main().

void fun_egg ( )

Definition at line 541 of file lsh.cc.

References std::endl().

Referenced by main().

void fun_help ( )

Definition at line 604 of file lsh.cc.

References std::endl().

Referenced by main().

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)
void fun_print ( string  colNr,
string  flag 
)

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 ( )
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 
)
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.

Referenced by fun_ls(), and main().

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)

Definition at line 134 of file lsh.cc.

References std::endl(), and leave().

Referenced by main().

Variable Documentation

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
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
map<int, int> mapEventsInRun

Definition at line 67 of file lsh.cc.

Referenced by fun_open(), and lsRuns().

map<int, string> mapRuns

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().

bool pageOutput = false

Definition at line 71 of file lsh.cc.

Referenced by main().

string pager = "less"

Definition at line 73 of file lsh.cc.

Referenced by end_paging(), and main().

vector<level> position

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().