 |
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;
44 else ATH_MSG_DEBUG(
"The pileup residual calibrations will be applied simultaneously (default).");
52 "Sequential residual calibration can not be applied in doMuOnly or doNPVOnly or doNJetOnly cases.");
55 "Conflicting configuation, UseNjet true but doMuOnly or doNPVOnly also true.");
58 "It was requested to apply only the mu-based AND the NPV-based calibrations.");
61 "It was requested to apply only the mu-based AND the NJet-based calibrations.");
64 "It was requested to apply only the NJet-based calibration but not to use Njet instead of NPV.");
67 "It was requested to apply NJet-based and NPV calibrations.");
73 "OffsetCorrection.DefaultMuRef not specified.");
76 "OffsetCorrection.DefaultNPVRef not specified.");
79 "OffsetCorrection.DefaultNjetRef not specified.");
86 "Incorrect specification of MuTerm binning" );
91 "Incorrect specification of nJetTerm binning." );
94 "Incorrect specification of NPVTerm binning." );
98 ATH_MSG_INFO(
"\n NPV beamspot correction will be applied.");
102 return StatusCode::SUCCESS;
111 double mu = eventInfoDecor(0) ;
122 "Could not retrieve xAOD::EventShape::Density from xAOD::EventShape "<<
m_rhoKey.key() );
136 static const double toGeV = 0.001;
147 const double E_det = jetStartP4.e();
148 const double pT_det = jetStartP4.pt();
149 const double eta_det = jetStartP4.eta();
150 const double mass_det = jetStartP4.mass();
152 if ( E_det < mass_det ) {
153 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." );
154 return StatusCode::FAILURE;
161 double pT_offset = pT_det;
162 double pileup_SF = 1;
170 pT_offset =
m_doJetArea ? pT_det -
rho*jetareaP4.pt() - offsetET : pT_det - offsetET;
173 pileup_SF = pT_offset >= 0 ? pT_offset / pT_det : 10./pT_det;
175 calibP4 = jetStartP4*pileup_SF;
180 pT_offset =
m_doJetArea ? pT_det -
rho*jetareaP4.pt() - offsetET : pT_det - offsetET;
181 double muSF = pT_offset >= 0 ? pT_offset / pT_det : 10./pT_det;
183 calibP4 = jetStartP4*muSF;
187 double pT_afterMuCalib = calibP4.pt();
188 pT_offset = pT_afterMuCalib - offsetET;
189 double SF = pT_offset >= 0 ? pT_offset / pT_afterMuCalib : 10./pT_afterMuCalib;
190 calibP4 = calibP4*
SF;
195 puCorrectedAcc(*
jet) = 1 ;
198 jet->setJetP4( calibP4 );
203 return StatusCode::SUCCESS;
208 int nJet,
bool MuOnly,
bool NOnly )
const {
214 int nJet,
bool MuOnly,
bool NOnly,
215 const std::vector<double>&
OffsetMu,
217 const std::vector<double>& OffsetNjet,
218 const TAxis *OffsetBins )
const {
220 static const double toMeV= 1000.;
228 if(!MuOnly){
beta = OffsetNjet[0];
231 }
else {
alpha = 0; }
234 for (;
bin<=OffsetBins->GetNbins();++
bin) {
235 etaEdge = OffsetBins->GetBinLowEdge(
bin);
236 const double width=OffsetBins->GetBinWidth(
bin);
237 if (abseta<etaEdge+
width)
break;
242 if(!MuOnly)
beta += OffsetNjet[
bin]*(abseta-etaEdge);
252 }
else {
alpha = 0; }
255 for (;
bin<=OffsetBins->GetNbins();++
bin) {
256 etaEdge = OffsetBins->GetBinLowEdge(
bin);
257 const double width=OffsetBins->GetBinWidth(
bin);
258 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< std::string > m_jetOutScale
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::string > m_jetInScale
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