Skip to content
Snippets Groups Projects
Commit 39c7b933 authored by Markus Frank's avatar Markus Frank
Browse files

Improve output

parent 1200d4fb
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@
#include <vector>
#include <cstdio>
#include <memory>
#include <cerrno>
#include "TFile.h"
#include "TTree.h"
......@@ -35,6 +36,15 @@ namespace {
static const char* line = "+-------------------------------------------------------------+";
static bool have_geometry = false;
int usage() {
printf("\ndumpDDG4 -opt [-opt] \n"
" -compact <compact-geometry> Supply geometry file to check hits with volume manager.\n"
" -input <root-file> File generated with DDG4 \n"
" -event <event-number> Specify event to be dumped. Default: ALL. \n"
"\n\n");
return EINVAL;
}
int printHits(const string& container, vector<Geant4Tracker::Hit*>* hits) {
typedef vector<Geant4Tracker::Hit*> _H;
if ( !hits ) {
......@@ -155,6 +165,7 @@ int dumpDDG4(const char* fname, int event_num) {
TFile* data = TFile::Open(fname);
if ( !data || data->IsZombie() ) {
printf("+ File seems to not exist. Exiting\n");
usage();
return -1;
}
TTree* tree = (TTree*)data->Get("EVENT");
......@@ -220,6 +231,9 @@ int main(int argc, char** argv) { // Main program if
event_num = ::atol(argv[++i]);
}
}
if ( !fname ) {
return usage();
}
return dumpDDG4(fname,event_num);
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment