StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MuDstChain.C
1 
2 // NOTE - chain needs to be declared global so for StHbtEventReader
3 //=========================================================================================
4 class StChain;
5 class StMuDstMaker;
6 
8 
9 
10 void MuDstChain(const char *dir ="/star/data35/reco/productionPP/ReversedFullField/DEV/2004/117/",
11  const char *file = "st_physics_5117072_raw_2010005.MuDst.root",
12  //const char *dir = "/star/data29/reco/pp200/pythia6_203/default/pt15/year2003/gheisha_on/trs_if/",
13  //const char *file = "rcf1205_2012_1000evts.MuDst.root",
14  const char *filter = "",
15  const char *Eout="test")
16 {
17  int nevents =5;
18  int total=0;
19 
20  if (gClassTable->GetID("TTable") < 0) {
21  gSystem->Load("libStar");
22  gSystem->Load("libPhysics");
23  }
24  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
25  loadSharedLibraries();
26  assert(gSystem->Load("StRFEmcTrigMaker")==0);
27 
28  chain= new StChain("StChain");
29  chain->SetDebug(1);
31  StMuDstMaker *muDstMaker = new StMuDstMaker(0,0,dir,file,filter,10,"MuDst");
32 
33  StRFEmcTrigMaker *trig = new StRFEmcTrigMaker("RFTrig");
34  trig->setDataMode(0);//0 for MuDst and 1 for StEvent
35 
36  Int_t EHT;
37  Int_t EJP;
38  Int_t ETOT;
39  Int_t BHT;
40  Int_t BJP;
41  Int_t BTOT;
42  Int_t BBCtrig;
43  int EHTtrig;
44  int thres=5;
45  //chain->PrintInfo();
46  chain->Init();
47  for (Int_t iev=0;iev<nevents; iev++) {
48  cout << "****************************************** " << endl;
49  cout << "Working on eventNumber " << iev << endl;
50  cout << "*************************1***************** " << endl;
51  chain->Clear();
52  int iret = chain->Make(iev);
53  total++;
54  EHT= trig->getEEMC_HT_ADC();
55  EJP= trig->getEEMC_JP_ADC();
56  ETOT= trig->getEEMC_TOT_ADC();
57  BHT= trig->getBEMC_HT_ADC();
58  BJP= trig->getBEMC_JP_ADC();
59  BTOT= trig->getBEMC_TOT_ADC();
60  cout <<"In the script now!"<<endl;
61  printf("ETOT=%d,EHT =%d,EJP=%d\n",ETOT,EHT,EJP);
62  printf("BTOT=%d,BHT=%d,BJP=%d\n",BTOT,BHT,BJP);
63 
64  BBCtrig= trig->getBBCtrig();
65  EHTtrig= trig->getEEMCtrigHT(thres);
66  cout <<"Thres = "<< thres << " EHTtrig = " << EHTtrig<<endl;
67  cout << "BBCtrig = " << BBCtrig<<endl;
68 
69  if (iret) {
70  cout << "Bad return code!" << endl;
71  break;
72  }
73  }
74  chain->Finish();
75  cout << "****************************************** " << endl;
76  cout << "total number of events " << total << endl;
77  cout << "****************************************** " << endl;
78 }
79 
80 
81 
82 
83 
84 
85 
StMuDstMaker(const char *name="MuDst")
Default constructor.
static void setLevel(unsigned int level)
sets the debug level
Definition: StMuDebug.h:74
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
Definition: StMuDstMaker.h:426