ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
AnalysisUtils
src
ParticleCandidateList.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// ParticleCandidateList.cxx
7
// Implementation file for class ParticleCandidateList
8
// Author: S.Binet<binet@cern.ch>
10
11
// Framework includes
12
#include "GaudiKernel/GaudiException.h"
13
14
// AnalysisUtils includes
15
#include "
AnalysisUtils/ParticleCandidateList.h
"
16
#include "
TruthUtils/HepMCHelpers.h
"
17
18
19
ParticleCandidateList::ParticleCandidateList
()
20
:
AthMessaging
(
"ParticleCandidateList"
)
21
{}
22
23
ParticleCandidateList::ParticleCandidateList
(
const
ParticleCandidateList
& rhs)
24
:
AthMessaging
(
"ParticleCandidateList"
),
25
m_list
(rhs.
m_list
)
26
{}
27
28
29
bool
ParticleCandidateList::hasInList
(
const
int
& pdgID,
30
const
bool
tightMatch )
const
31
{
32
ATH_MSG_VERBOSE
(
"In ParticleCandidateList::hasInList( pdgID ) : "
<<
this
33
<<
endmsg
34
<<
"Size of List = "
<<
size
() );
35
if
(
size
() <=
unsigned
(0) ) {
36
static
const
std::string
error
(
"List size <=0 !!"
);
37
ATH_MSG_ERROR
(
error
);
38
throw
GaudiException(
error
,
"ParticleCandidateList"
,
39
StatusCode::FAILURE );
40
}
41
42
for
(
auto
itrPart =
m_list
.begin();
43
itrPart !=
m_list
.end();
44
++itrPart ) {
//> Loop over the list of intern particles
45
ATH_MSG_VERBOSE
(
"in loop over list of intern particle candidates"
46
<<
"\t>>>Comparing pid-s..."
);
47
if
( tightMatch && ( (*itrPart) == pdgID ) ) {
48
ATH_MSG_VERBOSE
(
">>> "
<< pdgID <<
" is in list ("
<< (*itrPart) <<
")"
);
49
return
true
;
50
}
else
if
( !tightMatch &&
51
std::abs( (*itrPart) ) == std::abs( pdgID ) ) {
52
return
true
;
53
}
54
}
//> end loop over the list of intern particles
55
56
return
false
;
57
}
58
59
void
ParticleCandidateList::dropList
()
const
60
{
61
ATH_MSG_VERBOSE
(
"---------------------------------------------------\n"
62
<<
"Added those particles : "
);
63
for
(
auto
itrPart =
m_list
.begin();
64
itrPart !=
m_list
.end();
65
++itrPart ) {
66
ATH_MSG_VERBOSE
(
"\tpdgID= "
<< (*itrPart) );
67
}
68
69
ATH_MSG_VERBOSE
(
"---------------------------------------------------"
);
70
}
71
75
void
ParticleCandidateList::addLeptons
()
76
{
77
m_list
.push_back(
MC::ELECTRON
);
//>e-
78
m_list
.push_back(
MC::POSITRON
);
//>e+
79
m_list
.push_back(
MC::NU_E
);
//>nu_e
80
m_list
.push_back( -
MC::NU_E
);
//>nu_e_bar
81
82
m_list
.push_back(
MC::MUON
);
//>mu-
83
m_list
.push_back( -
MC::MUON
);
//>mu+
84
m_list
.push_back(
MC::NU_MU
);
//>nuMu
85
m_list
.push_back( -
MC::NU_MU
);
//>nuMu_bar
86
87
m_list
.push_back(
MC::TAU
);
//>tau-
88
m_list
.push_back( -
MC::TAU
);
//>tau+
89
m_list
.push_back(
MC::NU_TAU
);
//>nuTau
90
m_list
.push_back( -
MC::NU_TAU
);
//>nuTau_bar
91
}
92
93
void
ParticleCandidateList::addLightJets
()
94
{
98
m_list
.push_back( 0 );
//> untagged jet : so taken light
99
100
m_list
.push_back(
MC::DQUARK
);
//> d
101
m_list
.push_back( -
MC::DQUARK
);
//> d_bar
102
m_list
.push_back(
MC::UQUARK
);
//> u
103
m_list
.push_back( -
MC::UQUARK
);
//> u_bar
104
m_list
.push_back(
MC::CQUARK
);
//> c
105
m_list
.push_back( -
MC::CQUARK
);
//> c_bar
106
m_list
.push_back(
MC::SQUARK
);
//> s
107
m_list
.push_back( -
MC::SQUARK
);
//> s_bar
108
}
109
110
void
ParticleCandidateList::addLightQuarks
()
111
{
112
m_list
.push_back(
MC::DQUARK
);
//> d
113
m_list
.push_back( -
MC::DQUARK
);
//> d_bar
114
m_list
.push_back(
MC::UQUARK
);
//> u
115
m_list
.push_back( -
MC::UQUARK
);
//> u_bar
116
m_list
.push_back(
MC::CQUARK
);
//> c
117
m_list
.push_back( -
MC::CQUARK
);
//> c_bar
118
m_list
.push_back(
MC::SQUARK
);
//> s
119
m_list
.push_back( -
MC::SQUARK
);
//> s_bar
120
}
121
122
void
ParticleCandidateList::add
(
const
std::string&
list
)
123
{
124
ATH_MSG_VERBOSE
(
"add( "
<<
list
<<
" )"
);
125
if
(
list
==
"LightQuarks"
)
addLightQuarks
();
126
else
if
(
list
==
"BQuark"
)
addBQuark
();
127
else
if
(
list
==
"BbarQuark"
)
addBbarQuark
();
128
else
if
(
list
==
"BQuarks"
)
addBQuarks
();
129
else
if
(
list
==
"Bjet"
||
130
list
==
"BJet"
)
addBjet
();
131
else
if
(
list
==
"Leptons"
||
132
list
==
"leptons"
)
addLeptons
();
133
else
if
(
list
==
"W+/-"
)
addWBosons
();
134
else
if
(
list
==
"Z0"
)
addZBoson
();
135
else
{
136
static
const
std::string
error
(
"Unknown Candidate List Name !!"
);
137
ATH_MSG_ERROR
(
error
);
138
throw
GaudiException(
error
,
"ParticleCandidateList"
,
139
StatusCode::FAILURE );
140
}
141
142
if
(
msg
().level() <= MSG::VERBOSE ) {
dropList
();
143
}
144
145
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
HepMCHelpers.h
ATLAS-specific HepMC functions.
ParticleCandidateList.h
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition
AthMessaging.h:167
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
ParticleCandidateList::ParticleCandidateList
ParticleCandidateList()
Default constructor:
Definition
ParticleCandidateList.cxx:19
ParticleCandidateList::m_list
std::list< int > m_list
Definition
ParticleCandidateList.h:120
ParticleCandidateList::addWBosons
void addWBosons()
Definition
ParticleCandidateList.h:212
ParticleCandidateList::addBQuark
void addBQuark()
Definition
ParticleCandidateList.h:190
ParticleCandidateList::addZBoson
void addZBoson()
Definition
ParticleCandidateList.h:218
ParticleCandidateList::size
size_type size() const
Definition
ParticleCandidateList.h:160
ParticleCandidateList::addBQuarks
void addBQuarks()
Definition
ParticleCandidateList.h:200
ParticleCandidateList::addLightQuarks
void addLightQuarks()
Definition
ParticleCandidateList.cxx:110
ParticleCandidateList::addBbarQuark
void addBbarQuark()
Definition
ParticleCandidateList.h:195
ParticleCandidateList::list
const std::list< int > & list() const
Return the wrapped STL list.
Definition
ParticleCandidateList.h:140
ParticleCandidateList::addLightJets
void addLightJets()
Definition
ParticleCandidateList.cxx:93
ParticleCandidateList::hasInList
bool hasInList(const int &pdgID, const bool tightMatch=false) const
Tells if a given particle or pID is in the list if tightMatch = false : look only if std::abs() of pa...
Definition
ParticleCandidateList.cxx:29
ParticleCandidateList::addBjet
void addBjet()
Definition
ParticleCandidateList.h:206
ParticleCandidateList::addLeptons
void addLeptons()
Non-const methods:
Definition
ParticleCandidateList.cxx:75
ParticleCandidateList::add
void add(const int &partID)
Definition
ParticleCandidateList.h:185
ParticleCandidateList::dropList
void dropList() const
Definition
ParticleCandidateList.cxx:59
MC::UQUARK
static const int UQUARK
Definition
HepMCHelpers.h:66
MC::SQUARK
static const int SQUARK
Definition
HepMCHelpers.h:67
MC::DQUARK
static const int DQUARK
Definition
HepMCHelpers.h:65
MC::MUON
static const int MUON
Definition
HepMCHelpers.h:78
MC::CQUARK
static const int CQUARK
Definition
HepMCHelpers.h:68
MC::TAU
static const int TAU
Definition
HepMCHelpers.h:80
MC::ELECTRON
static const int ELECTRON
Definition
HepMCHelpers.h:75
MC::POSITRON
static const int POSITRON
Definition
HepMCHelpers.h:76
MC::NU_MU
static const int NU_MU
Definition
HepMCHelpers.h:79
MC::NU_E
static const int NU_E
Definition
HepMCHelpers.h:77
MC::NU_TAU
static const int NU_TAU
Definition
HepMCHelpers.h:81
error
Definition
IImpactPoint3dEstimator.h:72
Generated on
for ATLAS Offline Software by
1.17.0