ATLAS Offline Software
Loading...
Searching...
No Matches
PseudoJetGetter Namespace Reference

Implementations of concrete input-to-PseudoJet conversions Separated from PseudoJetAlgorithm for readability. More...

Classes

struct  EMTopoRejecter
struct  IParticleRejecter
struct  PFlowRejecter

Functions

std::vector< fastjet::PseudoJet > IParticlesToPJs (const xAOD::IParticleContainer &ips, bool skipNegativeEnergy)
std::vector< fastjet::PseudoJet > EMToposToPJs (const xAOD::IParticleContainer &ips, bool skipNegativeEnergy)
std::vector< fastjet::PseudoJet > PFlowsToPJs (const xAOD::IParticleContainer &ips, bool skipNegativeEnergy, bool useChargedPFOs, bool useNeutralPFOs, bool useChargedPV, bool useChargedPUsideband, bool isUFO)
std::vector< fastjet::PseudoJet > ByVertexPFlowsToPJs (const xAOD::IParticleContainer &ips, const xAOD::VertexContainer *pvs, bool skipNegativeEnergy, bool useChargedPFOs, bool useNeutralPFOs, bool isUFO)

Detailed Description

Implementations of concrete input-to-PseudoJet conversions Separated from PseudoJetAlgorithm for readability.

IParticle is the generic type that is normally assumed. Special treatment is needed for two cases:

  • EMTopo clusters will be converted at the uncalibrated cluster scale – this is mostly obsolete in offline reco but used by trigger for the moment
  • ParticleFlowObjects that are charged will be filtered out if they are not matched to the primary vertex

Function Documentation

◆ ByVertexPFlowsToPJs()

std::vector< fastjet::PseudoJet > PseudoJetGetter::ByVertexPFlowsToPJs ( const xAOD::IParticleContainer & ips,
const xAOD::VertexContainer * pvs,
bool skipNegativeEnergy,
bool useChargedPFOs,
bool useNeutralPFOs,
bool isUFO )

Definition at line 217 of file PseudoJetGetter.h.

217 {
218
219 const static SG::AuxElement::Accessor< unsigned > copyIndex("ConstituentCopyIndex"); // For neutral PFOs
220 const static SG::AuxElement::Accessor< std::vector<unsigned> > matchedPVs("MatchingPVs"); // For charged PFOs
221 const static SG::AuxElement::Accessor< std::vector<unsigned> > matchedPUSBs("MatchingPUsidebands"); // For charged PFOs
222 PFlowRejecter rejecter(skipNegativeEnergy, useChargedPFOs, useNeutralPFOs, false, false, isUFO);
223 std::vector<fastjet::PseudoJet> vpj;
224 int index = -1;
225
226 // loop over the input iparticles, select and convert to pseudojets
227 for(const xAOD::IParticle* ip: ips) {
228
229 const xAOD::FlowElement* pfo = dynamic_cast<const xAOD::FlowElement*>(ip);
230 ++index;
231 if(rejecter(ip)){
232 continue;
233 }
234
235 unsigned vertexIndex{0};
236 if (pfo->isCharged())
237 {
238 // Charged PFOs - use the vertex matched to the track
239 if (matchedPVs.isAvailable(*pfo) && matchedPVs(*pfo).size())
240 {
241 // A charged PFO can potentially match multiple vertices, depending on the matching criteria used
242 // For now, just use the first match, to be further optimised later -- TODO
243 // Also add the part for PU sidebands -- TODO
244 vertexIndex = matchedPVs(*pfo).at(0);
245 }
246 else{
247 continue;
248 }
249 }
250 else
251 {
252 // Neutral PFOs - there is one neutral PFO corrected to point to each vertex of interest
253 // As such, just get the vertex index that this neutral PFO corresponds to
254 if (copyIndex.isAvailable(*pfo)){
255 vertexIndex = copyIndex(*pfo);
256 }
257 else{
258 continue;
259 }
260 }
261
262 // Create a Pseudojet with the momentum of the selected IParticles.
263 fastjet::PseudoJet psj(ip->p4());
264
265
266 // Get the specified vertex and build the VertexIndexedConstituentUserInfo
267 for (const xAOD::Vertex* vertex : *pvs)
268 if (vertex->index() == vertexIndex){
269 // vertex indexed constituent info associated to the pseudojet
270 psj.set_user_info(new jet::VertexIndexedConstituentUserInfo(vertex));
271
272 // user index is used to identify the xAOD object used for the PSeudoJet
273 psj.set_user_index(index);
274
275 vpj.push_back(psj);
276 }
277 }
278 return vpj;
279 }
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
Class providing the definition of the 4-vector interface.
Definition index.py:1
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition FlowElement.h:16
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ EMToposToPJs()

