agile is hosted by Hepforge, IPPP Durham

Run Class Reference

#include <Run.hh>

Collaboration diagram for Run:

List of all members.

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.

Detailed Description

Author:
Andy Buckley

Definition at line 14 of file Run.hh.


Member Enumeration Documentation

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.

Enumerator:
NOFILT 
DOCFILT 
UNSTABLEFILT 

Definition at line 21 of file Run.hh.

00021 { NOFILT=0, DOCFILT=1, UNSTABLEFILT=2 };


Constructor & Destructor Documentation

Run ( Generator gen  ) 

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   }

Run ( Generator gen,
const std::string &  evtfile = "-",
int  precision = 16 
)

Make a generator run with a particular gen and I/O target.


Member Function Documentation

const HepMC::GenEvent& event (  )  const [inline]

Get the current generated event.

Definition at line 41 of file Run.hh.

References Run::_evt.

00041                                        {
00042       return _evt;
00043     }

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     }


Member Data Documentation

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().

Generator* _gen [private]

Generator used in this run.

Definition at line 52 of file Run.hh.

Referenced by Run::makeEvent().

shared_ptr<HepMC::IO_GenEvent> _io [private]

HepMC I/O writer.

Definition at line 64 of file Run.hh.

Referenced by Run::makeEvent().

shared_ptr<std::ostream> _ostr [private]

Output stream for HepMC writer.

Definition at line 61 of file Run.hh.


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 10:39:41 2012 for AGILe - A Generator Interface Library (+ executable) by  doxygen 1.6.3