ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
doL1CaloHVCorrections.HVCorrectionCalculator Class Reference
Collaboration diagram for doL1CaloHVCorrections.HVCorrectionCalculator:

Public Member Functions

def __init__ (self, mapping)
 
def GetCorrection (self, receiver, layer_corr, layer_names)
 

Public Attributes

 geometry_convertor
 
 layer_weights_em
 
 layer_weights_had
 

Detailed Description

Definition at line 69 of file doL1CaloHVCorrections.py.

Constructor & Destructor Documentation

◆ __init__()

def doL1CaloHVCorrections.HVCorrectionCalculator.__init__ (   self,
  mapping 
)

Definition at line 71 of file doL1CaloHVCorrections.py.

71  def __init__(self, mapping):
72 
73  self.geometry_convertor = mapping
74 
75  self.layer_weights_em = {} # per eta bin
76  self.layer_weights_had = {} # per eta bin
77 
78  file_name = ROOT.PathResolver.find_calib_file("TrigT1Calo/HVcorrPhysicsWeights_v1.txt")
79 
80 
81 
82  try:
83 
84  file = open(file_name)
85 
86  except IOError:
87 
88  print ("\ncould not find file: %s ....exiting\n" % file_name)
89 
90  sys.exit()
91 
92  for line in file.readlines():
93 
94  parts = line.split()
95 
96  self.layer_weights_em [int(parts[0])] = [float(parts[1]),float(parts[2]),float(parts[3]),float(parts[4]),float(parts[5])]
97  self.layer_weights_had[int(parts[0])] = [float(parts[6]),float(parts[7]),float(parts[8]),float(parts[9])]
98 
99  file.close()
100 
101 

Member Function Documentation

◆ GetCorrection()

def doL1CaloHVCorrections.HVCorrectionCalculator.GetCorrection (   self,
  receiver,
  layer_corr,
  layer_names 
)

Definition at line 102 of file doL1CaloHVCorrections.py.

102  def GetCorrection(self, receiver, layer_corr, layer_names):
103 
104  coolid = self.geometry_convertor.getPPMfromReceiver(receiver)
105 
106  eta_bin = self.geometry_convertor.getEtaBin(coolid)
107 
108  hv_coef = 0. # new hv coefficient
109  normalisation = 0.
110 
111 
112 
113  if self.geometry_convertor.isCoolEm (coolid):
114 
115  is_overlap = self.geometry_convertor.isPPMOverlap(coolid)
116 
117 
118 
119  for n in range(len(layer_names)):
120 
121  layer = layer_names[n]
122 
124 
125  hv_coef += layer_corr[n] * self.layer_weights_em [eta_bin][0]
126  normalisation += self.layer_weights_em [eta_bin][0]
127 
128  if PlotCalibrationHV.isEmFront(layer,is_overlap):
129 
130  hv_coef += layer_corr[n] * self.layer_weights_em [eta_bin][1]
131  normalisation += self.layer_weights_em [eta_bin][1]
132 
133  if PlotCalibrationHV.isEmMiddle(layer,is_overlap):
134 
135  hv_coef += layer_corr[n] * self.layer_weights_em [eta_bin][2]
136  normalisation += self.layer_weights_em [eta_bin][2]
137 
138  if PlotCalibrationHV.isEmBack(layer,is_overlap):
139 
140  hv_coef += layer_corr[n] * self.layer_weights_em [eta_bin][3]
141  normalisation += self.layer_weights_em [eta_bin][3]
142 
143  if PlotCalibrationHV.isEmOverlapBack(layer,is_overlap):
144 
145  hv_coef += layer_corr[n] * self.layer_weights_em [eta_bin][4]
146  normalisation += self.layer_weights_em [eta_bin][4]
147 
148 
149 
150  if self.geometry_convertor.isCoolHad(coolid):
151 
152  regions = "EmbFcalHighEta" # (?)
153 
154 
155 
156  for n in range(len(layer_names)):
157 
158  layer = layer_names[n]
159 
160  if PlotCalibrationHV.isHadFirstLayer(layer,regions):
161 
162  hv_coef += layer_corr[n] * self.layer_weights_had[eta_bin][0]
163  normalisation += self.layer_weights_had[eta_bin][0]
164 
165  if PlotCalibrationHV.isHadSecondLayer(layer,regions):
166 
167  hv_coef += layer_corr[n] * self.layer_weights_had[eta_bin][1]
168  normalisation += self.layer_weights_had[eta_bin][1]
169 
170  if PlotCalibrationHV.isHadThirdLayer(layer,regions):
171 
172  hv_coef += layer_corr[n] * self.layer_weights_had[eta_bin][2]
173  normalisation += self.layer_weights_had[eta_bin][2]
174 
175  if PlotCalibrationHV.isHadFourthLayer(layer,regions):
176 
177  hv_coef += layer_corr[n] * self.layer_weights_had[eta_bin][3]
178  normalisation += self.layer_weights_had[eta_bin][3]
179 
180  totalCorrection = hv_coef / normalisation # correction is a weighted sum of layer corrections
181 
182  return totalCorrection
183 

Member Data Documentation

◆ geometry_convertor

doL1CaloHVCorrections.HVCorrectionCalculator.geometry_convertor

Definition at line 73 of file doL1CaloHVCorrections.py.

◆ layer_weights_em

doL1CaloHVCorrections.HVCorrectionCalculator.layer_weights_em

Definition at line 75 of file doL1CaloHVCorrections.py.

◆ layer_weights_had

doL1CaloHVCorrections.HVCorrectionCalculator.layer_weights_had

Definition at line 76 of file doL1CaloHVCorrections.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
PlotCalibrationHV.isEmPresampler
def isEmPresampler(layerName)
Definition: PlotCalibrationHV.py:17
PlotCalibrationHV.isHadFirstLayer
def isHadFirstLayer(layerName, TT_part)
Definition: PlotCalibrationHV.py:84
PlotCalibrationHV.isHadSecondLayer
def isHadSecondLayer(layerName, TT_part)
Definition: PlotCalibrationHV.py:93
PlotCalibrationHV.isEmMiddle
def isEmMiddle(layerName, isOverlap)
Definition: PlotCalibrationHV.py:43
PlotCalibrationHV.isEmFront
def isEmFront(layerName, isOverlap)
Definition: PlotCalibrationHV.py:27
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
PlotCalibrationHV.isEmOverlapBack
def isEmOverlapBack(layerName, isOverlap)
Definition: PlotCalibrationHV.py:73
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40
PlotCalibrationHV.isHadThirdLayer
def isHadThirdLayer(layerName, TT_part)
Definition: PlotCalibrationHV.py:102
PlotCalibrationHV.isEmBack
def isEmBack(layerName, isOverlap)
Definition: PlotCalibrationHV.py:58
readCCLHist.float
float
Definition: readCCLHist.py:83
PlotCalibrationHV.isHadFourthLayer
def isHadFourthLayer(layerName, TT_part)
Definition: PlotCalibrationHV.py:111