ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
MuonID
MuonIDEvent
src
MuonConstituent.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
MuonConstituents.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 "
MuonIDEvent/MuonConstituent.h
"
17
18
namespace
Analysis
19
{
20
21
22
MuonConstituent::MuonConstituent
()
23
{ }
24
25
MuonConstituent::MuonConstituent
(
NameType
&
name
)
26
:
m_name
(
name
)
27
{ }
28
29
void
MuonConstituent::setName
(
NameType
&
name
) {
m_name
=
name
;}
30
31
NameType
MuonConstituent::name
()
const
{
return
m_name
;}
32
33
IConstituent
*
MuonConstituent::clone
()
const
34
{
return
new
MuonConstituent
( *
this
);}
35
36
const
Muon
*
MuonConstituent::muon
()
const
37
{
38
//get muon from Navigable
39
if
(this->
size
() ==0)
40
return
0;
41
else
if
(this->
size
() > 1)
42
return
0;
43
// this shouldn't happen
44
else
45
return
getConstituentPtr
((this->
getConstituents
()).
begin
());
46
}
47
48
void
MuonConstituent::set_muon
(
const
MuonContainer
* theContainer,
49
const
Muon
* the_muon,
50
double
weight)
51
{
52
double
newWeight = weight;
53
// muon already in collection
54
if
( this->
contains
(the_muon) )
55
{
56
// update weight
57
newWeight *= this->
getMuonWeight
(the_muon);
58
// remove the previous muon
59
this->
remove
(the_muon);
60
}
61
62
// from Navigable base
63
this->
putElement
(theContainer,the_muon,newWeight);
64
65
}
66
67
void
MuonConstituent::set_muon
(
const
MuonContainer
* theContainer,
68
index_type
& theIndex,
69
double
weight)
70
{
71
double
newWeight = weight;
72
// muon already in collection
73
if
( this->
contains
(theContainer,theIndex) )
74
{
75
// update weight
76
newWeight *= this->
getMuonWeight
(theContainer,theIndex);
77
// remove the previous muon
78
this->
remove
(theContainer,theIndex);
79
}
80
81
// from Navigable base
82
this->
putElement
(theContainer,theIndex,newWeight);
83
84
}
85
86
double
MuonConstituent::getMuonWeight
(
const
Muon
* the_muon)
const
87
{
88
// from Navigable
89
return
(this->
contains
(the_muon) )
90
? this->
getParameter
(the_muon)
91
: 0.;
92
}
93
94
double
MuonConstituent::getMuonWeight
(
const
MuonContainer
* theContainer,
95
index_type
& theIndex)
const
96
{
97
// from Navigable
98
return
(this->
contains
(theContainer,theIndex))
99
? this->
getParameter
(theContainer,theIndex)
100
: 0.;
101
}
102
103
104
}
MuonConstituent.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::MuonConstituent::muon
const Muon * muon() const
get muon directly without token
Definition
MuonConstituent.cxx:36
Analysis::MuonConstituent::setName
virtual void setName(NameType &name)
to set the name
Definition
MuonConstituent.cxx:29
Analysis::MuonConstituent::clone
virtual IConstituent * clone() const
a clone method for the proper workings of the copy constructor
Definition
MuonConstituent.cxx:33
Analysis::MuonConstituent::getMuonWeight
double getMuonWeight(const Muon *the_muon) const
Definition
MuonConstituent.cxx:86
Analysis::MuonConstituent::name
virtual NameType name() const
returns the infoType of the info objects.
Definition
MuonConstituent.cxx:31
Analysis::MuonConstituent::set_muon
void set_muon(const MuonContainer *theContainer, const Muon *the_muon, double weight=1)
Definition
MuonConstituent.cxx:48
Analysis::MuonConstituent::m_name
std::string m_name
Definition
MuonConstituent.h:88
Analysis::MuonConstituent::MuonConstituent
MuonConstituent()
constructor
Definition
MuonConstituent.cxx:22
Analysis::MuonConstituent::index_type
Navigable< MuonContainer, double >::external_index_type index_type
Definition
MuonConstituent.h:46
Analysis::MuonContainer
definition of StoreGate container holding a vector of Analysis::Muon
Definition
Reconstruction/MuonIdentification/muonEvent/muonEvent/MuonContainer.h:38
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
Analysis::NameType
std::string NameType
string to identify the constituent
Definition
IConstituent.h:30
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