|
ATLAS Offline Software
|
#include <EtaJESCorrection.h>
Definition at line 26 of file EtaJESCorrection.h.
◆ EtaJESCorrection() [1/2]
EtaJESCorrection::EtaJESCorrection |
( |
| ) |
|
◆ EtaJESCorrection() [2/2]
EtaJESCorrection::EtaJESCorrection |
( |
const std::string & |
name, |
|
|
TEnv * |
config, |
|
|
TString |
jetAlgo, |
|
|
TString |
calibAreaTag, |
|
|
bool |
mass, |
|
|
bool |
dev |
|
) |
| |
◆ ~EtaJESCorrection()
EtaJESCorrection::~EtaJESCorrection |
( |
| ) |
|
|
virtual |
◆ calibrate()
Implements JetCalibrationStep.
Definition at line 224 of file EtaJESCorrection.cxx.
228 jetStartP4 =
jet.jetP4();
232 float detectorEta =
jet.getAttribute<
float>(
"DetectorEta");
236 const double etaCorr = calibP4.eta() +
getEtaCorr( calibP4.e(), detectorEta );
239 else{ massCorr = jetStartP4.mass()*
getMassCorr(calibP4.e(), detectorEta); }
240 TLorentzVector TLVjet;
241 TLVjet.SetPtEtaPhiM( calibP4.P()/cosh(etaCorr),etaCorr,calibP4.phi(),massCorr );
242 calibP4.SetPxPyPzE( TLVjet.Px(), TLVjet.Py(), TLVjet.Pz(), TLVjet.E() );
245 float JESFactor = calibP4.e()/jetStartP4.e();
246 jet.setAttribute<
float>(
"JetJESCalibFactor",JESFactor);
251 jet.setJetP4( calibP4 );
253 return StatusCode::SUCCESS;
◆ getEtaBin()
int EtaJESCorrection::getEtaBin |
( |
double |
eta_det | ) |
const |
|
private |
◆ getEtaCorr()
double EtaJESCorrection::getEtaCorr |
( |
double |
E_corr, |
|
|
double |
eta_det |
|
) |
| const |
|
private |
◆ getJES()
double EtaJESCorrection::getJES |
( |
double |
E_uncorr, |
|
|
double |
eta_det |
|
) |
| const |
|
private |
◆ getLogPolN()
double EtaJESCorrection::getLogPolN |
( |
const double * |
factors, |
|
|
double |
x |
|
) |
| const |
|
private |
◆ getLogPolNSlope()
double EtaJESCorrection::getLogPolNSlope |
( |
const double * |
factors, |
|
|
double |
x |
|
) |
| const |
|
private |
◆ getLowPtJES()
double EtaJESCorrection::getLowPtJES |
( |
double |
E_uncorr, |
|
|
double |
eta_det |
|
) |
| const |
|
private |
Definition at line 298 of file EtaJESCorrection.cxx.
310 double R = slope*(E_uncorr-Ecutoff)+Rcutoff;
318 else ATH_MSG_WARNING(
"Incorrect specification of low Pt JES extrapolation, please check the value of the LowPtJESExtrapolationMethod config flag.");
◆ getMassCorr()
double EtaJESCorrection::getMassCorr |
( |
double |
E_corr, |
|
|
double |
eta_det |
|
) |
| const |
|
private |
◆ getNominalResolutionData()
StatusCode JetCalibrationStep::getNominalResolutionData |
( |
const xAOD::Jet & |
, |
|
|
double & |
|
|
) |
| const |
|
virtualinherited |
◆ getNominalResolutionMC()
StatusCode JetCalibrationStep::getNominalResolutionMC |
( |
const xAOD::Jet & |
, |
|
|
double & |
|
|
) |
| const |
|
virtualinherited |
◆ getSplineCorr()
double EtaJESCorrection::getSplineCorr |
( |
const int |
etaBin, |
|
|
double |
E |
|
) |
| const |
|
private |
◆ getSplineSlope()
double EtaJESCorrection::getSplineSlope |
( |
const int |
ieta, |
|
|
const double |
minE |
|
) |
| const |
|
private |
◆ initialize()
StatusCode EtaJESCorrection::initialize |
( |
| ) |
|
|
overridevirtual |
Implements JetCalibrationStep.
Definition at line 34 of file EtaJESCorrection.cxx.
40 return StatusCode::FAILURE;
45 TString absoluteJESCalibFile =
m_config->GetValue(
"AbsoluteJES.CalibFile",
"");
47 absoluteJESCalibFile.Remove(0,33);
48 absoluteJESCalibFile.Insert(0,
"JetCalibTools/");
52 m_config->ReadFile(calibFile, kEnvLocal);
53 ATH_MSG_INFO(
"Reading absolute calibration factors from: " << calibFile);
76 for (
int i=0;
i<=90;
i++)
79 else if (
etaBins.empty()) {
ATH_MSG_FATAL(
"JES.EtaBins incorrectly specified");
return StatusCode::FAILURE; }
82 return StatusCode::FAILURE;
90 else {
ATH_MSG_FATAL(
"You can't apply the mass correction unless you specify ApplyMassCorrection: true in the configuration file!");
return StatusCode::FAILURE; }
99 if (m_nPar<s_nParMin || m_nPar>
s_nParMax) {
ATH_MSG_FATAL(
"Cannot read JES calib constants " <<
key );
return StatusCode::FAILURE; }
113 const double Rcutoff =
getLogPolN(factors,Ecutoff);
115 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] );
125 const double Param1 = (2/Ecutoff)*(Rcutoff-
h)-Slope;
126 const double Param2 = (0.5/Ecutoff)*(Slope-Param1);
128 if( Param1 < 0 || Param1 + 2*Param2*Ecutoff < 0)
ATH_MSG_FATAL(
"Polynomial extension to calibration curve below minimum ET is not monotonically increasing for etabin " << ieta <<
", eta = " <<
etaBins[ieta] );
136 TString
key=Form(
"EtaCorr.%s_Bin%d",
m_jetAlgo.Data(),ieta);
146 if (
params.size()!=1) {
ATH_MSG_FATAL(
"Cannot read starting energy for the freezing of JES correction " <<
key );
return StatusCode::FAILURE; }
160 TString absoluteJESCalibHists =
m_config->GetValue(
"AbsoluteJES.CalibHists",
"");
162 absoluteJESCalibHists.Remove(0,33);
163 absoluteJESCalibHists.Insert(0,
"JetCalibTools/");
173 ATH_MSG_ERROR(
"Only linear extrapolations are supported for p-splines currently. Please change the config file to reflect this");
174 return StatusCode::FAILURE;
189 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 return StatusCode::SUCCESS;
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ loadSplineHists()
void EtaJESCorrection::loadSplineHists |
( |
const TString & |
fileName, |
|
|
const std::string & |
etajes_name = "etaJes" |
|
) |
| |
|
private |
Loads the calib constants from histograms in TFile named fileName.
Definition at line 204 of file EtaJESCorrection.cxx.
206 std::unique_ptr<TFile> tmpF(TFile::Open(
fileName ));
207 TList *etajes_l =
static_cast<TList*
>( tmpF->Get(etajes_name.c_str()));
211 ATH_MSG_WARNING(
"Do not have the correct number of eta bins for " <<
fileName <<
"\t" << etajes_name <<
"\t" << etajes_l->GetSize() );
215 auto *pTH1 =
dynamic_cast<TH1*
>(etajes_l->At(
i));
216 if (not pTH1)
continue;
◆ msg() [1/2]
MsgStream & asg::AsgMessaging::msg |
( |
| ) |
const |
|
inherited |
The standard message stream.
- Returns
- A reference to the default message stream of this object.
Definition at line 49 of file AsgMessaging.cxx.
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
54 #endif // not XAOD_STANDALONE
◆ msg() [2/2]
MsgStream & asg::AsgMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
The standard message stream.
- Parameters
-
lvl | The message level to set the stream to |
- Returns
- A reference to the default message stream, set to level "lvl"
Definition at line 57 of file AsgMessaging.cxx.
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
63 #endif // not XAOD_STANDALONE
◆ msgLvl()
bool asg::AsgMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inherited |
Test the output level of the object.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicting if messages at given level will be printed
-
true
If messages at level "lvl" will be printed
Definition at line 41 of file AsgMessaging.cxx.
42 #ifndef XAOD_STANDALONE
43 return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45 return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ setStartP4()
StatusCode JetCalibrationStep::setStartP4 |
( |
xAOD::Jet & |
jet | ) |
const |
|
protectedvirtualinherited |
Definition at line 21 of file JetCalibrationStep.cxx.
24 return StatusCode::SUCCESS;
27 return StatusCode::SUCCESS;
30 return StatusCode::FAILURE;
◆ setUnitsGeV()
virtual void JetCalibrationStep::setUnitsGeV |
( |
bool |
useGeV | ) |
|
|
inlinevirtualinherited |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_applyMassCorrection
bool EtaJESCorrection::m_applyMassCorrection {} |
|
private |
◆ m_calibAreaTag
TString EtaJESCorrection::m_calibAreaTag |
|
private |
◆ m_config
TEnv* EtaJESCorrection::m_config {} |
|
private |
◆ m_dev
bool EtaJESCorrection::m_dev {} |
|
private |
◆ m_energyFreezeJES
double EtaJESCorrection::m_energyFreezeJES[s_nEtaBins] ={} |
|
private |
◆ m_etaBinAxis
TAxis* EtaJESCorrection::m_etaBinAxis {} |
|
private |
◆ m_etaCorrFactors
◆ m_etajesFactors
std::vector<std::unique_ptr<TH1> > EtaJESCorrection::m_etajesFactors |
|
private |
◆ m_etaSecondaryminPt_JES
double EtaJESCorrection::m_etaSecondaryminPt_JES {} |
|
private |
◆ m_freezeJESatHighE
bool EtaJESCorrection::m_freezeJESatHighE {} |
|
private |
◆ m_GeV
double JetCalibrationStep::m_GeV |
|
protectedinherited |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_isSpline
bool EtaJESCorrection::m_isSpline {} |
|
private |
◆ m_JES_MinPt_E
double EtaJESCorrection::m_JES_MinPt_E[s_nEtaBins] ={} |
|
private |
◆ m_JES_MinPt_Param1
double EtaJESCorrection::m_JES_MinPt_Param1[s_nEtaBins] ={} |
|
private |
◆ m_JES_MinPt_Param2
double EtaJESCorrection::m_JES_MinPt_Param2[s_nEtaBins] {} |
|
private |
◆ m_JES_MinPt_R
double EtaJESCorrection::m_JES_MinPt_R[s_nEtaBins] ={} |
|
private |
◆ m_JES_MinPt_Slopes
double EtaJESCorrection::m_JES_MinPt_Slopes[s_nEtaBins] ={} |
|
private |
◆ m_jesDesc
TString EtaJESCorrection::m_jesDesc |
|
private |
◆ m_JESFactors
◆ m_jetAlgo
TString EtaJESCorrection::m_jetAlgo |
|
private |
◆ m_jetStartScale
std::string JetCalibrationStep::m_jetStartScale |
|
protectedinherited |
◆ m_JMSFactors
◆ m_lowPtExtrap
unsigned int EtaJESCorrection::m_lowPtExtrap {} |
|
private |
◆ m_lowPtMinR
double EtaJESCorrection::m_lowPtMinR {} |
|
private |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_mass
bool EtaJESCorrection::m_mass {} |
|
private |
◆ m_maxE_EtaCorr
double EtaJESCorrection::m_maxE_EtaCorr {} |
|
private |
◆ m_minPt_EtaCorr
double EtaJESCorrection::m_minPt_EtaCorr {} |
|
private |
◆ m_minPt_JES
double EtaJESCorrection::m_minPt_JES {} |
|
private |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_name
std::string JetCalibrationStep::m_name |
|
protectedinherited |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_nPar
unsigned int EtaJESCorrection::m_nPar {} |
|
private |
◆ m_secondaryminPt_JES
double EtaJESCorrection::m_secondaryminPt_JES {} |
|
private |
◆ m_useSecondaryminPt_JES
bool EtaJESCorrection::m_useSecondaryminPt_JES {} |
|
private |
◆ s_nEtaBins
const unsigned int EtaJESCorrection::s_nEtaBins =90 |
|
staticprivate |
◆ s_nParMax
const unsigned int EtaJESCorrection::s_nParMax =9 |
|
staticprivate |
◆ s_nParMin
const unsigned int EtaJESCorrection::s_nParMin =7 |
|
staticprivate |
The documentation for this class was generated from the following files:
void loadSplineHists(const TString &fileName, const std::string &etajes_name="etaJes")
Loads the calib constants from histograms in TFile named fileName.
std::atomic< MSG::Level > m_lvl
Current logging level.
double getLogPolN(const double *factors, double x) const
virtual StatusCode setStartP4(xAOD::Jet &jet) const
double getEtaCorr(double E_corr, double eta_det) const
double getLogPolNSlope(const double *factors, double x) const
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
std::vector< std::unique_ptr< TH1 > > m_etajesFactors
JetCalibrationStep(const char *name="JetCalibrationStep")
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
double m_JES_MinPt_Param1[s_nEtaBins]
double getSplineCorr(const int etaBin, double E) const
double m_JES_MinPt_Param2[s_nEtaBins]
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
double m_energyFreezeJES[s_nEtaBins]
double getSplineSlope(const int ieta, const double minE) const
static const unsigned int s_nEtaBins
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
static const unsigned int s_nParMax
std::string m_jetStartScale
double m_JES_MinPt_E[s_nEtaBins]
double m_secondaryminPt_JES
double m_etaCorrFactors[s_nEtaBins][s_nParMax]
double m_JES_MinPt_Slopes[s_nEtaBins]
double m_JMSFactors[s_nEtaBins][s_nParMax]
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
double getLowPtJES(double E_uncorr, double eta_det) const
double getMassCorr(double E_corr, double eta_det) const
#define ATH_MSG_WARNING(x)
std::string m_nm
Message source name.
VecD VectorizeD(const TString &str, const TString &sep=" ")
double m_etaSecondaryminPt_JES
bool m_applyMassCorrection
bool m_useSecondaryminPt_JES
double getJES(double E_uncorr, double eta_det) const
int getEtaBin(double eta_det) const
double m_JES_MinPt_R[s_nEtaBins]
unsigned int m_lowPtExtrap
double m_JESFactors[s_nEtaBins][s_nParMax]