CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MCParticleReplacer.h
Go to the documentation of this file.
1 #ifndef TauAnalysis_MCEmbeddingTools_MCParticleReplacer_h
2 #define TauAnalysis_MCEmbeddingTools_MCParticleReplacer_h
3 
28 
30 
31 #include<string>
32 
33 #include<boost/shared_ptr.hpp>
34 
36 {
37  public:
38  explicit MCParticleReplacer(const edm::ParameterSet&);
40 
41  virtual void produce(edm::Event&, const edm::EventSetup&);
42  virtual void beginRun(edm::Run&,const edm::EventSetup&);
43  virtual void endRun();
44  virtual void beginJob();
45  virtual void endJob();
46 
47  template <typename T>
48  void call_produces(const std::string& instanceName)
49  {
50  produces<T>(instanceName);
51  }
52 
53  template <typename T>
54  void call_put(T& product, const std::string& instanceName)
55  {
56  evt_->put(product, instanceName);
57  }
58 
59  edm::StreamID getStreamID() const { assert(evt_ != nullptr); return evt_->streamID(); }
60 
61  private:
62  enum HepMcMode { kInvalid = 0, kNew, kReplace };
64 
70 
72 };
73 
74 #endif
assert(m_qm.get())
edm::StreamID getStreamID() const
MCParticleReplacer(const edm::ParameterSet &)
void call_put(T &product, const std::string &instanceName)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
static HepMcMode stringToHepMcMode(const std::string &name)
edm::InputTag srcHepMC_
void call_produces(const std::string &instanceName)
ParticleReplacerBase * replacer_
virtual void beginRun(edm::Run &, const edm::EventSetup &)
StreamID streamID() const
Definition: Event.h:72
virtual void produce(edm::Event &, const edm::EventSetup &)
long double T
Definition: Run.h:41