Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
29 return StatusCode::FAILURE;
34 return StatusCode::FAILURE;
41 return StatusCode::SUCCESS;
62 double jesCorrection =
getJES(varE, varEta,
Emax);
69 const float etaCorr = calibP4.eta() +
getEtaCorr(jesCorrection*varE, varEta) ;
73 TLorentzVector TLVjet;
74 TLVjet.SetPtEtaPhiM( calibP4.P()/cosh(etaCorr), etaCorr, calibP4.phi(), calibP4.M() );
75 calibP4.SetPxPyPzE( TLVjet.Px(), TLVjet.Py(), TLVjet.Pz(), TLVjet.E() );
76 ATH_MSG_DEBUG(
"JES = "<<jesCorrection <<
" e="<<varE <<
" eta="<<jetStartP4.Eta()<<
" ieta="<< ieta <<
" post_pt= ="<< calibP4.Pt() <<
" etaCorr="<< etaCorr);
80 jet->setJetP4(calibP4);
83 return StatusCode::SUCCESS;
96 std::string jetAlgo=
static_cast<std::string
> (
m_jetAlgo);
100 for (
int i=0;
i<=90;
i++)
110 TString
key=Form(
"JES.%s_Bin%d",jetAlgo.c_str(),ieta);
121 const double Rcutoff =
getLogPolN(factors,Ecutoff);
123 if(Slope > Rcutoff/Ecutoff)
ATH_MSG_FATAL(
"Slope of calibration curve at minimum ET is too steep for the JES factors of etabin " << ieta <<
", eta = " <<
etaBins[ieta] );
132 ATH_MSG_ERROR(
"LowPtJESExtrapolationMethod==2 not supported yet");
138 key=Form(
"EtaCorr.%s_Bin%d",jetAlgo.c_str(),ieta);
145 key=Form(
"EmaxJES.%s_Bin%d",jetAlgo.c_str(),ieta);
164 std::string jetAlgo=
static_cast<std::string
> (
m_jetAlgo);
168 for (
int i=0;
i<=90;
i++)
181 ATH_MSG_ERROR(
"Only linear extrapolations are supported for p-splines currently. Please change the config file to reflect this");
191 if(Slope > Rcutoff/Ecutoff)
ATH_MSG_WARNING(
"Slope of calibration curve at minimum ET is too steep for the JES factors of etabin " << ieta <<
", eta = " <<
etaBins[ieta] );
197 TString
key=Form(
"EmaxJES.%s_Bin%d",jetAlgo.c_str(),ieta);
202 key=Form(
"EtaCorr.%s_Bin%d",jetAlgo.c_str(),ieta);
260 R = slope*(E_uncorr-Ecutoff)+Rcutoff;
262 else ATH_MSG_WARNING(
"Incorrect specification of low Pt JES extrapolation, please check the value of the LowPtJESExtrapolationMethod config flag.");
294 y += factors[
i]*TMath::Power(
log(
x),Int_t(
i));
303 if (
bin<=0)
return 0;
310 const double inv_x = 1. /
x;
312 y +=
i*factors[
i]*TMath::Power(
log(
x),Int_t(
i-1))*inv_x;
319 std::unique_ptr<TFile> tmpF(TFile::Open(
fileName.c_str() ));
320 TList *etajes_l =
static_cast<TList*
>( tmpF->Get(etajes_name.c_str()));
324 ATH_MSG_WARNING(
"Do not have the correct number of eta bins for " <<
fileName <<
"\t" << etajes_name <<
"\t" << etajes_l->GetSize() );
328 auto *pTH1 =
dynamic_cast<TH1*
>(etajes_l->At(
i));
329 if (not pTH1)
continue;
344 double slope = (rSecond - rFirst) /
binWidth;
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
int getEtaBin(double eta_det) const
double m_JES_MinPt_R[s_nEtaBins]
Class JetContext Designed to read AOD information related to the event, N vertices,...
double m_etaCorrFactors[s_nEtaBins][s_nParMax]
void setAttribute(SG::AuxElement &p, const TYPE &v) const
EtaMassJESCalibStep(const std::string &name="EtaMassJESCalibStep")
double m_energyFreezeJES[s_nEtaBins]
double getLowPtJES(double E_uncorr, double eta_det) const
deal with low pt jets
double getEtaCorr(double X, double Y=0) const
return Eta correction
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< std::string > m_jetAlgo
jet collection to be calibrated
Gaudi::Property< float > m_lowPtExtrap
double m_JESFactors[s_nEtaBins][s_nParMax]
void loadSplineHists(const std::string &fileName, const std::string &etajes_name)
virtual StatusCode calibrate(xAOD::JetContainer &) const override
Apply calibration to a jet container.
double getSplineCorr(const int etaBin, double E) const
double m_JES_MinPt_E[s_nEtaBins]
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
double getJES(const double X, const double Y=0, const double Emax=-1) const
return MCJES calibration factor
double getLogPolNSlope(const double *factors, double x) const
::StatusCode StatusCode
StatusCode definition for legacy code.
double m_JES_MinPt_Slopes[s_nEtaBins]
Gaudi::Property< float > m_minPt_JES
ToolHandle< JetHelper::IVarTool > m_vartoolEta
interface for xAOD::jet variable to be defined by user, this must correspond to jet Eta in currect ve...
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Gaudi::Property< float > m_maxE_EtaCorr
bool readMCJESFromHists()
ToolHandle< JetHelper::IVarTool > m_vartoolE
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
double getLogPolN(const double *factors, double x) const
Gaudi::Property< float > m_minPt_EtaCorr
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< std::string > m_histoFileName
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_useSpline
double getEmaxJES(const double Y) const
return Emax
VecD VectorizeD(const TString &str, const TString &sep=" ")
double getSplineSlope(const int ieta, const double minE) const
Gaudi::Property< std::string > m_constantFileName
name of the text file
std::vector< std::unique_ptr< TH1 > > m_etajesFactors
Gaudi::Property< bool > m_freezeJESatHighE