5 #include "TGraphErrors.h" 7 #include "TDirectory.h" 11 TGraphErrors* bspos =
new TGraphErrors();
12 TGraphErrors* bpixpos =
new TGraphErrors();
16 sprintf(bsfolder,
"%s/run_%d", bsmodule,
run);
17 if (
ff->cd(bsfolder)) {
18 TH1F* bsx = (TH1F*)gDirectory->Get(
"bsxrun");
19 TH1F* bsy = (TH1F*)gDirectory->Get(
"bsyrun");
21 std::cout <<
"beam spot position (" << bsx->GetMean() <<
"+/-" << bsx->GetMeanError() <<
"," << bsy->GetMean()
22 <<
"+/-" << bsy->GetMeanError() <<
")" << std::endl;
23 bspos->SetPoint(0, bsx->GetMean(), bsy->GetMean());
24 bspos->SetPointError(0, bsx->GetMeanError(), bsy->GetMeanError());
28 sprintf(occufolder,
"%s/run_%d", occumodule,
run);
29 if (
ff->cd(occufolder)) {
30 TProfile* xmean = (TProfile*)gDirectory->Get(
"avex");
31 TProfile* ymean = (TProfile*)gDirectory->Get(
"avey");
33 for (
int i = 1;
i <= xmean->GetNbinsX(); ++
i) {
34 if (xmean->GetBinEntries(
i) > 0) {
35 std::cout <<
"ladder position " <<
i <<
" : (" << xmean->GetBinContent(
i) <<
"+/-" << xmean->GetBinError(
i)
36 <<
"," << ymean->GetBinContent(
i) <<
"+/-" << ymean->GetBinError(
i) <<
")" << std::endl;
37 int point = bpixpos->GetN();
38 bpixpos->SetPoint(
point, xmean->GetBinContent(
i), ymean->GetBinContent(
i));
39 bpixpos->SetPointError(
point, xmean->GetBinError(
i), ymean->GetBinError(
i));
45 new TCanvas(
"bsbpix",
"bsbpix", 500, 500);
void BSvsBPIXPlot(TFile *ff, const char *bsmodule, const char *occumodule, const int run)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point