Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
37 std::unique_ptr<TFile>
file(TFile::Open(
fullPath.c_str(),
"READ"));
40 return StatusCode::FAILURE;
44 std::string
key =
"etaBinning";
47 histo->SetDirectory(
nullptr);
52 return StatusCode::FAILURE;
58 TString tmpSlopKey[
s_nProngBins] = {
"slopeNPV1P",
"slopeNPV3P"};
59 TString tmpFuncBase[
s_nProngBins] = {
"OneP_Eta_",
"MultiP_Eta_"};
71 histo =
dynamic_cast<TH1*
>(
file->Get(tmpSlopKey[
i]));
73 histo->SetDirectory(
nullptr);
77 ATH_MSG_FATAL(
"Failed to get an object with key " << tmpSlopKey[
i]);
78 return StatusCode::FAILURE;
82 TString
key = tmpFuncBase[
i];
84 TF1* fcn =
dynamic_cast<TF1*
>(
file->Get(
key));
90 return StatusCode::FAILURE;
99 return StatusCode::SUCCESS;
109 if ( tau_p4.Pt() <= 0.) {
110 ATH_MSG_DEBUG(
"tau energy at LC scale is " << tau_p4.Pt()/
GeV <<
"--> set energy=0.001");
111 tau.
setP4(0.001, tau_p4.Eta(), tau_p4.Phi(), tau.
m());
113 return StatusCode::SUCCESS;
118 if (tau.
nTracks() <= 1) prongBin = 0;
120 double absEta = std::abs( tau_p4.Eta() );
121 int etaBin = std::as_const(*m_etaBinHist).GetXaxis()->FindBin(
absEta) - 1;
135 nVertex = eventInfoDecorHandle(0);
136 ATH_MSG_DEBUG(
"AvgInteractions object in tau candidate = " << nVertex);
141 if (!vertexInHandle.
isValid()) {
142 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << vertexInHandle.
key());
143 return StatusCode::FAILURE;
146 for (
const auto *
const vertex : *vxContainer) {
154 double calibConst = 1.;
160 double energyLC = tau_p4.Pt()/
GeV;
162 if (energyLC -
offset <= 0.) {
163 ATH_MSG_DEBUG(
"after pile-up correction energy would be = " << energyLC -
offset <<
" --> setting offset=0 now!");
168 double energyPileupCorr = energyLC -
offset;
170 if (energyPileupCorr > 0. and energyPileupCorr < 10000.)
174 if (calibConst <= 0.) {
184 double energyFinal = energyPileupCorr / calibConst;
188 tau.
setP4( energyFinal *
GeV, tau_p4.Eta(), tau_p4.Phi(), tau.
m());
190 ATH_MSG_DEBUG(
"Energy at LC scale = " << energyLC <<
" pile-up offset " <<
offset <<
" calib. const. = " << calibConst <<
" final energy = " << energyFinal);
192 return StatusCode::SUCCESS;
const_pointer_type cptr()
Dereference the pointer.
virtual double eta() const
The pseudorapidity ( ) of the particle.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double m() const
The invariant mass of the particle.
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
static const int s_nProngBins
bool isPresent() const
Is the referenced container present in SG?
SG::ReadDecorHandleKey< xAOD::EventInfo > m_aveIntPerXKey
void setP4(double pt, double eta, double phi, double m)
Set methods for IParticle values.
TauCalibrateLC(const std::string &name="TauCalibrateLC")
virtual double pt() const
The transverse momentum ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
std::unique_ptr< TH1 > m_etaBinHist
Handle class for reading a decoration on an object.
virtual StatusCode initialize() override
Tool initializer.
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexInputContainer
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a tau jet.
virtual StatusCode execute(xAOD::TauJet &tau) const override
Execute - called for each tau candidate.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::vector< std::unique_ptr< TH1 > > m_slopeNPVHist
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
#define ATH_MSG_WARNING(x)
virtual FourMom_t p4() const
The full 4-momentum of the particle.
bool absEta(const xAOD::TauJet &tau, double &out)
std::string m_calibrationFile
bool m_doVertexCorrection
std::vector< std::vector< std::unique_ptr< TF1 > > > m_calibFunc