LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
UTIL::LCStdHepRdr Class Reference

Basic utility for reading a binary stdhep file and filling a LCCollectionVec with MCParticles containing the stdhep file information. More...

#include <LCStdHepRdr.h>

Public Member Functions

 LCStdHepRdr (const char *evfile)
 Open the stdhep input file in the constructer. More...
 
 LCStdHepRdr (const LCStdHepRdr &)=delete
 no copy constructor More...
 
LCStdHepRdroperator= (const LCStdHepRdr &)=delete
 no assignment operator More...
 
 ~LCStdHepRdr ()
 noop More...
 
long getNumberOfEvents () const
 Get number of events in the stdhep file. More...
 
long getNumberOfTotalEventsExpected () const
 Get total number of expected events in the whole set of stdhep files from which this stdhep file belongs to. More...
 
IMPL::LCCollectionVecreadEvent ()
 Read an event and return an LCCollectionVec of MCParticles. More...
 
void updateNextEvent (IMPL::LCEventImpl *evt, const char *colName=EVENT::LCIO::MCPARTICLE)
 Reads the next stdhep event and adds a new MCParticle collection to the the event with default name 'MCParticle'. More...
 
void printHeader (std::ostream &os=std::cout)
 Print the file header to the given ostream. More...
 
int threeCharge (int pdgID) const
 Return the charge of the particle times 3 - code copied from HepPDT package. More...
 

Private Attributes

lStdHep_reader {NULL}
 

Detailed Description

Basic utility for reading a binary stdhep file and filling a LCCollectionVec with MCParticles containing the stdhep file information.

Author
cassell
Version
Id:
LCStdHepRdr.h,v 1.4 2007-11-12 16:39:04 gaede Exp

Definition at line 24 of file LCStdHepRdr.h.

Constructor & Destructor Documentation

UTIL::LCStdHepRdr::LCStdHepRdr ( const char *  evfile)

Open the stdhep input file in the constructer.

Definition at line 21 of file LCStdHepRdr.cc.

References std::ends(), and std::stringstream::str().

UTIL::LCStdHepRdr::LCStdHepRdr ( const LCStdHepRdr )
delete

no copy constructor

UTIL::LCStdHepRdr::~LCStdHepRdr ( )

noop

Definition at line 35 of file LCStdHepRdr.cc.

Member Function Documentation

long UTIL::LCStdHepRdr::getNumberOfEvents ( ) const
inline

Get number of events in the stdhep file.

This number is read from the file header (no guarantee that it is correct)

Definition at line 45 of file LCStdHepRdr.h.

References _reader, and UTIL::lStdHep::numEvents().

long UTIL::LCStdHepRdr::getNumberOfTotalEventsExpected ( ) const
inline

Get total number of expected events in the whole set of stdhep files from which this stdhep file belongs to.

This number is read from the file header (no guarantee that it is correct)

Definition at line 53 of file LCStdHepRdr.h.

References _reader, and UTIL::lStdHep::numEventsExpected().

LCStdHepRdr& UTIL::LCStdHepRdr::operator= ( const LCStdHepRdr )
delete

no assignment operator

void UTIL::LCStdHepRdr::printHeader ( std::ostream os = std::cout)

Print the file header to the given ostream.

Definition at line 42 of file LCStdHepRdr.cc.

IMPL::LCCollectionVec * UTIL::LCStdHepRdr::readEvent ( )
int UTIL::LCStdHepRdr::threeCharge ( int  pdgID) const

Return the charge of the particle times 3 - code copied from HepPDT package.

PID digits (base 10) are: n nr nl nq1 nq2 nq3 nj The location enum provides a convenient index into the PID.

Definition at line 493 of file LCStdHepRdr.cc.

References std::pow().

void UTIL::LCStdHepRdr::updateNextEvent ( IMPL::LCEventImpl evt,
const char *  colName = EVENT::LCIO::MCPARTICLE 
)

Reads the next stdhep event and adds a new MCParticle collection to the the event with default name 'MCParticle'.

Exceptions
IO::EndOfDataExceptionif no event in stdhep file

Definition at line 52 of file LCStdHepRdr.cc.

References IMPL::LCEventImpl::addCollection(), EVTWGT_NAME, EVENT::LCParameters::getFloatVal(), EVENT::LCParameters::getIntVal(), IMPL::LCCollectionVec::getParameters(), IDRUP_NAME, IMPL::LCEventImpl::parameters(), EVENT::LCParameters::setValue(), and IMPL::LCEventImpl::setWeight().

Member Data Documentation

lStdHep* UTIL::LCStdHepRdr::_reader {NULL}
private

Definition at line 80 of file LCStdHepRdr.h.

Referenced by getNumberOfEvents(), and getNumberOfTotalEventsExpected().


The documentation for this class was generated from the following files: