StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runMudst.C
1 void loadLibraries(bool fmsLibs = true);
2 void runMudst(
3  const char* inFile = "inFiles_fms.list",
4  const char* outFile = "fmsCalib.root"
5  )
6 {
7  TStopwatch sw;
8  sw.Start();
9 
10  loadLibraries();
11  gSystem->Load("StFmsCalibMaker");
12 
13  gMessMgr->SetLimit("I", 0);
14  gMessMgr->SetLimit("Q", 0);
15  gMessMgr->SetLimit("W", 0);
16 
17  StChain* chain = new StChain("StChain");
18  chain->SetDEBUG(0);
19 
20  //-------------------------------------------
21 
22  //Arguments(default): mode, nameMode, directory (./), file, filter (.), max files (10), and name (MuDst)
23  StMuDstMaker* muDstMk = new StMuDstMaker(0, 0, "", inFile, ".MuDst.root", 1000, "MuDst");
24  cout <<Form("\nEntries in %s: %i", inFile, muDstMk->tree()->GetEntries()) <<endl;
25 
26  St_db_Maker* StarDb = new St_db_Maker("StarDb", "MySQL:StarDb", "$STAR/StarDb");
27  StarDb->SetAttr("blacklist", "emc");
28  StarDb->SetAttr("blacklist", "eemc");
29  StarDb->SetAttr("blacklist", "ftpc");
30  StarDb->SetAttr("blacklist", "ist");
31  StarDb->SetAttr("blacklist", "mtd");
32  StarDb->SetAttr("blacklist", "pmd");
33  StarDb->SetAttr("blacklist", "pp2pp");
34  StarDb->SetAttr("blacklist", "pxl");
35  StarDb->SetAttr("blacklist", "ssd");
36  StarDb->SetAttr("blacklist", "svt");
37  StarDb->SetAttr("blacklist", "tof");
38  StarDb->SetAttr("blacklist", "tpc");
39  StarDb->SetDebug();
40 
41  StFmsDbMaker* fmsDb = new StFmsDbMaker("fmsDb");
42  fmsDb->setDebug(0);
43  fmsDb->readGainCorrFromText(true); cout <<"WARNING! External gain correction factors are being used!\n" <<endl;
44 
45  StEventMaker* eventMk = new StEventMaker();
46  StFmsHitMaker* fmsHitMk = new StFmsHitMaker();
47  StFmsPointMaker* fmsPointMk = new StFmsPointMaker();
48  //fmsHitMk ->SetReadMuDst();
49  //fmsPointMk->SetReadMuDst();
50 
51  //-------------------------------------------
52 
53  StFmsCalibMaker* fmsCalib = new StFmsCalibMaker();
54  TString outName(outFile);
55  if (!strcmp(outFile, "")) { outName = inFile; outName.ReplaceAll("MuDst", "fmsCalib"); }
56  fmsCalib->SetOutName((const char*)outName);
57  fmsCalib->ReadCellStat("FmsCellStat.txt");
58  fmsCalib->ReadBbcSlewing("/star/u/ckimstar/work/fms_calib/Oleg_bbc_slewing_run15_pp200.dat"); //Apply zVtx
59  //fmsCalib->VpdTimingCut(1300); cout <<"WARNING! VPD west timing cut is being applied!\n" <<endl;
60  //fmsCalib->GetQaHistAdc(480202); //BHT1*VPDMB-30, RUN15pp200trans
61  //fmsCalib->GetQaHist();
62  //fmsCalib->GetQaTree();
63  //fmsCalib->GetMap();
64 
65  //-------------------------------------------
66 
67  chain->Init();
68  chain->EventLoop();
69  chain->Finish();
70  delete chain;
71 
72  sw.Stop();
73  sw.Print();
74  std::cout <<"Done!" <<endl;
75  return;
76 }//Main
77 
78 //==============================
79 void loadLibraries(bool fmsLibs)
80 {
81  //STAR libraries for chain, MuDST, logger etc
82  gROOT->Macro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
83  loadSharedLibraries();
84  gROOT->Macro("loadMuDst.C");
85  //gROOT->Macro("LoadLogger.C");
86 
87  gSystem->Load("StTpcDb");
88  gSystem->Load("St_db_Maker");
89  gSystem->Load("StDaqLib");
90  gSystem->Load("StDbBroker");
91  gSystem->Load("StDbUtilities");
92  gSystem->Load("StDetectorDbMaker");
93  gSystem->Load("StEEmcDbMaker");
94  gSystem->Load("StEEmcUtil");
95  gSystem->Load("StEmcRawMaker");
96  gSystem->Load("StEmcADCtoEMaker");
97  gSystem->Load("StEmcTriggerMaker");
98  gSystem->Load("StEpcMaker");
99  gSystem->Load("StEventMaker");
100  gSystem->Load("StMCAsymMaker");
101  gSystem->Load("StPreEclMaker");
102  gSystem->Load("StRandomSelector");
103  gSystem->Load("StSpinDbMaker");
104  gSystem->Load("StTriggerFilterMaker");
105  gSystem->Load("StTriggerUtilities");
106  if (fmsLibs)
107  {
108  gSystem->Load("libMinuit.so");
109  gSystem->Load("StFmsUtil");
110  gSystem->Load("StFmsDbMaker");
111  gSystem->Load("StFmsHitMaker");
112  gSystem->Load("StFmsPointMaker");
113  gSystem->Load("StFmsFpsMaker");
114  }
115 
116  return;
117 }//loadLibraries
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 readGainCorrFromText(int v=1)
force gain to be read from FmsGain.txt
Definition: StFmsDbMaker.h:226
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
StFmsHitMaker.
Definition: StFmsHitMaker.h:27