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;
171 if (!PVMatchedAcc.isAvailable(*pfe)){
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());
219 double weight = puppi.getWeight(pj);
220 double alpha = puppi.getAlpha(pj);
223 alphaAcc(*pfe) = alpha;
230 return StatusCode::SUCCESS;