108 def GetGain(self, receiver, orig_gain, layer_corr_ref, layer_corr_new, layer_names):
110 coolid = self.geometry_convertor.getPPMfromReceiver(receiver)
112 eta_bin = self.geometry_convertor.getEtaBin(coolid)
119 if self.geometry_convertor.isCoolEm (coolid):
121 is_overlap = self.geometry_convertor.isPPMOverlap(coolid)
125 for n
in range(len(layer_names)):
127 layer = layer_names[n]
131 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_em [eta_bin][0]
132 hv_coef_new += layer_corr_new[n] * self.layer_weights_em [eta_bin][0]
136 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_em [eta_bin][1]
137 hv_coef_new += layer_corr_new[n] * self.layer_weights_em [eta_bin][1]
141 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_em [eta_bin][2]
142 hv_coef_new += layer_corr_new[n] * self.layer_weights_em [eta_bin][2]
146 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_em [eta_bin][3]
147 hv_coef_new += layer_corr_new[n] * self.layer_weights_em [eta_bin][3]
151 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_em [eta_bin][4]
152 hv_coef_new += layer_corr_new[n] * self.layer_weights_em [eta_bin][4]
156 if self.geometry_convertor.isCoolHad(coolid):
158 regions =
"EmbFcalHighEta"
162 for n
in range(len(layer_names)):
164 layer = layer_names[n]
168 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_had[eta_bin][0]
169 hv_coef_new += layer_corr_new[n] * self.layer_weights_had[eta_bin][0]
173 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_had[eta_bin][1]
174 hv_coef_new += layer_corr_new[n] * self.layer_weights_had[eta_bin][1]
178 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_had[eta_bin][2]
179 hv_coef_new += layer_corr_new[n] * self.layer_weights_had[eta_bin][2]
183 hv_coef_ref += layer_corr_ref[n] * self.layer_weights_had[eta_bin][3]
184 hv_coef_new += layer_corr_new[n] * self.layer_weights_had[eta_bin][3]
186 pred_gain = orig_gain * (hv_coef_new/hv_coef_ref)