CMS 3D CMS Logo

FastSimProducer.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 #include <string>
4 
5 // framework
17 
18 // data formats
25 
26 // fastsim
38 
39 // Hack for calorimetry
47 
49 // Author: L. Vanelderen, S. Kurz
50 // Date: 29 May 2017
52 
54 
65 public:
66  explicit FastSimProducer(const edm::ParameterSet&);
67  ~FastSimProducer() override { ; }
68 
69 private:
70  void beginStream(edm::StreamID id) override;
71  void produce(edm::Event&, const edm::EventSetup&) override;
72  void endStream() override;
74  fastsim::ParticleManager* particleManager,
75  HepPDT::ParticleDataTable const& particleTable);
76 
80  double beamPipeRadius_;
83  std::unique_ptr<RandomEngineAndDistribution> _randomEngine;
84 
88  std::unique_ptr<CalorimetryManager> myCalorimetry; // unfortunately, default constructor cannot be called
90 
92  std::vector<std::unique_ptr<fastsim::InteractionModel> > interactionModels_;
93  std::map<std::string, fastsim::InteractionModel*> interactionModelMap_;
95 };
96 
97 const std::string FastSimProducer::MESSAGECATEGORY = "FastSimulation";
98 
100  : genParticlesToken_(consumes<edm::HepMCProduct>(iConfig.getParameter<edm::InputTag>("src"))),
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),
107  simulateCalorimetry(iConfig.getParameter<bool>("simulateCalorimetry")),
108  simulateMuons(iConfig.getParameter<bool>("simulateMuons")) {
109  //----------------
110  // define interaction models
111  //---------------
112 
113  const edm::ParameterSet& modelCfgs = iConfig.getParameter<edm::ParameterSet>("interactionModels");
114  for (const std::string& modelName : modelCfgs.getParameterNames()) {
115  const edm::ParameterSet& modelCfg = modelCfgs.getParameter<edm::ParameterSet>(modelName);
116  std::string modelClassName(modelCfg.getParameter<std::string>("className"));
117  // Use plugin-factory to create model
118  std::unique_ptr<fastsim::InteractionModel> interactionModel(
119  fastsim::InteractionModelFactory::get()->create(modelClassName, modelName, modelCfg));
120  if (!interactionModel.get()) {
121  throw cms::Exception("FastSimProducer") << "InteractionModel " << modelName << " could not be created";
122  }
123  // Add model to list
124  interactionModels_.push_back(std::move(interactionModel));
125  // and create the map
127  }
128 
129  //----------------
130  // calorimetry
131  //---------------
132 
133  if (simulateCalorimetry) {
134  myCalorimetry =
135  std::make_unique<CalorimetryManager>(nullptr,
136  iConfig.getParameter<edm::ParameterSet>("Calorimetry"),
137  iConfig.getParameter<edm::ParameterSet>("MaterialEffectsForMuonsInECAL"),
138  iConfig.getParameter<edm::ParameterSet>("MaterialEffectsForMuonsInHCAL"),
139  iConfig.getParameter<edm::ParameterSet>("GFlash"));
140  }
141 
142  //----------------
143  // register products
144  //----------------
145 
146  // SimTracks and SimVertices
147  produces<edm::SimTrackContainer>();
148  produces<edm::SimVertexContainer>();
149  // products of interaction models, i.e. simHits
150  for (auto& interactionModel : interactionModels_) {
151  interactionModel->registerProducts(producesCollector());
152  }
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");
158 }
159 
161  _randomEngine = std::make_unique<RandomEngineAndDistribution>(id);
162 }
163 
165  LogDebug(MESSAGECATEGORY) << " produce";
166 
169 
170  // Define containers for SimTracks, SimVertices
171  std::unique_ptr<edm::SimTrackContainer> simTracks_(new edm::SimTrackContainer);
172  std::unique_ptr<edm::SimVertexContainer> simVertices_(new edm::SimVertexContainer);
173 
174  // Get the particle data table (in case lifetime or charge of GenParticles not set)
176  iSetup.getData(pdt);
177 
178  // Get the GenParticle collection
181 
182  // Load the ParticleManager which returns the particles that have to be propagated
183  // Creates a fastsim::Particle out of a GenParticle/secondary
184  fastsim::ParticleManager particleManager(*genParticles->GetEvent(),
185  *pdt,
189  *simTracks_,
190  *simVertices_);
191 
192  // Initialize the calorimeter geometry
193  if (simulateCalorimetry) {
194  if (watchCaloGeometry_.check(iSetup) || watchCaloTopology_.check(iSetup)) {
196  iSetup.get<CaloGeometryRecord>().get(pG);
197  myCalorimetry->getCalorimeter()->setupGeometry(*pG);
198 
199  edm::ESHandle<CaloTopology> theCaloTopology;
200  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
201  myCalorimetry->getCalorimeter()->setupTopology(*theCaloTopology);
202  myCalorimetry->getCalorimeter()->initialize(geometry_.getMagneticFieldZ(math::XYZTLorentzVector(0., 0., 0., 0.)));
203 
204  myCalorimetry->getHFShowerLibrary()->initHFShowerLibrary(iSetup);
205  }
206 
207  // Important: this also cleans the calorimetry information from the last event
208  myCalorimetry->initialize(_randomEngine.get());
209  }
210 
211  // The vector of SimTracks needed for the CalorimetryManager
212  std::vector<FSimTrack> myFSimTracks;
213 
214  LogDebug(MESSAGECATEGORY) << "################################"
215  << "\n###############################";
216 
217  // loop over particles
218  for (std::unique_ptr<fastsim::Particle> particle = particleManager.nextParticle(*_randomEngine); particle != nullptr;
219  particle = particleManager.nextParticle(*_randomEngine)) {
220  LogDebug(MESSAGECATEGORY) << "\n moving NEXT particle: " << *particle;
221 
222  // -----------------------------
223  // This condition is necessary because of hack for calorimetry
224  // -> The CalorimetryManager should also be implemented based on this new FastSim classes (Particle.h) in a future project.
225  // A second loop (below) loops over all parts of the calorimetry in order to create a track of the old FastSim class FSimTrack.
226  // The condition below (R<128, z<302) makes sure that the particle geometrically is outside the tracker boundaries
227  // -----------------------------
228 
229  if (particle->position().Perp2() < 128. * 128. && std::abs(particle->position().Z()) < 302.) {
230  // move the particle through the layers
231  fastsim::LayerNavigator layerNavigator(geometry_);
232  const fastsim::SimplifiedGeometry* layer = nullptr;
233 
234  // moveParticleToNextLayer(..) returns 0 in case that particle decays
235  // in this case particle is propagated up to its decay vertex
236  while (layerNavigator.moveParticleToNextLayer(*particle, layer)) {
237  LogDebug(MESSAGECATEGORY) << " moved to next layer: " << *layer;
238  LogDebug(MESSAGECATEGORY) << " new state: " << *particle;
239 
240  // Hack to interface "old" calo to "new" tracking
241  // Particle reached calorimetry so stop further propagation
243  layer = nullptr;
244  // particle no longer is on a layer
245  particle->resetOnLayer();
246  break;
247  }
248 
249  // break after 25 ns: only happens for particles stuck in loops
250  if (particle->position().T() > 25) {
251  layer = nullptr;
252  // particle no longer is on a layer
253  particle->resetOnLayer();
254  break;
255  }
256 
257  // perform interaction between layer and particle
258  // do only if there is actual material
259  if (layer->getThickness(particle->position(), particle->momentum()) > 1E-10) {
260  int nSecondaries = 0;
261  // loop on interaction models
262  for (fastsim::InteractionModel* interactionModel : layer->getInteractionModels()) {
263  LogDebug(MESSAGECATEGORY) << " interact with " << *interactionModel;
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);
268  }
269 
270  // kinematic cuts: particle might e.g. lost all its energy
271  if (!particleFilter_.acceptsEn(*particle)) {
272  // Add endvertex if particle did not create any secondaries
273  if (nSecondaries == 0)
274  particleManager.addEndVertex(particle.get());
275  layer = nullptr;
276  break;
277  }
278  }
279 
280  LogDebug(MESSAGECATEGORY) << "--------------------------------"
281  << "\n-------------------------------";
282  }
283 
284  // do decays
285  if (!particle->isStable() && particle->remainingProperLifeTimeC() < 1E-10) {
286  LogDebug(MESSAGECATEGORY) << "Decaying particle...";
287  std::vector<std::unique_ptr<fastsim::Particle> > secondaries;
288  decayer_.decay(*particle, secondaries, _randomEngine->theEngine());
289  LogDebug(MESSAGECATEGORY) << " decay has " << secondaries.size() << " products";
290  particleManager.addSecondaries(particle->position(), particle->simTrackIndex(), secondaries);
291  continue;
292  }
293 
294  LogDebug(MESSAGECATEGORY) << "################################"
295  << "\n###############################";
296  }
297 
298  // -----------------------------
299  // Hack to interface "old" calorimetry with "new" propagation in tracker
300  // The CalorimetryManager has to know which particle could in principle hit which parts of the calorimeter
301  // I think it's a bit strange to propagate the particle even further (and even decay it) if it already hits
302  // some part of the calorimetry but this is how the code works...
303  // -----------------------------
304 
305  if (particle->position().Perp2() >= 128. * 128. || std::abs(particle->position().Z()) >= 302.) {
306  LogDebug(MESSAGECATEGORY) << "\n moving particle to calorimetry: " << *particle;
307 
308  // create FSimTrack (this is the object the old propagation uses)
309  myFSimTracks.push_back(createFSimTrack(particle.get(), &particleManager, *pdt));
310  // particle was decayed
311  if (!particle->isStable() && particle->remainingProperLifeTimeC() < 1E-10) {
312  continue;
313  }
314 
315  LogDebug(MESSAGECATEGORY) << "################################"
316  << "\n###############################";
317  }
318 
319  // -----------------------------
320  // End Hack
321  // -----------------------------
322 
323  LogDebug(MESSAGECATEGORY) << "################################"
324  << "\n###############################";
325  }
326 
327  // store simTracks and simVertices
328  iEvent.put(std::move(simTracks_));
329  iEvent.put(std::move(simVertices_));
330  // store products of interaction models, i.e. simHits
331  for (auto& interactionModel : interactionModels_) {
332  interactionModel->storeProducts(iEvent);
333  }
334 
335  // -----------------------------
336  // Calorimetry Manager
337  // -----------------------------
338  if (simulateCalorimetry) {
339  for (auto myFSimTrack : myFSimTracks) {
340  myCalorimetry->reconstructTrack(myFSimTrack, _randomEngine.get());
341  }
342  }
343 
344  // -----------------------------
345  // Store Hits
346  // -----------------------------
347  std::unique_ptr<edm::PCaloHitContainer> p4(new edm::PCaloHitContainer);
348  std::unique_ptr<edm::PCaloHitContainer> p5(new edm::PCaloHitContainer);
349  std::unique_ptr<edm::PCaloHitContainer> p6(new edm::PCaloHitContainer);
350  std::unique_ptr<edm::PCaloHitContainer> p7(new edm::PCaloHitContainer);
351 
352  std::unique_ptr<edm::SimTrackContainer> m1(new edm::SimTrackContainer);
353 
354  if (simulateCalorimetry) {
355  myCalorimetry->loadFromEcalBarrel(*p4);
356  myCalorimetry->loadFromEcalEndcap(*p5);
357  myCalorimetry->loadFromPreshower(*p6);
358  myCalorimetry->loadFromHcal(*p7);
359  if (simulateMuons) {
360  myCalorimetry->harvestMuonSimTracks(*m1);
361  }
362  }
363  iEvent.put(std::move(p4), "EcalHitsEB");
364  iEvent.put(std::move(p5), "EcalHitsEE");
365  iEvent.put(std::move(p6), "EcalHitsES");
366  iEvent.put(std::move(p7), "HcalHits");
367  iEvent.put(std::move(m1), "MuonSimTracks");
368 }
369 
371 
373  fastsim::ParticleManager* particleManager,
374  HepPDT::ParticleDataTable const& particleTable) {
375  FSimTrack myFSimTrack(particle->pdgId(),
376  particleManager->getSimTrack(particle->simTrackIndex()).momentum(),
377  particle->simVertexIndex(),
378  particle->genParticleIndex(),
379  particle->simTrackIndex(),
380  particle->charge(),
381  particle->position(),
382  particle->momentum(),
383  particleManager->getSimVertex(particle->simVertexIndex()));
384 
385  // move the particle through the caloLayers
386  fastsim::LayerNavigator caloLayerNavigator(caloGeometry_);
387  const fastsim::SimplifiedGeometry* caloLayer = nullptr;
388 
389  // moveParticleToNextLayer(..) returns 0 in case that particle decays
390  // in this case particle is propagated up to its decay vertex
391  while (caloLayerNavigator.moveParticleToNextLayer(*particle, caloLayer)) {
392  LogDebug(MESSAGECATEGORY) << " moved to next caloLayer: " << *caloLayer;
393  LogDebug(MESSAGECATEGORY) << " new state: " << *particle;
394 
395  // break after 25 ns: only happens for particles stuck in loops
396  if (particle->position().T() > 50) {
397  caloLayer = nullptr;
398  break;
399  }
400 
402  // Define ParticlePropagators (RawParticle) needed for CalorimetryManager and save them
404 
405  RawParticle PP = makeParticle(&particleTable, particle->pdgId(), particle->momentum(), particle->position());
406 
407  // no material
408  if (caloLayer->getThickness(particle->position(), particle->momentum()) < 1E-10) {
409  // unfortunately needed for CalorimetryManager
410  if (caloLayer->getCaloType() == fastsim::SimplifiedGeometry::ECAL) {
411  if (!myFSimTrack.onEcal()) {
412  myFSimTrack.setEcal(PP, 0);
413  }
414  } else if (caloLayer->getCaloType() == fastsim::SimplifiedGeometry::HCAL) {
415  if (!myFSimTrack.onHcal()) {
416  myFSimTrack.setHcal(PP, 0);
417  }
418  } else if (caloLayer->getCaloType() == fastsim::SimplifiedGeometry::VFCAL) {
419  if (!myFSimTrack.onVFcal()) {
420  myFSimTrack.setVFcal(PP, 0);
421  }
422  }
423 
424  // not necessary to continue propagation
425  if (caloLayer->getCaloType() == fastsim::SimplifiedGeometry::VFCAL) {
426  myFSimTrack.setGlobal();
427  caloLayer = nullptr;
428  break;
429  }
430 
431  continue;
432  }
433 
434  // Stupid variable used by the old propagator
435  // For details check BaseParticlePropagator.h
436  int success = 0;
437  if (caloLayer->isForward()) {
438  success = 2;
439  // particle moves inwards
440  if (particle->position().Z() * particle->momentum().Z() < 0) {
441  success *= -1;
442  }
443  } else {
444  success = 1;
445  // particle moves inwards
446  if (particle->momentum().X() * particle->position().X() + particle->momentum().Y() * particle->position().Y() <
447  0) {
448  success *= -1;
449  }
450  }
451 
452  // Save the hit
454  if (!myFSimTrack.onLayer1()) {
455  myFSimTrack.setLayer1(PP, success);
456  }
457  }
458 
460  if (!myFSimTrack.onLayer2()) {
461  myFSimTrack.setLayer2(PP, success);
462  }
463  }
464 
465  if (caloLayer->getCaloType() == fastsim::SimplifiedGeometry::ECAL) {
466  if (!myFSimTrack.onEcal()) {
467  myFSimTrack.setEcal(PP, success);
468  }
469  }
470 
471  if (caloLayer->getCaloType() == fastsim::SimplifiedGeometry::HCAL) {
472  if (!myFSimTrack.onHcal()) {
473  myFSimTrack.setHcal(PP, success);
474  }
475  }
476 
477  if (caloLayer->getCaloType() == fastsim::SimplifiedGeometry::VFCAL) {
478  if (!myFSimTrack.onVFcal()) {
479  myFSimTrack.setVFcal(PP, success);
480  }
481  }
482 
483  // Particle reached end of detector
484  if (caloLayer->getCaloType() == fastsim::SimplifiedGeometry::VFCAL) {
485  myFSimTrack.setGlobal();
486  caloLayer = nullptr;
487  break;
488  }
489 
490  LogDebug(MESSAGECATEGORY) << "--------------------------------"
491  << "\n-------------------------------";
492  }
493 
494  // do decays
495  // don't have to worry about daughters if particle already within the calorimetry
496  // since they will be rejected by the vertex cut of the ParticleFilter
497  if (!particle->isStable() && particle->remainingProperLifeTimeC() < 1E-10) {
498  LogDebug(MESSAGECATEGORY) << "Decaying particle...";
499  std::vector<std::unique_ptr<fastsim::Particle> > secondaries;
500  decayer_.decay(*particle, secondaries, _randomEngine->theEngine());
501  LogDebug(MESSAGECATEGORY) << " decay has " << secondaries.size() << " products";
502  particleManager->addSecondaries(particle->position(), particle->simTrackIndex(), secondaries);
503  }
504 
505  return myFSimTrack;
506 }
507 
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::StreamID
Definition: StreamID.h:30
FastHFShowerLibrary.h
Handle.h
fastsim::Geometry
Definition the tracker geometry (vectors of forward/barrel layers).
Definition: Geometry.h:32
fastsim::Particle::momentum
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
Definition: Particle.h:143
electrons_cff.bool
bool
Definition: electrons_cff.py:393
RawParticle
Definition: RawParticle.h:37
MessageLogger.h
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
FSimTrack::onLayer2
int onLayer2() const
Definition: FSimTrack.h:106
InteractionModel.h
edm::ESWatcher< CaloGeometryRecord >
FSimTrack::setLayer1
void setLayer1(const RawParticle &pp, int success)
Set the preshower layer1 variables.
Definition: FSimTrack.cc:106
FSimTrack::setEcal
void setEcal(const RawParticle &pp, int success)
Set the ecal variables.
Definition: FSimTrack.cc:118
ESHandle.h
FSimTrack::onLayer1
int onLayer1() const
Definition: FSimTrack.h:101
makeParticle
RawParticle makeParticle(HepPDT::ParticleDataTable const *, int id, const math::XYZTLorentzVector &p)
Definition: makeParticle.cc:28
FastSimProducer::interactionModels_
std::vector< std::unique_ptr< fastsim::InteractionModel > > interactionModels_
All defined interaction models.
Definition: FastSimProducer.cc:92
FastSimProducer::interactionModelMap_
std::map< std::string, fastsim::InteractionModel * > interactionModelMap_
Each interaction model has a unique name.
Definition: FastSimProducer.cc:93
edm::EDGetTokenT< edm::HepMCProduct >
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
PSimHitContainer.h
FastSimProducer::~FastSimProducer
~FastSimProducer() override
Definition: FastSimProducer.cc:67
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
FSimTrack.h
fastsim::SimplifiedGeometry
Implementation of a generic detector layer (base class for forward/barrel layers).
Definition: SimplifiedGeometry.h:35
EDProducer.h
fastsim::SimplifiedGeometry::getCaloType
CaloType getCaloType() const
Hack to interface "old" Calorimetry with "new" Tracker.
Definition: SimplifiedGeometry.h:65
FastSimProducer::decayer_
fastsim::Decayer decayer_
Handles decays of non-stable particles using pythia.
Definition: FastSimProducer.cc:91
Geometry.h
FastSimProducer
The core class of the new SimplifiedGeometryPropagator.
Definition: FastSimProducer.cc:64
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
fastsim::Particle::simTrackIndex
int simTrackIndex() const
Return index of the SimTrack.
Definition: Particle.h:153
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
FastSimProducer::myCalorimetry
std::unique_ptr< CalorimetryManager > myCalorimetry
Definition: FastSimProducer.cc:88
edm::Handle< edm::HepMCProduct >
RandomEngineAndDistribution.h
FastSimProducer::_randomEngine
std::unique_ptr< RandomEngineAndDistribution > _randomEngine
The random engine.
Definition: FastSimProducer.cc:83
FSimTrack::setVFcal
void setVFcal(const RawParticle &pp, int success)
Set the hcal variables.
Definition: FSimTrack.cc:130
InteractionModelFactory.h
Particle.h
fastsim::InteractionModel
Base class for any interaction model between a particle and a tracker layer.
Definition: InteractionModel.h:29
MakerMacros.h
LayerNavigator.h
FSimTrack::setGlobal
void setGlobal()
particle did not decay before more detectors (useful for newProducer)
Definition: FSimTrack.h:161
HLTEgPhaseIITestSequence_cff.modelName
modelName
Definition: HLTEgPhaseIITestSequence_cff.py:16
FastSimProducer::particleFilter_
fastsim::ParticleFilter particleFilter_
Decides which particles have to be propagated.
Definition: FastSimProducer.cc:82
FastSimProducer::beginStream
void beginStream(edm::StreamID id) override
Definition: FastSimProducer.cc:160
fastsim::SimplifiedGeometry::getThickness
virtual const double getThickness(const math::XYZTLorentzVector &position) const =0
Return thickness of the layer at a given position.
fastsim::ParticleManager
Manages GenParticles and Secondaries from interactions.
Definition: ParticleManager.h:36
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
FSimTrack::onHcal
int onHcal() const
Definition: FSimTrack.h:116
fastsim::SimplifiedGeometry::HCAL
Definition: SimplifiedGeometry.h:59
FastSimProducer::createFSimTrack
virtual FSimTrack createFSimTrack(fastsim::Particle *particle, fastsim::ParticleManager *particleManager, HepPDT::ParticleDataTable const &particleTable)
Definition: FastSimProducer.cc:372
fastsim::LayerNavigator
Handles/tracks (possible) intersections of particle's trajectory and tracker layers.
Definition: LayerNavigator.h:48
fastsim::Geometry::getMagneticFieldZ
double getMagneticFieldZ(const math::XYZTLorentzVector &position) const
Initializes the tracker geometry.
Definition: Geometry.cc:155
edm::ESHandle< HepPDT::ParticleDataTable >
summarizeEdmComparisonLogfiles.success
success
Definition: summarizeEdmComparisonLogfiles.py:115
FastSimProducer::caloGeometry_
fastsim::Geometry caloGeometry_
Hack to interface "old" calo to "new" tracking.
Definition: FastSimProducer.cc:79
FSimTrack::onVFcal
int onVFcal() const
Definition: FSimTrack.h:121
FastSimProducer::genParticlesToken_
edm::EDGetTokenT< edm::HepMCProduct > genParticlesToken_
Token to get the genParticles.
Definition: FastSimProducer.cc:77
fastsim::SimplifiedGeometry::TRACKERBOUNDARY
Definition: SimplifiedGeometry.h:59
fastsim::Particle::position
const math::XYZTLorentzVector & position() const
Return position of the particle.
Definition: Particle.h:140
fastsim::Particle::isStable
bool isStable() const
Returns true if particle is considered stable.
Definition: Particle.h:171
FastSimProducer::beamPipeRadius_
double beamPipeRadius_
The radius of the beampipe.
Definition: FastSimProducer.cc:80
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
fastsim::SimplifiedGeometry::getInteractionModels
const std::vector< InteractionModel * > & getInteractionModels() const
Return the vector of all interaction models that are assigned with a layer.
Definition: SimplifiedGeometry.h:146
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ParameterSet
Definition: Functions.h:16
CaloGeometryHelper.h
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::Particle::pdgId
int pdgId() const
Return pdgId of the particle.
Definition: Particle.h:134
FastSimProducer::watchCaloGeometry_
edm::ESWatcher< CaloGeometryRecord > watchCaloGeometry_
Definition: FastSimProducer.cc:86
fastsim::LayerNavigator::moveParticleToNextLayer
bool moveParticleToNextLayer(Particle &particle, const SimplifiedGeometry *&layer)
Move particle along its trajectory to the next intersection with any of the tracker layers.
Definition: LayerNavigator.cc:69
CaloTopologyRecord.h
edm::ParameterSet::getParameterNames
std::vector< std::string > getParameterNames() const
Definition: ParameterSet.cc:663
LorentzVector.h
iEvent
int iEvent
Definition: GenABIO.cc:224
fastsim::Decayer::decay
void decay(const Particle &particle, std::vector< std::unique_ptr< Particle > > &secondaries, CLHEP::HepRandomEngine &engine) const
Decay particle using pythia.
Definition: Decayer.cc:29
fastsim::Particle::charge
double charge() const
Return charge of the particle.
Definition: Particle.h:137
p4
double p4[4]
Definition: TauolaWrapper.h:92
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
fastsim::Particle::genParticleIndex
int genParticleIndex() const
Return index of the particle in the genParticle vector.
Definition: Particle.h:165
CalorimetryManager.h
fastsim::Particle
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
Definition: Particle.h:16
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
edm::stream::EDProducer
Definition: EDProducer.h:38
makeParticle.h
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
FastSimProducer::geometry_
fastsim::Geometry geometry_
The definition of the tracker according to python config.
Definition: FastSimProducer.cc:78
FastSimProducer::MESSAGECATEGORY
static const std::string MESSAGECATEGORY
Category of debugging messages ("FastSimulation")
Definition: FastSimProducer.cc:94
FastSimProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: FastSimProducer.cc:164
SimplifiedGeometry.h
FastSimProducer::simulateCalorimetry
bool simulateCalorimetry
Definition: FastSimProducer.cc:85
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
fastsim::Decayer
Implementation of non-stable particle decays.
Definition: Decayer.h:34
Decayer.h
FSimTrack::setHcal
void setHcal(const RawParticle &pp, int success)
Set the hcal variables.
Definition: FSimTrack.cc:124
eostools.move
def move(src, dest)
Definition: eostools.py:511
fastsim::SimplifiedGeometry::PRESHOWER1
Definition: SimplifiedGeometry.h:59
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
ParticleFilter.h
ParticleManager.h
Frameworkfwd.h
ESWatcher.h
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
FastSimProducer::FastSimProducer
FastSimProducer(const edm::ParameterSet &)
Definition: FastSimProducer.cc:99
Exception
Definition: hltDiff.cc:246
CaloGeometry.h
fastsim::SimplifiedGeometry::VFCAL
Definition: SimplifiedGeometry.h:59
FastSimProducer::simulateMuons
bool simulateMuons
Definition: FastSimProducer.cc:89
fastsim::Particle::remainingProperLifeTimeC
double remainingProperLifeTimeC() const
Return the particle's remaining proper lifetime[in ct].
Definition: Particle.h:150
fastsim::ParticleFilter::acceptsEn
bool acceptsEn(const Particle &particle) const
Kinematic cuts on the particle.
Definition: ParticleFilter.cc:61
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition: PCaloHitContainer.h:8
fastSimProducer_cff.simulateCalorimetry
simulateCalorimetry
Definition: fastSimProducer_cff.py:14
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
fastsim::SimplifiedGeometry::ECAL
Definition: SimplifiedGeometry.h:59
fastsim::SimplifiedGeometry::isForward
virtual bool isForward() const =0
Returns false/true depending if the object is a (non-abstract) barrel/forward layer.
HepMCProduct
FSimTrack
Definition: FSimTrack.h:30
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
HepMCProduct.h
FastSimProducer::endStream
void endStream() override
Definition: FastSimProducer.cc:370
FastSimProducer::deltaRchargedMother_
double deltaRchargedMother_
Cut on deltaR for ClosestChargedDaughter algorithm (FastSim tracking)
Definition: FastSimProducer.cc:81
FSimTrack::onEcal
int onEcal() const
Definition: FSimTrack.h:111
edm::Event
Definition: Event.h:73
StreamID.h
SimTrackContainer.h
ParticleDataTable
HepPDT::ParticleDataTable ParticleDataTable
Definition: ParticleDataTable.h:8
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition: SimVertexContainer.h:12
fastsim::Particle::simVertexIndex
int simVertexIndex() const
Return index of the origin vertex.
Definition: Particle.h:159
SimVertexContainer.h
fastsim::SimplifiedGeometry::PRESHOWER2
Definition: SimplifiedGeometry.h:59
fastsim::Geometry::update
void update(const edm::EventSetup &iSetup, const std::map< std::string, InteractionModel * > &interactionModelMap)
Initializes the tracker geometry.
Definition: Geometry.cc:50
fastsim::ParticleFilter
(Kinematic) cuts on the particles that are propagated.
Definition: ParticleFilter.h:26
FastSimProducer::watchCaloTopology_
edm::ESWatcher< CaloTopologyRecord > watchCaloTopology_
Definition: FastSimProducer.cc:87
FSimTrack::setLayer2
void setLayer2(const RawParticle &pp, int success)
Set the preshower layer2 variables.
Definition: FSimTrack.cc:112
fastSimProducer_cff.simulateMuons
simulateMuons
Definition: fastSimProducer_cff.py:15