ATLAS Offline Software
Loading...
Searching...
No Matches
JetParticleShrinkingConeAssociation.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5// author: cpollard@cern.ch
6
9
10using namespace std;
11using namespace xAOD;
12
22
23
24const vector<vector<ElementLink<IParticleContainer> > >*
26
27 vector<vector<ElementLink<IParticleContainer> > >* matchedparts =
28 new vector<vector<ElementLink<IParticleContainer> > >(jets.size());
29
30
31 for (xAOD::IParticleContainer::const_iterator part_itr = parts.begin();
32 part_itr != parts.end(); ++part_itr) {
33
34 const xAOD::IParticle& part = **part_itr;
35
36 double drmin = -1;
37 int matchjetidx = -1;
38 for (unsigned int iJet = 0; iJet < jets.size(); iJet++) {
39 const xAOD::Jet& jet = *jets[iJet];
40
41 double match_dr = coneSize(jet.pt());
42 double dr = jet.p4().DeltaR(part.p4());
43
44 if (dr > match_dr)
45 continue;
46
47 // if there is more than one matching jet, take the
48 // closest
49 if (drmin < 0 || dr < drmin) {
50 drmin = dr;
51 matchjetidx = iJet;
52 }
53 }
54
55
56 if (matchjetidx >= 0) {
58 EL.toContainedElement(parts, *part_itr);
59 (*matchedparts)[matchjetidx].push_back(EL);
60 }
61 }
62
63
64 return matchedparts;
65}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
JetParticleAssociation(const std::string &name)
virtual const std::vector< std::vector< ElementLink< xAOD::IParticleContainer > > > * match(const xAOD::JetContainer &, const xAOD::IParticleContainer &) const override
Class providing the definition of the 4-vector interface.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.