| HepMC3 event record library
    | 
Example analysis. Produces a rapidity distribution of final state particles.
Definition at line 25 of file AnalysisExample.h.
#include <AnalysisExample.h>
 Inheritance diagram for AnalysisExample:
 Inheritance diagram for AnalysisExample: Collaboration diagram for AnalysisExample:
 Collaboration diagram for AnalysisExample:| Public Member Functions | |
| AnalysisExample (const std::string &filename, std::shared_ptr< GenRunInfo > run) | |
| Constructor. | |
| AnalysisExample (std::ostream &stream, std::shared_ptr< GenRunInfo > run) | |
| Constructor from ostream. | |
| void | write_event (const GenEvent &evt) override | 
| Write event to file. | |
| bool | failed () override | 
| Return status of the stream. | |
| void | close () override | 
| Close file stream. | |
| ~AnalysisExample () | |
| destructor | |
| virtual void | set_run_info (std::shared_ptr< GenRunInfo > run) | 
| Set the global GenRunInfo object. | |
| virtual std::shared_ptr< GenRunInfo > | run_info () const | 
| Get the global GenRunInfo object. | |
| virtual void | set_options (const std::map< std::string, std::string > &options) | 
| Set options. | |
| virtual std::map< std::string, std::string > | get_options () const | 
| Set options. | |
| Data Fields | |
| double | m_sum_of_weights =0 | 
| Sum of event weights. | |
| double | m_sum_of_weights2 =0 | 
| Sum of event weights**2. | |
| std::map< std::string, std::vector< double > > | m_bins | 
| Binings. | |
| std::map< std::string, std::vector< double > > | m_vals | 
| Values. | |
| std::map< std::string, std::vector< double > > | m_errs | 
| Uncertainties. | |
| Protected Attributes | |
| std::map< std::string, std::string > | m_options | 
| options | |
| Private Attributes | |
| std::ofstream | m_file | 
| Output file. | |
| std::ostream * | m_stream =nullptr | 
| Output stream. | |
| std::shared_ptr< GenRunInfo > | m_run_info | 
| The global GenRunInfo object. | |
| AnalysisExample | ( | const std::string & | filename, | 
| std::shared_ptr< GenRunInfo > | run ) | 
Constructor.
Definition at line 13 of file AnalysisExample.cc.
References AnalysisExample(), m_bins, m_errs, m_file, m_stream, m_sum_of_weights, m_sum_of_weights2, and m_vals.
| AnalysisExample | ( | std::ostream & | stream, | 
| std::shared_ptr< GenRunInfo > | run ) | 
Constructor from ostream.
Definition at line 26 of file AnalysisExample.cc.
References m_bins, m_errs, m_stream, m_sum_of_weights, m_sum_of_weights2, and m_vals.
| 
 | inline | 
| 
 | overridevirtual | 
Close file stream.
Implements Writer.
Definition at line 53 of file AnalysisExample.cc.
References m_bins, m_errs, m_stream, m_sum_of_weights, and m_vals.
| 
 | inlineoverridevirtual | 
Return status of the stream.
Implements Writer.
Definition at line 38 of file AnalysisExample.h.
References m_file.
| 
 | inlinevirtualinherited | 
Set options.
Reimplemented in WriterPlugin.
Definition at line 54 of file Writer.h.
References m_options.
| 
 | inlinevirtualinherited | 
Get the global GenRunInfo object.
Reimplemented in WriterPlugin.
Definition at line 45 of file Writer.h.
References m_run_info.
| 
 | inlinevirtualinherited | 
Set options.
Reimplemented in WriterPlugin.
Definition at line 52 of file Writer.h.
References m_options.
| 
 | inlinevirtualinherited | 
Set the global GenRunInfo object.
Reimplemented in WriterPlugin.
Definition at line 42 of file Writer.h.
References m_run_info.
| 
 | overridevirtual | 
Write event to file.
| [in] | evt | Event to be serialized | 
Implements Writer.
Definition at line 37 of file AnalysisExample.cc.
References m_bins, m_errs, m_sum_of_weights, m_sum_of_weights2, m_vals, GenEvent::particles(), and GenEvent::weight().
| std::map<std::string, std::vector<double> > m_bins | 
Binings.
Definition at line 48 of file AnalysisExample.h.
| std::map<std::string, std::vector<double> > m_errs | 
Uncertainties.
Definition at line 50 of file AnalysisExample.h.
| 
 | private | 
Output file.
Definition at line 52 of file AnalysisExample.h.
| 
 | protectedinherited | 
| 
 | privateinherited | 
The global GenRunInfo object.
| 
 | private | 
Output stream.
Definition at line 53 of file AnalysisExample.h.
| double m_sum_of_weights =0 | 
Sum of event weights.
Definition at line 46 of file AnalysisExample.h.
| double m_sum_of_weights2 =0 | 
Sum of event weights**2.
Definition at line 47 of file AnalysisExample.h.
| std::map<std::string, std::vector<double> > m_vals | 
Values.
Definition at line 49 of file AnalysisExample.h.