ATLAS Offline Software
Classes | Functions
BSFilePeeker.cxx File Reference
#include <iostream>
#include <string>
#include <unistd.h>
#include "EventStorage/pickDataReader.h"
#include "FileMetaData.h"
#include "CxxUtils/checker_macros.h"
Include dependency graph for BSFilePeeker.cxx:

Go to the source code of this file.

Classes

class  BSFilePeeker
 

Functions

int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv)
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

int main ATLAS_NOT_THREAD_SAFE ( int  argc,
char **  argv 
)

Definition at line 103 of file BSFilePeeker.cxx.

103  {
104 
105  bool verbose=false;
106  bool kvDump=false;
107  int c;
108 
109  while ((c = getopt (argc, argv, "vk")) != -1) {
110  switch (c) {
111  case 'v':
112  verbose=true;
113  break;
114  case 'k':
115  kvDump=true;
116  break;
117  default:
118  std::cerr << "Unkown command line option" << std::endl;
119  return -1;
120  }
121  }
122 
123 
124  const int nfiles=argc-optind;
125  if (nfiles<=0) {
126  std::cerr << "Expected at least one file name as parameter" << std::endl;
127  return -1;
128  }
129 
130 
131  std::vector<FileMetaData> output;
132 
133  for (int iFile=optind;iFile<argc;++iFile) {
134  const std::string filename(argv[iFile]);
135  if (verbose) std::cout << "Checking file " << filename << std::endl;
136 
137  BSFilePeeker bsfp(filename);
138 
139  output.push_back(bsfp.get());
140  }//end loop over input file names
141 
142 
143  if (kvDump) {
144  for (const auto& o : output) o.keyValueDump();
145  }
146  else {
147  for (const auto& o : output) o.dump();
148  }
149 
150  return 0;
151 }
BSFilePeeker
Definition: BSFilePeeker.cxx:13
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
merge.output
output
Definition: merge.py:17
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
python.compressB64.c
def c
Definition: compressB64.py:93