StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runqa.C
1 #include <TSystem.h>
2 
3 int runqa(Int_t run=16020057,Int_t ped=0,Int_t nevents=0,const Char_t *evpdir = "/evp/a/"){
4  int day=run/1000;
5  LoadLibs();
6  Int_t ierr = 0;
7 
8  cout << "Constructing the chain" << endl;
9  StChain* analysisChain = new StChain("fpsQAChain");
10 
11  TString dir0 = "MySQL:StarDb";
12  TString dir1 = "$STAR/StarDb";
13  St_db_Maker *dbMkr = new St_db_Maker( "dbMkr", dir0, dir1 );
14 
15  cout << "Constructing StFmsDbMaker" << endl;
16  fgtDbMkr = new StFmsDbMaker();
17 
18 
19  cout << "Constructing the FPS raw daq reader" << endl;
20  char filename[200];
21  sprintf(filename,"%s/%d",evpdir,run);
22  //sprintf(filename,"%s/%d_DELETE",evpdir,run);
23  daqRdr = new StFpsRawDaqReader( "daqReader", filename);
24  //daqRdr->SetDebug();
25 
26  cout << "Constructing the FPS QA maker" << endl;
27  StFpsQaMaker *qaMkr=new StFpsQaMaker("FpsQa");
28  qaMkr->setRun(run);
29  qaMkr->setPed(ped);
30 
31  cout << "Initializing" << endl;
32  ierr = analysisChain->Init();
33 
34  if( ierr ){
35  cout << "Error initializing" << endl;
36  return;
37  };
38 
39  if(nevents<=0) nevents = 1<<30; // a big number
40 
41  cout << "Max nevents = " << nevents << endl;
42  for( int i=0; i<nevents && !ierr; ++i ){
43  if( i%100 == 0 ) cout << " Eevent= " << i << endl;
44  //cout << " Eevent number " << i << endl;
45  ierr = analysisChain->Make();
46  analysisChain->Clear();
47  };
48  cout << "Finish" << endl;
49  analysisChain->Finish();
50  return 0;
51 };
52 
53 // load the shared libraries
54 void LoadLibs() {
55  gROOT->Macro("loadMuDst.C");
56  gSystem->Load("libPhysics");
57  gSystem->Load("St_base");
58  gSystem->Load("StChain");
59  gSystem->Load("StUtilities");
60  gSystem->Load("StEvent");
61  gSystem->Load("libStDb_Tables.so");
62  gSystem->Load("StDbLib.so");
63  gSystem->Load("St_db_Maker");
64  gSystem->Load("StDbBroker");
65  gSystem->Load("RTS");
66  gSystem->Load("StFmsDbMaker");
67  gSystem->Load("StFpsRawDaqReader");
68  gSystem->Load("StFpsQaMaker");
69 };
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Finish()
Definition: StChain.cxx:85
virtual Int_t Make()
Definition: StChain.cxx:110