ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ParticleJetTools
Root
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
7
#include "
ParticleJetTools/JetParticleShrinkingConeAssociation.h
"
8
#include "
AsgMessaging/Check.h
"
9
10
using namespace
std
;
11
using namespace
xAOD
;
12
13
JetParticleShrinkingConeAssociation::JetParticleShrinkingConeAssociation
(
const
string
&
name
)
14
:
JetParticleAssociation
(
name
) {
15
16
declareProperty
(
"coneSizeFitPar1"
,
m_coneSizeFitPar1
=0);
17
declareProperty
(
"coneSizeFitPar2"
,
m_coneSizeFitPar2
=0);
18
declareProperty
(
"coneSizeFitPar3"
,
m_coneSizeFitPar3
=0);
19
20
return
;
21
}
22
23
24
const
vector<vector<ElementLink<IParticleContainer> > >*
25
JetParticleShrinkingConeAssociation::match
(
const
xAOD::JetContainer
& jets,
const
xAOD::IParticleContainer
& parts)
const
{
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) {
57
ElementLink<IParticleContainer>
EL
;
58
EL
.toContainedElement(parts, *part_itr);
59
(*matchedparts)[matchjetidx].push_back(
EL
);
60
}
61
}
62
63
64
return
matchedparts;
65
}
Check.h
JetParticleShrinkingConeAssociation.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
DataVector< IParticle >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
JetParticleAssociation::JetParticleAssociation
JetParticleAssociation(const std::string &name)
Definition
JetParticleAssociation.cxx:11
JetParticleShrinkingConeAssociation::m_coneSizeFitPar1
double m_coneSizeFitPar1
Definition
JetParticleShrinkingConeAssociation.h:30
JetParticleShrinkingConeAssociation::m_coneSizeFitPar3
double m_coneSizeFitPar3
Definition
JetParticleShrinkingConeAssociation.h:32
JetParticleShrinkingConeAssociation::JetParticleShrinkingConeAssociation
JetParticleShrinkingConeAssociation(const std::string &name)
Definition
JetParticleShrinkingConeAssociation.cxx:13
JetParticleShrinkingConeAssociation::m_coneSizeFitPar2
double m_coneSizeFitPar2
Definition
JetParticleShrinkingConeAssociation.h:31
JetParticleShrinkingConeAssociation::match
virtual const std::vector< std::vector< ElementLink< xAOD::IParticleContainer > > > * match(const xAOD::JetContainer &, const xAOD::IParticleContainer &) const override
Definition
JetParticleShrinkingConeAssociation.cxx:25
JetParticleShrinkingConeAssociation::coneSize
double coneSize(double pt) const
Definition
JetParticleShrinkingConeAssociation.h:24
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
std
STL namespace.
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
xAOD::IParticleContainer
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
Definition
xAOD/xAODBase/xAODBase/IParticleContainer.h:32
Generated on
for ATLAS Offline Software by
1.17.0