void checktagger(int r){ char fnam[128]; sprintf(fnam, "localdir/run%d/pi0test_run%d.root",r,r); TFile *INF = new TFile(fnam,"READ"); TH1D *h[2]; h[0] = (TH1D*)INF->Get("rfbeamM"); h[1] = (TH1D*)INF->Get("rfbeamH"); if ((!h[0]) || (!h[1])){ return; } if (h[0]->GetEntries()<100000.){ return; } double MaxLoc[2] = {0.,0.}; for (int k=0 ; k<2; k++) { if (h[k]->GetEntries()>100){ int mb = h[k]->GetMaximumBin(); double max = h[k]->GetBinCenter(mb); h[k]->Fit("gaus","","R",max-0.5,max+0.5); TF1 *f = h[k]->GetFunction("gaus"); MaxLoc[k] = f->GetParameter(1); } } TH1D *hcal[2]; hcal[0] = (TH1D*)INF->Get("PhotonTBCAL"); hcal[1] = (TH1D*)INF->Get("PhotonTFCAL"); if ((!hcal[0]) || (!hcal[1])){ return; } double Means[2] = {0.,0.}; for (int k=0 ; k<2; k++) { if (hcal[k]->GetEntries()>100){ Means[k] = hcal[k]->GetMean(); } } char ofnam[128]; sprintf(ofnam, "localdir/run%d/tagger_run%d.dat",r,r); char s1[128]; sprintf(s1,"%7.2f %7.2f",MaxLoc[0], MaxLoc[1]); char s2[128]; sprintf(s2,"%7.2f %7.2f",Means[0], Means[1]); ofstream OUTF(ofnam); OUTF<