LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LCStdHepRdr.h
Go to the documentation of this file.
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 
33  LCStdHepRdr(const LCStdHepRdr&) = delete ;
35  LCStdHepRdr& operator=(const LCStdHepRdr&) = delete ;
36 
39  ~LCStdHepRdr() ;
40 
41 
45  long getNumberOfEvents() const {
46  return _reader->numEvents() ;
47  }
48 
54  return _reader->numEventsExpected() ;
55  }
56 
61 
66  void updateNextEvent( IMPL::LCEventImpl* evt , const char* colName=EVENT::LCIO::MCPARTICLE ) ;
67 
68 
71  void printHeader(std::ostream& os = std::cout ) ;
72 
73 
76  int threeCharge( int pdgID ) const ;
77 
78  private:
79 
80  lStdHep* _reader{NULL};
81 
82 
83  }; // class
84 
85 } // namespace UTIL
86 
87 #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.
long numEventsExpected() const
Definition: lStdHep.hh:176
Implementation of the main event class.
Definition: LCEventImpl.h:31
lStdHep * _reader
Definition: LCStdHepRdr.h:80
LCStdHepRdr & operator=(const LCStdHepRdr &)=delete
no assignment operator
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:53
long getNumberOfEvents() const
Get number of events in the stdhep file.
Definition: LCStdHepRdr.h:45
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
long numEvents() const
Definition: lStdHep.hh:175
IMPL::LCCollectionVec * readEvent()
Read an event and return an LCCollectionVec of MCParticles.
Definition: LCStdHepRdr.cc:87
STL class.
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:493