ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
MuonID
MuonIDEvent
src
MuonAssociation.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 "
MuonIDEvent/MuonAssociation.h
"
7
8
namespace
Analysis
9
{
10
11
12
MuonAssociation::MuonAssociation
()
13
{ }
14
15
MuonAssociation::MuonAssociation
(
const
NameType
&
name
)
16
{ this->
setName
(name); }
17
18
JetAssociationBase
*
MuonAssociation::clone
()
const
19
{
return
new
MuonAssociation
( *
this
);}
20
21
const
Muon
*
MuonAssociation::muon
()
const
22
{
23
//get muon from Navigable
24
if
(this->
size
() ==0)
25
return
0;
26
else
if
(this->
size
() > 1)
27
return
0;
28
// this shouldn't happen
29
else
30
return
getConstituentPtr
((this->
getConstituents
()).
begin
());
31
}
32
33
void
MuonAssociation::set_muon
(
const
MuonContainer
* theContainer,
34
const
Muon
* the_muon,
35
double
weight)
36
{
37
double
newWeight = weight;
38
// muon already in collection
39
if
( this->
contains
(the_muon) )
40
{
41
// update weight
42
newWeight *= this->
getMuonWeight
(the_muon);
43
// remove the previous muon
44
this->
remove
(the_muon);
45
}
46
47
// from Navigable base
48
this->
putElement
(theContainer,the_muon,newWeight);
49
50
}
51
52
void
MuonAssociation::set_muon
(
const
MuonContainer
* theContainer,
53
const
index_type
& theIndex,
54
double
weight)
55
{
56
double
newWeight = weight;
57
// muon already in collection
58
if
( this->
contains
(theContainer,theIndex) )
59
{
60
// update weight
61
newWeight *= this->
getMuonWeight
(theContainer,theIndex);
62
// remove the previous muon
63
this->
remove
(theContainer,theIndex);
64
}
65
66
// from Navigable base
67
this->
putElement
(theContainer,theIndex,newWeight);
68
69
}
70
71
double
MuonAssociation::getMuonWeight
(
const
Muon
* the_muon)
const
72
{
73
// from Navigable
74
return
(this->
contains
(the_muon) )
75
? this->
getParameter
(the_muon)
76
: 0.;
77
}
78
79
double
MuonAssociation::getMuonWeight
(
const
MuonContainer
* theContainer,
80
const
index_type
& theIndex)
const
81
{
82
// from Navigable
83
return
(this->
contains
(theContainer,theIndex))
84
? this->
getParameter
(theContainer,theIndex)
85
: 0.;
86
}
87
88
89
}
MuonAssociation.h
Analysis::MuonAssociation::MuonAssociation
MuonAssociation()
constructor
Definition
MuonAssociation.cxx:12
Analysis::MuonAssociation::index_type
Navigable< MuonContainer, double >::external_index_type index_type
Definition
MuonAssociation.h:27
Analysis::MuonAssociation::muon
const Muon * muon() const
get muon directly without token
Definition
MuonAssociation.cxx:21
Analysis::MuonAssociation::set_muon
void set_muon(const MuonContainer *theContainer, const Muon *the_muon, double weight=1)
Definition
MuonAssociation.cxx:33
Analysis::MuonAssociation::getMuonWeight
double getMuonWeight(const Muon *the_muon) const
Definition
MuonAssociation.cxx:71
Analysis::MuonAssociation::clone
virtual JetAssociationBase * clone() const
a clone method for the proper workings of the copy constructor
Definition
MuonAssociation.cxx:18
Analysis::MuonContainer
definition of StoreGate container holding a vector of Analysis::Muon
Definition
Reconstruction/MuonIdentification/muonEvent/muonEvent/MuonContainer.h:38
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
Navigable< MuonContainer, double >::getConstituents
const constituent_coll & getConstituents() const
Definition
Navigable.h:290
Navigable< MuonContainer, double >::size
virtual unsigned int size() const
Navigable< MuonContainer, double >::begin
virtual object_iter begin() const
Navigable< MuonContainer, double >::remove
bool remove(const constituent_type *aConstituent)
Navigable< MuonContainer, double >::putElement
void putElement(const MuonContainer *objectContainer, const constituent_type *constituentObject, const double &objectParameter=double(), size_t sizeHint=0)
Navigable< MuonContainer, double >::getParameter
double getParameter(const constituent_type *aConstituent) const
Navigable< MuonContainer, double >::contains
bool contains(const constituent_type *aConstituent) const
Navigable< MuonContainer, double >::getConstituentPtr
virtual const constituent_type * getConstituentPtr(constituent_iter iter) const
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition
IConstituent.h:25
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
Generated on
for ATLAS Offline Software by
1.17.0