FairRoot/PandaRoot
Functions
MvdOfflineTBAnalysis_Topix4/MQ/runFileSampler.cxx File Reference
#include <PndMvdMQFileSampler.h>
#include <csignal>
#include "FairMQLogger.h"
#include "runSimpleMQStateMachine.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 std More...
 

Function Documentation

int main ( int  argc,
char **  argv 
)

std

FairRoot - FairMQ - base/MQ

Definition at line 15 of file MvdOfflineTBAnalysis_Topix4/MQ/runFileSampler.cxx.

References PndMvdMQFileSampler::AddInputBranchName(), PndMvdMQFileSampler::AddInputFileName(), filename, and PndMvdMQFileSampler::SetMaxIndex().

16 {
17  try
18  {
19  std::vector<std::string> filename;
20  std::string branchname;
21  int64_t maxindex;
22 
23  namespace po = boost::program_options;
24  po::options_description sampler_options("Sampler options");
25  sampler_options.add_options()
26  ("file-name", po::value<std::vector<std::string>>(&filename) , "Path to the input file")
27  ("max-index", po::value<int64_t> (&maxindex) ->default_value(-1), "number of events to read")
28  ("branch-name", po::value<std::string> (&branchname) , "branch name");
29 
30 
31  FairMQProgOptions config;
32  config.AddToCmdLineOptions(sampler_options);
33 
34  config.ParseAll(argc, argv);
35 
36  PndMvdMQFileSampler sampler;
37 
38  for ( unsigned int ielem = 0 ; ielem < filename.size() ; ielem++ ) {
39  sampler.AddInputFileName(filename.at(ielem));
40  }
41 
42  sampler.SetMaxIndex(maxindex);
43 
44  sampler.AddInputBranchName(branchname);
45 
46  sampler.AddInputBranchName("EventHeader.");
47 
48  runStateMachine(sampler, config);
49 
50 
51  }
52  catch (std::exception& e)
53  {
54  LOG(ERROR) << "Unhandled Exception reached the top of main: "
55  << e.what() << ", application will now exit";
56  return 1;
57  }
58 
59  return 0;
60 }
void AddInputFileName(std::string tempString)
const string filename