 |
ATLAS Offline Software
|
Go to the documentation of this file.
31 return StatusCode::FAILURE;
36 return StatusCode::FAILURE;
43 return StatusCode::SUCCESS;
55 jet->setJetP4(jetStartP4);
64 double jesCorrection =
getJES(varE, varEta,
Emax);
71 const float etaCorr = calibP4.eta() +
getEtaCorr(jesCorrection*varE, varEta) ;
75 TLorentzVector TLVjet;
76 TLVjet.SetPtEtaPhiM( calibP4.P()/cosh(etaCorr), etaCorr, calibP4.phi(), calibP4.M() );
77 calibP4.SetPxPyPzE( TLVjet.Px(), TLVjet.Py(), TLVjet.Pz(), TLVjet.E() );
78 ATH_MSG_DEBUG(
"JES = "<<jesCorrection <<
" e="<<varE <<
" eta="<<jetStartP4.Eta()<<
" ieta="<< ieta <<
" post_pt= ="<< calibP4.Pt() <<
" etaCorr="<< etaCorr);
82 jet->setJetP4(calibP4);
85 return StatusCode::SUCCESS;
98 std::string jetAlgo=
static_cast<std::string
> (
m_jetAlgo);
102 for (
int i=0;
i<=90;
i++)
112 TString
key=Form(
"JES.%s_Bin%d",jetAlgo.c_str(),ieta);
123 const double Rcutoff =
getLogPolN(factors,Ecutoff);
125 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] );
134 ATH_MSG_ERROR(
"LowPtJESExtrapolationMethod==2 not supported yet");
140 key=Form(
"EtaCorr.%s_Bin%d",jetAlgo.c_str(),ieta);
147 key=Form(
"EmaxJES.%s_Bin%d",jetAlgo.c_str(),ieta);
166 std::string jetAlgo=
static_cast<std::string
> (
m_jetAlgo);
170 for (
int i=0;
i<=90;
i++)
183 ATH_MSG_ERROR(
"Only linear extrapolations are supported for p-splines currently. Please change the config file to reflect this");
193 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] );
199 TString
key=Form(
"EmaxJES.%s_Bin%d",jetAlgo.c_str(),ieta);
204 key=Form(
"EtaCorr.%s_Bin%d",jetAlgo.c_str(),ieta);
262 R = slope*(E_uncorr-Ecutoff)+Rcutoff;
264 else ATH_MSG_WARNING(
"Incorrect specification of low Pt JES extrapolation, please check the value of the LowPtJESExtrapolationMethod config flag.");
296 y += factors[
i]*TMath::Power(
log(
x),Int_t(
i));
305 if (
bin<=0)
return 0;
312 const double inv_x = 1. /
x;
314 y +=
i*factors[
i]*TMath::Power(
log(
x),Int_t(
i-1))*inv_x;
321 std::unique_ptr<TFile> tmpF(TFile::Open(
fileName.c_str() ));
322 TList *etajes_l =
static_cast<TList*
>( tmpF->Get(etajes_name.c_str()));
326 ATH_MSG_WARNING(
"Do not have the correct number of eta bins for " <<
fileName <<
"\t" << etajes_name <<
"\t" << etajes_l->GetSize() );
330 auto *pTH1 =
dynamic_cast<TH1*
>(etajes_l->At(
i));
331 if (not pTH1)
continue;
346 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,...
Gaudi::Property< std::string > m_jetInScale
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< std::string > m_jetOutScale
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