Manages GenParticles and Secondaries from interactions. More...
#include <ParticleManager.h>
Public Member Functions | |
unsigned | addEndVertex (const Particle *particle) |
Necessary to add an end vertex to a particle. More... | |
void | addSecondaries (const math::XYZTLorentzVector &vertexPosition, int motherSimTrackId, std::vector< std::unique_ptr< Particle > > &secondaries, const SimplifiedGeometry *layer=nullptr) |
Adds secondaries that are produced by any of the interactions (or particle decay) to the buffer. More... | |
const SimTrack | getSimTrack (unsigned i) |
Returns a given SimTrack. Needed for interfacing the code with the old calorimetry. More... | |
const SimVertex | getSimVertex (unsigned i) |
Returns the position of a given SimVertex. Needed for interfacing the code with the old calorimetry. More... | |
std::unique_ptr< Particle > | nextParticle (const RandomEngineAndDistribution &random) |
Returns the next particle that has to be propagated (secondary or genParticle). More... | |
ParticleManager (const HepMC::GenEvent &genEvent, const HepPDT::ParticleDataTable &particleDataTable, double beamPipeRadius, double deltaRchargedMother, const ParticleFilter &particleFilter, std::vector< SimTrack > &simTracks, std::vector< SimVertex > &simVertices) | |
Constructor. More... | |
~ParticleManager () | |
Default destructor. More... | |
Private Member Functions | |
unsigned | addSimTrack (const Particle *particle) |
Add a simTrack (simTrack contains some basic info about the particle, e.g. pdgId). More... | |
unsigned | addSimVertex (const math::XYZTLorentzVector &position, int motherIndex) |
Add a simVertex (simVertex contains information about the track it was produced). More... | |
std::unique_ptr< Particle > | nextGenParticle () |
Returns next particle from the GenEvent that has to be propagated. More... | |
Private Attributes | |
const double | beamPipeRadius2_ |
(Radius of the beampipe)^2 More... | |
const double | deltaRchargedMother_ |
For FastSim (cheat) tracking: cut on the angle between a charged mother and charged daughter. More... | |
const HepMC::GenEvent *const | genEvent_ |
The GenEvent. More... | |
const HepMC::GenEvent::particle_const_iterator | genParticleEnd_ |
The last particle of the GenEvent. More... | |
int | genParticleIndex_ |
Index of particle in the GenEvent (if it is a GenParticle) More... | |
HepMC::GenEvent::particle_const_iterator | genParticleIterator_ |
Iterator to keep track on which GenParticles where already considered. More... | |
double | lengthUnitConversionFactor2_ |
Convert pythia unis to cm^2 (FastSim standard) More... | |
double | lengthUnitConversionFactor_ |
Convert pythia unis to cm (FastSim standard) More... | |
double | momentumUnitConversionFactor_ |
Convert pythia units to GeV (FastSim standard) More... | |
std::vector< std::unique_ptr< Particle > > | particleBuffer_ |
The vector of all secondaries that are not yet propagated in the event. More... | |
const HepPDT::ParticleDataTable *const | particleDataTable_ |
Necessary to get information like lifetime and charge of a particle if unknown. More... | |
const ParticleFilter *const | particleFilter_ |
(Kinematic) cuts on the particles that have to be propagated. More... | |
std::vector< SimTrack > * | simTracks_ |
The generated SimTrack of this event. More... | |
std::vector< SimVertex > * | simVertices_ |
The generated SimVertices of this event. More... | |
double | timeUnitConversionFactor_ |
Convert pythia unis to ns (FastSim standard) More... | |
Manages GenParticles and Secondaries from interactions.
Manages which particle has to be propagated next, this includes GenParticles and secondaries from the interactions. Furthermore, checks if all necessary information is included with the GenParticles (charge, lifetime), otherwise reads information from HepPDT::ParticleDataTable. Also handles secondaries, including closestChargedDaughter algorithm which is used for FastSim (cheat) tracking: a charged daughter can continue the track of a charged mother, see addSecondaries(...).
Definition at line 36 of file ParticleManager.h.
fastsim::ParticleManager::ParticleManager | ( | const HepMC::GenEvent & | genEvent, |
const HepPDT::ParticleDataTable & | particleDataTable, | ||
double | beamPipeRadius, | ||
double | deltaRchargedMother, | ||
const ParticleFilter & | particleFilter, | ||
std::vector< SimTrack > & | simTracks, | ||
std::vector< SimVertex > & | simVertices | ||
) |
Constructor.
genEvent | Get the GenEvent. |
particleDataTable | Get information about particles, e.g. charge, lifetime. |
beamPipeRadius | Radius of the beampipe. |
deltaRchargedMother | For FastSim (cheat) tracking: cut on the angle between a charged mother and charged daughter. |
particleFilter | Selects which particles have to be propagated. |
simTracks | The SimTracks. |
simVertices | The SimVertices. |
Definition at line 17 of file ParticleManager.cc.
References addSimVertex(), nano_cff::genEvent, genEvent_, lengthUnitConversionFactor_, position, and timeUnitConversionFactor_.
fastsim::ParticleManager::~ParticleManager | ( | ) |
unsigned fastsim::ParticleManager::addEndVertex | ( | const Particle * | particle | ) |
Necessary to add an end vertex to a particle.
Needed if particle is no longer propagated for some reason (e.g. remaining energy below threshold) and no secondaries where produced at that point.
Definition at line 178 of file ParticleManager.cc.
References fastsim::Particle::position(), and fastsim::Particle::simTrackIndex().
void fastsim::ParticleManager::addSecondaries | ( | const math::XYZTLorentzVector & | vertexPosition, |
int | motherSimTrackId, | ||
std::vector< std::unique_ptr< Particle > > & | secondaries, | ||
const SimplifiedGeometry * | layer = nullptr |
||
) |
Adds secondaries that are produced by any of the interactions (or particle decay) to the buffer.
Also checks which charged daughter is closest to a charged mother (in deltaR) and assigns the same SimTrack ID.
vertexPosition | The origin vertex (interaction or particle decay took place here). |
motherSimTrackId | SimTrack ID of the mother particle, necessary for FastSim (cheat) tracking. |
secondaries | All secondaries that where produced in a single particle decay or interaction. |
Definition at line 119 of file ParticleManager.cc.
References muonTagProbeFilters_cff::distMin, charmTagsComputerCvsB_cfi::idx, fastsim::SimplifiedGeometry::index(), fastsim::SimplifiedGeometry::isForward(), and eostools::move().
Referenced by FastSimProducer::createFSimTrack().
|
private |
Add a simTrack (simTrack contains some basic info about the particle, e.g. pdgId).
Add a simTrack for a given particle and assign an index for that track. This might also be the index of the track of the mother particle (FastSim cheat tracking).
particle | Particle that produces that simTrack. |
Definition at line 188 of file ParticleManager.cc.
References fastsim::Particle::genParticleIndex(), fastsim::Particle::momentum(), fastsim::Particle::pdgId(), and fastsim::Particle::simVertexIndex().
|
private |
Add a simVertex (simVertex contains information about the track it was produced).
Add a origin vertex for any particle.
position | Position of the vertex. |
motherIndex | Index of the parent's simTrack. |
Definition at line 182 of file ParticleManager.cc.
References position.
Referenced by ParticleManager().
|
inline |
Returns a given SimTrack. Needed for interfacing the code with the old calorimetry.
Definition at line 85 of file ParticleManager.h.
References mps_fire::i, and simTracks_.
Referenced by FastSimProducer::createFSimTrack().
|
inline |
Returns the position of a given SimVertex. Needed for interfacing the code with the old calorimetry.
Definition at line 82 of file ParticleManager.h.
References mps_fire::i, and simVertices_.
Referenced by FastSimProducer::createFSimTrack().
|
private |
Returns next particle from the GenEvent that has to be propagated.
Tries to get some basic information about the status of the particle from the GenEvent and does some first rejection cuts based on them.
Definition at line 196 of file ParticleManager.cc.
References funct::abs(), GenParticle::GenParticle, and fastsim::Constants::speedOfLight.
std::unique_ptr< fastsim::Particle > fastsim::ParticleManager::nextParticle | ( | const RandomEngineAndDistribution & | random | ) |
Returns the next particle that has to be propagated (secondary or genParticle).
Main method of this class. At first consideres particles from the buffer (secondaries) if there are none, then the next GenParticle is considered. Only returns particles that pass the (kinetic) cuts of the ParticleFilter. Furthermore, uses the ParticleDataTable to ensure all necessary information about the particle is stored (lifetime, charge).
Definition at line 62 of file ParticleManager.cc.
References MillePedeFileConverter_cfg::e, RandomEngineAndDistribution::flatShoot(), dqm-mbProfile::log, eostools::move(), LHEGenericFilter_cfi::ParticleID, and ApeEstimator_cff::width.
|
private |
(Radius of the beampipe)^2
Definition at line 128 of file ParticleManager.h.
|
private |
For FastSim (cheat) tracking: cut on the angle between a charged mother and charged daughter.
Definition at line 130 of file ParticleManager.h.
|
private |
|
private |
The last particle of the GenEvent.
Definition at line 124 of file ParticleManager.h.
|
private |
Index of particle in the GenEvent (if it is a GenParticle)
Definition at line 125 of file ParticleManager.h.
|
private |
Iterator to keep track on which GenParticles where already considered.
Definition at line 123 of file ParticleManager.h.
|
private |
Convert pythia unis to cm^2 (FastSim standard)
Definition at line 136 of file ParticleManager.h.
|
private |
Convert pythia unis to cm (FastSim standard)
Definition at line 135 of file ParticleManager.h.
Referenced by ParticleManager().
|
private |
Convert pythia units to GeV (FastSim standard)
Definition at line 134 of file ParticleManager.h.
|
private |
The vector of all secondaries that are not yet propagated in the event.
Definition at line 139 of file ParticleManager.h.
|
private |
Necessary to get information like lifetime and charge of a particle if unknown.
Definition at line 127 of file ParticleManager.h.
|
private |
(Kinematic) cuts on the particles that have to be propagated.
Definition at line 131 of file ParticleManager.h.
|
private |
The generated SimTrack of this event.
Definition at line 132 of file ParticleManager.h.
Referenced by getSimTrack().
|
private |
The generated SimVertices of this event.
Definition at line 133 of file ParticleManager.h.
Referenced by getSimVertex().
|
private |
Convert pythia unis to ns (FastSim standard)
Definition at line 137 of file ParticleManager.h.
Referenced by ParticleManager().