StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runSimBfc.C
1 TString input_dir = "fzd/";
2 TString output_dir = "sim/";
3 TString input_chain = "sdt20141215,fzin,geant,evout,y2015,FieldOn,logger,MakeEvent,McEvout,IdTruth,ReverseField,db,fmsDB,fmsSim,FmsPoint,-tpcDB";
4 
6 
7 void runSimBfc( Int_t nEvents=100, Int_t run=100, const char* pid="gamma", int merge=1,
8  int print=0,
9  TString myDir=input_dir, TString myOutDir=output_dir,
10  TString myChain=input_chain, Int_t mnEvents=1){
11 
12  gROOT->LoadMacro("bfc.C");
13  gROOT->Macro("loadMuDst.C");
14  TString myDat=Form("test_%s_run%i.fzd",pid,run);
15  bfc( -1, myChain, myDir+myDat );
16 
17  TString outfile = myOutDir + myDat.ReplaceAll(".fzd",".root");
18  //TString outfile = myOutDir + chain->GetFileOut();
19  cout << "output file=" <<outfile<<endl;
20  chain->SetOutputFile(outfile);
21 
22  StFmsDbMaker* fmsdb = (StFmsDbMaker*) chain->GetMaker("fmsDb");
23  //fmsdb->readGainFromText();
24  //fmsdb->forceUniformGain(0.038);
25  //fmsdb->forceUniformGainCorrection(1.0);
26  fmsdb->setDebug(2);
27  fmsdb->readRecParamFromFile();
28 
29  StFmsFastSimulatorMaker *fmssim = (StFmsFastSimulatorMaker*) chain->GetMaker("fmsSim");
30  fmssim->SetDebug();
31  fmssim->setFpsNPhotonPerMIP(100.0);
32 
33  StFmsPointMaker* pointMaker = (StFmsPointMaker*) chain->GetMaker("StFmsPointMaker");
34  pointMaker->setMergeSmallToLarge(merge);
35 
36  gSystem->Load("StFmsFpsMaker");
37  StFmsFpsMaker* fmsfps = new StFmsFpsMaker();
38  fmsfps->setPrint(4);
39  outfile.ReplaceAll(".root",".fmsfps.root");
40  fmsfps->setQA(outfile.Data());
41 
42  if(print>=9){
43  gSystem->Load("StFmsEventDisplay");
44  StFmsEventDisplay* fmsed = new StFmsEventDisplay();
45  fmsed->setMaxEvents(100);
46  //outfile.ReplaceAll(".fmsfps.root",".eventDisplay.pdf");
47  outfile.ReplaceAll(".fmsfps.root",".eventDisplay.png");
48  fmsed->setFileName(outfile.Data());
49  if(print==10) fmsed->setFilter(1);
50  }
51 
52  chain->Init();
53  StMaker::lsMakers(chain);
54  chain->EventLoop(mnEvents,nEvents);
55  chain->Finish();
56 }
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