std::vector< fastjet::PseudoJet > PseudoJetGetter::EMToposToPJs ( const xAOD::IParticleContainer & ips,
bool skipNegativeEnergy )

Definition at line 88 of file PseudoJetGetter.h.

88 {
89
90 // helper objects for selecting iparticles to be converted to pseudojets
91 IParticleRejecter ipRejecter(skipNegativeEnergy);
92 EMTopoRejecter emRejecter;
93
94 std::vector<fastjet::PseudoJet> vpj;
95 int index = -1;
96
97 // loop over iparticles, select and convert to pseudojets
98
99 for(const xAOD::IParticle* ip: ips) {
100 ++index;
101 if(ipRejecter(ip) or emRejecter(ip)){continue;}
102
103 // Create a Pseudojet with the momentum of the cluster.
104 fastjet::PseudoJet
106
107 // user index is used to identify the xAOD object used for the PseudoJet
108 psj.set_user_index(index);
109 vpj.push_back(psj);
110 }
111 return vpj;
112 }
virtual FourMom_t p4() const
The full 4-momentum of the particle.
const xAOD::CaloCluster * cluster

◆ IParticlesToPJs()

std::vector< fastjet::PseudoJet > PseudoJetGetter::IParticlesToPJs ( const xAOD::IParticleContainer & ips,
bool skipNegativeEnergy )

Definition at line 51 of file PseudoJetGetter.h.

51 {
52
53 IParticleRejecter rejecter(skipNegativeEnergy);
54
55 std::vector<fastjet::PseudoJet> vpj;
56 int index = -1;
57
58 // loop over the input iparticles, select and convert to pseudojets
59 for(const xAOD::IParticle* ip: ips) {
60 ++index;
61 if(rejecter(ip)){continue;}
62
63 // Create a Pseudojet with the momentum of the selected IParticles.
64 fastjet::PseudoJet psj(ip->p4());
65
66 // user index is used to identify the xAOD object used for the PseudoJet
67 psj.set_user_index(index);
68 vpj.push_back(psj);
69
70 }
71 return vpj;
72 }

◆ PFlowsToPJs()

std::vector< fastjet::PseudoJet > PseudoJetGetter::PFlowsToPJs ( const xAOD::IParticleContainer & ips,
bool skipNegativeEnergy,
bool useChargedPFOs,
bool useNeutralPFOs,
bool useChargedPV,
bool useChargedPUsideband,
bool isUFO )

Definition at line 193 of file PseudoJetGetter.h.

193 {
194
195 PFlowRejecter rejecter(skipNegativeEnergy, useChargedPFOs, useNeutralPFOs, useChargedPV, useChargedPUsideband, isUFO);
196 std::vector<fastjet::PseudoJet> vpj;
197 int index = -1;
198
199 // loop over the input iparticles, select and convert to pseudojets
200
201 for(const xAOD::IParticle* ip: ips) {
202 ++index;
203 if(rejecter(ip)){continue;}
204
205 // Create a PSeudojet with the momentum of the selected IParticles.
206 fastjet::PseudoJet psj(ip->p4());
207
208 // user index is used to identify the xAOD object used for the PSeudoJet
209 psj.set_user_index(index);
210
211 vpj.push_back(psj);
212 }
213 return vpj;
214 }