CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HepMCFileReader.h
Go to the documentation of this file.
1 #ifndef Input_HepMCFileReader_h
2 #define Input_HepMCFileReader_h
3 
4 // $Id: HepMCFileReader.h,v 1.5 2009/12/01 19:23:11 fabstoec Exp $
5 
20 #include <vector>
21 #include <map>
22 
23 
24 namespace HepMC {
25  class IO_BaseClass;
26  class GenEvent;
27  class GenParticle;
28 }
29 
30 
32 
33  protected:
35 
36  public:
37  virtual ~HepMCFileReader();
38  virtual void initialize(const std::string &filename);
39  inline bool isInitialized() const;
40 
41  virtual bool setEvent(int event);
42  virtual bool readCurrentEvent();
43  virtual bool printHepMcEvent() const;
44  HepMC::GenEvent *fillCurrentEventData();
45  // virtual bool fillEventData(HepMC::GenEvent *event);
46  // this method prints the event information as
47  // obtained by the input file in HepEvt style
48  void printEvent() const;
49  // get all the 'integer' properties of a particle
50  // like mother, daughter, pid and status
51  // 'j' is the number of the particle in the HepMc
52  virtual void getStatsFromTuple(int &mo1, int &mo2, int &da1, int &da2,
53  int &status, int &pid, int j) const;
54  virtual void ReadStats();
55 
56  static HepMCFileReader *instance();
57 
58  private:
59  // current HepMC evt
60  HepMC::GenEvent *evt_;
61  HepMC::IO_BaseClass *input_;
62 
64 
65  int rdstate() const;
66  //maps to convert HepMC::GenParticle to particles # and vice versa
67  // -> needed for HepEvt like output
68  std::vector<HepMC::GenParticle*> index_to_particle;
69  std::map<HepMC::GenParticle*,int> particle_to_index;
70  // find index to HepMC::GenParticle* p in map m
71  int find_in_map(const std::map<HepMC::GenParticle*,int>& m,
72  HepMC::GenParticle *p) const;
73 };
74 
75 
77 {
78  return input_ != 0;
79 }
80 
81 #endif
void printEvent() const
static HepMCFileReader * instance_
virtual void ReadStats()
std::map< HepMC::GenParticle *, int > particle_to_index
int rdstate() const
virtual void initialize(const std::string &filename)
virtual bool setEvent(int event)
std::vector< HepMC::GenParticle * > index_to_particle
virtual ~HepMCFileReader()
static HepMCFileReader * instance()
virtual void getStatsFromTuple(int &mo1, int &mo2, int &da1, int &da2, int &status, int &pid, int j) const
int find_in_map(const std::map< HepMC::GenParticle *, int > &m, HepMC::GenParticle *p) const
HepMC::IO_BaseClass * input_
int j
Definition: DBlmapReader.cc:9
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isInitialized() const
virtual bool printHepMcEvent() const
virtual bool readCurrentEvent()
HepMC::GenEvent * fillCurrentEventData()
tuple filename
Definition: lut2db_cfg.py:20
tuple status
Definition: ntuplemaker.py:245
HepMC::GenEvent * evt_