ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
18
20 : AthMessaging ("ParticleCandidateList")
21{}
22
24 : AthMessaging ("ParticleCandidateList"),
25 m_list(rhs.m_list)
26{}
27
28
29bool 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 !!" );
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
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
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
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
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
122void 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 !!" );
138 throw GaudiException( error, "ParticleCandidateList",
139 StatusCode::FAILURE );
140 }
141
142 if ( msg().level() <= MSG::VERBOSE ) { dropList();
143 }
144
145}
#define endmsg
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
ATLAS-specific HepMC functions.
MsgStream & msg() const
The standard message stream.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
ParticleCandidateList()
Default constructor:
const std::list< int > & list() const
Return the wrapped STL list.
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...
void addLeptons()
Non-const methods:
void add(const int &partID)
static const int UQUARK
static const int SQUARK
static const int DQUARK
static const int MUON
static const int CQUARK
static const int TAU
static const int ELECTRON
static const int POSITRON
static const int NU_MU
static const int NU_E
static const int NU_TAU