CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
HepMCEventWriter Class Reference
Inheritance diagram for HepMCEventWriter:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 HepMCEventWriter (const edm::ParameterSet &params)
 
virtual ~HepMCEventWriter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &es) override
 
virtual void beginRun (const edm::Run &run, const edm::EventSetup &es) override
 
virtual void endRun (const edm::Run &run, const edm::EventSetup &es) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

HepMC::IO_GenEvent * _output
 
edm::InputTag hepMCProduct_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 20 of file HepMCEventWriter.cc.

Constructor & Destructor Documentation

HepMCEventWriter::HepMCEventWriter ( const edm::ParameterSet params)
explicit

Definition at line 35 of file HepMCEventWriter.cc.

35  :
36  hepMCProduct_(params.getParameter<edm::InputTag>("hepMCProduct"))
37 {
38 }
T getParameter(std::string const &) const
edm::InputTag hepMCProduct_
HepMCEventWriter::~HepMCEventWriter ( )
virtual

Definition at line 40 of file HepMCEventWriter.cc.

41 {
42 }

Member Function Documentation

void HepMCEventWriter::analyze ( const edm::Event event,
const edm::EventSetup es 
)
overrideprotectedvirtual

Implements edm::EDAnalyzer.

Definition at line 57 of file HepMCEventWriter.cc.

References _output, and hepMCProduct_.

58 {
59 
61  event.getByLabel(hepMCProduct_, product);
62 
63  const HepMC::GenEvent* evt = product->GetEvent();
64 
65  _output->write_event(evt);
66 
67 }
HepMC::IO_GenEvent * _output
edm::InputTag hepMCProduct_
void HepMCEventWriter::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 44 of file HepMCEventWriter.cc.

References _output, and dbtoconf::out.

45 {
46 
47  _output = new HepMC::IO_GenEvent("GenEvent_ASCII.dat",std::ios::out);
48 
49 }
HepMC::IO_GenEvent * _output
tuple out
Definition: dbtoconf.py:99
void HepMCEventWriter::endRun ( const edm::Run run,
const edm::EventSetup es 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file HepMCEventWriter.cc.

References _output.

53 {
54  if (_output) delete _output;
55 }
HepMC::IO_GenEvent * _output

Member Data Documentation

HepMC::IO_GenEvent* HepMCEventWriter::_output
private

Definition at line 31 of file HepMCEventWriter.cc.

Referenced by analyze(), beginRun(), and endRun().

edm::InputTag HepMCEventWriter::hepMCProduct_
private

Definition at line 32 of file HepMCEventWriter.cc.

Referenced by analyze().