StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunTriggerSimu.C
1 void RunTriggerSimu(int nevents = 1000000,
2 //const char* indir = "root://xrdstar.rcf.bnl.gov:1095//home/starreco/reco/pp200_production_2012/ReversedFullField/P12id/2012/049/13049101/st_physics_13049101_raw_2020005.MuDst.root",
3 const char* indir = "root://xrdstar.rcf.bnl.gov:1095//home/starreco/reco/pp500_production_2012/ReversedFullField/P13ib/2012/078/13078014/st_physics_13078014_raw_1020001.MuDst.root"
4  )
5 {
6 // cout<<"MuDst file is "<<MuDst<<endl;
7 
8  gROOT->Macro("loadMuDst.C");
9  gROOT->Macro("LoadLogger.C");
10 
11  gSystem->Load("StDetectorDbMaker");
12  gSystem->Load("StDaqLib");
13  gSystem->Load("StEmcRawMaker");
14  gSystem->Load("StEmcADCtoEMaker");
15  gSystem->Load("StDbBroker");
16  gSystem->Load("St_db_Maker");
17  gSystem->Load("StEEmcUtil");
18  gSystem->Load("StEEmcDbMaker");
19  gSystem->Load("StEmcTriggerMaker");
20  gSystem->Load("StTriggerUtilities");
21  gSystem->Load("StTriggerFilterMaker");
22 
23  StChain *chain = new StChain;
24 
25  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,indir, "","",1000);
26 
27  StMuDbReader* muDstDb = StMuDbReader::instance();
28 
29  St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb");
30 
31  StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
32 
33  // StSpinDbMaker* spinDb = new StSpinDbMaker;
34 
36  adc->saveAllStEvent(true);
37 
38  StTriggerSimuMaker* simuTrig = new StTriggerSimuMaker;
39  //use online or offline option
40  //simuTrig->useOnlineDB();
41  simuTrig->useOfflineDB();
42  simuTrig->setMC(false);
43 
44  //bbc is not used in run12 analysis
45  // simuTrig->useBbc();
46  simuTrig->useBemc();
47  simuTrig->useEemc();
48  //use online or offline bemc tower pedestals and statuses
49  //simuTrig->bemc->setConfig(StBemcTriggerSimu::kOffline);
50  simuTrig->bemc->setConfig(StBemcTriggerSimu::kOnline);
51  //define triggers with trigger index, trigger name, offline Id, onbits, offbits, onbits1, onbits2, onbits3, offbits1, offbits2, offbits3
52  //this method need to be called only when the trigger definitions in online and offline are not correct
53  //simuTrig->emc->defineTrigger(8, "JP0", 380401, 0x0, 0x0, 0x80000000, 0x0, 0x0, 0x0, 0x0, 0x1);
54  //set jet patch thresholds only used when the jet patch thresholds in online and offline database not correct
55  //jp-th0 set to 28
56  //simuTrig->setBarrelJetPatchTh(0,28);
57  //simuTrig->setOverlapJetPatchTh(0,28);
58  //simuTrig->setEndcapJetPatchTh(0,28);
59  //set high tower thresholds only used when the jet patch thresholds in online and offline database not correct
60  //simuTrig->setBarrelHighTowerTh(0, 11);
61  //simuTrig->setEndcapHighTowerTh(0, 25);
62  // Run
63  chain->Init();
64  for(int iEvent = 0; iEvent < nevents; iEvent++)
65  {
66  chain->Clear();
67  int status = chain->Make(iEvent);
68  if(status == kStSkip) continue;
69  if(status % 10 == kStEOF || status % 10 == kStFatal) break;
70  std::cout<<"trigger simulator: JP0 fired = "<< simuTrig->isTrigger(380401) <<endl;
71  }
72  //chain->EventLoop(nevents);
73 }
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
Definition: Stypes.h:49
Definition: Stypes.h:43
virtual Int_t Make()
Definition: StChain.cxx:110
void saveAllStEvent(Bool_t a)
Set to kTRUE if all hits are to be saved on StEvent.