Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
30 ATH_MSG_FATAL(
"If you're trying to apply only the Residual pile up correction, it needs to be specify in the Calibration Sequence. ApplyOnlyResidual should be true in the configuration file and the PileupStartScale should be specified.");
31 return StatusCode::FAILURE;
42 else ATH_MSG_DEBUG(
"The pileup residual calibrations will be applied simultaneously (default).");
50 "Sequential residual calibration can not be applied in doMuOnly or doNPVOnly or doNJetOnly cases.");
53 "Conflicting configuation, UseNjet true but doMuOnly or doNPVOnly also true.");
56 "It was requested to apply only the mu-based AND the NPV-based calibrations.");
59 "It was requested to apply only the mu-based AND the NJet-based calibrations.");
62 "It was requested to apply only the NJet-based calibration but not to use Njet instead of NPV.");
65 "It was requested to apply NJet-based and NPV calibrations.");
71 "OffsetCorrection.DefaultMuRef not specified.");
74 "OffsetCorrection.DefaultNPVRef not specified.");
77 "OffsetCorrection.DefaultNjetRef not specified.");
84 "Incorrect specification of MuTerm binning" );
89 "Incorrect specification of nJetTerm binning." );
92 "Incorrect specification of NPVTerm binning." );
96 ATH_MSG_INFO(
"\n NPV beamspot correction will be applied.");
100 return StatusCode::SUCCESS;
109 double mu = eventInfoDecor(0) ;
120 "Could not retrieve xAOD::EventShape::Density from xAOD::EventShape "<<
m_rhoKey.key() );
134 static const double toGeV = 0.001;
145 const double E_det = jetStartP4.e();
146 const double pT_det = jetStartP4.pt();
147 const double eta_det = jetStartP4.eta();
148 const double mass_det = jetStartP4.mass();
150 if ( E_det < mass_det ) {
151 ATH_MSG_ERROR(
"JetPileupCorrection::calibrateImpl : Current jet has mass=" << mass_det*
toGeV <<
" GeV, which is greater than it's energy=" << E_det*
toGeV <<
" GeV?? Aborting." );
152 return StatusCode::FAILURE;
159 double pT_offset = pT_det;
160 double pileup_SF = 1;
168 pT_offset =
m_doJetArea ? pT_det -
rho*jetareaP4.pt() - offsetET : pT_det - offsetET;
171 pileup_SF = pT_offset >= 0 ? pT_offset / pT_det : 10./pT_det;
173 calibP4 = jetStartP4*pileup_SF;
178 pT_offset =
m_doJetArea ? pT_det -
rho*jetareaP4.pt() - offsetET : pT_det - offsetET;
179 double muSF = pT_offset >= 0 ? pT_offset / pT_det : 10./pT_det;
181 calibP4 = jetStartP4*muSF;
185 double pT_afterMuCalib = calibP4.pt();
186 pT_offset = pT_afterMuCalib - offsetET;
187 double SF = pT_offset >= 0 ? pT_offset / pT_afterMuCalib : 10./pT_afterMuCalib;
188 calibP4 = calibP4*
SF;
193 puCorrectedAcc(*
jet) = 1 ;
196 jet->setJetP4( calibP4 );
201 return StatusCode::SUCCESS;
206 int nJet,
bool MuOnly,
bool NOnly )
const {
212 int nJet,
bool MuOnly,
bool NOnly,
213 const std::vector<double>&
OffsetMu,
215 const std::vector<double>& OffsetNjet,
216 const TAxis *OffsetBins )
const {
218 static const double toMeV= 1000.;
226 if(!MuOnly){
beta = OffsetNjet[0];
229 }
else {
alpha = 0; }
232 for (;
bin<=OffsetBins->GetNbins();++
bin) {
233 etaEdge = OffsetBins->GetBinLowEdge(
bin);
234 const double width=OffsetBins->GetBinWidth(
bin);
235 if (abseta<etaEdge+
width)
break;
240 if(!MuOnly)
beta += OffsetNjet[
bin]*(abseta-etaEdge);
250 }
else {
alpha = 0; }
253 for (;
bin<=OffsetBins->GetNbins();++
bin) {
254 etaEdge = OffsetBins->GetBinLowEdge(
bin);
255 const double width=OffsetBins->GetBinWidth(
bin);
256 if (abseta<etaEdge+
width)
break;
bool getDensity(EventDensityID id, double &v) const
Get a density variable from the object.
virtual StatusCode calibrate(xAOD::JetContainer &jetCont) const override
Apply calibration to a jet container.
Gaudi::Property< bool > m_applyNPVBeamspotCorrection
Gaudi::Property< bool > m_doOnlyResidual
Helper class to provide type-safe access to aux data.
double getNPVBeamspotCorrection(double NPV) const
void setAttribute(SG::AuxElement &p, const TYPE &v) const
const float SF[NF]
Cross sections for Fluor.
void getAttribute(const SG::AuxElement &p, TYPE &v) const
bool isPresent() const
Is the referenced container present in SG?
Gaudi::Property< bool > m_doMuOnly
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
Gaudi::Property< bool > m_isData
NPVBeamspotCorrection * m_npvBeamspotCorr
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Handle class for reading a decoration on an object.
Gaudi::Property< std::vector< double > > m_offsetEtaBins
SG::ReadHandleKey< xAOD::JetContainer > m_nJetContainerKey
Gaudi::Property< std::vector< double > > m_resOffsetNjet
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK_THEN_ERROR(checkcode, message)
SG::ReadDecorHandleKey< xAOD::EventInfo > m_muKey
Gaudi::Property< float > m_nJet_ref
Gaudi::Property< bool > m_useNjet
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< float > m_mu_ref
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Gaudi::Property< bool > m_doSequentialResidual
double getResidualOffset(double abseta, double mu, double NPV, int nJet, bool MuOnly, bool NOnly) const
Pileup1DResidualCalibStep(const std::string &name="Pileup1DResidualCalibStep")
Gaudi::Property< float > m_NPV_ref
Gaudi::Property< bool > m_doNJetOnly
Gaudi::Property< bool > m_doNPVOnly
Gaudi::Property< int > m_njetThreshold
Gaudi::Property< std::vector< double > > m_resOffsetNPV
SG::ReadHandleKey< xAOD::EventShape > m_rhoKey
SG::ReadHandleKey< xAOD::VertexContainer > m_pvKey
int countNPV(const VXCONT &vxCont)
Gaudi::Property< float > m_muSF
Gaudi::Property< bool > m_doJetArea
This header defines wrapper classes around SG::AuxElement::Accessor used internally in the Jet EDM.
Gaudi::Property< std::vector< double > > m_resOffsetMu
double getResidualOffsetET(double abseta, double mu, double NPV, int nJet, bool MuOnly, bool NOnly, const std::vector< double > &OffsetMu, const std::vector< double > &OffsetNPV, const std::vector< double > &OffsetNjet, const TAxis *OffsetBins) const