LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
LCStdHepRdr.h
1 #ifndef UTIL_LCStdHepRdr_H
2 #define UTIL_LCStdHepRdr_H 1
3 
4 #include "IMPL/LCCollectionVec.h"
5 #include "UTIL/lStdHep.hh"
6 #include "EVENT/LCIO.h"
7 #include "Exceptions.h"
8 
9 namespace IMPL{
10 
11 class LCEventImpl ;
12 
13 }
14 
15 namespace UTIL{
16 
24  class LCStdHepRdr{
25 
26  public:
27 
30  LCStdHepRdr(const char* evfile) ;
31 
34  ~LCStdHepRdr() ;
35 
36 
40  long getNumberOfEvents() const {
41  return _reader->numEvents() ;
42  }
43 
49  return _reader->numEventsExpected() ;
50  }
51 
56 
61  void updateNextEvent( IMPL::LCEventImpl* evt , const char* colName=EVENT::LCIO::MCPARTICLE ) ;
62 
63 
66  void printHeader(std::ostream& os = std::cout ) ;
67 
68 
71  int threeCharge( int pdgID ) const ;
72 
73  private:
74 
75  lStdHep* _reader;
76 
77 
78  }; // class
79 
80 } // namespace UTIL
81 
82 #endif /* ifndef UTIL_LCStdHepRdr_H */
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 '...
Definition: LCStdHepRdr.cc:52
Implementation of the LCCollection using (inheriting from) an STL vector of LCObjects.
Definition: LCCollectionVec.h:26
Implementation of the main event class.
Definition: LCEventImpl.h:31
long getNumberOfTotalEventsExpected() const
Get total number of expected events in the whole set of stdhep files from which this stdhep file belo...
Definition: LCStdHepRdr.h:48
long getNumberOfEvents() const
Get number of events in the stdhep file.
Definition: LCStdHepRdr.h:40
Basic utility for reading a binary stdhep file and filling a LCCollectionVec with MCParticles contain...
Definition: LCStdHepRdr.h:24
void printHeader(std::ostream &os=std::cout)
Print the file header to the given ostream.
Definition: LCStdHepRdr.cc:42
IMPL::LCCollectionVec * readEvent()
Read an event and return an LCCollectionVec of MCParticles.
Definition: LCStdHepRdr.cc:87
~LCStdHepRdr()
noop
Definition: LCStdHepRdr.cc:35
LCStdHepRdr(const char *evfile)
Open the stdhep input file in the constructer.
Definition: LCStdHepRdr.cc:21
int threeCharge(int pdgID) const
Return the charge of the particle times 3 - code copied from HepPDT package.
Definition: LCStdHepRdr.cc:491