ATLAS Offline Software
MuonTrackMonitorPostProcessing.py
Go to the documentation of this file.
1 """
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  2021 Peter Kraemer - Uni Mainz
4 """
5 
6 
7 """Implement functions for postprocessing used by histgrinder."""
8 
9 
10 def 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]
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
MuonTrackMonitorPostProcessing.project_mean_ROOT
def project_mean_ROOT(inputs)
Definition: MuonTrackMonitorPostProcessing.py:10