|
|
Go to the documentation of this file.
101 geometry_(iConfig.getParameter<
edm::
ParameterSet>(
"trackerDefinition")),
102 caloGeometry_(iConfig.getParameter<
edm::
ParameterSet>(
"caloDefinition")),
103 beamPipeRadius_(iConfig.getParameter<double>(
"beamPipeRadius")),
104 deltaRchargedMother_(iConfig.getParameter<double>(
"deltaRchargedMother")),
105 particleFilter_(iConfig.getParameter<
edm::
ParameterSet>(
"particleFilter")),
106 _randomEngine(nullptr),
118 std::unique_ptr<fastsim::InteractionModel> interactionModel(
120 if (!interactionModel.get()) {
146 produces<edm::SimTrackContainer>();
147 produces<edm::SimVertexContainer>();
150 interactionModel->registerProducts(producesCollector());
152 produces<edm::PCaloHitContainer>(
"EcalHitsEB");
153 produces<edm::PCaloHitContainer>(
"EcalHitsEE");
154 produces<edm::PCaloHitContainer>(
"EcalHitsES");
155 produces<edm::PCaloHitContainer>(
"HcalHits");
156 produces<edm::SimTrackContainer>(
"MuonSimTracks");
160 _randomEngine = std::make_unique<RandomEngineAndDistribution>(
id);
200 myCalorimetry->getCalorimeter()->setupTopology(*theCaloTopology);
203 myCalorimetry->getHFShowerLibrary()->initHFShowerLibrary(iSetup);
211 std::vector<FSimTrack> myFSimTracks;
214 <<
"\n###############################";
217 for (std::unique_ptr<fastsim::Particle> particle = particleManager.nextParticle(*
_randomEngine); particle !=
nullptr;
228 if (particle->position().Perp2() < 128. * 128. &&
std::abs(particle->position().Z()) < 302.) {
244 particle->resetOnLayer();
249 if (particle->position().T() > 25) {
252 particle->resetOnLayer();
258 if (layer->
getThickness(particle->position(), particle->momentum()) > 1E-10) {
259 int nSecondaries = 0;
263 std::vector<std::unique_ptr<fastsim::Particle> > secondaries;
264 interactionModel->interact(*particle, *layer, secondaries, *
_randomEngine);
265 nSecondaries += secondaries.size();
266 particleManager.addSecondaries(particle->position(), particle->simTrackIndex(), secondaries, layer);
272 if (nSecondaries == 0)
273 particleManager.addEndVertex(particle.get());
280 <<
"\n-------------------------------";
284 if (!particle->isStable() && particle->remainingProperLifeTimeC() < 1E-10) {
286 std::vector<std::unique_ptr<fastsim::Particle> > secondaries;
289 particleManager.addSecondaries(particle->position(), particle->simTrackIndex(), secondaries);
294 <<
"\n###############################";
304 if (particle->position().Perp2() >= 128. * 128. ||
std::abs(particle->position().Z()) >= 302.) {
308 myFSimTracks.push_back(
createFSimTrack(particle.get(), &particleManager, *pdt));
310 if (!particle->isStable() && particle->remainingProperLifeTimeC() < 1E-10) {
315 <<
"\n###############################";
323 <<
"\n###############################";
331 interactionModel->storeProducts(
iEvent);
338 for (
auto myFSimTrack : myFSimTracks) {
395 if (particle->
position().T() > 50) {
410 if (!myFSimTrack.
onEcal()) {
414 if (!myFSimTrack.
onHcal()) {
465 if (!myFSimTrack.
onEcal()) {
471 if (!myFSimTrack.
onHcal()) {
490 <<
"\n-------------------------------";
498 std::vector<std::unique_ptr<fastsim::Particle> > secondaries;
bool check(const edm::EventSetup &iSetup)
Definition the tracker geometry (vectors of forward/barrel layers).
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
void setLayer1(const RawParticle &pp, int success)
Set the preshower layer1 variables.
void setEcal(const RawParticle &pp, int success)
Set the ecal variables.
RawParticle makeParticle(HepPDT::ParticleDataTable const *, int id, const math::XYZTLorentzVector &p)
std::vector< std::unique_ptr< fastsim::InteractionModel > > interactionModels_
All defined interaction models.
std::map< std::string, fastsim::InteractionModel * > interactionModelMap_
Each interaction model has a unique name.
~FastSimProducer() override
Implementation of a generic detector layer (base class for forward/barrel layers).
CaloType getCaloType() const
Hack to interface "old" Calorimetry with "new" Tracker.
fastsim::Decayer decayer_
Handles decays of non-stable particles using pythia.
The core class of the new SimplifiedGeometryPropagator.
int simTrackIndex() const
Return index of the SimTrack.
def create(alignables, pedeDump, additionalData, outputFile, config)
std::unique_ptr< CalorimetryManager > myCalorimetry
std::unique_ptr< RandomEngineAndDistribution > _randomEngine
The random engine.
void setVFcal(const RawParticle &pp, int success)
Set the hcal variables.
Base class for any interaction model between a particle and a tracker layer.
void setGlobal()
particle did not decay before more detectors (useful for newProducer)
fastsim::ParticleFilter particleFilter_
Decides which particles have to be propagated.
void beginStream(edm::StreamID id) override
virtual const double getThickness(const math::XYZTLorentzVector &position) const =0
Return thickness of the layer at a given position.
Manages GenParticles and Secondaries from interactions.
#define DEFINE_FWK_MODULE(type)
virtual FSimTrack createFSimTrack(fastsim::Particle *particle, fastsim::ParticleManager *particleManager, HepPDT::ParticleDataTable const &particleTable)
Handles/tracks (possible) intersections of particle's trajectory and tracker layers.
double getMagneticFieldZ(const math::XYZTLorentzVector &position) const
Initializes the tracker geometry.
fastsim::Geometry caloGeometry_
Hack to interface "old" calo to "new" tracking.
edm::EDGetTokenT< edm::HepMCProduct > genParticlesToken_
Token to get the genParticles.
const math::XYZTLorentzVector & position() const
Return position of the particle.
bool isStable() const
Returns true if particle is considered stable.
double beamPipeRadius_
The radius of the beampipe.
const std::vector< InteractionModel * > & getInteractionModels() const
Return the vector of all interaction models that are assigned with a layer.
const SimVertex getSimVertex(unsigned i)
Returns the position of a given SimVertex. Needed for interfacing the code with the old calorimetry.
int pdgId() const
Return pdgId of the particle.
edm::ESWatcher< CaloGeometryRecord > watchCaloGeometry_
bool moveParticleToNextLayer(Particle &particle, const SimplifiedGeometry *&layer)
Move particle along its trajectory to the next intersection with any of the tracker layers.
std::vector< std::string > getParameterNames() const
void decay(const Particle &particle, std::vector< std::unique_ptr< Particle > > &secondaries, CLHEP::HepRandomEngine &engine) const
Decay particle using pythia.
double charge() const
Return charge of the particle.
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.
int genParticleIndex() const
Return index of the particle in the genParticle vector.
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
const SimTrack getSimTrack(unsigned i)
Returns a given SimTrack. Needed for interfacing the code with the old calorimetry.
fastsim::Geometry geometry_
The definition of the tracker according to python config.
static const std::string MESSAGECATEGORY
Category of debugging messages ("FastSimulation")
void produce(edm::Event &, const edm::EventSetup &) override
bool getData(T &iHolder) const
Implementation of non-stable particle decays.
T getParameter(std::string const &) const
void setHcal(const RawParticle &pp, int success)
Set the hcal variables.
std::vector< SimTrack > SimTrackContainer
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
FastSimProducer(const edm::ParameterSet &)
double remainingProperLifeTimeC() const
Return the particle's remaining proper lifetime[in ct].
bool acceptsEn(const Particle &particle) const
Kinematic cuts on the particle.
std::vector< PCaloHit > PCaloHitContainer
virtual bool isForward() const =0
Returns false/true depending if the object is a (non-abstract) barrel/forward layer.
Abs< T >::type abs(const T &t)
void endStream() override
double deltaRchargedMother_
Cut on deltaR for ClosestChargedDaughter algorithm (FastSim tracking)
HepPDT::ParticleDataTable ParticleDataTable
std::vector< SimVertex > SimVertexContainer
int simVertexIndex() const
Return index of the origin vertex.
void update(const edm::EventSetup &iSetup, const std::map< std::string, InteractionModel * > &interactionModelMap)
Initializes the tracker geometry.
(Kinematic) cuts on the particles that are propagated.
edm::ESWatcher< CaloTopologyRecord > watchCaloTopology_
void setLayer2(const RawParticle &pp, int success)
Set the preshower layer2 variables.