CMS 3D CMS Logo

ParticleManager.h
Go to the documentation of this file.
1 #ifndef FASTSIM_PARTICLEMANAGER_H
2 #define FASTSIM_PARTICLEMANAGER_H
3 
5 #include "HepMC/GenEvent.h"
6 #include <vector>
7 #include <memory>
8 
11 
13 // Author: L. Vanelderen, S. Kurz
14 // Date: 29 May 2017
16 
17 namespace HepPDT {
18  class ParticleDataTable;
19 }
20 
22 
23 namespace fastsim {
24  class Particle;
25  class ParticleFilter;
26  class SimplifiedGeometry;
27 
29 
37  public:
39 
49  const HepPDT::ParticleDataTable& particleDataTable,
50  double beamPipeRadius,
51  double deltaRchargedMother,
53  std::vector<SimTrack>& simTracks,
54  std::vector<SimVertex>& simVertices);
55 
58 
60 
67  std::unique_ptr<Particle> nextParticle(const RandomEngineAndDistribution& random);
68 
70 
76  void addSecondaries(const math::XYZTLorentzVector& vertexPosition,
77  int motherSimTrackId,
78  std::vector<std::unique_ptr<Particle> >& secondaries,
79  const SimplifiedGeometry* layer = nullptr);
80 
82  const SimVertex getSimVertex(unsigned i) { return simVertices_->at(i); }
83 
85  const SimTrack getSimTrack(unsigned i) { return simTracks_->at(i); }
86 
88 
93  unsigned addEndVertex(const Particle* particle);
94 
95  private:
97 
104 
106 
112  unsigned addSimTrack(const Particle* particle);
113 
115 
118  std::unique_ptr<Particle> nextGenParticle();
119 
120  // data members
121  const HepMC::GenEvent* const genEvent_;
122  HepMC::GenEvent::particle_const_iterator
124  const HepMC::GenEvent::particle_const_iterator genParticleEnd_;
126  const HepPDT::ParticleDataTable* const
128  const double beamPipeRadius2_;
129  const double
132  std::vector<SimTrack>* simTracks_;
133  std::vector<SimVertex>* simVertices_;
138  std::vector<std::unique_ptr<Particle> >
140  };
141 } // namespace fastsim
142 
143 #endif
fastSimProducer_cff.beamPipeRadius
beamPipeRadius
Definition: fastSimProducer_cff.py:17
fastsim::ParticleManager::particleBuffer_
std::vector< std::unique_ptr< Particle > > particleBuffer_
The vector of all secondaries that are not yet propagated in the event.
Definition: ParticleManager.h:139
mps_fire.i
i
Definition: mps_fire.py:355
SimVertex
Definition: SimVertex.h:5
fastsim::ParticleManager::beamPipeRadius2_
const double beamPipeRadius2_
(Radius of the beampipe)^2
Definition: ParticleManager.h:128
fastsim::SimplifiedGeometry
Implementation of a generic detector layer (base class for forward/barrel layers).
Definition: SimplifiedGeometry.h:35
fastsim::ParticleManager::~ParticleManager
~ParticleManager()
Default destructor.
Definition: ParticleManager.cc:60
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
objects.autophobj.motherIndex
motherIndex
Definition: autophobj.py:242
fastsim::ParticleManager::addSimVertex
unsigned addSimVertex(const math::XYZTLorentzVector &position, int motherIndex)
Add a simVertex (simVertex contains information about the track it was produced).
Definition: ParticleManager.cc:182
fastsim::ParticleManager::genEvent_
const HepMC::GenEvent *const genEvent_
The GenEvent.
Definition: ParticleManager.h:121
ParticleFilter_cfi.ParticleFilter
ParticleFilter
Definition: ParticleFilter_cfi.py:4
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
fastsim::ParticleManager::genParticleIterator_
HepMC::GenEvent::particle_const_iterator genParticleIterator_
Iterator to keep track on which GenParticles where already considered.
Definition: ParticleManager.h:123
fastsim::ParticleManager
Manages GenParticles and Secondaries from interactions.
Definition: ParticleManager.h:36
fastsim::ParticleManager::timeUnitConversionFactor_
double timeUnitConversionFactor_
Convert pythia unis to ns (FastSim standard)
Definition: ParticleManager.h:137
SimVertex.h
fastsim::ParticleManager::particleDataTable_
const HepPDT::ParticleDataTable *const particleDataTable_
Necessary to get information like lifetime and charge of a particle if unknown.
Definition: ParticleManager.h:127
fastsim::ParticleManager::lengthUnitConversionFactor2_
double lengthUnitConversionFactor2_
Convert pythia unis to cm^2 (FastSim standard)
Definition: ParticleManager.h:136
fastsim::ParticleManager::momentumUnitConversionFactor_
double momentumUnitConversionFactor_
Convert pythia units to GeV (FastSim standard)
Definition: ParticleManager.h:134
HepPDT
Definition: ParticleManager.h:17
fastsim::ParticleManager::getSimVertex
const SimVertex getSimVertex(unsigned i)
Returns the position of a given SimVertex. Needed for interfacing the code with the old calorimetry.
Definition: ParticleManager.h:82
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
fastsim::ParticleManager::particleFilter_
const ParticleFilter *const particleFilter_
(Kinematic) cuts on the particles that have to be propagated.
Definition: ParticleManager.h:131
LorentzVector.h
fastsim::ParticleManager::genParticleEnd_
const HepMC::GenEvent::particle_const_iterator genParticleEnd_
The last particle of the GenEvent.
Definition: ParticleManager.h:124
fastsim::ParticleManager::addSimTrack
unsigned addSimTrack(const Particle *particle)
Add a simTrack (simTrack contains some basic info about the particle, e.g. pdgId).
Definition: ParticleManager.cc:188
fastsim::ParticleManager::addSecondaries
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.
Definition: ParticleManager.cc:119
fastsim::ParticleManager::getSimTrack
const SimTrack getSimTrack(unsigned i)
Returns a given SimTrack. Needed for interfacing the code with the old calorimetry.
Definition: ParticleManager.h:85
nano_cff.genEvent
genEvent
Definition: nano_cff.py:97
fastsim::ParticleManager::genParticleIndex_
int genParticleIndex_
Index of particle in the GenEvent (if it is a GenParticle)
Definition: ParticleManager.h:125
SimTrack
Definition: SimTrack.h:6
fastsim::ParticleManager::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.
Definition: ParticleManager.cc:17
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
fastsim::ParticleManager::lengthUnitConversionFactor_
double lengthUnitConversionFactor_
Convert pythia unis to cm (FastSim standard)
Definition: ParticleManager.h:135
fastsim::ParticleManager::nextGenParticle
std::unique_ptr< Particle > nextGenParticle()
Returns next particle from the GenEvent that has to be propagated.
Definition: ParticleManager.cc:196
Particle
Definition: Particle.py:1
fastsim
Definition: BarrelSimplifiedGeometry.h:15
HGCalValidator_cfi.simVertices
simVertices
Definition: HGCalValidator_cfi.py:43
SimTrack.h
fastsim::ParticleManager::deltaRchargedMother_
const double deltaRchargedMother_
For FastSim (cheat) tracking: cut on the angle between a charged mother and charged daughter.
Definition: ParticleManager.h:130
fastsim::ParticleManager::addEndVertex
unsigned addEndVertex(const Particle *particle)
Necessary to add an end vertex to a particle.
Definition: ParticleManager.cc:178
fastSimProducer_cff.particleFilter
particleFilter
Definition: fastSimProducer_cff.py:12
ParticleDataTable
HepPDT::ParticleDataTable ParticleDataTable
Definition: ParticleDataTable.h:8
fastSimProducer_cff.deltaRchargedMother
deltaRchargedMother
Definition: fastSimProducer_cff.py:18
fastsim::ParticleFilter
(Kinematic) cuts on the particles that are propagated.
Definition: ParticleFilter.h:26
fastsim::ParticleManager::nextParticle
std::unique_ptr< Particle > nextParticle(const RandomEngineAndDistribution &random)
Returns the next particle that has to be propagated (secondary or genParticle).
Definition: ParticleManager.cc:62
fastsim::ParticleManager::simTracks_
std::vector< SimTrack > * simTracks_
The generated SimTrack of this event.
Definition: ParticleManager.h:132
RandomEngineAndDistribution
Definition: RandomEngineAndDistribution.h:18
fastsim::ParticleManager::simVertices_
std::vector< SimVertex > * simVertices_
The generated SimVertices of this event.
Definition: ParticleManager.h:133