 |
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");
139 key=Form(
"EtaCorr.%s_Bin%d",jetAlgo.c_str(),ieta);
146 key=Form(
"EmaxJES.%s_Bin%d",jetAlgo.c_str(),ieta);
165 std::string jetAlgo=
static_cast<std::string
> (
m_jetAlgo);
169 for (
int i=0;
i<=90;
i++)
182 ATH_MSG_ERROR(
"Only linear extrapolations are supported for p-splines currently. Please change the config file to reflect this");
192 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] );
198 TString
key=Form(
"EmaxJES.%s_Bin%d",jetAlgo.c_str(),ieta);
203 key=Form(
"EtaCorr.%s_Bin%d",jetAlgo.c_str(),ieta);
261 R = slope*(E_uncorr-Ecutoff)+Rcutoff;
263 else ATH_MSG_WARNING(
"Incorrect specification of low Pt JES extrapolation, please check the value of the LowPtJESExtrapolationMethod config flag.");
295 y += factors[
i]*TMath::Power(
log(
x),Int_t(
i));
304 if (
bin<=0)
return 0;
311 const double inv_x = 1. /
x;
313 y +=
i*factors[
i]*TMath::Power(
log(
x),Int_t(
i-1))*inv_x;
320 std::unique_ptr<TFile> tmpF(TFile::Open(
fileName.c_str() ));
321 TList *etajes_l =
static_cast<TList*
>( tmpF->Get(etajes_name.c_str()));
325 ATH_MSG_WARNING(
"Do not have the correct number of eta bins for " <<
fileName <<
"\t" << etajes_name <<
"\t" << etajes_l->GetSize() );
329 auto *pTH1 =
dynamic_cast<TH1*
>(etajes_l->At(
i));
330 if (not pTH1)
continue;
345 double slope = (rSecond - rFirst) /
binWidth;
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
double m_JES_MinPt_Slopes[s_nEtaBins]
Gaudi::Property< std::string > m_constantFileName
name of the text file
double getSplineSlope(const int ieta, const double minE) const
double m_etaCorrFactors[s_nEtaBins][s_nParMax]
int getEtaBin(double eta_det) const
Class JetContext Designed to read AOD information related to the event, N vertices,...
void loadSplineHists(const std::string &fileName, const std::string &etajes_name)
void setAttribute(SG::AuxElement &p, const TYPE &v) const
Gaudi::Property< std::string > m_jetInScale
bool readMCJESFromHists()
Gaudi::Property< float > m_minPt_EtaCorr
std::vector< std::unique_ptr< TH1 > > m_etajesFactors
#define ATH_MSG_VERBOSE(x)
double m_JES_MinPt_E[s_nEtaBins]
Gaudi::Property< std::string > m_jetOutScale
Gaudi::Property< std::vector< double > > m_etaBins
Eta bins if other than 0.1 steps from -4.5 to 4.5.
Gaudi::Property< float > m_lowPtExtrap
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
double getLogPolNSlope(const double *factors, double x) const
double m_energyFreezeJES[s_nEtaBins]
::StatusCode StatusCode
StatusCode definition for legacy code.
double getEtaCorr(double X, double Y=0) const
return Eta correction
virtual StatusCode calibrate(xAOD::JetContainer &) const override
Apply calibration to a jet container.
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Gaudi::Property< bool > m_freezeJESatHighE
EtaJESCalibStep(const std::string &name="EtaJESCalibStep")
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
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 getLowPtJES(double E_uncorr, double eta_det) const
deal with low pt jets
Gaudi::Property< std::string > m_histoFileName
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Gaudi::Property< float > m_minPt_JES
double getEmaxJES(const double Y) const
return Emax
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_useSpline
double m_JES_MinPt_R[s_nEtaBins]
double getLogPolN(const double *factors, double x) const
VecD VectorizeD(const TString &str, const TString &sep=" ")
Gaudi::Property< float > m_maxE_EtaCorr
double m_JESFactors[s_nEtaBins][s_nParMax]
double getSplineCorr(const int etaBin, double E) const
double getJES(const double X, const double Y=0, const double Emax=-1) const
return MCJES calibration factor
Gaudi::Property< std::string > m_jetAlgo
jet collection to be calibrated
ToolHandle< JetHelper::IVarTool > m_vartoolE