1) Environment variables allowing flip and offset of anode wires 2) Environment variables allowing for selection of runs' start and stop time positions, to help with phi scanning runs 3) *fix histograms defined that incorporate step-ladder corrections applied to pcz, hard-coded currently in sx3cal/sx3z_vs_pcz/testmodel.h. Will need a better home in the future 4) EXFit2.C has the capability to now gainmatch all sx3 pads, and position along strip is still found from the central three pad edges. Treatment for (backE-missingfrontE) is being considered.
38 lines
1.5 KiB
C
38 lines
1.5 KiB
C
{
|
|
TFile *f = new TFile("../results_run01.root");
|
|
f->cd("l_vs_r");
|
|
gDirectory->ls();
|
|
int clkpos = 1;
|
|
std::ofstream ofile(Form("rightgains%d.dat",clkpos));
|
|
for(int i=0; i<4; i++) {
|
|
TH2F h2(*(TH2F*)(f->Get(Form("l_vs_r/l_vs_r_sx3_id_%d_f%d",clkpos,i))));
|
|
h2.Draw();
|
|
|
|
TH1F hproj(*(TH1F*)(h2.ProjectionX("_px")));
|
|
/*hproj.Draw("SAME");
|
|
gPad->Modified();
|
|
gPad->Update();
|
|
while(gPad->WaitPrimitive());*/
|
|
|
|
int leftbin = hproj.FindFirstBinAbove(hproj.GetMaximum()*0.4);
|
|
int rightbin = hproj.FindLastBinAbove(hproj.GetMaximum()*0.1);
|
|
|
|
TH1F h1(*(TH1F*)(h2.ProfileX("_pfx",leftbin,rightbin)));
|
|
h1.Draw("histo same");
|
|
TLine L1(h1.GetBinCenter(leftbin),0,h1.GetBinCenter(leftbin),1000); L1.SetLineColor(kRed); L1.Draw("SAME");
|
|
TLine L2(h1.GetBinCenter(rightbin),0,h1.GetBinCenter(rightbin),1000); L2.SetLineColor(kRed); L2.Draw("SAME");
|
|
//h2.GetYaxis()->SetRangeUser(0,2000);
|
|
//h2.GetXaxis()->SetRangeUser(hproj.GetBinCenter(leftbin),hproj.GetBinCenter(rightbin));
|
|
h2.Fit("pol1","","SAME",h1.GetBinCenter(leftbin),h1.GetBinCenter(rightbin));
|
|
|
|
TF1 *f1 = (TF1*)h2.GetFunction("pol1");
|
|
f1->Draw("SAME");
|
|
ofile << clkpos << " " << i << " " << f1->GetParameter(0) << " " << TMath::Abs(f1->GetParameter(1)) << std::endl;
|
|
gPad->Modified();
|
|
gPad->Update();
|
|
while(gPad->WaitPrimitive());
|
|
}
|
|
ofile.close();
|
|
f->Close();
|
|
}
|