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  void exoticRelativesChecker(const HepMC::GenVertex* originVertex, int& hasExoticAssociation, int ngendepth);
114 
116 
119  std::unique_ptr<Particle> nextGenParticle();
120 
121  // data members
122  const HepMC::GenEvent* const genEvent_;
123  HepMC::GenEvent::particle_const_iterator
125  const HepMC::GenEvent::particle_const_iterator genParticleEnd_;
127  const HepPDT::ParticleDataTable* const
129  const double beamPipeRadius2_;
130  const double
133  std::vector<SimTrack>* simTracks_;
134  std::vector<SimVertex>* simVertices_;
139  std::vector<std::unique_ptr<Particle> >
141  };
142 } // namespace fastsim
143 
144 inline bool isExotic(int pdgid_) {
145  unsigned int pdgid = std::abs(pdgid_);
146  return ((pdgid >= 1000000 && pdgid < 4000000 && pdgid != 3000022) || // SUSY, R-hadron, and technicolor particles
147  pdgid == 17 || // 4th generation lepton
148  pdgid == 34 || // W-prime
149  pdgid == 37); // charged Higgs
150 }
151 
152 #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:140
mps_fire.i
i
Definition: mps_fire.py:428
SimVertex
Definition: SimVertex.h:5
fastsim::ParticleManager::beamPipeRadius2_
const double beamPipeRadius2_
(Radius of the beampipe)^2
Definition: ParticleManager.h:129
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:122
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:124
isExotic
bool isExotic(int pdgid_)
Definition: ParticleManager.h:144
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:138
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:128
fastsim::ParticleManager::lengthUnitConversionFactor2_
double lengthUnitConversionFactor2_
Convert pythia unis to cm^2 (FastSim standard)
Definition: ParticleManager.h:137
fastsim::ParticleManager::momentumUnitConversionFactor_
double momentumUnitConversionFactor_
Convert pythia units to GeV (FastSim standard)
Definition: ParticleManager.h:135
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
fastsim::ParticleManager::exoticRelativesChecker
void exoticRelativesChecker(const HepMC::GenVertex *originVertex, int &hasExoticAssociation, int ngendepth)
Definition: ParticleManager.cc:281
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:132
LorentzVector.h
fastsim::ParticleManager::genParticleEnd_
const HepMC::GenEvent::particle_const_iterator genParticleEnd_
The last particle of the GenEvent.
Definition: ParticleManager.h:125
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
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
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
fastsim::ParticleManager::genParticleIndex_
int genParticleIndex_
Index of particle in the GenEvent (if it is a GenParticle)
Definition: ParticleManager.h:126
SimTrack
Definition: SimTrack.h:6
genWeightsTable_cfi.genEvent
genEvent
Definition: genWeightsTable_cfi.py:4
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:136
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
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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:131
EgammaValidation_cff.pdgid
pdgid
Definition: EgammaValidation_cff.py:30
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:133
RandomEngineAndDistribution
Definition: RandomEngineAndDistribution.h:18
fastsim::ParticleManager::simVertices_
std::vector< SimVertex > * simVertices_
The generated SimVertices of this event.
Definition: ParticleManager.h:134