Produces SimHits in the tracker layers. More...
Public Member Functions | |
std::pair< double, std::unique_ptr< PSimHit > > | createHitOnDetector (const TrajectoryStateOnSurface &particle, int pdgId, double layerThickness, double eLoss, int simTrackId, const GeomDet &detector, GlobalPoint &refPos) |
Helper funtion to create the actual SimHit on a detector (sub-) module. More... | |
void | interact (Particle &particle, const SimplifiedGeometry &layer, std::vector< std::unique_ptr< Particle >> &secondaries, const RandomEngineAndDistribution &random) override |
Perform the interaction. More... | |
void | registerProducts (edm::ProducesCollector) const override |
Register the SimHit collection. More... | |
void | storeProducts (edm::Event &iEvent) override |
Store the SimHit collection. More... | |
TrackerSimHitProducer (const std::string &name, const edm::ParameterSet &cfg) | |
Constructor. More... | |
~TrackerSimHitProducer () override | |
Default destructor. More... | |
Public Member Functions inherited from fastsim::InteractionModel | |
const std::string | getName () |
Return (unique) name of this interaction. More... | |
virtual void | interact (Particle &particle, const SimplifiedGeometry &layer, std::vector< std::unique_ptr< Particle > > &secondaries, const RandomEngineAndDistribution &random)=0 |
Perform the interaction. More... | |
InteractionModel (std::string name) | |
Constructor. More... | |
virtual | ~InteractionModel () |
Default destructor. More... | |
Private Attributes | |
bool | doHitsFromInboundParticles_ |
If not set, incoming particles (negative speed relative to center of detector) don't create a SimHits since reconstruction anyways not possible. More... | |
double | minMomentum_ |
Set the minimal momentum of incoming particle. More... | |
const double | onSurfaceTolerance_ |
Max distance between particle and active (sub-) module. Otherwise particle has to be propagated. More... | |
std::unique_ptr< edm::PSimHitContainer > | simHitContainer_ |
The SimHit. More... | |
Produces SimHits in the tracker layers.
Also assigns the energy loss of the particle (ionization) with the SimHit. Furthermore, SimHits from different SubModules have to be sorted by their occurance!
Definition at line 54 of file TrackerSimHitProducer.cc.
fastsim::TrackerSimHitProducer::TrackerSimHitProducer | ( | const std::string & | name, |
const edm::ParameterSet & | cfg | ||
) |
Constructor.
Definition at line 108 of file TrackerSimHitProducer.cc.
References looper::cfg, doHitsFromInboundParticles_, and minMomentum_.
|
inlineoverride |
std::pair< double, std::unique_ptr< PSimHit > > fastsim::TrackerSimHitProducer::createHitOnDetector | ( | const TrajectoryStateOnSurface & | particle, |
int | pdgId, | ||
double | layerThickness, | ||
double | eLoss, | ||
int | simTrackId, | ||
const GeomDet & | detector, | ||
GlobalPoint & | refPos | ||
) |
Helper funtion to create the actual SimHit on a detector (sub-) module.
particle | Representation of the particle's trajectory |
pdgId | The pdgId of the particle |
layerThickness | The thickness of the layer (in radLengths) |
eLoss | The energy that particle deposited in the detector (lost via ionisation) |
simTrackId | The SimTrack this hit should be assigned to |
detector | The detector element that is hit |
refPos | Reference position that is used to sort the hits if layer consists of sub-detectors \ return Returns the SimHit and the distance relative to refPos since hits have to be ordered (in time) afterwards. |
Definition at line 256 of file TrackerSimHitProducer.cc.
References anyDirection, PV3DBase< T, PVType, FrameType >::basicVector(), Surface::bounds(), hgcalTestNeighbor_cfi::detector, simKBmtfDigis_cfi::eLoss, mps_splice::entry, beamvalidation::exit(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), Bounds::length(), TrajectoryStateOnSurface::localMomentum(), TrajectoryStateOnSurface::localPosition(), PV3DBase< T, PVType, FrameType >::mag(), mag(), castor_dqm_sourceclient_file_cfg::path, EgammaValidation_cff::pdgId, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), fastsim::Constants::speedOfLight, PV3DBase< T, PVType, FrameType >::theta(), Bounds::thickness(), TrajectoryStateOnSurface::transverseCurvature(), Vector3DBase< T, FrameTag >::unit(), Bounds::width(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
|
override |
Perform the interaction.
particle | The particle that interacts with the matter. |
layer | The detector layer that interacts with the particle. |
secondaries | Particles that are produced in the interaction (if any). |
random | The Random Engine. |
Definition at line 127 of file TrackerSimHitProducer.cc.
References anyDirection, fastsim::Particle::charge(), hgcalTestNeighbor_cfi::detector, fastsim::Particle::getEnergyDeposit(), fastsim::Particle::getMotherSimTrackIndex(), fastsim::Particle::isLooper(), phase1PixelTopology::layer, HLT_2022v14_cff::magneticField, genParticles_cff::map, fastsim::Particle::momentum(), eostools::move(), EgammaValidation_cff::pdgId, fastsim::Particle::pdgId(), fastsim::Particle::position(), position, TrackCandidateProducer_cfi::propagator, fastsim::Particle::setEnergyDeposit(), fastsim::Particle::setLooper(), and fastsim::Particle::simTrackIndex().
|
overridevirtual |
Register the SimHit collection.
Reimplemented from fastsim::InteractionModel.
Definition at line 118 of file TrackerSimHitProducer.cc.
References edm::ProducesCollector::produces().
|
overridevirtual |
Store the SimHit collection.
Reimplemented from fastsim::InteractionModel.
Definition at line 122 of file TrackerSimHitProducer.cc.
References iEvent, and eostools::move().
|
private |
If not set, incoming particles (negative speed relative to center of detector) don't create a SimHits since reconstruction anyways not possible.
Definition at line 104 of file TrackerSimHitProducer.cc.
Referenced by TrackerSimHitProducer().
|
private |
Set the minimal momentum of incoming particle.
Definition at line 103 of file TrackerSimHitProducer.cc.
Referenced by TrackerSimHitProducer().
|
private |
Max distance between particle and active (sub-) module. Otherwise particle has to be propagated.
Definition at line 101 of file TrackerSimHitProducer.cc.
|
private |
The SimHit.
Definition at line 102 of file TrackerSimHitProducer.cc.