ATLAS Offline Software
Loading...
Searching...
No Matches
make_eop_maps.cxx File Reference
#include "TH2.h"
#include "TCanvas.h"
#include "TFile.h"
#include "TString.h"
Include dependency graph for make_eop_maps.cxx:

Go to the source code of this file.

Functions

void make_eop_maps (TString path, Float_t range=0.2)
void make_sagitta_maps (TString path, Float_t range=0.004)

Function Documentation

◆ make_eop_maps()

void make_eop_maps ( TString path,
Float_t range = 0.2 )

Definition at line 21 of file make_eop_maps.cxx.

21 { //zmin=0.8, Float_t zmax=1.2){
22
23 // Make the ratio histogram from the input file
24 TFile *f = new TFile(path);
25 TH2D *h1 = (TH2D*)f->Get("meanPlotPos");
26 TH2D *h2 = (TH2D*)f->Get("meanPlotNeg");
27 TH2D *outhist = h1->Clone();
28 outhist->Divide(h2);
29
30 // Set up the output canvas
31 TCanvas *c1 = new TCanvas("c1","c1",800,600);
32 c1->SetRightMargin(0.13);
33
34 // Set up ranges
35 Float_t zmin = 1.-range;
36 Float_t zmax = 1.+range;
37
38 // Plot aesthetics
39 outhist->SetTitle("E/p ratio <+>/<->");
40 outhist->GetZaxis()->SetRangeUser(zmin,zmax);
41 outhist->GetXaxis()->SetTitle("#eta");
42 outhist->GetXaxis()->SetTitleOffset(1);
43 outhist->GetYaxis()->SetTitle("#phi [rad]");
44 outhist->GetYaxis()->SetTitleOffset(.7);
45 TPaletteAxis *palette = (TPaletteAxis*)outhist->GetListOfFunctions()->FindObject("palette");
46 palette->SetX1NDC(0.87);
47 palette->SetX2NDC(0.92);
48 palette->SetY1NDC(0.1);
49 palette->SetY2NDC(0.9);
50
51 // Draw and print
52 outhist->Draw("colz");
53 c1->Print("EoverP.pdf","Portrait pdf");
54
55 return;
56}

◆ make_sagitta_maps()

void make_sagitta_maps ( TString path,
Float_t range = 0.004 )

Definition at line 58 of file make_eop_maps.cxx.

58 {
59
60 // Make the ratio histogram from the input file
61 TFile *f = new TFile(path);
62 TH2D *outhist = (TH2D*)f->Get("FinalCorrections");
63
64 // Set up the output canvas
65 TCanvas *c1 = new TCanvas("c1","c1",800,600);
66 c1->SetRightMargin(0.16);
67
68 // Set up ranges
69 range = fabs(range);
70 Float_t zmin = (-1.)*range;
71 Float_t zmax = range;
72
73 // Plot aesthetics
74 outhist->SetTitle("Sagitta Bias");
75 outhist->GetZaxis()->SetRangeUser(zmin,zmax);
76 outhist->GetXaxis()->SetTitle("#eta");
77 outhist->GetXaxis()->SetTitleOffset(1);
78 outhist->GetYaxis()->SetTitle("#phi [rad]");
79 outhist->GetYaxis()->SetTitleOffset(.7);
80 TPaletteAxis *palette = (TPaletteAxis*)outhist->GetListOfFunctions()->FindObject("palette");
81 palette->SetX1NDC(0.84);
82 palette->SetX2NDC(0.89);
83 palette->SetY1NDC(0.1);
84 palette->SetY2NDC(0.9);
85 TGaxis::SetMaxDigits(2);
86
87 // Draw and print
88 outhist->Draw("colz");
89 c1->Print("Sagitta.pdf","Portrait pdf");
90
91 return;
92}