ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
JetTagEvent
src
TrackAssociation.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
6
#include "
JetTagEvent/TrackAssociation.h
"
7
#include "
EventKernel/INavigable4Momentum.h
"
8
#include "
NavFourMom/INavigable4MomentumCollection.h
"
9
namespace
Analysis
10
{
11
12
TrackAssociation::TrackAssociation
()
13
{ }
14
15
TrackAssociation::TrackAssociation
(
const
NameType
&
name
)
16
{ this->
setName
(name); }
17
18
JetAssociationBase
*
TrackAssociation::clone
()
const
19
{
20
return
new
TrackAssociation
( *
this
);
21
}
22
23
void
TrackAssociation::set_track
(
const
Rec::TrackParticleContainer
* theContainer,
24
const
Rec::TrackParticle
* theTrack,
double
weight)
25
{
26
double
newWeight = weight;
27
// track already in collection
28
if
( this->
contains
(theTrack) )
29
{
30
// update weight
31
newWeight *= this->
getTrackWeight
(theTrack);
32
// remove the previous track
33
this->
remove
(theTrack);
34
}
35
36
// from Navigable base
37
this->
putElement
(theContainer,theTrack,newWeight);
38
}
39
40
void
TrackAssociation::set_track
(
const
Rec::TrackParticleContainer
* theContainer,
41
const
index_type
& theIndex,
double
weight)
42
{
43
double
newWeight = weight;
44
// track already in collection
45
if
( this->
contains
(theContainer,theIndex) )
46
{
47
// update weight
48
newWeight *= this->
getTrackWeight
(theContainer,theIndex);
49
// remove the previous track
50
this->
remove
(theContainer,theIndex);
51
}
52
53
// from Navigable base
54
this->
putElement
(theContainer,theIndex,newWeight);
55
}
56
57
void
TrackAssociation::set_association
(
const
Rec::TrackParticleContainer
* theContainer,
58
const
Rec::TrackParticle
* theTrack,
double
weight)
59
{
60
this->
set_track
(theContainer, theTrack, weight);
61
}
62
63
void
TrackAssociation::set_association
(
const
Rec::TrackParticleContainer
* theContainer,
64
const
index_type
& theIndex,
double
weight)
65
{
66
this->
set_track
(theContainer, theIndex, weight);
67
}
68
69
double
TrackAssociation::getTrackWeight
(
const
Rec::TrackParticle
* theTrack)
const
70
{
71
// from Navigable
72
return
(this->
contains
(theTrack) )
73
? this->
getParameter
(theTrack)
74
: 0.;
75
}
76
77
double
TrackAssociation::getTrackWeight
(
const
Rec::TrackParticleContainer
* theContainer,
78
const
index_type
& theIndex)
const
79
{
80
// from Navigable
81
return
(this->
contains
(theContainer,theIndex))
82
? this->
getParameter
(theContainer,theIndex)
83
: 0.;
84
}
85
86
std::vector<const Rec::TrackParticle*>*
TrackAssociation::tracks
()
const
87
{
88
std::vector<const Rec::TrackParticle*>*
tracks
=
89
new
std::vector<const Rec::TrackParticle*>();
90
91
for
(
iterator
it =
begin
(); it!=
end
(); ++it)
92
tracks
->push_back(*it);
93
94
return
tracks
;
95
}
96
}
INavigable4MomentumCollection.h
INavigable4Momentum.h
TrackAssociation.h
Analysis::TrackAssociation::iterator
Navigable< Rec::TrackParticleContainer, double >::object_iter iterator
Definition
TrackAssociation.h:30
Analysis::TrackAssociation::set_association
void set_association(const Rec::TrackParticleContainer *, const Rec::TrackParticle *, double weight=0.)
Definition
TrackAssociation.cxx:57
Analysis::TrackAssociation::set_track
void set_track(const Rec::TrackParticleContainer *, const Rec::TrackParticle *, double weight=0.)
set method for tracks.
Definition
TrackAssociation.cxx:23
Analysis::TrackAssociation::TrackAssociation
TrackAssociation()
constructor
Definition
TrackAssociation.cxx:12
Analysis::TrackAssociation::NameType
std::string NameType
Definition
TrackAssociation.h:23
Analysis::TrackAssociation::index_type
Navigable< Rec::TrackParticleContainer, double >::external_index_type index_type
Definition
TrackAssociation.h:20
Analysis::TrackAssociation::clone
JetAssociationBase * clone() const
Definition
TrackAssociation.cxx:18
Analysis::TrackAssociation::getTrackWeight
double getTrackWeight(const Rec::TrackParticle *) const
Definition
TrackAssociation.cxx:69
Analysis::TrackAssociation::tracks
std::vector< const Rec::TrackParticle * > * tracks() const
get a vector of trackparticles. user must delete the vector, but not constituents
Definition
TrackAssociation.cxx:86
JetAssociationBase::setName
void setName(const name_t &name)
Definition
JetAssociationBase.cxx:15
JetAssociationBase::name
const name_t & name() const
Definition
JetAssociationBase.cxx:20
JetAssociationBase::JetAssociationBase
JetAssociationBase()
Definition
JetAssociationBase.cxx:10
Navigable< Rec::TrackParticleContainer, double >::begin
virtual object_iter begin() const
Navigable< Rec::TrackParticleContainer, double >::remove
bool remove(const constituent_type *aConstituent)
Navigable< Rec::TrackParticleContainer, double >::putElement
void putElement(const Rec::TrackParticleContainer *objectContainer, const constituent_type *constituentObject, const double &objectParameter=double(), size_t sizeHint=0)
Navigable< Rec::TrackParticleContainer, double >::getParameter
double getParameter(const constituent_type *aConstituent) const
Navigable< Rec::TrackParticleContainer, double >::contains
bool contains(const constituent_type *aConstituent) const
Navigable< Rec::TrackParticleContainer, double >::end
virtual object_iter end() const
Rec::TrackParticleContainer
Definition
Reconstruction/Particle/Particle/TrackParticleContainer.h:33
Rec::TrackParticle
Definition
Reconstruction/Particle/Particle/TrackParticle.h:47
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition
IConstituent.h:25
Generated on
for ATLAS Offline Software by
1.17.0