Produces SimHits in the tracker layers. More...
Public Member Functions | |
std::pair< double, 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::ProducerBase &producer) 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... | |
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 55 of file TrackerSimHitProducer.cc.
fastsim::TrackerSimHitProducer::TrackerSimHitProducer | ( | const std::string & | name, |
const edm::ParameterSet & | cfg | ||
) |
Constructor.
Definition at line 102 of file TrackerSimHitProducer.cc.
References doHitsFromInboundParticles_, edm::ParameterSet::getParameter(), and minMomentum_.
|
inlineoverride |
Default destructor.
Definition at line 62 of file TrackerSimHitProducer.cc.
References createHitOnDetector(), gamEcalExtractorBlocks_cff::detector, iEvent, interact(), common_cff::pdgId, random, registerProducts(), and storeProducts().
std::pair< double, 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 245 of file TrackerSimHitProducer.cc.
References anyDirection, PV3DBase< T, PVType, FrameType >::basicVector(), Surface::bounds(), DEFINE_EDM_PLUGIN, mps_splice::entry, cmsRelvalreport::exit, GeomDet::geographicalId(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::localMomentum(), TrajectoryStateOnSurface::localPosition(), PV3DBase< T, PVType, FrameType >::mag(), mag(), onSurfaceTolerance_, callgraph::path, common_cff::pdgId, PV3DBase< T, PVType, FrameType >::phi(), DetId::rawId(), fastsim::Constants::speedOfLight, GeomDet::surface(), PV3DBase< T, PVType, FrameType >::theta(), Bounds::thickness(), Surface::toGlobal(), GeomDet::toLocal(), TrajectoryStateOnSurface::transverseCurvature(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by interact(), and ~TrackerSimHitProducer().
|
overridevirtual |
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. |
Implements fastsim::InteractionModel.
Definition at line 126 of file TrackerSimHitProducer.cc.
References anyDirection, fastsim::Particle::charge(), GeometricSearchDet::compatibleDets(), GeomDet::components(), createHitOnDetector(), gamEcalExtractorBlocks_cff::detector, doHitsFromInboundParticles_, fastsim::SimplifiedGeometry::getDetLayer(), fastsim::Particle::getEnergyDeposit(), fastsim::SimplifiedGeometry::getMagneticFieldZ(), fastsim::Particle::getMotherDeltaR(), fastsim::Particle::getMotherPdgId(), fastsim::SimplifiedGeometry::getThickness(), fastsim::SimplifiedGeometry::isForward(), GeomDet::isLeaf(), fastsim::Particle::isLooper(), seedCreatorFromRegionConsecutiveHitsEDProducer_cff::magneticField, minMomentum_, fastsim::Particle::momentum(), common_cff::pdgId, fastsim::Particle::pdgId(), fastsim::Particle::position(), position, PhotonConversionTrajectorySeedProducerFromQuadruplets_cfi::propagator, fastsim::Particle::setEnergyDeposit(), fastsim::Particle::setLooper(), simHitContainer_, fastsim::Particle::simTrackIndex(), GeometricSearchDet::surface(), and Surface::tangentPlane().
Referenced by ~TrackerSimHitProducer().
|
overridevirtual |
Register the SimHit collection.
Reimplemented from fastsim::InteractionModel.
Definition at line 115 of file TrackerSimHitProducer.cc.
References edm::ProductRegistryHelper::produces().
Referenced by ~TrackerSimHitProducer().
|
overridevirtual |
Store the SimHit collection.
Reimplemented from fastsim::InteractionModel.
Definition at line 120 of file TrackerSimHitProducer.cc.
References eostools::move(), edm::Event::put(), and simHitContainer_.
Referenced by ~TrackerSimHitProducer().
|
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 96 of file TrackerSimHitProducer.cc.
Referenced by interact(), and TrackerSimHitProducer().
|
private |
Set the minimal momentum of incoming particle.
Definition at line 95 of file TrackerSimHitProducer.cc.
Referenced by interact(), and TrackerSimHitProducer().
|
private |
Max distance between particle and active (sub-) module. Otherwise particle has to be propagated.
Definition at line 93 of file TrackerSimHitProducer.cc.
Referenced by createHitOnDetector().
|
private |
The SimHit.
Definition at line 94 of file TrackerSimHitProducer.cc.
Referenced by interact(), and storeProducts().