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.;
462 double resolution = 0;
469 resolution = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.Eta());
475 resolution = histo.getValue(jet4vec.Pt()*
m_energyScale,fabs(jet4vec.Eta()));
478 resolution = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()*massShiftFactor/jet4vec.Pt());
481 resolution = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()*massShiftFactor/jet4vec.Pt(),jet4vec.Eta());
484 resolution = histo.getValue(jet4vec.Pt()*
m_energyScale,jet4vec.M()*massShiftFactor/jet4vec.Pt(),fabs(jet4vec.Eta()));
493 resolution = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()*massShiftFactor/jet4vec.E()));
496 resolution = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()*massShiftFactor/jet4vec.E()),jet4vec.Eta());
499 resolution = histo.getValue(jet4vec.E()*
m_energyScale,log(jet4vec.M()*massShiftFactor/jet4vec.E()),fabs(jet4vec.Eta()));
505 return resolution == 0 ? 0 : 1./(resolution*resolution);
#define JESUNC_ERROR_CODE
#define JESUNC_NO_DEFAULT_CONSTRUCTOR
#define JESUNC_SAFE_DELETE(T)
SG::ConstAccessor< T, ALLOC > ConstAccessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual StatusCode setCaloTerm(UncertaintyGroup *caloComp)
virtual StatusCode setCombWeightParam(const CompParametrization::TypeEnum param)
CombinedMassUncertaintyComponent(const ComponentHelper &component)
virtual StatusCode initialize(TFile *histFile)
JetFourMomAccessor m_caloMassScale_weights
virtual bool getValidUncertaintyCalo(double &unc, const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual StatusCode setTAWeights(const UncertaintyHistogram *TAWeights)
const UncertaintyHistogram * m_TAMassWeight
virtual StatusCode setCombWeightMassDefs(const CompMassDef::TypeEnum caloMassDef, const CompMassDef::TypeEnum TAMassDef)
virtual double getWeightFactorCalo(const xAOD::Jet &jet, const double shiftFactor) const
virtual ~CombinedMassUncertaintyComponent()
virtual bool getValidityTA(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
double readHistoFromParam(const xAOD::JetFourMom_t &jet4vec, const UncertaintyHistogram &histo, const CompParametrization::TypeEnum param, const double massShiftFactor) const
virtual CombinedMassUncertaintyComponent * clone() const
virtual double getUncertaintyImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual double getUncertaintyCalo(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
UncertaintyGroup * m_TAMassComp
virtual bool getValidityCalo(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual double getUncertaintyTA(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
StatusCode calculateCombinedMass(const xAOD::Jet &jet, const double shiftFactorCalo, const double shiftFactorTA, double &combMass) const
const CombMassComp::TypeEnum m_combMassType
JetFourMomAccessor m_TAMassScale_weights
CompParametrization::TypeEnum m_weightParam
virtual bool isAlwaysZero() const
virtual StatusCode setCaloWeights(const UncertaintyHistogram *caloWeights)
const UncertaintyHistogram * m_caloMassWeight
std::vector< LargeRJetTruthLabel::TypeEnum > m_truthLabels
std::string m_truthLabelName
virtual double getWeightFactorTA(const xAOD::Jet &jet, const double shiftFactor) const
UncertaintyGroup * m_caloMassComp
virtual bool getValidUncertaintyTA(double &unc, const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual bool getValidityImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual StatusCode setTATerm(UncertaintyGroup *TAComp)
JetFourMomAccessor is an extension of JetAttributeAccessor::AccessorWrapper<xAOD::JetFourMom_t> Acces...
const float m_energyScale
UncertaintyComponent(const ComponentHelper &component, const size_t numHist=1)
virtual TString getName() const
TypeEnum intToEnum(const int type)
TString getJetScaleString(const TypeEnum type)
Jet_v1 Jet
Definition of the current "jet version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.