ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaEvent
src
ElectronConstituent.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
ElectronConstituents.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 "
egammaEvent/ElectronConstituent.h
"
17
18
namespace
Analysis
19
{
20
21
ElectronConstituent::ElectronConstituent
(
NameType
&
name
)
22
:
m_name
(
name
)
23
{
24
}
25
26
27
void
ElectronConstituent::setName
(
NameType
&
name
) {
m_name
=
name
;}
28
29
NameType
ElectronConstituent::name
()
const
{
return
m_name
;}
30
31
IConstituent
*
ElectronConstituent::clone
()
const
32
{
return
new
ElectronConstituent
( *
this
);}
33
34
const
Electron
*
ElectronConstituent::electron
()
const
35
{
36
//get electron from Navigable
37
if
(this->
size
() ==0)
38
return
nullptr
;
39
if
(this->
size
() > 1)
40
return
nullptr
;
41
// this shouldn't happen
42
else
43
return
getConstituentPtr
((this->
getConstituents
()).
begin
());
44
}
45
46
void
ElectronConstituent::set_electron
(
const
ElectronContainer
* theContainer,
47
const
Electron
* the_electron,
48
double
weight)
49
{
50
double
newWeight = weight;
51
// electron already in collection
52
if
( this->
contains
(the_electron) )
53
{
54
// update weight
55
newWeight *= this->
getElectronWeight
(the_electron);
56
// remove the previous electron
57
this->
remove
(the_electron);
58
}
59
60
// from Navigable base
61
this->
putElement
(theContainer,the_electron,newWeight);
62
63
}
64
65
void
ElectronConstituent::set_electron
(
const
ElectronContainer
* theContainer,
66
index_type
& theIndex,
67
double
weight)
68
{
69
double
newWeight = weight;
70
// electron already in collection
71
if
( this->
contains
(theContainer,theIndex) )
72
{
73
// update weight
74
newWeight *= this->
getElectronWeight
(theContainer,theIndex);
75
// remove the previous electron
76
this->
remove
(theContainer,theIndex);
77
}
78
79
// from Navigable base
80
this->
putElement
(theContainer,theIndex,newWeight);
81
82
}
83
84
double
ElectronConstituent::getElectronWeight
(
const
Electron
* the_electron)
const
85
{
86
// from Navigable
87
return
(this->
contains
(the_electron) )
88
? this->
getParameter
(the_electron)
89
: 0.;
90
}
91
92
double
ElectronConstituent::getElectronWeight
(
const
ElectronContainer
* theContainer,
93
index_type
& theIndex)
const
94
{
95
// from Navigable
96
return
(this->
contains
(theContainer,theIndex))
97
? this->
getParameter
(theContainer,theIndex)
98
: 0.;
99
}
100
101
102
}
ElectronConstituent.h
Analysis::ElectronConstituent::name
virtual NameType name() const
returns the infoType of the info objects.
Definition
ElectronConstituent.cxx:29
Analysis::ElectronConstituent::setName
virtual void setName(NameType &name)
method to set the name
Definition
ElectronConstituent.cxx:27
Analysis::ElectronConstituent::clone
virtual IConstituent * clone() const
a clone method for the proper workings of the copy constructor
Definition
ElectronConstituent.cxx:31
Analysis::ElectronConstituent::electron
const Electron * electron() const
get electron directly without token
Definition
ElectronConstituent.cxx:34
Analysis::ElectronConstituent::index_type
Navigable< ElectronContainer, double >::external_index_type index_type
Definition
ElectronConstituent.h:47
Analysis::ElectronConstituent::set_electron
void set_electron(const ElectronContainer *theContainer, const Electron *the_electron, double weight=1)
Definition
ElectronConstituent.cxx:46
Analysis::ElectronConstituent::getElectronWeight
double getElectronWeight(const Electron *the_electron) const
Definition
ElectronConstituent.cxx:84
Analysis::ElectronConstituent::ElectronConstituent
ElectronConstituent()=default
Default constructor.
Analysis::ElectronConstituent::m_name
std::string m_name
Definition
ElectronConstituent.h:93
Analysis::Electron
Definition
Reconstruction/egamma/egammaEvent/egammaEvent/Electron.h:20
Analysis::IConstituent
Class IConstituent: This is the abstract base class for additional jet constituents to be put into th...
Definition
IConstituent.h:43
ElectronContainer
Class to define the ElectronContainer.
Definition
Reconstruction/egamma/egammaEvent/egammaEvent/ElectronContainer.h:32
Navigable< ElectronContainer, double >::getConstituents
const constituent_coll & getConstituents() const
Definition
Navigable.h:290
Navigable< ElectronContainer, double >::size
virtual unsigned int size() const
Navigable< ElectronContainer, double >::begin
virtual object_iter begin() const
Navigable< ElectronContainer, double >::remove
bool remove(const constituent_type *aConstituent)
Navigable< ElectronContainer, double >::putElement
void putElement(const ElectronContainer *objectContainer, const constituent_type *constituentObject, const double &objectParameter=double(), size_t sizeHint=0)
Navigable< ElectronContainer, double >::getParameter
double getParameter(const constituent_type *aConstituent) const
Navigable< ElectronContainer, double >::contains
bool contains(const constituent_type *aConstituent) const
Navigable< ElectronContainer, double >::getConstituentPtr
virtual const constituent_type * getConstituentPtr(constituent_iter iter) const
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