CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Ntuple2HepMCFiller.h
Go to the documentation of this file.
1 #ifndef Ntuple2HepMCFiller_H
2 #define Ntuple2HepMCFiller_H
3 
11 #include <iostream>
12 #include <iomanip>
13 #include <vector>
14 #include <fstream>
15 #include <string>
16 #include <algorithm>
17 #include "HepMC/GenEvent.h"
18 class NtupleROOTFile;
20 
21  protected:
24  void setInitialized(bool value);
25 
26  public:
28  virtual ~Ntuple2HepMCFiller();
29  static Ntuple2HepMCFiller * instance();
30  virtual void initialize(const std::string & filename, int id);
31  bool isInitialized();
32  virtual bool setEvent(unsigned int event);
33  virtual bool readCurrentEvent();
34  virtual bool printHepMcEvent() const;
35  HepMC::GenEvent* fillCurrentEventData();
36  virtual bool toGenEvent( int evtnum, HepMC::GenEvent* evt );
38 
39 
40 
41  private:
43  // current HepMC evt
44  HepMC::GenEvent * evt;
47 
48  // # of particles in evt
50  //maps to convert HepMC::GenParticle to particles # and vice versa
51  // -> needed for HepEvt like output
52  std::vector<HepMC::GenParticle*> index_to_particle;
53  std::map<HepMC::GenParticle *,int> particle_to_index;
54  int evtid;
55  int ntpl_id;
56 
57  // find index to HepMC::GenParticle* p in map m
58  int find_in_map(const std::map<HepMC::GenParticle*,int>& m,
59  HepMC::GenParticle* p) const;
60  void buildProductionVertex( int i,
61  std::vector<HepMC::GenParticle*>& hepevt_particle,
62  HepMC::GenEvent* evt, bool printInconsistencyErrors );
63  int number_children( int index ) ;
64  int number_parents( int index );
65 };
66 
67 #endif // Ntuple2HepMCFiller_H
68 
HepMC::GenEvent * fillCurrentEventData()
NtupleROOTFile * input_
int i
Definition: DBlmapReader.cc:9
virtual ~Ntuple2HepMCFiller()
Destructor.
HepMC::GenEvent * evt
Ntuple2HepMCFiller()
Constructor.
virtual bool readCurrentEvent()
int find_in_map(const std::map< HepMC::GenParticle *, int > &m, HepMC::GenParticle *p) const
static Ntuple2HepMCFiller * instance_
static Ntuple2HepMCFiller * instance()
void buildProductionVertex(int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt, bool printInconsistencyErrors)
std::map< HepMC::GenParticle *, int > particle_to_index
int number_parents(int index)
HepMC::GenParticle * createParticle(int index)
virtual bool toGenEvent(int evtnum, HepMC::GenEvent *evt)
virtual bool setEvent(unsigned int event)
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
virtual bool printHepMcEvent() const
tuple filename
Definition: lut2db_cfg.py:20
int number_children(int index)
std::vector< HepMC::GenParticle * > index_to_particle
virtual void initialize(const std::string &filename, int id)
void setInitialized(bool value)