#include <Run.hh>
Public Types | |
enum | FilterLevel { NOFILT = 0, DOCFILT = 1, UNSTABLEFILT = 2 } |
Enum to specify the level of event format filtering to apply NOFILT = no filtering; DOCFILT = filter unphysical particles with status other than 1, 2, or 4; UNSTABLEFILT = filter as for DOCFILT, but also exclude any unstable particles with status = 2. More... | |
Public Member Functions | |
Run (Generator &gen) | |
Make a generator run with a particular gen. | |
Run (Generator &gen, const std::string &evtfile="-", int precision=16) | |
Make a generator run with a particular gen and I/O target. | |
void | setFilter (FilterLevel filt=DOCFILT) |
Choose whether to filter out unphysical particles. | |
bool | makeEvent () |
Generate an event and send it to the writer if it exists. | |
const HepMC::GenEvent & | event () const |
Get the current generated event. | |
std::string | eventSummary () const |
Return an event summary string. | |
Private Attributes | |
Generator * | _gen |
Generator used in this run. | |
FilterLevel | _filter |
Flag to decide whether or not to strip unphysical particles out of events. | |
HepMC::GenEvent | _evt |
Current HepMC event. | |
shared_ptr< std::ostream > | _ostr |
Output stream for HepMC writer. | |
shared_ptr< HepMC::IO_GenEvent > | _io |
HepMC I/O writer. |
Definition at line 14 of file Run.hh.
enum FilterLevel |
Enum to specify the level of event format filtering to apply NOFILT = no filtering; DOCFILT = filter unphysical particles with status other than 1, 2, or 4; UNSTABLEFILT = filter as for DOCFILT, but also exclude any unstable particles with status = 2.
Definition at line 21 of file Run.hh.
00021 { NOFILT=0, DOCFILT=1, UNSTABLEFILT=2 };
Make a generator run with a particular gen.
Definition at line 8 of file Run.cc.
00009 : _gen(&gen), _filter(Run::DOCFILT)//, _ostr(0), _io(0) 00010 { 00011 // 00012 }
Make a generator run with a particular gen and I/O target.
const HepMC::GenEvent& event | ( | ) | const [inline] |
string eventSummary | ( | ) | const |
Return an event summary string.
Definition at line 136 of file Run.cc.
References Run::_evt.
00136 { 00137 std::ostringstream ss; 00138 int Nfs = 0; 00139 for (HepMC::GenEvent::particle_const_iterator pi = _evt.particles_begin(); 00140 pi != _evt.particles_end(); ++pi) { 00141 if ((*pi)->status() == 1) Nfs += 1; 00142 } 00143 ss << "HepMC::GenEvent { " 00144 << _evt.particles_size() << " particles " 00145 << "(" << Nfs << " in FS), " 00146 << _evt.vertices_size() << " vertices }"; 00147 return ss.str(); 00148 }
bool makeEvent | ( | ) |
Generate an event and send it to the writer if it exists.
Definition at line 116 of file Run.cc.
References Run::_evt, Run::_filter, Run::_gen, Run::_io, AGILe::filterEvent(), and Generator::makeEvent().
00116 { 00117 // Make and fill event 00118 _gen->makeEvent(_evt); 00119 00120 // Filter unphysical bits of event (reduces storage/transport size, and ensures physicality) 00121 filterEvent(&_evt, _filter); 00122 00123 // Do I/O streaming if required 00124 if (_io) { 00125 _io->write_event(&_evt); 00126 if (_io->rdstate() != 0) { 00127 return false; 00128 } 00129 } 00130 00131 return true; 00132 }
void setFilter | ( | FilterLevel | filt = DOCFILT |
) | [inline] |
Choose whether to filter out unphysical particles.
Definition at line 33 of file Run.hh.
References Run::_filter.
00033 { 00034 _filter = filt; 00035 }
HepMC::GenEvent _evt [private] |
Current HepMC event.
Definition at line 58 of file Run.hh.
Referenced by Run::event(), Run::eventSummary(), and Run::makeEvent().
FilterLevel _filter [private] |
Flag to decide whether or not to strip unphysical particles out of events.
Definition at line 55 of file Run.hh.
Referenced by Run::makeEvent(), and Run::setFilter().
shared_ptr<HepMC::IO_GenEvent> _io [private] |
shared_ptr<std::ostream> _ostr [private] |