27 s <<
"Usage: " <<
argv[0] <<
" [OPTIONS] [-r] <input1.root input2.root ...>\n\n";
28 s <<
"Configuration: \n";
30 s <<
" -r, --release \t show the release data\n";
31 s <<
" -ro, --releaseonly \t show the release data and then quit\n";
32 s <<
" -h, --help \t this help\n";
45 bool show_release =
false;
46 bool quit_after_release =
false;
48 std::vector<std::string>
files;
56 for (
int i=1 ;
i<
argc ;
i++ ) {
57 std::string argi = std::string(
argv[
i]);
58 if ( argi ==
"-r" || argi ==
"--release" ) show_release =
true;
59 if ( argi ==
"-ro" || argi ==
"--releaseonly" ) show_release = quit_after_release =
true;
60 else if ( argi ==
"-h" || argi ==
"--help" )
return usage( std::cout,
argc,
argv );
61 else files.push_back( argi );
66 for (
unsigned i=0 ;
i<
files.size() ;
i++ ) {
68 TFile* finput = TFile::Open(
files[
i].c_str() );
70 if ( finput==0 || !finput->IsOpen() || finput->IsZombie() ) {
71 std::cerr <<
"Error: could not open output file" << std::endl;
75 if ( show_release || quit_after_release ) {
76 TTree* dataTree = (TTree*)finput->Get(
"dataTree");
77 TString* releaseData =
new TString(
"");
80 dataTree->SetBranchAddress(
"ReleaseMetaData", &releaseData);
82 for (
unsigned int i=0;
i<dataTree->GetEntries() ;
i++ ) {
83 dataTree->GetEntry(
i);
84 std::cout <<
"releaseData: " << *releaseData << std::endl;
88 std::cerr <<
"no release data" << std::endl;
90 if ( quit_after_release )
return 0;
96 TTree*
data = (TTree*)finput->Get(
"tree");
99 data->SetBranchAddress(
"TIDA::Event",&track_ev);
102 for (
unsigned int i=0;
i<
data->GetEntries() ;
i++ ) {
104 std::cout << *track_ev << std::endl;