LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
LCStdHepRdrNew.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 
25 
26  public:
27 
30  LCStdHepRdrNew(const char* evfile) ;
31 
34  ~LCStdHepRdrNew() ;
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  void setWriteEventNumber(bool writeEventNumber) {
74  _writeEventNumber = writeEventNumber;
75  }
76 
77  private:
78 
79  lStdHep* _reader;
80  bool _writeEventNumber;
81 
82 
83  }; // class
84 
85 } // namespace UTIL
86 
87 #endif /* ifndef UTIL_LCStdHepRdr_H */
long getNumberOfEvents() const
Get number of events in the stdhep file.
Definition: LCStdHepRdrNew.h:40
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
int threeCharge(int pdgID) const
Return the charge of the particle times 3 - code copied from HepPDT package.
Definition: LCStdHepRdrNew.cc:489
Basic utility for reading a binary stdhep file and filling a LCCollectionVec with MCParticles contain...
Definition: LCStdHepRdrNew.h:24
IMPL::LCCollectionVec * readEvent()
Read an event and return an LCCollectionVec of MCParticles.
Definition: LCStdHepRdrNew.cc:87
long getNumberOfTotalEventsExpected() const
Get total number of expected events in the whole set of stdhep files from which this stdhep file belo...
Definition: LCStdHepRdrNew.h:48
void printHeader(std::ostream &os=std::cout)
Print the file header to the given ostream.
Definition: LCStdHepRdrNew.cc:40
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: LCStdHepRdrNew.cc:49
LCStdHepRdrNew(const char *evfile)
Open the stdhep input file in the constructer.
Definition: LCStdHepRdrNew.cc:21
~LCStdHepRdrNew()
noop
Definition: LCStdHepRdrNew.cc:35