|
ATLAS Offline Software
|
Go to the documentation of this file.
25 int pdg_id = std::abs(
p->pdgId() );
26 int mom_pdg_id = pdg_id;
30 while (pdg_id == mom_pdg_id) {
33 mom_pdg_id = abs(mother->
pdgId());
35 if (pdg_id != mom_pdg_id)
break;
39 if(oldVprod==mother->
prodVtx())
break;
59 bool isWZ = (nDecay==2);
60 return (mom_pdg_id == 23 || mom_pdg_id == 24 || isWZ);
65 bool isWZDecay(
const xAOD::TruthParticle*
p, std::vector<const xAOD::TruthParticle*>& wzLeptons,
double photonCone2) {
66 int pdg_id = abs(
p->pdgId() );
68 if(!
p->hasProdVtx() )
return false;
75 wzLeptons.push_back(
p);
79 if( pdg_id == 22 && photonCone2>0)
81 for(
const auto *lep: wzLeptons) {
99 int pdg =
part->pdgId();
102 if(!
part->hasProdVtx())
return false;
104 if(!prod)
return false;
107 int parentId = (*elParent)->pdgId();
108 if(abs(
parentId) == 15 && isWZDecay(*elParent)) {
116 if(isLeptonFromTau(*elParent)) {
136 m_useOnlyCharged(false),
137 m_listPDGofStables(false),
138 m_selectionModeName(
"StableNoMuonNoNu"),
142 declareInterface<JetTruthParticleSelectorTool>(
this);
173 return StatusCode::FAILURE;
188 return StatusCode::SUCCESS;
193 auto truth4Mom = truthPart->
p4();
195 if ( truth4Mom.E() <= 0 )
return false;
196 if ( truth4Mom.P() - truth4Mom.Pz() <= 0 )
return false;
198 double pt = truth4Mom.Pt();
201 double eta = truth4Mom.Eta();
230 !isLeptonFromTau(truthPart) );
237 int apId = abs(truthPart->
pdgId());
238 auto truth4Mom = truthPart->
p4();
239 double p = truth4Mom.P();
240 double phi = truth4Mom.Phi();
241 double pt = truth4Mom.Pt();
242 double eta = truth4Mom.Eta();
254 m_avM[apId]=truthPart->
m();
255 m_av2M[apId]=truthPart->
m() * truthPart->
m();
266 m_avM[apId]+=truthPart->
m();
267 m_av2M[apId]+=truthPart->
m() * truthPart->
m();
281 msg(MSG::INFO) <<
"Counts of PDGs of all stable particles :" <<
endmsg;
282 msg(MSG::INFO) <<
"========================================" <<
endmsg;
283 msg(MSG::INFO) <<
"| PDG | # particles |" <<
endmsg;
286 msg(MSG::INFO) <<
"|"
287 << std::setw(10) <<
it->first <<
" |"
288 << std::setw(10) <<
it->second <<
" |"
291 msg(MSG::INFO) <<
"| PDG | <p> | rms | <pt> | rms | <eta> | rms |" <<
endmsg;
304 msg(MSG::INFO) <<
"|"
305 << std::setw(15) <<
it->first <<
" |"
306 << std::setw(15) <<
p <<
" |"
307 << std::setw(15) <<
p2 <<
" |"
308 << std::setw(15) <<
pt <<
" |"
309 << std::setw(15) << pt2 <<
" |"
310 << std::setw(15) <<
eta <<
" |"
311 << std::setw(15) <<
eta2 <<
" |"
314 msg(MSG::INFO) <<
"| PDG | <phi> | rms | <m> | rms |" <<
endmsg;
326 msg(MSG::INFO) <<
"|"
327 << std::setw(15) <<
it->first <<
" |"
328 << std::setw(15) <<
phi <<
" |"
329 << std::setw(15) << phi2 <<
" |"
330 << std::setw(15) <<
m <<
" |"
331 << std::setw(15) <<
m2 <<
" |"
335 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
JetTruthParticleSelectorTool(const std::string &s)
Scalar phi() const
phi method
bool isSpecialNonInteracting(const T &p)
Identify a special non-interacting particles.
bool passKinematics(const xAOD::TruthParticle *truth) const
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
#define ATH_MSG_VERBOSE(x)
double deltaR2(double rapidity1, double phi1, double rapidity2, double phi2)
from bare rapidity,phi
const TPLinks_t & outgoingParticleLinks() const
Get all the outgoing particles.
std::vector< const xAOD::TruthParticle * > m_wzLeptons
bool isSMLepton(const T &p)
virtual StatusCode finalize() override
std::string m_selectionModeName
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
bool hasProdVtx() const
Check for a production vertex on this particle.
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Class describing a truth vertex in the MC record.
bool selector(const xAOD::TruthParticle *truth)
virtual ~JetTruthParticleSelectorTool()
bool isGeantino(const T &p)
bool isStableOrSimDecayed(const T &p)
Identify if particle is satble or decayed in simulation.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
size_t nIncomingParticles() const
Get the number of incoming particles.
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
bool isZeroEnergyPhoton(const T &p)
Identify a photon with zero energy. Probably a workaround for a generator bug.
int pdgId() const
PDG ID code.
SelectionMode m_selectionMode
virtual double m() const override final
The mass of the particle.
const TPLinks_t & incomingParticleLinks() const
Get all the incoming particles.