ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
JetTagEvent
src
TrackConstituents.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/***************************************************************************
6
TrackConstituent.h - Description
7
-------------------
8
begin : January, 2005
9
authors : Kyle Cranmer, Andreas Wildauer
10
email : cranmer@cern.ch, andreas.wildauer@cern.ch
11
12
changes :
13
14
***************************************************************************/
15
16
#include "
JetTagEvent/TrackConstituents.h
"
17
#include "
EventKernel/INavigable4Momentum.h
"
18
#include "
NavFourMom/INavigable4MomentumCollection.h
"
19
namespace
Analysis
20
{
21
22
23
TrackConstituents::TrackConstituents
()
24
{ }
25
26
TrackConstituents::TrackConstituents
(
NameType
&
name
)
27
:
m_name
(
name
)
28
{ }
29
30
void
TrackConstituents::setName
(
NameType
&
name
) {
m_name
=
name
;}
31
32
NameType
TrackConstituents::name
()
const
{
return
m_name
;}
33
34
IConstituent
*
TrackConstituents::clone
()
const
35
{
return
new
TrackConstituents
( *
this
);}
36
37
38
void
TrackConstituents::set_track
(
const
Rec::TrackParticleContainer
* theContainer,
39
const
Rec::TrackParticle
* theTrack,
double
weight)
40
{
41
double
newWeight = weight;
42
// track already in collection
43
if
( this->
contains
(theTrack) )
44
{
45
// update weight
46
newWeight *= this->
getTrackWeight
(theTrack);
47
// remove the previous track
48
this->
remove
(theTrack);
49
}
50
51
// from Navigable base
52
this->
putElement
(theContainer,theTrack,newWeight);
53
54
55
}
56
57
void
TrackConstituents::set_track
(
const
Rec::TrackParticleContainer
* theContainer,
58
index_type
& theIndex,
double
weight)
59
{
60
double
newWeight = weight;
61
// track already in collection
62
if
( this->
contains
(theContainer,theIndex) )
63
{
64
// update weight
65
newWeight *= this->
getTrackWeight
(theContainer,theIndex);
66
// remove the previous track
67
this->
remove
(theContainer,theIndex);
68
}
69
70
// from Navigable base
71
this->
putElement
(theContainer,theIndex,newWeight);
72
73
}
74
75
void
TrackConstituents::set_constituent
(
const
Rec::TrackParticleContainer
* theContainer,
76
const
Rec::TrackParticle
* theTrack,
double
weight)
77
{ this->
set_track
(theContainer, theTrack, weight); }
78
79
void
TrackConstituents::set_constituent
(
const
Rec::TrackParticleContainer
* theContainer,
80
index_type
& theIndex,
double
weight)
81
{ this->
set_track
(theContainer, theIndex, weight); }
82
83
/* void TrackConstituents::set_track(const INavigable4MomentumCollection* theContainer,
84
const INavigable4Momentum* theTrack, double weight)
85
{
86
double newWeight = weight;
87
// track already in collection
88
if ( this->contains(theTrack) )
89
{
90
// update weight
91
newWeight *= this->getTrackWeight(theTrack);
92
// remove the previous track
93
this->remove(theTrack);
94
}
95
96
// from Navigable base
97
this->putElement(theContainer,theTrack,newWeight);
98
99
100
}*/
101
102
double
TrackConstituents::getTrackWeight
(
const
Rec::TrackParticle
* theTrack)
const
103
{
104
// from Navigable
105
return
(this->
contains
(theTrack) )
106
? this->
getParameter
(theTrack)
107
: 0.;
108
}
109
110
double
TrackConstituents::getTrackWeight
(
const
Rec::TrackParticleContainer
* theContainer,
111
index_type
& theIndex)
const
112
{
113
// from Navigable
114
return
(this->
contains
(theContainer,theIndex))
115
? this->
getParameter
(theContainer,theIndex)
116
: 0.;
117
}
118
119
std::vector<const Rec::TrackParticle*>*
TrackConstituents::tracks
()
const
120
{
121
std::vector<const Rec::TrackParticle*>*
tracks
=
122
new
std::vector<const Rec::TrackParticle*>();
123
124
for
(
iterator
it =
begin
(); it!=
end
(); ++it)
125
tracks
->push_back(*it);
126
127
return
tracks
;
128
}
129
130
}
INavigable4MomentumCollection.h
INavigable4Momentum.h
TrackConstituents.h
Analysis::IConstituent
Class IConstituent: This is the abstract base class for additional jet constituents to be put into th...
Definition
IConstituent.h:43
Analysis::TrackConstituents::setName
virtual void setName(NameType &name)
to set the name
Definition
TrackConstituents.cxx:30
Analysis::TrackConstituents::name
virtual NameType name() const
returns the infoType of the info objects.
Definition
TrackConstituents.cxx:32
Analysis::TrackConstituents::tracks
std::vector< const Rec::TrackParticle * > * tracks() const
get a vector of trackparticles. user must delete the vector, but not constituents
Definition
TrackConstituents.cxx:119
Analysis::TrackConstituents::getTrackWeight
double getTrackWeight(const Rec::TrackParticle *) const
Definition
TrackConstituents.cxx:102
Analysis::TrackConstituents::clone
virtual IConstituent * clone() const
a clone method for the proper workings of the copy constructor
Definition
TrackConstituents.cxx:34
Analysis::TrackConstituents::index_type
Navigable< Rec::TrackParticleContainer, double >::external_index_type index_type
Definition
TrackConstituents.h:39
Analysis::TrackConstituents::iterator
Navigable< Rec::TrackParticleContainer, double >::object_iter iterator
Definition
TrackConstituents.h:48
Analysis::TrackConstituents::TrackConstituents
TrackConstituents()
constructor
Definition
TrackConstituents.cxx:23
Analysis::TrackConstituents::set_constituent
void set_constituent(const Rec::TrackParticleContainer *, const Rec::TrackParticle *, double weight=0.)
set method for tracks.
Definition
TrackConstituents.cxx:75
Analysis::TrackConstituents::set_track
void set_track(const Rec::TrackParticleContainer *, const Rec::TrackParticle *, double weight=0.)
set method for tracks.
Definition
TrackConstituents.cxx:38
Analysis::TrackConstituents::m_name
std::string m_name
Definition
TrackConstituents.h:100
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
Analysis::NameType
std::string NameType
string to identify the constituent
Definition
IConstituent.h:30
Generated on
for ATLAS Offline Software by
1.17.0