23 int runEEmcSlowMaker(
int nEve=2000 ){
31 char* file=
"rcf1308_01_2000evts.MuDst.root";
33 char* file=
"rcf1308_01_2000evts.event.root";
35 char* inDir=
"/star/data47/reco/pp200/pythia6_410/11_15gev/cdf_a/y2006c/gheisha_on/p07ic/";
38 char *outname=
"mudst";
40 char *outname=
"stevent";
42 TString fullName=file;
44 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
45 loadSharedLibraries();
46 gROOT->Macro(
"LoadLogger.C");
47 cout <<
" loading done " << endl;
49 gSystem->Load(
"StDbBroker");
50 gSystem->Load(
"St_db_Maker");
51 gSystem->Load(
"StEEmcUtil");
52 gSystem->Load(
"StEEmcDbMaker");
53 gSystem->Load(
"StEEmcSimulatorMaker");
54 gSystem->Load(
"StEEmcA2EMaker");
59 printf(
"adding MuDst/StEvent from run '%s' ....\n",fullName.Data());
64 TChain* tree=muMk->chain(); assert(tree);
65 int nEntries=tree->GetEntries();
66 printf(
"total eve in chain =%d\n",nEntries);
69 ioMaker->SetFile(gSystem->ConcatFileName(inDir, file));
70 ioMaker->SetBranch(
"*", 0,
"0");
71 ioMaker->SetBranch(
"eventBranch", 0,
"r");
72 ioMaker->SetBranch(
"geantBranch", 0,
"r");
77 stDb->SetDateTime(20031120,0);
78 stDb->SetFlavor(
"sim",
"eemcPMTcal");
79 stDb->SetFlavor(
"sim",
"eemcPIXcal");
80 stDb->SetFlavor(
"sim",
"eemcPMTped");
81 stDb->SetFlavor(
"sim",
"eemcPMTstat");
82 stDb->SetFlavor(
"sim",
"eemcPMTname");
83 stDb->SetFlavor(
"sim",
"eemcADCconf");
92 mEEbefore->
source(
"MuDst",1);
94 mEEbefore->
source(
"StEvent",2);
122 slowSim->SetHList(HList);
129 mEEafter->
source(
"MuDst",1);
131 mEEafter->
source(
"StEvent",2);
137 TH2F *h_compare=
new TH2F(
"h_compare",
"ADC after slow maker vs before; uncorrected ADC; corrected ADC",512,0.,1024.,512,0.,1024. );
138 TH2F *h_compare_pre1=
new TH2F(
"h_compare_pre1",
"ADC after slow maker vs before",256,0.,1024.,256,0.,256. );
139 TH2F *h_compare_pre2=
new TH2F(
"h_compare_pre2",
"ADC after slow maker vs before",256,0.,1024.,256,0.,256. );
140 TH2F *h_testit=
new TH2F(
"h_testit",
"ADC after-before vs ADC pre1+pre2; pre1+pre2 AD; corrected-uncorrected",256,0.,512.,100,-50.,50.);
141 TH2F *h_perinc=
new TH2F(
"h_perinc",
"percent increase vs before; ADC [before simu]; % increase",128,0.,1024.,120,-10.,50.);
142 TH2F *h_perincE=
new TH2F(
"h_perincE",
"percent increase vs original E; Energy [before simu]; % increase",150,0.,30.,120,-10.,50.);
143 TH2F *h_perincEZ=
new TH2F(
"h_perincEZ",
"percent increase vs original E (zeros supressed); Energy [before simu]; % increase",150,0.,30.,120,-10.,50.);
163 if(eventCounter>=nEve)
break;
166 stat = chain->
Make();
167 if(eventCounter%100==0)
168 printf(
"\n====================%d processing ============\n", eventCounter);
176 h_compare->Fill( tbefore.
adc(), tafter.
adc());
178 h_testit->Fill( pbefore.
adc()+pbefore.
adc(), tafter.
adc()-tbefore.
adc() );
180 h_perinc->Fill( tbefore.
adc(), 100.0* (tafter.
adc()-tbefore.
adc() )/tafter.
adc() );
181 h_perincE->Fill( tbefore.
energy(), 100.0* (tafter.
adc()-tbefore.
adc() )/tafter.
adc() );
182 if ( TMath::Abs(tbefore.
adc() - tafter.
adc()) >1. )
183 h_perincEZ->Fill( tbefore.
energy(), 100.0* (tafter.
adc()-tbefore.
adc() )/tafter.
adc() );
189 printf(
"sorting done, nEve=%d of %d\n",nEve, nEntries);
193 float tMnt=(t2-t1)/60.;
194 float rate=1.*nEve/(t2-t1);
195 printf(
"sorting done %d of nEve=%d, CPU rate=%.1f Hz, total time %.1f minute(s) \n",eventCounter,nEntries,rate,tMnt);
210 TFile f( out,
"recreate");
212 printf(
"%d histos are written to '%s' ...\n",HList->GetEntries(),out.Data());
216 h_perinc->Write();h_perincE->Write();h_perincEZ->Write();
StEEmcA2EMaker(const Char_t *name="mEEanalysis")
EEmc ADC –> energy maker.
StEEmcTower & hittower(Int_t hit, Int_t layer)
void source(const Char_t *, Int_t=0)
void setAddPed(Bool_t a=true)
Add pedestal offsets from DB.
virtual void Clear(Option_t *option="")
User defined functions.
Int_t numberOfHitTowers(Int_t layer) const
virtual void ls(Option_t *option="") const
Base class for representing tower, preshower and postshower elements.
void setOverwrite(Bool_t o=true)
Overwrite the muDst values.
void setDropBad(Bool_t d=true)
Drop bad channels marked as "fail" in DB.
void adc(Float_t a)
Set the pedestal-subtracted ADC for this element.
void setSmearPed(Bool_t s=true)
Smear the pedestal with sigma from DB.
StEEmcTower & tower(Int_t index, Int_t layer=0)
void setSource(const Char_t *name)
Set the source of ADC. Can be "MuDst" (default) or "StEvent".
void energy(Float_t e)
Set the energy (adc-ped+0.5)/gain for this element.
void database(const Char_t *)
Set the name of the EEMC database, init obtains pointer.
void setSectors(int, int)
limit the range of sectors for speed