-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConvertGainMapToNiceCPad.C
More file actions
80 lines (67 loc) · 2.13 KB
/
ConvertGainMapToNiceCPad.C
File metadata and controls
80 lines (67 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <iostream>
#include <math.h>
#include "TPCSimulation/Cluster.h"
#include "TPCBase/Mapper.h"
#include "TPCReconstruction/TrackTPC.h"
#include "TPCBase/CRU.h"
#include "TPCBase/ROC.h"
#include "TPCBase/CalDet.h"
#include "TPCBase/Painter.h"
#include "TH1.h"
#include "TH2.h"
#include "TChain.h"
#include "TFile.h"
#include "TString.h"
#include "TSystem.h"
#include "TROOT.h"
#include "TF1.h"
#include "TTree.h"
#include "TCanvas.h"
#include "TMath.h"
#include "TPaveText.h"
#include "TStyle.h"
void ConvertGainMapToNiceCPad(TString GainMapFile)
{
using namespace o2::TPC;
gStyle->SetOptStat(0);
Mapper& mapper = Mapper::instance();
TFile f(GainMapFile);
// gROOT->cd();
TH1D *hGainDist = nullptr;
f.GetObject("GainDistribution", hGainDist);
TCanvas *GainDist = new TCanvas("c2","gain distribution");
float hMean = hGainDist->GetMean();
float hRMS = hGainDist->GetRMS();
TPaveText *pave = new TPaveText(0.6,.7,.9,.9,"NDC");
pave->SetBorderSize(1);
pave->AddText(Form("mean: %.2f", hMean));
pave->AddText(Form("RMS: %.2f", hRMS));
hGainDist->Draw();
// GainDist->Update();
pave->Draw("same");
// GainDist->Update();
TH2D *hGainMap = nullptr;
f.GetObject("GainMap", hGainMap);
TH2D *hGainMapCPad = new TH2D("GainMap", "; Row; Pad", 63,0,62,101,-50,50);
for (int irow = 0; irow<63; ++irow) {
for (int ipad = 0; ipad<90; ++ipad){
double gain = hGainMap->GetBinContent(irow,ipad);
float cpad = ipad - mapper.getNumberOfPadsInRowSector(irow)/2;
hGainMapCPad->Fill(irow, cpad, gain);
}
}
TCanvas *GainMap = new TCanvas("c1","gain map");
hGainMapCPad->GetZaxis()->SetRangeUser(0.0,1.3);
hGainMapCPad->GetYaxis()->SetTitleSize(24);
hGainMapCPad->GetYaxis()->SetLabelSize(21);
hGainMapCPad->GetYaxis()->SetTitleFont(43);
hGainMapCPad->GetYaxis()->SetLabelFont(43);
hGainMapCPad->GetYaxis()->SetTitleOffset(1.1);
hGainMapCPad->GetXaxis()->SetTitleSize(24);
hGainMapCPad->GetXaxis()->SetLabelSize(21);
hGainMapCPad->GetXaxis()->SetTitleFont(43);
hGainMapCPad->GetXaxis()->SetLabelFont(43);
hGainMapCPad->GetXaxis()->SetTitleOffset(1.1);
hGainMapCPad->Draw("colz");
return;
}