4 void rdMuFindBckg(
int nevents=200000,
char* outDir=
"./") {
12 #if 1 // barrelBckg run
13 muDstFile=
"/star/data05/scratch/qattan/myruns_R7138017/*.MuDst.root";
14 int RunNumber=7138017;
19 cout <<
"MuDst chain file:\t"<<muDstFile<<endl;
22 if (gClassTable->GetID(
"TTable") < 0) {
23 gSystem->Load(
"libStar");
24 gSystem->Load(
"libPhysics");
27 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
28 loadSharedLibraries();
31 "StEmcRawMaker",
"StEmcADCtoEMaker",
32 "StDbBroker",
"St_db_Maker",
"StDaqLib",
35 "libStEmcPoolBckgFinder"
39 for(i=0;i<
sizeof(libL)/
sizeof(
char*);i++) {
40 printf(
"'%s', ",libL[i]);
41 assert(!gSystem->Load(libL[i]));
43 printf(
" \ndone loading %d libraries\n",i);
50 printf(
"muDst: =%s=\n",muDstFile);
53 TChain* tree=muDstMaker->
chain(); assert(tree);
54 int nEntries=(int) tree->GetEntries();
55 printf(
"total eve in muDst chain =%d\n",nEntries);
57 if(nEntries<=0)
return;
71 myMk->SetHList(mHList);
79 myMk->SetTrigger(137222);
89 myMk->SetAdcThreshold(10);
92 myMk->SetAdcSumThreshold(150.);
95 myMk->SetPatternLength(5);
98 myMk->SetMaxYesPlots(0);
101 myMk->SetMaxNoPlots(0);
109 TTree *tr=jetReader->tree();
110 jetReader->InitFile(jetTreeFile);
119 int Decision,eta1,phi1,eta2,Length;
124 for (Int_t iev=0;iev<nevents; iev++) {
127 int iret = chain->
Make(iev);
129 printf(
"*******************************************************************************\n");
130 printf(
"Working on eventNumber = %d:\n",iev+1);
133 myMk->GetDecision(Decision,eta1,phi1,eta2,Length,Adcsum);
134 const int *idL=myMk->GetSoftIdList();
139 printf(
"EventDecision = YES --> THIS EVENT IS A BACKGROUND LOCATED AT: (eta1=%d phi1=%d eta2=%d), PATTERN LENGTH=%d, ADCSUM=%f\n",eta1,phi1,eta2,Length,Adcsum);
141 printf(
"List of towers SoftIds in the background pattern found:\t");
144 printf(
"%d, ", *idL);
148 printf(
"\n===============================================================================\n");
153 printf(
"===============================================================================\n");
154 printf(
"EventDecision = NO --> THIS EVENT IS NOT A BACKGROUND.\n");
155 printf(
"===============================================================================\n");
158 printf(
"===============================================================================\n");
159 printf(
"EventDecision = NOT SEARCHED ..... NOT OF TRIGGER TYPE.\n");
160 printf(
"===============================================================================\n");
166 cout <<
"Bad return code!" << endl;
174 printf(
"\n*******************************************************************************\n");
178 float tMnt=(t2-t1)/60.;
179 float rate=1.*eventCounter/(t2-t1);
180 printf(
"Sorting Done: %d of nEve=%d, CPU rate=%.1f Hz, total time %.1f minute(s) \n\n",eventCounter,nEntries,rate,tMnt);
183 TString outF=outDir; outF+=RunNumber; outF+=
".hist.root";
184 hf=
new TFile(outF,
"recreate");
187 printf(
"\n Histo saved -->%s<\n",outF.Data());
192 gSystem->Load(
"liblog4cxx.so");
193 gSystem->Load(
"StStarLogger.so");
194 StLoggerManager::StarLoggerInit();
virtual void Clear(Option_t *option="")
User defined functions.
virtual void ls(Option_t *option="") const
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
void SetStatus(const char *arrType, int status)