ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ParticleSampler Class Reference

#include <Samplers.h>

Collaboration diagram for ParticleSampler:

Public Member Functions

 ~ParticleSampler ()=default
 
 ParticleSampler (Sampler *pid, MomSampler *mom, int n=1)
 
std::vector< SampledParticleshoot ()
 

Private Attributes

MomSamplerm_mom {}
 
PosSampler m_pos {}
 
Samplerm_pid {}
 
ConstSampler m_n {}
 
bool m_mass_override {}
 
std::map< unsigned int, float > m_massdict
 

Detailed Description

Definition at line 345 of file Samplers.h.

Constructor & Destructor Documentation

◆ ~ParticleSampler()

ParticleSampler::~ParticleSampler ( )
default

◆ ParticleSampler()

ParticleSampler::ParticleSampler ( Sampler pid,
MomSampler mom,
int  n = 1 
)
inline

Definition at line 348 of file Samplers.h.

Member Function Documentation

◆ shoot()

std::vector<SampledParticle> ParticleSampler::shoot ( )
inline

Definition at line 367 of file Samplers.h.

367  {
368  int numparticles = m_n.shoot();
369  std::cout << "ParticleSampler throwing " << numparticles << " particles" << std::endl;
370  std::vector<SampledParticle> rtn;
371  for (int i=0; i<numparticles ; i++){
372  //Sample the particle ID and create a particle
373  int pid = m_pid->shoot();
374  std::cout << " shot pid=" << pid << std::endl;
376  // Pass mass info to the v4 sampler and set same generated mass
377  if (m_mass_override && m_massdict.find(abs(pid))!=m_massdict.end()){
378  float m = m_massdict[abs(pid)];
379  m_mom->m_mass = new ConstSampler(m);
380  p.m_mass = m;
381  }
382  // Sample momentum and vertex positions into the particle
383  p.m_mom = m_mom->shoot();
384  p.m_pos = m_pos.shoot();
385  std::cout << " (" << p.m_mom.Eta() << ", " << p.m_mom.Phi() << ", " << p.m_mom.E() << ", " << p.m_mom.M() << ")" << std::endl;
386  // Add particle to output list
387  rtn.push_back(p);
388  }
389  return rtn;
390  }

Member Data Documentation

◆ m_mass_override

bool ParticleSampler::m_mass_override {}
private

Definition at line 396 of file Samplers.h.

◆ m_massdict

std::map<unsigned int,float> ParticleSampler::m_massdict
private

Definition at line 397 of file Samplers.h.

◆ m_mom

MomSampler* ParticleSampler::m_mom {}
private

Definition at line 392 of file Samplers.h.

◆ m_n

ConstSampler ParticleSampler::m_n {}
private

Definition at line 395 of file Samplers.h.

◆ m_pid

Sampler* ParticleSampler::m_pid {}
private

Definition at line 394 of file Samplers.h.

◆ m_pos

PosSampler ParticleSampler::m_pos {}
private

Definition at line 393 of file Samplers.h.


The documentation for this class was generated from the following file:
ParticleConstants::photonMassInMeV
constexpr double photonMassInMeV
various mass-less particles
Definition: ParticleConstants.h:136
ParticleSampler::m_massdict
std::map< unsigned int, float > m_massdict
Definition: Samplers.h:397
ParticleConstants::PDG2011::tauMassInMeV
constexpr double tauMassInMeV
the mass of the tau (in MeV)
Definition: ParticleConstants.h:32
MomSampler::shoot
virtual TLorentzVector shoot()
Definition: Samplers.h:43
ParticleConstants::PDG2011::muonMassInMeV
constexpr double muonMassInMeV
the mass of the muon (in MeV)
Definition: ParticleConstants.h:29
ParticleConstants::PDG2011::etaMassInMeV
constexpr double etaMassInMeV
the mass of the eta meson (in MeV)
Definition: ParticleConstants.h:44
ParticleConstants::PDG2011::chargedKaonMassInMeV
constexpr double chargedKaonMassInMeV
the mass of the charged kaon (in MeV)
Definition: ParticleConstants.h:50
MomSampler::m_mass
ConstSampler * m_mass
Definition: Samplers.h:45
ParticleSampler::m_mass_override
bool m_mass_override
Definition: Samplers.h:396
Sampler::shoot
virtual float shoot()
Definition: Samplers.h:25
ParticleConstants::PDG2011::piZeroMassInMeV
constexpr double piZeroMassInMeV
the mass of the pi zero (in MeV)
Definition: ParticleConstants.h:38
PosSampler::shoot
TLorentzVector shoot()
Definition: Samplers.h:267
ConstSampler
Definition: Samplers.h:31
PosSampler
Definition: Samplers.h:258
ParticleConstants::tauNeutrinoMassInMeV
constexpr double tauNeutrinoMassInMeV
Definition: ParticleConstants.h:139
ParticleSampler::m_pid
Sampler * m_pid
Definition: Samplers.h:394
ParticleConstants::muonNeutrinoMassInMeV
constexpr double muonNeutrinoMassInMeV
Definition: ParticleConstants.h:138
ParticleConstants::PDG2011::chargedPionMassInMeV
constexpr double chargedPionMassInMeV
the mass of the charged pion (in MeV)
Definition: ParticleConstants.h:41
SampledParticle
Definition: Samplers.h:330
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
lumiFormat.i
int i
Definition: lumiFormat.py:85
ConstSampler::shoot
virtual float shoot()
Definition: Samplers.h:36
beamspotman.n
n
Definition: beamspotman.py:729
ParticleConstants::PDG2011::KZeroMassInMeV
constexpr double KZeroMassInMeV
the mass of the neutral kaon (K0) (in MeV)
Definition: ParticleConstants.h:47
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
ParticleSampler::m_pos
PosSampler m_pos
Definition: Samplers.h:393
ParticleConstants::electronNeutrinoMassInMeV
constexpr double electronNeutrinoMassInMeV
Definition: ParticleConstants.h:137
ParticleSampler::m_n
ConstSampler m_n
Definition: Samplers.h:395
ParticleConstants::PDG2011::protonMassInMeV
constexpr double protonMassInMeV
the mass of the proton (in MeV)
Definition: ParticleConstants.h:71
ParticleSampler::m_mom
MomSampler * m_mom
Definition: Samplers.h:392
python.SystemOfUnits.m
float m
Definition: SystemOfUnits.py:106
ParticleConstants::PDG2011::neutronMassInMeV
constexpr double neutronMassInMeV
the mass of the neutron (in MeV)
Definition: ParticleConstants.h:68
ParticleConstants::PDG2011::electronMassInMeV
constexpr double electronMassInMeV
the mass of the electron (in MeV)
Definition: ParticleConstants.h:26