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