StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runMudst.C
1 
3 void runMudst(char* file="/star/u/akio/pwg/fms2015/mudst/st_fms_16077027_raw_4000001.MuDst.root",
4  int ifile=0, Int_t nevt=1000, char* outdir="hist", int merge=1, int readMuDst=0, int print=0){
5  gROOT->Macro("load.C"); // Load all required libraries
6  gSystem->Load("StEventMaker");
7 
8  StChain* chain = new StChain("StChain"); chain->SetDEBUG(0);
9  StMuDstMaker* muDstMaker = new StMuDstMaker(0, 0, "", file,".", 1000, "MuDst");
10  int n=muDstMaker->tree()->GetEntries();
11  printf("Found %d entries in Mudst\n",n);
12  int start=ifile*nevt;
13  int stop=(ifile+1)*nevt-1;
14  if(n<start) {printf(" No event left. Exiting\n"); return;}
15  if(n<stop) {printf(" Overwring end event# stop=%d\n",n); stop=n;}
16  printf("Doing Event=%d to %d\n",start,stop);
17 
18  StTriggerFilterMaker* filterMaker = new StTriggerFilterMaker;
19  filterMaker->printTriggerId();
20  const int TIDBASE=480800;
21  const int MAXVERSION=3;
22  const int NTRG=11; //123=FMS-sm-bs123,456=FMS-lg-bs123,7=FMS-DiBS,8910=FMS-JP012,11=FMS-DiJP,13=LED
23  for(int i=1; i<=NTRG; i++){
24  for(int j=0; j<MAXVERSION; j++){
25  int id=TIDBASE + 20*j + i;
26  printf("Adding TriggerId=%d to the filter %d %d\n",id,i,j);
27  filterMaker->addTrigger(id);
28  }
29  }
30  filterMaker->addVetoTrigger(480813); //Veto LED events
31  filterMaker->addVetoTrigger(480833);
32 
33  St_db_Maker* dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb");
34  dbMk->SetDEBUG(0); //dbMk->SetDateTime(20150301,0);
35 
36  StFmsDbMaker* fmsdb = new StFmsDbMaker("fmsDb");
37  fmsdb->setDebug(1);
38  //fmsdb->readGainFromText();
39  fmsdb->readRecParamFromFile();
40 
41  StEventMaker* eventMk = new StEventMaker();
42  StFmsHitMaker* fmshitMk = new StFmsHitMaker();
43  StFmsPointMaker* fmsptMk = new StFmsPointMaker("StFmsPointMaker");;
44  fmsptMk->setMergeSmallToLarge(merge);
45  if(readMuDst){
46  fmshitMk->SetReadMuDst();
47  fmsptMk->SetReadMuDst();
48  }
49  StFmsFpsMaker* fmsfps = new StFmsFpsMaker();
50  fmsfps->setReadMuDST();
51  fmsfps->setPrint(print);
52  TString filename(file);
53  filename.ReplaceAll("mudst",outdir);
54  filename.ReplaceAll(".MuDst.root",Form(".%d.fmsfps.root",ifile));
55  fmsfps->setQA(filename.Data());
56 
57  chain->Init();
58  chain->EventLoop(start,stop);
59  chain->Finish();
60  delete chain;
61 }
TTree * tree()
Returns pointer to the current TTree, the top level io structure that holds the event, track, v0, etc. information in branches of that tree.
Definition: StMuDstMaker.h:427
void setDebug(Int_t debug)
debug mode, 0 for minimal message, &gt;0 for more debug messages
virtual Int_t Finish()
Definition: StChain.cxx:85
void SetReadMuDst(int v=1)
void SetReadMuDst(int v=1)
Definition: StFmsHitMaker.h:47
StFmsHitMaker.
Definition: StFmsHitMaker.h:27