StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
doMuDST2MyEvent.C
1 
2 #include "TString.h"
3 void doMuDST2MyEvent(unsigned long nEvents, char *infile,char *jobid,char *flag,char *coll)
4 {
5  Bool_t debug=kFALSE;//macro debug
6  Bool_t debugg=kFALSE;
7 
8  gSystem->Load("StarRoot");
9  gSystem->Load("libTable");
10  gSystem->Load("libPhysics");
11  gSystem->Load("St_base");
12 
13  gSystem->Load("liblog4cxx.so");
14  gSystem->Load("StStarLogger.so");
15  StLoggerManager::StarLoggerInit();
16 
17  gSystem->Load("StChain");
18  gSystem->Load("St_Tables");
19  gSystem->Load("StarMagField");
20  gSystem->Load("StMagF");
21  gSystem->Load("StUtilities");
22  gSystem->Load("StTreeMaker");
23  gSystem->Load("StIOMaker");
24  gSystem->Load("StarClassLibrary");
25  gSystem->Load("StTriggerDataMaker");
26  gSystem->Load("StTpcDb");
27  gSystem->Load("StDetectorDbMaker");
28  gSystem->Load("StDbUtilities");
29  gSystem->Load("StEvent");
30  gSystem->Load("StEventUtilities");
31  gSystem->Load("StMcEvent");
32  gSystem->Load("StMcEventMaker");
33  gSystem->Load("StAssociationMaker");
34  gSystem->Load("StStrangeMuDstMaker");
35  gSystem->Load("StEmcUtil");
36  gSystem->Load("StEEmcUtil");
37  gSystem->Load("StPmdUtil");
38  gSystem->Load("StMuDSTMaker");
39  gSystem->Load("StBichsel");
40 
41  // libraries for the DB
42  gSystem->Load("StDaqLib");
43  gSystem->Load("StDbLib");
44  gSystem->Load("StDbBroker");
45  gSystem->Load("St_db_Maker");
46  gSystem->Load("StDetectorDbMaker");
47 
48  //gSystem->Load("StEmcDecoder");
49  gSystem->Load("StEmcRawMaker");
50  gSystem->Load("StEmcADCtoEMaker");
51  gSystem->Load("StPreEclMaker");
52  gSystem->Load("StEpcMaker");
53 
54  gSystem->Load("/star/u/russcher/MyEvent/MyEvent.so");
55  gSystem->Load("StMyEventMaker");
56 
57  cout << "Finished loading libraries " << endl;
58 
59  StChain* chain = new StChain("bfc");
60 
61  StEmcADCtoEMaker* adcMaker=0;
62  StPreEclMaker* preEcl=0;
63  StEpcMaker *epc=0;
64  St_db_Maker* dbMk=0;
65  StDetectorDbMaker *detMk=0;
66 
67  TString output(jobid);
68  output.Append("_");
69  output.Append(coll);
70  output.Append("_");
71  output.Append(flag);
72  output.Append(".root");
73 
74  TString input(infile);
75 
76  StIOMaker* ioMaker=0;
77 
78  StMuDstMaker* mudstMaker = new StMuDstMaker(0,0,"",input.Data(),"",25);
79  dbMk = new St_db_Maker("db","MySQL:StarDb", "$STAR/StarDb");
80  detDbMk = new StDetectorDbMaker();
81 
82  adcMaker=new StEmcADCtoEMaker("adcm");
83  preEcl = new StPreEclMaker();
84  epc = new StEpcMaker();
85  adcMaker->setPrint(debug);
86  preEcl->setPrint(debug);
87  epc->setPrint(debug);
88 
89  StMyEventMaker* myMaker = new StMyEventMaker("myMaker",output.Data(),flag,coll,debugg);
90  myMaker->setDbMaker(dbMk);
91  myMaker->setAdcMaker(adcMaker);
92 
93  chain->Init();
94 
95  if(preEcl) {
96  cout<<endl<<"Using old clustering, setting parameters now!"<<endl;
97  preEcl->SetClusterConditions("bemc", 4, .35, .0350, 0.02, kFALSE);
98  preEcl->SetClusterConditions("bprs", 1, 500., 500., 501., kFALSE);
99  preEcl->SetClusterConditions("bsmde", 5, .20, .0005, 0.10, kFALSE);
100  preEcl->SetClusterConditions("bsmdp", 5, .20, .0005, 0.10, kFALSE);
101  //set for AuAu200 (ht trigs):
102  if(strcmp(coll,"auau200")==0){
103  preEcl->SetClusterConditions("bemc", 4, .35, .1, 0.02, kFALSE);
104  preEcl->SetClusterConditions("bprs", 1, 500., 500., 501., kFALSE);
105  preEcl->SetClusterConditions("bsmde", 5, .20, .0005, 0.10, kFALSE);
106  preEcl->SetClusterConditions("bsmdp", 5, .20, .0005, 0.10, kFALSE);
107  }
108  }
109 
110  for(unsigned long iev=0;iev<nEvents; iev++)
111  {
112  if(iev%100==0) cout<<"processing event: "<<iev<<endl;
113  chain->Clear();
114  Int_t iret = chain->Make(iev);
115  if(iev%500==0){
116  //gObjectTable.Print();
117  myMaker->saveHistograms();
118  }
119  if(iret==2) cout <<"### Last Event Processed. Status = "<<iret<< endl;
120  if(iret==3) cout <<"### Error Event Processed. Status = "<<iret<< endl;
121  if(iret==4) cout <<"### Fatal Event Processed. Status = "<<iret<< endl;
122  if(iret>1) break;
123  }
124  chain->Finish();
125 }
126 
127 
128 
129 
130 
131 
132 
133 
void setPrint(Bool_t)
Obsolete function; users can control messages with logger config file.
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
void setPrint(Bool_t a)
Obsolete function; users can control messages with logger config file.
Definition: StPreEclMaker.h:36
virtual Int_t Finish()
Definition: StChain.cxx:85
void SetClusterConditions(char *, Int_t, Float_t, Float_t, Float_t, Bool_t=kFALSE)
this is for background compatibility with the old finder
virtual Int_t Make()
Definition: StChain.cxx:110
void setPrint(Bool_t a)
Obsolete function; users can control messages with logger config file.
Definition: StEpcMaker.h:89