CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
BSvsBPIX.cc File Reference
#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.

Functions

void BSvsBPIXPlot (TFile *ff, const char *bsmodule, const char *occumodule, const int run)
 

Function Documentation

void BSvsBPIXPlot ( TFile *  ff,
const char *  bsmodule,
const char *  occumodule,
const int  run 
)

Definition at line 10 of file BSvsBPIX.cc.

References gather_cfg::cout, i, and point.

10  {
11 
12  TGraphErrors* bspos = new TGraphErrors();
13  TGraphErrors* bpixpos = new TGraphErrors();
14 
15  if(ff) {
16 
17  char bsfolder[200];
18  sprintf(bsfolder,"%s/run_%d",bsmodule,run);
19  if(ff->cd(bsfolder)) {
20  TH1F* bsx = (TH1F*)gDirectory->Get("bsxrun");
21  TH1F* bsy = (TH1F*)gDirectory->Get("bsyrun");
22  if(bsx && bsy) {
23  std::cout << "beam spot position ("
24  << bsx->GetMean() << "+/-" << bsx->GetMeanError() << ","
25  << bsy->GetMean() << "+/-" << bsy->GetMeanError() << ")" << std::endl;
26  bspos->SetPoint(0,bsx->GetMean(),bsy->GetMean());
27  bspos->SetPointError(0,bsx->GetMeanError(),bsy->GetMeanError());
28  }
29  }
30  char occufolder[200];
31  sprintf(occufolder,"%s/run_%d",occumodule,run);
32  if(ff->cd(occufolder)) {
33  TProfile* xmean = (TProfile*)gDirectory->Get("avex");
34  TProfile* ymean = (TProfile*)gDirectory->Get("avey");
35  if(xmean && ymean) {
36  for(int i=1;i<=xmean->GetNbinsX();++i) {
37  if(xmean->GetBinEntries(i) >0) {
38  std::cout << "ladder position " << i << " : ("
39  << xmean->GetBinContent(i) << "+/-" << xmean->GetBinError(i) << ","
40  << ymean->GetBinContent(i) << "+/-" << ymean->GetBinError(i) << ")" << std::endl;
41  int point = bpixpos->GetN();
42  bpixpos->SetPoint(point,xmean->GetBinContent(i),ymean->GetBinContent(i));
43  bpixpos->SetPointError(point,xmean->GetBinError(i),ymean->GetBinError(i));
44  }
45  }
46  }
47 
48  }
49  }
50  new TCanvas("bsbpix","bsbpix",500,500);
51  bpixpos->Draw("ap");
52  bspos->Draw("p");
53 
54 }
int i
Definition: DBlmapReader.cc:9
tuple cout
Definition: gather_cfg.py:145
*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
Definition: invegas.h:5