ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTrackMonitorPostProcessing Namespace Reference

Functions

 project_mean_ROOT (inputs)
 efficiencies_2d (inputs)

Detailed Description

 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 2021 Peter Kraemer - Uni Mainz

Function Documentation

◆ efficiencies_2d()

MuonTrackMonitorPostProcessing.efficiencies_2d ( inputs)
Returns 2D efficiencies from two 2D input histograms, the first the selective and the second the inclusive histogram.

Definition at line 35 of file MuonTrackMonitorPostProcessing.py.

35def efficiencies_2d(inputs):
36 """Returns 2D efficiencies from two 2D input histograms, the first the selective and the second the inclusive histogram."""
37 selective = inputs[0][1][0].Clone()
38 inclusive = inputs[0][1][1].Clone()
39 efficiency = selective.Clone()
40 efficiency.Reset()
41
42 n_bins_x = selective.GetNbinsX()
43 n_bins_y = selective.GetNbinsY()
44 for i in range(n_bins_x):
45 for j in range(n_bins_y):
46 bin1 = selective.GetBinContent(i, j)
47 bin2 = inclusive.GetBinContent(i, j)
48 eff = float(bin1)/float(bin2) if bin2!=0 else 0
49 efficiency.SetBinContent(i, j, eff)
50
51 efficiency.SetTitle(selective.GetTitle())
52 efficiency.GetXaxis().SetTitle("eta")
53 efficiency.GetYaxis().SetTitle("phi")
54 return [efficiency]

◆ project_mean_ROOT()

MuonTrackMonitorPostProcessing.project_mean_ROOT ( inputs)
Fit peak for every row in 2D histogram.

Definition at line 10 of file MuonTrackMonitorPostProcessing.py.

10def project_mean_ROOT(inputs):
11 """Fit peak for every row in 2D histogram."""
12 mean = inputs[0][1][0].ProjectionY().Clone()
13 mean.Clear()
14 sigma = inputs[0][1][0].ProjectionY().Clone()
15 sigma.Clear()
16 name = inputs[0][1][0].GetName()
17 n_bins_y = inputs[0][1][0].GetNbinsY()
18 for i in range(n_bins_y):
19 tmp = inputs[0][1][0].ProjectionX(name, i,i).Clone()
20 if tmp.GetEntries() == 0:
21 print("zero entries in Projection")
22 continue
23 mean.SetBinContent(i, tmp.GetMean(1))
24 mean.SetBinError(i, tmp.GetMeanError(1))
25 sigma.SetBinContent(i, tmp.GetRMS(1))
26 sigma.SetBinError(i, tmp.GetRMSError(1))
27 mean.SetTitle(inputs[0][1][0].GetTitle()+"projection mean")
28 mean.GetXaxis().SetTitle("#eta regions")
29 mean.GetYaxis().SetTitle("entries")
30 sigma.SetTitle(inputs[0][1][0].GetTitle()+"projection sigma")
31 sigma.GetXaxis().SetTitle("#eta regions")
32 sigma.GetYaxis().SetTitle("entries")
33 return [mean, sigma]
34
void print(char *figname, TCanvas *c1)