6#include "fastjet/PseudoJet.hh"
45 ATH_MSG_ERROR(
"Incompatible configuration: ApplyToNeutralPFO=False -- what kind of pileup do you wish to suppress?");
46 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
53 return StatusCode::SUCCESS;
61 return StatusCode::SUCCESS;
83 std::vector<fastjet::PseudoJet> chargedHSVector;
84 std::vector<fastjet::PseudoJet> chargedPUVector;
85 std::vector<fastjet::PseudoJet> neutralVector;
86 std::vector<fastjet::PseudoJet> forwardVector;
91 ATH_MSG_ERROR(
"Not known if PFO is matched to primary vertex. Run CorrectPFOTool before ChargedHadronSubtractionTool");
92 return StatusCode::FAILURE;
95 if (ppfo->pt()<=FLT_MIN)
continue;
97 fastjet::PseudoJet pj(ppfo->p4());
100 float charge = ppfo->charge();
103 if(fabs(ppfo->eta()) >
m_etaBoundary) forwardVector.push_back(pj);
106 bool matchedToPrimaryVertex=PVMatchedAcc(*ppfo);
107 if(matchedToPrimaryVertex) chargedHSVector.push_back(pj);
108 else chargedPUVector.push_back(pj);
110 else neutralVector.push_back(pj);
117 if (!handle.isValid()){
119 return StatusCode::FAILURE;
122 pvtxs = handle.cptr();
125 return StatusCode::FAILURE;
129 for(
const auto *vtx_itr : *pvtxs ){
130 if((
int)vtx_itr->nTrackParticles() < 2 )
continue;
135 puppi.
setParticles(chargedHSVector, chargedPUVector, neutralVector, forwardVector, nPV);
138 float charge = ppfo->charge();
142 fastjet::PseudoJet pj(ppfo->p4());
148 alphaAcc(*ppfo) = alpha;
149 weightAcc(*ppfo) = weight;
155 return StatusCode::SUCCESS;
164 std::vector<fastjet::PseudoJet> chargedHSVector;
165 std::vector<fastjet::PseudoJet> chargedPUVector;
166 std::vector<fastjet::PseudoJet> neutralVector;
167 std::vector<fastjet::PseudoJet> forwardVector;
172 ATH_MSG_ERROR(
"Not known if FlowElement is matched to primary vertex. Run CorrectPFOTool before ChargedHadronSubtractionTool");
173 return StatusCode::FAILURE;
176 if (pfe->pt()<=FLT_MIN)
continue;
178 fastjet::PseudoJet pj(pfe->p4());
180 if(fabs(pfe->eta()) >
m_etaBoundary) forwardVector.push_back(pj);
182 if(pfe->isCharged()){
183 bool matchedToPrimaryVertex=PVMatchedAcc(*pfe);
184 if(matchedToPrimaryVertex) chargedHSVector.push_back(pj);
185 else chargedPUVector.push_back(pj);
187 else neutralVector.push_back(pj);
194 if (!handle.isValid()){
196 return StatusCode::FAILURE;
199 pvtxs = handle.cptr();
202 return StatusCode::FAILURE;
206 for(
const auto *vtx_itr : *pvtxs ){
207 if((
int)vtx_itr->nTrackParticles() < 2 )
continue;
212 puppi.
setParticles(chargedHSVector, chargedPUVector, neutralVector, forwardVector, nPV);
217 fastjet::PseudoJet pj(pfe->p4());
222 if ((!(pfe->isCharged()) || isForward) &&
m_applyWeight) pfe->setP4(weight*pfe->p4());
223 alphaAcc(*pfe) = alpha;
224 weightAcc(*pfe) = weight;
230 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
bool isCharged(const T &p)
double charge(const T &p)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool empty() const noexcept
Returns true if the collection is empty.
JetConstituentModifierBase(const std::string &name)
void setParticles(const std::vector< fastjet::PseudoJet > &chargedHS, const std::vector< fastjet::PseudoJet > &chargedPU, const std::vector< fastjet::PseudoJet > &neutral, const std::vector< fastjet::PseudoJet > &forward, int nPU)
double getAlpha(const fastjet::PseudoJet &pfo)
double getWeight(const fastjet::PseudoJet &pfo)
SG::Accessor< T, ALLOC > Accessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
@ ParticleFlow
The object is a particle-flow object.
@ FlowElement
The object is a track-calo-cluster.
FlowElementContainer_v1 FlowElementContainer
Definition of the current "pfo container version".
PFO_v1 PFO
Definition of the current "pfo version".
PFOContainer_v1 PFOContainer
Definition of the current "pfo container version".
FlowElement_v1 FlowElement
Definition of the current "pfo version".
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.