FairRoot/PandaRoot
Namespaces | Typedefs | Functions
MvdMQ/run/runFileSampler.cxx File Reference
#include <csignal>
#include "FairMQLogger.h"
#include "runSimpleMQStateMachine.h"
#include "PndMvdMQFileSampler.h"

Go to the source code of this file.

Namespaces

 std
 

Typedefs

using channelBranches = std::vector< std::pair< std::string, std::string > >
 std More...
 

Functions

static std::istreamstd::operator>> (std::istream &is, std::pair< std::string, std::string > &into)
 
int main (int argc, char **argv)
 

Typedef Documentation

using channelBranches = std::vector<std::pair<std::string, std::string> >

std

FairRoot - FairMQ - base/MQ

Definition at line 16 of file MvdMQ/run/runFileSampler.cxx.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 29 of file MvdMQ/run/runFileSampler.cxx.

References PndMvdMQFileSampler::AddInputChannelBranchName(), PndMvdMQFileSampler::AddInputFileName(), filename, i, and PndMvdMQFileSampler::SetMaxIndex().

30 {
31  try
32  {
33  std::vector<std::string> filename;
34  channelBranches branchnames;
35  int64_t maxindex;
36 
37 
38  po::options_description sampler_options("Sampler options");
39  sampler_options.add_options()
40  ("file-name", po::value<std::vector<std::string>>(&filename) , "Path to the input file")
41  ("max-index", po::value<int64_t> (&maxindex) ->default_value(-1), "number of events to read")
42  ("branch-name", po::value<channelBranches>(&branchnames) ->multitoken() , "branch name");
43 
44 
45  FairMQProgOptions config;
46  config.AddToCmdLineOptions(sampler_options);
47 
48  config.ParseAll(argc, argv);
49 
50  PndMvdMQFileSampler sampler;
51 
52  for ( unsigned int ielem = 0 ; ielem < filename.size() ; ielem++ ) {
53  sampler.AddInputFileName(filename.at(ielem));
54  }
55 
56  sampler.SetMaxIndex(maxindex);
57 
58  for(int i = 0; i < branchnames.size(); i++){
59  LOG(INFO) << "BranchNames: " << branchnames[i].first << "/" << branchnames[i].second;
60  sampler.AddInputChannelBranchName(branchnames[i]);
61  }
62 
63 // sampler.AddInputBranchName("EventHeader.");
64 
65  runStateMachine(sampler, config);
66 
67 
68  }
69  catch (std::exception& e)
70  {
71  LOG(ERROR) << "Unhandled Exception reached the top of main: "
72  << e.what() << ", application will now exit";
73  return 1;
74  }
75 
76  return 0;
77 }
void AddInputFileName(std::string tempString)
Int_t i
Definition: run_full.C:25
void AddInputChannelBranchName(std::pair< std::string, std::string > tempString)
std::vector< std::pair< std::string, std::string > > channelBranches
std
const string filename