Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Fun4MainDaqE906.C
Go to the documentation of this file.
1 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
3 R__LOAD_LIBRARY(libinterface_main)
4 R__LOAD_LIBRARY(libonlmonserver)
5 R__LOAD_LIBRARY(libdecoder_maindaq)
6 #endif
7 
8 int Fun4MainDaqE906(const int run=28700, const int nevent=0)
9 {
10  gSystem->Load("libinterface_main.so");
11  gSystem->Load("libdecoder_maindaq.so");
12  gSystem->Load("libonlmonserver.so");
13 
14  const bool use_onlmon = true;
15  const char* dir_in = "/data3/data/mainDAQ";
16  const char* dir_out = ".";
17 
18  ostringstream oss;
19  oss << setfill('0') << dir_in << "/run_" << setw(6) << run << ".dat";
20  string fn_in = oss.str();
21  oss.str("");
22  oss << dir_out << "/run_" << setw(6) << run << ".root";
23  string fn_out = oss.str();
24 
26  //se->Verbosity(1);
27 
29  in->Verbosity(1);
30  in->SetOnline(false);
31  in->EventSamplingFactor(100);
32  //if (is_online) in->PretendSpillInterval(20);
33  //in->DirParam("/seaquest/production/runs");
34  in->fileopen(fn_in);
35  se->registerInputManager(in);
36 
37  Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT", fn_out);
38  se->registerOutputManager(out);
39 
40  se->registerSubsystem(new DbUpRun());
41  se->registerSubsystem(new DbUpSpill());
42  se->registerSubsystem(new CalibInTime());
43  se->registerSubsystem(new CalibXT());
44 
45  if (use_onlmon) { // Register the online-monitoring clients
46  se->StartServer();
68  }
69 
70  se->run(nevent);
71  se->End();
72 
73  delete se;
74  cout << "Fun4MainDaq Done!" << endl;
75  return 0;
76 }
int registerInputManager(Fun4AllInputManager *InManager)
void SetOnline(const bool is_online)
int Fun4MainDaqE906(const int run=28700, const int nevent=0)
Fun4MainDaq.C: Fun4all macro to decode the MainDAQ data.
Fun4AllServer * se
int run(const int nEvents=1)
Definition: run.C:10
int fileopen(const std::string &filenam)
OnlMonMainDaq.
Definition: OnlMonMainDaq.h:6
int registerSubsystem(SubsysReco *subsystem, const std::string &topnodename="TOP")
int run(const int nevnts=0, const bool require_nevents=false)
run n events (0 means up to end of file)
int registerOutputManager(Fun4AllOutputManager *manager)
Definition: CalibXT.h:7
Definition: DbUpRun.h:7
void StartServer()
Definition: OnlMonServer.cc:66
virtual void Verbosity(const int ival)
Sets the verbosity of this module (0 by default=quiet).
Definition: Fun4AllBase.h:58
static OnlMonServer * instance()
Definition: OnlMonServer.cc:34
void EventSamplingFactor(const int factor)