|
ATLAS Offline Software
|
Go to the documentation of this file.
15 m_weightPFOTool(
"",this) {
29 "Datahandle key for the primary vertex container");
35 return StatusCode::FAILURE;
38 ATH_MSG_ERROR(
"CorrectPFOTool requires PFO inputs. It cannot operate on objects of type "
40 return StatusCode::FAILURE;
48 return StatusCode::SUCCESS;
57 ATH_MSG_ERROR(
"CorrectPFOTool received FlowElements that aren't PFOs");
58 return StatusCode::FAILURE;
69 if (!handle.isValid()){
82 for (
const auto *theVertex : *pvtxs) {
89 ATH_MSG_DEBUG(
"Could not find a primary vertex in this event " );
90 for (
const auto *theVertex : *pvtxs) {
107 ATH_MSG_ERROR(
"Primary vertex container was empty or no valid vertex found!");
108 return StatusCode::FAILURE;
110 ATH_MSG_VERBOSE(
"No genuine primary vertex found. Will not apply origin correction");
116 if ( std::abs(ppfo->charge())<FLT_MIN) {
127 return StatusCode::SUCCESS;
136 ATH_MSG_ERROR(
"Primary vertex container was empty or no valid vertex found!");
137 return StatusCode::FAILURE;
139 ATH_MSG_VERBOSE(
"No genuine primary vertex found. Will not apply origin correction");
145 if ( !ppfo->isCharged()) {
156 return StatusCode::SUCCESS;
163 if (!handle.isValid()){
165 return StatusCode::FAILURE;
170 ATH_MSG_WARNING(
" Failed to retrieve valid primary vertex container" );
171 return StatusCode::FAILURE;
176 if ( std::abs(ppfo->charge())<FLT_MIN) {
182 ATH_MSG_WARNING(
"Encountered a neutral per-vertex PFO object without the corresponding vertex index attribute");
186 const unsigned iVtx = copyIndex(*ppfo);
187 if (iVtx >= pvtxs->
size())
189 ATH_MSG_WARNING(
"Encountered a neutral per-vertex PFO object with an index beyond the size of the vertex container");
197 if (ppfo->e() < FLT_MIN) {
198 ppfo->setP4(0, 0, 0, 0);
201 ppfo->setP4(ppfo->GetVertexCorrectedFourVec(*vtx));
203 ppfo->setP4(ppfo->GetVertexCorrectedEMFourVec(*vtx));
214 return StatusCode::SUCCESS;
222 if (!handle.isValid()){
224 return StatusCode::FAILURE;
229 ATH_MSG_WARNING(
" Failed to retrieve valid primary vertex container" );
230 return StatusCode::FAILURE;
235 if ( !ppfo->isCharged()) {
239 if (!copyIndex.isAvailable(*ppfo))
241 ATH_MSG_WARNING(
"Encountered a neutral per-vertex PFO object without the corresponding vertex index attribute");
245 const unsigned iVtx = copyIndex(*ppfo);
246 if (iVtx >= pvtxs->
size())
248 ATH_MSG_WARNING(
"Encountered a neutral per-vertex PFO object with an index beyond the size of the vertex container");
256 if (ppfo->e() < FLT_MIN) {
257 ppfo->setP4(0, 0, 0, 0);
269 return StatusCode::SUCCESS;
274 if (pfo.
e() < FLT_MIN) {
289 return StatusCode::SUCCESS;
293 if (pfo.
e() < FLT_MIN) {
300 return StatusCode::SUCCESS;
310 return StatusCode::SUCCESS;
320 return StatusCode::SUCCESS;
virtual double pt() const
The transverse momentum ( ) of the particle.
Helper class to provide type-safe access to aux data.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double pt() const override
#define ATH_MSG_VERBOSE(x)
VxType::VertexType vertexType() const
The type of the vertex.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
TLorentzVector GetVertexCorrectedFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct 4-vector to point at a vertex.
FourMom_t p4EM() const
get EM scale 4-vector
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
virtual double e() const
The total energy of the particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
const T * front() const
Access the first element in the collection as an rvalue.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
@ ParticleFlow
The object is a particle-flow object.
Class describing a particle flow object.
virtual double e() const override
The total energy of the particle.
void setP4(const FourMom_t &vec)
set the 4-vec
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
void setP4(float pt, float eta, float phi, float m)
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
const T * at(size_type n) const
Access an element, as an rvalue.
TLorentzVector GetVertexCorrectedEMFourVec(const xAOD::Vertex &vertexToCorrectTo) const
Correct EM scale 4-vector to point at a vertex.
TLorentzVector getVertexCorrectedFourVec(const xAOD::FlowElement &fe, const xAOD::Vertex &vertexToCorrectTo)
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
A detector object made of other lower level object(s)