StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunFmsTrigOverData.C
1 //
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M
4 // 14 July 2012
5 //
6 // Macro to run FMS trigger simulator
7 //
8 
9 void RunFmsTrigOverData(int nevents = 1000, const char* mudstfile = "/star/data27/reco/pp500_production_2011/ReversedFullField/P11id/2011/056/12056013/st_physics_12056013_raw_5020002.MuDst.root")
10 {
11  // Load shared libraries
12  gROOT->Macro("loadMuDst.C");
13  gROOT->Macro("LoadLogger.C");
14  gSystem->Load("StDbBroker");
15  gSystem->Load("St_db_Maker");
16  gSystem->Load("StEEmcUtil");
17  gSystem->Load("StFmsTriggerMaker");
18 
19  // Create chain
20  StChain* chain = new StChain;
21 
22  // Instantiate MuDst maker
23  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,"",mudstfile,".",1000,"MuDst");
24 
25  // STAR database
26  St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb");
27 
28  // FMS trigger simulator
29  StFmsTriggerMaker* fmstrig = new StFmsTriggerMaker;
30  fmstrig->useMuDst();
31 
32  // Initialize chain
33  chain->Init();
34 
35  // Event loop
36  for (int iEvent = 1; iEvent <= nevents; ++iEvent) {
37  chain->Clear();
38  int status = chain->Make(iEvent);
39  if (status == kStSkip) continue;
40  if (status % 10 == kStEOF || status % 10 == kStFatal) break;
41 
42  // Test FMS dijet trigger
43  if (fmstrig->FmsDijet()) {
44  printf("Run=%d Event=%d - Got FMS dijet trigger\n",chain->GetRunNumber(),chain->GetEventNumber());
45  }
46  } // Event loop
47 }
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
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
Definition: StMaker.cxx:1054