test
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 
17 #include <vector>
18 #include <map>
19 
20 
21 namespace HepMC {
22  class IO_BaseClass;
23  class GenEvent;
24  class GenParticle;
25 }
26 
27 
29 
30  protected:
32 
33  public:
34  virtual ~HepMCFileReader();
35  virtual void initialize(const std::string &filename);
36  inline bool isInitialized() const;
37 
38  virtual bool setEvent(int event);
39  virtual bool readCurrentEvent();
40  virtual bool printHepMcEvent() const;
41  HepMC::GenEvent *fillCurrentEventData();
42  // virtual bool fillEventData(HepMC::GenEvent *event);
43  // this method prints the event information as
44  // obtained by the input file in HepEvt style
45  void printEvent() const;
46  // get all the 'integer' properties of a particle
47  // like mother, daughter, pid and status
48  // 'j' is the number of the particle in the HepMc
49  virtual void getStatsFromTuple(int &mo1, int &mo2, int &da1, int &da2,
50  int &status, int &pid, int j) const;
51  virtual void ReadStats();
52 
53  static HepMCFileReader *instance();
54 
55  private:
56  // current HepMC evt
57  HepMC::GenEvent *evt_;
58  HepMC::IO_BaseClass *input_;
59 
61 
62  int rdstate() const;
63  //maps to convert HepMC::GenParticle to particles # and vice versa
64  // -> needed for HepEvt like output
65  std::vector<HepMC::GenParticle*> index_to_particle;
66  std::map<HepMC::GenParticle*,int> particle_to_index;
67  // find index to HepMC::GenParticle* p in map m
68  int find_in_map(const std::map<HepMC::GenParticle*,int>& m,
69  HepMC::GenParticle *p) const;
70 };
71 
72 
74 {
75  return input_ != 0;
76 }
77 
78 #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 pid
Definition: sysUtil.py:22
tuple filename
Definition: lut2db_cfg.py:20
tuple status
Definition: ntuplemaker.py:245
HepMC::GenEvent * evt_