#include "DPGAnalysis/SiStripTools/bin/BSvsBPIX.h"
#include "TFile.h"
#include "TH1F.h"
#include "TProfile.h"
#include "TGraphErrors.h"
#include "TCanvas.h"
#include "TDirectory.h"
#include <iostream>
Go to the source code of this file.
|
void | BSvsBPIXPlot (TFile *ff, const char *bsmodule, const char *occumodule, const int run) |
|
◆ BSvsBPIXPlot()
void BSvsBPIXPlot |
( |
TFile * |
ff, |
|
|
const char * |
bsmodule, |
|
|
const char * |
occumodule, |
|
|
const int |
run |
|
) |
| |
Definition at line 10 of file BSvsBPIX.cc.
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);
References gather_cfg::cout, alignCSCRings::ff, mps_fire::i, point, and writedatasetfile::run.