|
|
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()) {
135 std::make_unique<CalorimetryManager>(
nullptr,
147 produces<edm::SimTrackContainer>();
148 produces<edm::SimVertexContainer>();
151 interactionModel->registerProducts(producesCollector());
153 produces<edm::PCaloHitContainer>(
"EcalHitsEB");
154 produces<edm::PCaloHitContainer>(
"EcalHitsEE");
155 produces<edm::PCaloHitContainer>(
"EcalHitsES");
156 produces<edm::PCaloHitContainer>(
"HcalHits");
157 produces<edm::SimTrackContainer>(
"MuonSimTracks");
161 _randomEngine = std::make_unique<RandomEngineAndDistribution>(
id);
201 myCalorimetry->getCalorimeter()->setupTopology(*theCaloTopology);
204 myCalorimetry->getHFShowerLibrary()->initHFShowerLibrary(iSetup);
212 std::vector<FSimTrack> myFSimTracks;
215 <<
"\n###############################";
218 for (std::unique_ptr<fastsim::Particle> particle = particleManager.nextParticle(*
_randomEngine); particle !=
nullptr;
229 if (particle->position().Perp2() < 128. * 128. &&
std::abs(particle->position().Z()) < 302.) {
245 particle->resetOnLayer();
250 if (particle->position().T() > 25) {
253 particle->resetOnLayer();
259 if (layer->
getThickness(particle->position(), particle->momentum()) > 1E-10) {
260 int nSecondaries = 0;
264 std::vector<std::unique_ptr<fastsim::Particle> > secondaries;
265 interactionModel->interact(*particle, *layer, secondaries, *
_randomEngine);
266 nSecondaries += secondaries.size();
267 particleManager.addSecondaries(particle->position(), particle->simTrackIndex(), secondaries, layer);
273 if (nSecondaries == 0)
274 particleManager.addEndVertex(particle.get());
281 <<
"\n-------------------------------";
285 if (!particle->isStable() && particle->remainingProperLifeTimeC() < 1E-10) {
287 std::vector<std::unique_ptr<fastsim::Particle> > secondaries;
290 particleManager.addSecondaries(particle->position(), particle->simTrackIndex(), secondaries);
295 <<
"\n###############################";
305 if (particle->position().Perp2() >= 128. * 128. ||
std::abs(particle->position().Z()) >= 302.) {
309 myFSimTracks.push_back(
createFSimTrack(particle.get(), &particleManager, *pdt));
311 if (!particle->isStable() && particle->remainingProperLifeTimeC() < 1E-10) {
316 <<
"\n###############################";
324 <<
"\n###############################";
332 interactionModel->storeProducts(
iEvent);
339 for (
auto myFSimTrack : myFSimTracks) {
396 if (particle->
position().T() > 50) {
411 if (!myFSimTrack.
onEcal()) {
415 if (!myFSimTrack.
onHcal()) {
466 if (!myFSimTrack.
onEcal()) {
472 if (!myFSimTrack.
onHcal()) {
491 <<
"\n-------------------------------";
499 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.
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
T getParameter(std::string const &) const
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.