![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
42 ATH_MSG_ERROR(
"JetVertexTaggerTool needs to have its input jet container configured!");
43 return StatusCode::FAILURE;
51 std::unique_ptr<TFile> jvtfile {TFile::Open(
m_fn)};
54 return StatusCode::FAILURE;
61 ATH_MSG_FATAL(
"\n Found JVT file, but JVT histogram missing. Aborting..." );
62 return StatusCode::FAILURE;
74 #ifndef XAOD_STANDALONE
94 return StatusCode::SUCCESS;
107 if(!HSvertex)
return StatusCode::FAILURE;
128 ATH_MSG_ERROR(
"OriginVertex was requested, but the jet does not contain an OriginVertex");
129 return StatusCode::FAILURE;
139 float jvfcorr = jvfCorrHandle(*
jet);
140 std::vector<float> sumpttrk = sumPtTrkHandle(*
jet);
141 const float rpt = sumpttrk[HSvertex->
index() - (*vertices)[0]->index()]/
jet->pt();
144 rptHandle(*
jet) = rpt;
145 jvtHandle(*
jet) = jvt;
146 ATH_MSG_VERBOSE(
"JetVertexTaggerTool " <<
name() <<
": JVT=" << jvt <<
", RpT=" << rpt <<
", JVFCorr=" << jvfcorr);
155 std::vector<float> jvtVtx;
156 std::vector<float> rptVtx;
161 std::vector<float> sumpttrk = sumPtTrkHandle(*
jet);
162 std::vector<float> jvfcorrVtx = jvfCorrVtxHandle(*
jet);
165 for(
size_t vtxi=0; vtxi<vertices->
size(); ++vtxi) {
167 float jvfcorr = jvfcorrVtx.at(vtxi);
168 const float rpt = sumpttrk[vtxi]/
jet->pt();
170 jvtVtx.push_back(jvt);
171 rptVtx.push_back(rpt);
174 jvtVecHandle(*
jet) = jvtVtx;
175 rptVecHandle(*
jet) = rptVtx;
180 return StatusCode::SUCCESS;
187 if ( jvfcorr == -1.0 ) {
190 float rpt_inputtojvt =
std::min(rpt, (
float) 1. );
191 int bin = std::as_const(
m_jvthisto)->FindBin(jvfcorr, rpt_inputtojvt);
193 jvt =
m_jvthisto->Interpolate(jvfcorr, rpt_inputtojvt);
204 float jvfcorr = jvfCorrHandle(
jet);
205 std::vector<float> sumpttrk = sumPtTrkHandle(
jet);
219 ATH_MSG_ERROR(
"No hard scatter vertex found. Returning JVT=-1");
227 const float rptnew = sumpttrk[HSvertex->
index() - (*vertices)[0]->index()]/
jet.pt();
245 if (vertices->
empty() ) {
250 for (
size_t iVertex = 0; iVertex < vertices->
size(); ++iVertex ) {
253 ATH_MSG_VERBOSE(
"JetVertexTaggerTool " <<
name() <<
" Found HS vertex at index: "<< iVertex);
254 return vertices->
at(iVertex);
257 ATH_MSG_VERBOSE(
"There is no vertex of type PriVx. Taking default vertex.");
258 return vertices->
at(0);
SG::ReadDecorHandleKey< xAOD::JetContainer > m_jvfCorrKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_jvfCorrVtxKey
Gaudi::Property< std::string > m_jetContainerName
const_pointer_type cptr()
Dereference the pointer.
Gaudi::Property< std::string > m_jvtlikelihoodHistName
SG::ReadDecorHandleKey< xAOD::JetContainer > m_sumPtTrkKey
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
Gaudi::Property< bool > m_useOriginVertex
SG::WriteDecorHandleKey< xAOD::JetContainer > m_rptKey
#define ATH_MSG_VERBOSE(x)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_rptVecKey
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Handle class for reading a decoration on an object.
virtual ~JetVertexTaggerTool()
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtVecKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_jvtKey
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Gaudi::Property< std::string > m_jvtfileName
size_t index() const
Return the index of this element within its container.
double GetBinContent(int) const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
float evaluateJvt(float rpt, float jvfcorr) const
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
virtual StatusCode decorate(const xAOD::JetContainer &jetCont) const override
Decorate a jet collection without otherwise modifying it.
Gaudi::Property< bool > m_suppressInputDeps
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
const xAOD::Vertex * findHSVertex() const
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
const T * at(size_type n) const
Access an element, as an rvalue.
float updateJvt(const xAOD::Jet &jet) const override
Calculate the updated JVT.
size_type size() const noexcept
Returns the number of elements in the collection.
StatusCode initialize() override
Dummy implementation of the initialisation function.
bool empty() const noexcept
Returns true if the collection is empty.
JetVertexTaggerTool(const std::string &name)