StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
testWff6MuDst.C
1 /*
2  Orig Author: Akio Ogawa
3  Edited: David Kapukchyan
4  @[May 18, 2022](David Kapukchyan)
5  > Copied from $STAR/StRoot/StFcsFastSimulatorMaker/macros/runMudst.C and modified so that I can test my own StFcsWaveformFitMaker.
6 
7  Macro to run micro dst from fast production of FCS data for Run 22 data.
8 */
9 
10 void testWff(int nevt = 1,
11  const char* outdir="test.root",
12  const char* file="st_fwd_23080044_raw_1000019.MuDst.root",
13  int readMuDst=1
14  )
15 {
16  gROOT->Macro("Load.C");
17  gROOT->Macro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
18  gSystem->Load("StEventMaker");
19  gSystem->Load("StFcsDbMaker");
20  gSystem->Load("StFcsRawHitMaker");
21  gSystem->Load("StFcsWaveformFitMaker");
22  gSystem->Load("libMinuit");
23 
24  //gMessMgr->SetLimit("I", 0);
25  //gMessMgr->SetLimit("Q", 0);
26  //gMessMgr->SetLimit("W", 0);
27 
28  gStyle->SetOptDate(0);
29  gStyle->SetOptFit(0);
30 
31  StChain* chain = new StChain("StChain"); chain->SetDEBUG(0);
32  StMuDstMaker* muDstMaker = new StMuDstMaker(0, 0, "", file,".", 1000, "MuDst");
33  int n=muDstMaker->tree()->GetEntries();
34  printf("Found %d entries in Mudst\n",n);
35 
36  St_db_Maker* dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb");
37  if(dbMk){
38  dbMk->SetAttr("blacklist", "tpc");
39  dbMk->SetAttr("blacklist", "svt");
40  dbMk->SetAttr("blacklist", "ssd");
41  dbMk->SetAttr("blacklist", "ist");
42  dbMk->SetAttr("blacklist", "pxl");
43  dbMk->SetAttr("blacklist", "pp2pp");
44  dbMk->SetAttr("blacklist", "ftpc");
45  dbMk->SetAttr("blacklist", "emc");
46  dbMk->SetAttr("blacklist", "eemc");
47  dbMk->SetAttr("blacklist", "mtd");
48  dbMk->SetAttr("blacklist", "pmd");
49  dbMk->SetAttr("blacklist", "tof");
50  dbMk->SetAttr("blacklist", "etof");
51  dbMk->SetAttr("blacklist", "rhicf");
52  }
53 
54  StFcsDbMaker *fcsDbMkr= new StFcsDbMaker();
55  StFcsDb* fcsDb = (StFcsDb*) chain->GetDataSet("fcsDb");
56  fcsDb->setReadGainCorrFromText();
57  StFcsDbPulse* fcsDbPulse = (StFcsDbPulse*) chain->GetDataSet("fcsPulse");
58  StEventMaker* eventMk = new StEventMaker();
60  //hit->setDebug();
61  hit->setReadMuDst(readMuDst);
63  wff->writeFile(outdir);
64  wff->setTest(6);//Sets energy select to proper value if not set already
65  wff->setEnergySumScale(1.0,1.0,1.0);
66  //wff->setMeasureTime("measure.png"); //Turn on if you want to measure the time for fitting
67  //wff->SetDebug(); //Turn on for debug output
68 
69  chain->Init();
70 
71  TStopwatch clock;
72  //Event loop
73  for( UInt_t i=0; i<nevt; ++i ){
74  chain->Make();
75  chain->Clear();
76  }
77  std::cout << "========================================" << std::endl;
78  std::cout << clock.RealTime() << " seconds" << std::endl;
79  std::cout << "========================================" << std::endl;
80 
81  chain->Finish();
82  delete chain;
83 }
84 
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
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
void writeFile(std::string filename)
Use to change the name of the file where test histograms will be saved.
void setReadMuDst(int v=1)
backward compatubility
void setTest(int v)
Set test level. Intended to be used for single files. Output file name can be changed with writeFile(...