22 , m_combMassType(CombMassComp::UNKNOWN)
23 , m_setWeightMassDefs(false)
24 , m_caloMassComp(nullptr)
25 , m_TAMassComp(nullptr)
26 , m_caloMassWeight(nullptr)
27 , m_TAMassWeight(nullptr)
28 , m_caloMassScale_weights(
"")
29 , m_TAMassScale_weights(
"")
30 , m_weightParam(CompParametrization::UNKNOWN)
31 , m_truthLabelName(
"")
39 , m_combMassType(component.combMassType)
40 , m_setWeightMassDefs(false)
41 , m_caloMassComp(nullptr)
42 , m_TAMassComp(nullptr)
43 , m_caloMassWeight(nullptr)
44 , m_TAMassWeight(nullptr)
45 , m_caloMassScale_weights(
"")
46 , m_TAMassScale_weights(
"")
47 , m_weightParam(CompParametrization::UNKNOWN)
48 , m_truthLabelName(component.LargeRJetTruthLabelName)
49 , m_truthLabels(component.LargeRJetTruthLabels)
56 , m_combMassType(toCopy.m_combMassType)
57 , m_setWeightMassDefs(toCopy.m_setWeightMassDefs)
58 , m_caloMassComp(nullptr)
59 , m_TAMassComp(nullptr)
60 , m_caloMassWeight(toCopy.m_caloMassWeight)
61 , m_TAMassWeight(toCopy.m_TAMassWeight)
62 , m_caloMassScale_weights(toCopy.m_caloMassScale_weights)
63 , m_TAMassScale_weights(toCopy.m_TAMassScale_weights)
64 , m_weightParam(toCopy.m_weightParam)
65 , m_truthLabelName(toCopy.m_truthLabelName)
66 , m_truthLabels(toCopy.m_truthLabels)
91 return StatusCode::FAILURE;
96 return StatusCode::FAILURE;
100 return StatusCode::SUCCESS;
108 return StatusCode::FAILURE;
113 return StatusCode::FAILURE;
117 return StatusCode::SUCCESS;
125 return StatusCode::FAILURE;
130 return StatusCode::FAILURE;
134 return StatusCode::SUCCESS;
142 return StatusCode::FAILURE;
147 return StatusCode::FAILURE;
151 return StatusCode::SUCCESS;
159 return StatusCode::FAILURE;
164 return StatusCode::FAILURE;
174 return StatusCode::FAILURE;
184 return StatusCode::FAILURE;
188 return StatusCode::SUCCESS;
196 return StatusCode::FAILURE;
200 return StatusCode::SUCCESS;
212 return StatusCode::FAILURE;
219 return StatusCode::FAILURE;
224 return StatusCode::FAILURE;
231 return StatusCode::FAILURE;
238 return StatusCode::FAILURE;
246 return StatusCode::FAILURE;
251 return StatusCode::FAILURE;
260 return StatusCode::FAILURE;
265 return StatusCode::FAILURE;
274 return StatusCode::FAILURE;
279 return StatusCode::FAILURE;
287 return StatusCode::FAILURE;
292 return StatusCode::FAILURE;
298 return StatusCode::SUCCESS;
325 if (factorCalo+factorTA == 0)
327 if (combMassScale.m(
jet) == 0)
332 return StatusCode::SUCCESS;
339 ATH_MSG_ERROR(
"Encountered division by zero when calculating weights: mCalo = " << caloMassScale.m(
jet) <<
", mTA = " << TAMassScale.m(
jet) <<
", mComb = " << combMassScale.m(
jet));
340 return StatusCode::FAILURE;
345 const double caloWeight = factorCalo/(factorCalo+factorTA);
346 const double TAWeight = factorTA/(factorCalo+factorTA);
351 if (caloMassScale.m(
jet) == 0)
352 combMass = TAMassScale.m(
jet)*shiftFactorTA;
353 else if (TAMassScale.m(
jet) == 0)
354 combMass = caloMassScale.m(
jet)*shiftFactorCalo;
356 combMass = (caloMassScale.m(
jet)*shiftFactorCalo*caloWeight) + (TAMassScale.m(
jet)*shiftFactorTA*TAWeight);
358 return StatusCode::SUCCESS;
371 ATH_MSG_ERROR(
"Unable to retrieve the LargeRJetTruthLabel: " <<
m_truthLabelName <<
" from the jet. Please use JetTruthLabelingTool before calling this function.");
378 bool labelApplies =
false;
381 if (aLabel == jetTruthLabel)
397 ATH_MSG_ERROR(
"Combined mass is outside of the validity range (calo part)");
404 ATH_MSG_ERROR(
"Combined mass is outside of the validity range (TA part)");
414 double massDefault = 0;
416 if (massDefault == 0)
return 0;
422 const double massUncUp = fabs((massUp-massDefault)/massDefault);
423 const double massUncDown = fabs((massDown-massDefault)/massDefault);
425 return (massUncUp+massUncDown)/2.;