10 using namespace HepMC;
24 initialized_(
false), input_(0),
25 index_to_particle(3996),evtid(1),ntpl_id(1) {
26 cout <<
"Constructing a new Ntuple2HepMCFiller" << endl;
32 cout <<
"Destructing Ntuple2HepMCFiller" << endl;
46 cout <<
"Ntuple2HepMCFiller was already initialized... reinitializing it " << endl;
52 cout<<
"Ntuple2HepMCFiller::initialize : Opening file "<<filename<<endl;
69 HepMC::GenEvent*
event =
new HepMC::GenEvent();
74 cout <<
"| --- Ntuple2HepMCFiller: Event Nr. " <<
evt->event_number() <<
" with " <<
evt->particles_size()<<
" particles --- !" <<endl;
79 cout <<
"Ntuple2HepMCFiller: Got no event :-(" <<endl;
114 evt->set_event_number( evtnum ) ;
119 std::vector<HepMC::GenParticle*> hepevt_particle(
input_->
getNhep()+1 );
124 hepevt_particle[0] = 0;
128 std::set<HepMC::GenVertex*> new_vertices;
154 p->suggest_barcode( index );
160 std::vector<HepMC::GenParticle*>& hepevt_particle,
161 HepMC::GenEvent* evt,
bool printInconsistencyErrors )
171 HepMC::GenVertex* prod_vtx = p->production_vertex();
173 while ( !prod_vtx && mother > 0 ) {
174 prod_vtx = hepevt_particle[mother]->end_vertex();
175 if ( prod_vtx ) prod_vtx->add_particle_out( p );
185 if ( !prod_vtx && (
number_parents(i)>0 || prod_pos!=FourVector(0,0,0,0) )){
186 prod_vtx =
new HepMC::GenVertex();
187 prod_vtx->add_particle_out( p );
188 evt->add_vertex( prod_vtx );
191 if ( prod_vtx && prod_vtx->position()==FourVector(0,0,0,0) ) {
192 prod_vtx->set_position( prod_pos );
197 while ( prod_vtx && mother > 0 ) {
198 if ( !hepevt_particle[mother]->end_vertex() ) {
200 prod_vtx->add_particle_in( hepevt_particle[mother] );
202 else if (hepevt_particle[mother]->end_vertex() != prod_vtx ) {
211 if ( printInconsistencyErrors )
std::cerr
212 <<
"Ntuple2HepMCFiller:: inconsistent mother/daughter "
213 <<
"information in HEPEVT event "
226 return ( firstchild>0 ) ?
238 if( firstparent <= 0 )
return 0;
240 if( secondparent <= 0 )
return 1;
241 return secondparent - firstparent + 1;
HepMC::GenEvent * fillCurrentEventData()
virtual int getNevhep() const
virtual ~Ntuple2HepMCFiller()
Destructor.
Ntuple2HepMCFiller()
Constructor.
virtual bool readCurrentEvent()
static Ntuple2HepMCFiller * instance_
static Ntuple2HepMCFiller * instance()
virtual int getJdahep(int j, int idx) const
void buildProductionVertex(int i, std::vector< HepMC::GenParticle * > &hepevt_particle, HepMC::GenEvent *evt, bool printInconsistencyErrors)
virtual double getVhep(int j, int idx) const
int number_parents(int index)
HepMC::GenParticle * createParticle(int index)
virtual int getIsthep(int j) const
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 void setEvent(int event) const
virtual int getNhep() const
virtual bool printHepMcEvent() const
virtual int getIdhep(int j) const
virtual double getPhep(int j, int idx) const
int number_children(int index)
virtual int getJmohep(int j, int idx) const
virtual void initialize(const std::string &filename, int id)
void setInitialized(bool value)