7 char* file=
"R5135068ezB.lis",
8 char* inDir =
"../oldPanitkin/muDst/",
9 TString outPath=
"feePed4/"
12 file=
"st_physics_6008016_raw_1020001.MuDst.root";
15 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
16 loadSharedLibraries();
17 cout <<
" loading done " << endl;
18 assert( !gSystem->Load(
"StEEmcPoolmuEztFeePed"));
24 printf(
"adding muDst from '%s' ....\n",file);
26 muMk =
new StMuDstMaker(0,0,inDir,file,
"MuDst.root",nFiles);
27 TChain* tree=muMk->
chain(); assert(tree);
28 int nEntries=tree->GetEntries();
29 printf(
"total eve in chain =%d\n",nEntries);
30 printf(
"in=%s%s=\n",inDir,file);
36 myMk3->SetHList(HList);
38 gMessMgr->SwitchOff(
"D");
39 gMessMgr->SwitchOn(
"I");
48 printf(
"All Ezt-branches set\n");
57 if(eventCounter>=nEve)
break;
62 if(eventCounter%1000!=0)
continue;
64 printf(
"\n\n ====================%d processing ==============\n", eventCounter);
67 printf(
"sorting done, nEve=%d of %d\n",nEve, nEntries);
70 float rate=1.*eventCounter/(t2-t1);
71 float nMnts=(t2-t1)/60.;
72 printf(
"sorting done %d of nEve=%d, elapsed rate=%.1f Hz, tot %.1f minutes\n",eventCounter,nEntries,rate,nMnts);
75 cout <<
"CPU time/event= " << timer.elapsedTime()/eventCounter <<
" sec "
76 <<
" rate= " << eventCounter/timer.elapsedTime() <<
" Hz" << endl;
81 printf(
"name Nentries chi2 gaus_ampl gaus_mean gaus_sig err_ampl err_mean err_sig \n");
83 TIterator* iter = HList->MakeIterator();
90 TString fName=outPath+
"eemcPed4.dat";
91 FILE *fo2=fopen(fName.Data(),
"w");
93 while((h=(TH1F*)iter->Next())) {
94 char *txt=h->GetName();
99 if(oName[0]) fclose(fo);
100 sprintf(oName,
"%scrate%dboard%d.ped4",outPath.Data(),cr, 1+chan/32);
101 FILE *fo=fopen(oName,
"w");
103 printf(
"\n\nDid you created dir=%s ??? ,JB\n\n",outPath.Data());
104 printf(
"ABORT macro\n");
107 printf(
" write to '%s'\n",oName);
112 if(cr==4 && chan==127) ret=myMk3->fitPed(h,20);
113 else ret=myMk3->fitPed(h);
116 printf(
"%s empty\n",h->GetName());
117 fprintf(fo2,
" %d %3d 5000 %d\n",cr,chan,ped4);
118 fprintf(fo,
" %d\n",ped4);
121 TF1* fit= h->GetFunction(
"pedFun");
127 float ped=fit->GetParameter(1);
129 if(ped>24) ped4=(22-ped)/4;
130 fprintf(fo2,
"%d %d %.1f %d\n",cr,chan,ped,ped4);
131 fprintf(fo,
"%d\n",ped4);
133 printf(
"%s %8.0f %8.3f %9.3f %8.2f %7.2f %6.2f %7.2f %6.2f\n",
137 fit->GetParameter(0),
138 fit->GetParameter(1),
139 fit->GetParameter(2),
142 fit->GetParError(2));
146 myMk3->saveHisto(outPath+
"feePed");
149 printf(
"Fit found %d pedestals\n",nPed);
152 h=(TH1F*)HList->FindObject(
"cr5_ch094");
153 h->Draw(); gPad->SetLogy();
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
void SetStatus(const char *arrType, int status)