00001
00003
00004
00005
00006
00008
00009 class StChain;
00010 StChain *chain=0;
00011
00012 void doBemcMuDst(bool StEv = true, char* list = "test.list", int nFiles = 5, int nevents = 2000000)
00013 {
00014 Bool_t debug = kFALSE;
00015 Bool_t fillExtraHisto = kFALSE;
00016 Bool_t saveAllStEvent = kFALSE;
00017
00018 cout <<"list = "<<list<<endl;
00019 cout <<"nFiles = "<<nFiles<<endl;
00020 cout <<"nevents = "<<nevents<<endl;
00021
00022 gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
00023 loadSharedLibraries();
00024 gSystem->Load("StTpcDb");
00025 gSystem->Load("StDbUtilities");
00026 gSystem->Load("StDbLib");
00027 gSystem->Load("StDbBroker");
00028 gSystem->Load("St_db_Maker");
00029 gSystem->Load("libgeometry_Tables");
00030 gSystem->Load("StDaqLib");
00031 gSystem->Load("StEmcRawMaker");
00032 gSystem->Load("StEmcADCtoEMaker");
00033 gSystem->Load("StPreEclMaker");
00034 gSystem->Load("StEpcMaker");
00035
00036
00037
00039
00041 chain = new StChain("StChain");
00042 if(debug) chain->SetDebug();
00043
00045
00047 StMuDstMaker* muDst = new StMuDstMaker(0,0,"",list,"",nFiles);
00048 StMuDbReader* muDB = StMuDbReader::instance();
00049 if(StEv) StMuDst2StEventMaker *muDst2StEvent = new StMuDst2StEventMaker();
00050
00052
00053 St_db_Maker *db = new St_db_Maker("StarDb","MySQL:StarDb");
00054
00055
00056
00057
00058
00059
00060
00062
00064
00065
00066 StEmcADCtoEMaker *adc=new StEmcADCtoEMaker();
00067 adc->saveAllStEvent(saveAllStEvent);
00068 adc->setPrint(debug);
00069 controlADCtoE_st* c = adc->getControlTable();
00070
00072
00073
00074
00075
00076
00077
00078
00079
00080
00082
00083
00084 StPreEclMaker *ecl=new StPreEclMaker();
00085 ecl->setFillHisto(fillExtraHisto);
00086 ecl->setPrint(debug);
00087
00088
00089 StEpcMaker *epc = new StEpcMaker();
00090 epc->setFillHisto(fillExtraHisto);
00091 epc->setPrint(debug);
00092
00094
00096
00097 chain->Init();
00098
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00112 ecl->SetClusterConditions("bemc", 4, 0.7, 0.001, 0.1, kFALSE);
00113 ecl->SetClusterConditions("bprs", 1, 0.1, 0.001, 0.1, kFALSE);
00114 ecl->SetClusterConditions("bsmde", 5, 0.4, 0.001, 0.1, kFALSE);
00115 ecl->SetClusterConditions("bsmdp", 5, 0.4, 0.001, 0.1, kFALSE);
00116
00118
00120 int n=0;
00121 int stat=0;
00122 int count = 1000;
00123 if(debug) count =1;
00124 TMemStat memory;
00125
00126 while ( (stat==0 || stat==1 ) && n<nevents)
00127 {
00128 chain->Clear();
00129 stat = chain->Make();
00130 if(n%count==0)
00131 {
00132 cout << "Finished processing event number "<<n <<endl;
00133 memory.PrintMem(NULL);
00134 }
00135 n++;
00136 }
00137 cout << endl;
00138 chain->Finish();
00139 }
00140