StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TestJpsiTopo.C
1 //
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M University
4 // 23 June 2010
5 //
6 
7 void TestJpsiTopo(int nevents = 1e6, const char* mudstfile = "/star/data28/reco/ppProductionJPsi/FullField/P06id/2006/139/7139023/st_jpsi_7139023_raw_1130010.MuDst.root")
8 {
9  gROOT->Macro("loadMuDst.C");
10  gROOT->Macro("LoadLogger.C");
11 
12  // Load shared libraries
13  gSystem->Load("StTpcDb");
14  gSystem->Load("StDetectorDbMaker");
15  gSystem->Load("StDbUtilities");
16  gSystem->Load("StMcEvent");
17  gSystem->Load("StMcEventMaker");
18  gSystem->Load("StDaqLib");
19  gSystem->Load("StEmcRawMaker");
20  gSystem->Load("StEmcADCtoEMaker");
21  gSystem->Load("StEpcMaker");
22  gSystem->Load("StEmcSimulatorMaker");
23  gSystem->Load("StDbBroker");
24  gSystem->Load("St_db_Maker");
25  gSystem->Load("StEEmcUtil");
26  gSystem->Load("StEEmcDbMaker");
27  gSystem->Load("StTriggerUtilities");
28 
29  // Create chain
30  StChain* chain = new StChain;
31 
32  // MuDst reader
33  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,"",mudstfile,"",100000,"MuDst");
34 
35  // StMuDbReader...
36  StMuDbReader* db = StMuDbReader::instance();
37 
38  // star database
39  St_db_Maker* starDb = new St_db_Maker("StarDb","MySQL:StarDb");
40 
41  // Endcap database
42  StEEmcDbMaker* eemcDb = new StEEmcDbMaker;
43 
44  // Barrel ADC to energy maker
46 
47  // Trigger simulator
48  StTriggerSimuMaker* trigSimu = new StTriggerSimuMaker;
49  trigSimu->setMC(false);
50  trigSimu->useBemc();
51  trigSimu->bemc->setConfig(StBemcTriggerSimu::kOffline);
52 
53  // Initialize chain
54  chain->Init();
55 
56  // Event loop
57  for (int iEvent = 1; iEvent <= nevents; ++iEvent) {
58  chain->Clear();
59  int status = chain->Make(iEvent);
60  if (status == kStSkip) continue;
61  if (status % 10 == kStEOF || status % 10 == kStFatal) break;
62 
63  cout << "Run = " << chain->GetRunNumber() << ", Event = " << chain->GetEventNumber() << endl;
64 
65  // Test J/psi topology trigger in Run 6
66  if (trigSimu->isTrigger(117705) || trigSimu->isTrigger(137705)) {
67  // Print number of J/psi candidate BEMC tower pairs that could have fired the J/psi trigger
68  cout << "Number of J/psi candidates = " << trigSimu->bemc->numberOfJpsiCandidates() << endl;
69  // Loop over J/psi candidates
70  for (int i = 0; i < trigSimu->bemc->numberOfJpsiCandidates(); ++i) {
71  cout << "J/psi candidate #" << i
72  << ": towerId1 = " << trigSimu->bemc->jpsiCandidateFirstTowerId(i)
73  << ", towerId2 = " << trigSimu->bemc->jpsiCandidateSecondTowerId(i)
74  << endl;
75  } // End loop over J/psi candidates
76  }
77 
78  } // End event loop
79 }
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