ATLAS Offline Software
Loading...
Searching...
No Matches
make_eop_maps.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6//
7// root[0] .L make_eop_maps.cxx
8// root[1] make_eop_maps("path/to/fitEoverP.root",zrange)
9// -- or --
10// root[1] make_sagitta_maps("path/to/Scaling.root",zrange)
11//
12// @author: will.di.clemente@cern.ch
13//
15
16#include "TH2.h"
17#include "TCanvas.h"
18#include "TFile.h"
19#include "TString.h"
20
21void make_eop_maps(TString path, Float_t range=0.2){ //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}
57
58void make_sagitta_maps(TString path, Float_t range=0.004){
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}
void make_sagitta_maps(TString path, Float_t range=0.004)
void make_eop_maps(TString path, Float_t range=0.2)