ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetEvent
src
JetINav4MomAssociation.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
#include "
JetEvent/JetINav4MomAssociation.h
"
6
7
JetINav4MomAssociation::JetINav4MomAssociation
()
8
=
default
;
9
10
JetINav4MomAssociation::JetINav4MomAssociation
(
NameType
&
name
)
11
{
12
this->
setName
(name);
13
}
14
15
JetAssociationBase
*
JetINav4MomAssociation::clone
()
const
16
{
17
return
new
JetINav4MomAssociation
( *
this
);
18
}
19
20
const
INavigable4Momentum
*
JetINav4MomAssociation::inav4momentum
()
const
21
{
22
//get jet from Navigable
23
if
(this->
size
() ==0)
24
return
nullptr
;
25
else
if
(this->
size
() > 1)
26
return
nullptr
;
27
// this shouldn't happen
28
else
29
return
getConstituentPtr
((this->
getConstituents
()).
begin
());
30
}
31
32
void
JetINav4MomAssociation::set_inav4momentum
(
const
INavigable4MomentumCollection
* theContainer,
33
const
INavigable4Momentum
* the_inav4momentum,
34
double
weight)
35
{
36
double
newWeight = weight;
37
// jet already in collection
38
if
( this->
contains
(the_inav4momentum) )
39
{
40
// update weight
41
newWeight *= this->
getinav4momentumWeight
(the_inav4momentum);
42
// remove the previous jet
43
this->
remove
(the_inav4momentum);
44
}
45
46
// from Navigable base
47
this->
putElement
(theContainer,the_inav4momentum,newWeight);
48
}
49
50
void
JetINav4MomAssociation::set_inav4momentum
(
const
INavigable4MomentumCollection
* theContainer,
51
index_type
& theIndex,
52
double
weight)
53
{
54
double
newWeight = weight;
55
// jet already in collection
56
if
( this->
contains
(theContainer,theIndex) )
57
{
58
// update weight
59
newWeight *= this->
getinav4momentumWeight
(theContainer,theIndex);
60
// remove the previous jet
61
this->
remove
(theContainer,theIndex);
62
}
63
64
// from Navigable base
65
this->
putElement
(theContainer,theIndex,newWeight);
66
}
67
68
double
JetINav4MomAssociation::getinav4momentumWeight
(
const
INavigable4Momentum
* the_inav4momentum)
const
69
{
70
// from Navigable
71
return
(this->
contains
(the_inav4momentum) )
72
? this->
getParameter
(the_inav4momentum)
73
: 0.;
74
}
75
76
double
JetINav4MomAssociation::getinav4momentumWeight
(
const
INavigable4MomentumCollection
* theContainer,
77
index_type
& theIndex)
const
78
{
79
// from Navigable
80
return
(this->
contains
(theContainer,theIndex))
81
? this->
getParameter
(theContainer,theIndex)
82
: 0.;
83
}
84
85
INavigable4MomentumCollection
DataVector< INavigable4Momentum > INavigable4MomentumCollection
Definition
INavigable4MomentumCollection.h:22
JetINav4MomAssociation.h
INavigable4Momentum
Definition
INavigable4Momentum.h:21
JetAssociationBase::setName
void setName(const name_t &name)
Definition
JetAssociationBase.cxx:15
JetAssociationBase::NameType
name_t NameType
Definition
JetAssociationBase.h:29
JetAssociationBase::name
const name_t & name() const
Definition
JetAssociationBase.cxx:20
JetAssociationBase::JetAssociationBase
JetAssociationBase()
Definition
JetAssociationBase.cxx:10
JetINav4MomAssociation::getinav4momentumWeight
double getinav4momentumWeight(const INavigable4Momentum *the_inav4momentum) const
Definition
JetINav4MomAssociation.cxx:68
JetINav4MomAssociation::JetINav4MomAssociation
JetINav4MomAssociation()
constructor
JetINav4MomAssociation::set_inav4momentum
void set_inav4momentum(const INavigable4MomentumCollection *theContainer, const INavigable4Momentum *the_inav4momentum, double weight=1)
Definition
JetINav4MomAssociation.cxx:32
JetINav4MomAssociation::clone
virtual JetAssociationBase * clone() const
a clone method for the proper workings of the copy constructor
Definition
JetINav4MomAssociation.cxx:15
JetINav4MomAssociation::inav4momentum
const INavigable4Momentum * inav4momentum() const
get jet directly without token
Definition
JetINav4MomAssociation.cxx:20
JetINav4MomAssociation::index_type
Navigable< INavigable4MomentumCollection, double >::external_index_type index_type
Definition
JetINav4MomAssociation.h:35
Navigable< INavigable4MomentumCollection, double >::getConstituents
const constituent_coll & getConstituents() const
Definition
Navigable.h:290
Navigable< INavigable4MomentumCollection, double >::size
virtual unsigned int size() const
Navigable< INavigable4MomentumCollection, double >::begin
virtual object_iter begin() const
Navigable< INavigable4MomentumCollection, double >::remove
bool remove(const constituent_type *aConstituent)
Navigable< INavigable4MomentumCollection, double >::putElement
void putElement(const INavigable4MomentumCollection *objectContainer, const constituent_type *constituentObject, const double &objectParameter=double(), size_t sizeHint=0)
Navigable< INavigable4MomentumCollection, double >::getParameter
double getParameter(const constituent_type *aConstituent) const
Navigable< INavigable4MomentumCollection, double >::contains
bool contains(const constituent_type *aConstituent) const
Navigable< INavigable4MomentumCollection, double >::getConstituentPtr
virtual const constituent_type * getConstituentPtr(constituent_iter iter) const
Generated on
for ATLAS Offline Software by
1.17.0