eic-smear  1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
ParticleIdentifier Class Reference

Implements methods to identify particles based on their species and status codes. More...

#include <ParticleIdentifier.h>

Public Member Functions

 ParticleIdentifier (const int leptonPdg=~unsigned(0)/2)
 Default constructor. More...
 
virtual ~ParticleIdentifier ()
 
virtual bool isBeamLepton (const erhic::VirtualParticle &) const
 Returns whether the particle is the beam lepton. More...
 
virtual bool isBeamNucleon (const erhic::VirtualParticle &) const
 Returns whether the particle is the beam hadron. More...
 
virtual bool isScatteredLepton (const erhic::VirtualParticle &) const
 Returns whether the particle is the scattered lepton beam particle. More...
 
virtual bool IsVirtualPhoton (const erhic::VirtualParticle &) const
 Returns whether the particle is a virtual photon. More...
 
virtual bool SkipParticle (const erhic::VirtualParticle &) const
 Returns whether the particles should be skipped by the tree building code. More...
 
virtual void SetLeptonBeamPdgCode (int pdg)
 Sets the PDG code to use when identifying the lepton beam. More...
 
virtual int GetLeptonBeamPdgCode () const
 Returns the PDG code to use when identifying the lepton beam. More...
 
virtual bool SetChargedCurrent (bool isChargedCurrent)
 Look for charged current events. More...
 

Static Public Member Functions

static bool IdentifyBeams (const erhic::VirtualEvent &, BeamParticles &)
 Identify the beams from an event and store their properties in a BeamParticles object. More...
 
static bool IdentifyBeams (const erhic::VirtualEvent &, std::vector< const erhic::VirtualParticle * > &)
 Identify the beams from an event and store their properties in a vector of pointers to the particle objects in the event. More...
 

Protected Member Functions

Int_t DetermineScatteredType (Int_t)
 Determine the scattered lepton type from an incident lepton type. More...
 

Protected Attributes

Bool_t mChargedCurrent
 
Int_t mLeptonBeamPdgCode
 
Int_t mScatteredPdgCode
 

Detailed Description

Implements methods to identify particles based on their species and status codes.

Definition at line 25 of file ParticleIdentifier.h.

Constructor & Destructor Documentation

◆ ParticleIdentifier()

ParticleIdentifier::ParticleIdentifier ( const int  leptonPdg = ~unsigned(0)/2)

Default constructor.

Initialise with the PDG code of the lepton beam. The default is an invalid value.

Definition at line 21 of file ParticleIdentifier.cxx.

◆ ~ParticleIdentifier()

virtual ParticleIdentifier::~ParticleIdentifier ( )
inlinevirtual

Definition at line 34 of file ParticleIdentifier.h.

Member Function Documentation

◆ DetermineScatteredType()

Int_t ParticleIdentifier::DetermineScatteredType ( Int_t  beamType)
protected

Determine the scattered lepton type from an incident lepton type.

For neutral current events these are equal. For charged current events the scattered lepton will be a neutrino, the type of which depends on the incident lepton type e.g. beam electron (11) --> scattered nu_e (12) beam positron (-11) --> scattered nu_e_bar (-12) Even though we would not envisage mu or tau beams (!) the algorithm is still robust for these inputs.

Definition at line 102 of file ParticleIdentifier.cxx.

◆ GetLeptonBeamPdgCode()

int ParticleIdentifier::GetLeptonBeamPdgCode ( ) const
inlinevirtual

Returns the PDG code to use when identifying the lepton beam.

Definition at line 121 of file ParticleIdentifier.h.

◆ IdentifyBeams() [1/2]

bool ParticleIdentifier::IdentifyBeams ( const erhic::VirtualEvent event,
BeamParticles beams 
)
static

Identify the beams from an event and store their properties in a BeamParticles object.

See BeamParticles.h for the quantities stored. Returns true if all beams are found, false if not. Important: finding the scattered hadron beam is not implemented.

Definition at line 139 of file ParticleIdentifier.cxx.

◆ IdentifyBeams() [2/2]

bool ParticleIdentifier::IdentifyBeams ( const erhic::VirtualEvent event,
std::vector< const erhic::VirtualParticle * > &  beams 
)
static

Identify the beams from an event and store their properties in a vector of pointers to the particle objects in the event.

Do not delete the pointers, as they belong to the event. The returned vector has four entries, in this order: incident lepton, incident hadron, exchanged boson, scattered lepton. Any particle not found yields a NULL pointer in the vector. Returns true if all beams are found (i.e. no NULL pointers), false if not. Important: finding the scattered hadron beam is not implemented.

Definition at line 161 of file ParticleIdentifier.cxx.

◆ isBeamLepton()

bool ParticleIdentifier::isBeamLepton ( const erhic::VirtualParticle particle) const
virtual

Returns whether the particle is the beam lepton.

Definition at line 30 of file ParticleIdentifier.cxx.

◆ isBeamNucleon()

bool ParticleIdentifier::isBeamNucleon ( const erhic::VirtualParticle particle) const
virtual

Returns whether the particle is the beam hadron.

Definition at line 90 of file ParticleIdentifier.cxx.

◆ isScatteredLepton()

bool ParticleIdentifier::isScatteredLepton ( const erhic::VirtualParticle particle) const
virtual

Returns whether the particle is the scattered lepton beam particle.

Definition at line 41 of file ParticleIdentifier.cxx.

◆ IsVirtualPhoton()

bool ParticleIdentifier::IsVirtualPhoton ( const erhic::VirtualParticle particle) const
virtual

Returns whether the particle is a virtual photon.

Definition at line 81 of file ParticleIdentifier.cxx.

◆ SetChargedCurrent()

bool ParticleIdentifier::SetChargedCurrent ( bool  isChargedCurrent)
virtual

Look for charged current events.

In this case, the scattered lepton searched for will be the neutrino corresponding to the incident lepton beam type (e.g. W- for electron, W+ for proton).

Definition at line 121 of file ParticleIdentifier.cxx.

◆ SetLeptonBeamPdgCode()

void ParticleIdentifier::SetLeptonBeamPdgCode ( int  pdg)
virtual

Sets the PDG code to use when identifying the lepton beam.

Definition at line 112 of file ParticleIdentifier.cxx.

◆ SkipParticle()

bool ParticleIdentifier::SkipParticle ( const erhic::VirtualParticle particle) const
virtual

Returns whether the particles should be skipped by the tree building code.

Definition at line 54 of file ParticleIdentifier.cxx.

Member Data Documentation

◆ mChargedCurrent

Bool_t ParticleIdentifier::mChargedCurrent
protected

Definition at line 116 of file ParticleIdentifier.h.

◆ mLeptonBeamPdgCode

Int_t ParticleIdentifier::mLeptonBeamPdgCode
protected

Definition at line 117 of file ParticleIdentifier.h.

◆ mScatteredPdgCode

Int_t ParticleIdentifier::mScatteredPdgCode
protected

Definition at line 118 of file ParticleIdentifier.h.


The documentation for this class was generated from the following files: